/* Shared shell: palette, top bar and page furniture for every tool. */
:root {
  --bg: #1e1e2e;
  --panel: #28283c;
  --panel-2: #32324a;
  --accent: #7c6cf0;
  --accent-hover: #9385f5;
  --text: #e4e4ef;
  --muted: #9999b0;
  --border: #3a3a52;
  --ok: #62d69f;
  --warn: #f0c674;
  --danger: #f07c8c;
  --radius: 8px;
}

* { box-sizing: border-box; }

/* `hidden` loses to any author `display` rule, which is a silent trap. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

body.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: var(--accent-hover); }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.topbar .brand {
  font-size: 15px;
  font-weight: 650;
  margin: 0 6px 0 0;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.toolnav { display: flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: var(--radius); }
.toolnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 6px;
  white-space: nowrap;
}
.toolnav a:hover { color: var(--text); background: var(--panel-2); }
.toolnav a.active { color: #fff; background: var(--accent); }
.topbar .spacer { margin-left: auto; }
.topbar .status { font-size: 12.5px; color: var(--muted); min-height: 1em; }

/* ---------- controls ---------- */
button, .filelabel {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
button:hover:not(:disabled), .filelabel:hover { background: var(--accent-hover); }
button:disabled { background: #44445e; color: var(--muted); cursor: not-allowed; }
button.secondary, .filelabel.secondary { background: var(--panel-2); }
button.secondary:hover:not(:disabled), .filelabel.secondary:hover { background: #46466a; }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
button.ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.filelabel { display: inline-block; }
.filelabel input { display: none; }

input[type=text], input[type=number], select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=color] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  height: 30px;
  width: 100%;
  cursor: pointer;
}
label.check { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
label.check input { width: auto; }

/* segmented radio group */
.seg { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg label { flex: 1; text-align: center; font-size: 12px; padding: 5px 4px; cursor: pointer; color: var(--muted); }
.seg input { display: none; }
.seg input:checked + span { color: #fff; }
.seg label:has(input:checked) { background: var(--accent); }
.seg label:hover:not(:has(input:checked)) { background: var(--panel-2); color: var(--text); }

/* ---------- marketing / doc pages ---------- */
.wrap { max-width: 900px; margin: 0 auto; padding: 34px 22px; }
.hero { max-width: 900px; margin: 0 auto; padding: 46px 22px 14px; }
.hero h1 { font-size: 30px; line-height: 1.25; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 62ch; }
.cards { max-width: 900px; margin: 0 auto; padding: 20px 22px 40px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.card.tool { display: flex; flex-direction: column; gap: 10px; }
.card.tool .btn { margin-top: auto; align-self: flex-start; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--panel-2); }
.btn.secondary:hover { background: #46466a; }
.callout { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 13px 16px; margin: 18px 0; font-size: 14px; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 20px 22px; text-align: center; }
h2 { font-size: 20px; margin: 28px 0 8px; }

/* ---------- long-form doc pages (guide, signature guide) ---------- */
.wrap h1 { font-size: 30px; margin: 0 0 8px; }
.wrap .lede { color: var(--muted); font-size: 16.5px; margin: 0 0 26px; }
.wrap h2 { font-size: 21px; margin: 38px 0 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.wrap h3 { font-size: 16.5px; margin: 22px 0 8px; }
.wrap ul, .wrap ol { padding-left: 22px; }
.wrap li { margin: 6px 0; }
.wrap code {
  background: #2c2c42; border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px;
}
.wrap pre {
  background: #16161f; border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto;
}
.wrap pre code { background: none; border: none; padding: 0; }
.wrap table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.wrap th, .wrap td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; font-size: 14px; }
.wrap th { background: var(--panel); }
.wrap blockquote {
  margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--accent);
  background: var(--panel); border-radius: 0 8px 8px 0; color: var(--muted);
}
.wrap blockquote strong { color: var(--text); }
.checklist { list-style: none; padding-left: 0; }
.checklist li::before { content: "☐ "; color: var(--accent); }
