/* Tokens, shell, sidebar and shared parts. Same palette as stapply.ai: no grey fills, thin solid
borders, dotted lines only on the sidebar edge and the new-key box. */
:root { color-scheme: dark; --bg: #0a0b0e; --ink: #f4f5f7; --soft: #c4c8d0; --mute: #9aa1ad; --faint: #6b7280; --line: rgba(255, 255, 255, 0.12); --rule: rgba(255, 255, 255, 0.08); --hair: rgba(255, 255, 255, 0.07); --blue: #3b82f6; --blue2: #60a5fa; --blue3: #93c5fd; --green: #22c55e; --green2: #4ade80; --amber: #f59e0b; --amber2: #fbbf24; --red: #ef4444; --red2: #f87171; --red3: #fca5a5; --violet: #a78bfa; --orange: #fb923c; --sans: Urbanist, ui-sans-serif, system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px / 1.5 var(--sans); }
a { color: var(--blue2); }
a:hover { color: var(--blue3); }
:focus-visible { outline: 2px solid var(--blue2); outline-offset: 2px; }
h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.note { font-size: 13px; color: var(--mute); }

.app { display: flex; min-height: 100vh; }
.main { flex: 1 1 560px; min-width: 0; max-width: 1120px; padding: 40px 48px 72px; display: flex; flex-direction: column; gap: 32px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }

.side { flex: 0 0 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 12px 16px; border-right: 2px dotted rgba(255, 255, 255, 0.14); display: flex; flex-direction: column; gap: 26px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 8px; color: var(--ink); text-decoration: none; }
.wordmark { font-family: Fredoka, var(--sans); font-synthesis: none; font-size: 20px; letter-spacing: -0.01em; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 0 0 6px; padding: 0 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--soft); text-decoration: none; }
.nav a svg { color: var(--mute); flex: 0 0 auto; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--blue2); }
.nav.resources { padding-top: 18px; border-top: 1px solid var(--rule); }
.nav.resources a { min-height: 36px; font-size: 14px; }
.nav.resources a span:nth-child(2) { flex: 1 1 auto; }
.nav .ic, .nav .out { display: flex; }
.nav .ic.orange svg { color: var(--orange); }
.nav .ic.violet svg { color: var(--violet); }
.nav .ic.green svg { color: var(--green2); }
.nav .out svg { color: var(--faint); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.balance { padding: 14px; border-radius: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.balance a { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 4px; font-size: 13.5px; color: var(--soft); min-width: 0; }
.me span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; text-decoration: none; }

.label { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.dot { width: 6px; height: 6px; border-radius: 999px; flex: 0 0 auto; }
.dot.blue { background: var(--blue); }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.violet { background: var(--violet); }
.value { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.value small { font-size: 15px; font-weight: 500; color: var(--mute); }
.balance .value { font-size: 22px; }
.up { font-weight: 600; color: var(--green2); }
.down { font-weight: 600; color: var(--red2); }

.stats { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.stats-row { display: flex; flex-wrap: wrap; margin-left: -1px; }
.stat { flex: 1 1 200px; padding: 20px 22px 22px; border-left: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; gap: 8px; }

.panel { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.panel-head { padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { font-size: 16px; }
.scroll { overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.t th { text-align: left; color: var(--mute); font-size: 12.5px; font-weight: 500; padding: 11px 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.t td { padding: 12px; border-top: 1px solid var(--hair); }
.t th:first-child, .t td:first-child { padding-left: 20px; }
.t th:last-child, .t td:last-child { padding-right: 20px; }
.t .num { text-align: right; }
.t tr.dim td { color: var(--mute); }
.empty { padding: 28px 20px; border-top: 1px solid var(--hair); text-align: center; font-size: 14px; color: var(--mute); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.chip.ok { color: var(--green2); background: rgba(34, 197, 94, 0.12); }
.chip.warn { color: var(--amber2); background: rgba(245, 158, 11, 0.12); }
.chip.bad { color: var(--red2); background: rgba(239, 68, 68, 0.13); }
.chip.muted { color: var(--soft); }
.chip.muted::before { background: var(--faint); }

.btn { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); background: transparent; color: var(--ink); font: inherit; font-size: 14.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #2563eb; border-color: #2563eb; }
.btn.small { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn.danger { border-color: rgba(248, 113, 113, 0.6); color: var(--red3); font-weight: 600; }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }
.quiet { min-height: 32px; padding: 0 10px; white-space: nowrap; border: 0; background: none; color: var(--mute); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.quiet:hover { color: var(--ink); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline { display: inline; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--mute); font: inherit; font-size: 13.5px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"], .tab.on { border-color: rgba(255, 255, 255, 0.22); color: var(--ink); font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 500; color: var(--mute); }
.in { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: var(--bg); color: var(--ink); font: inherit; font-size: 14.5px; width: 100%; }
.in:focus-visible { outline: none; border-color: var(--blue); }
.in.bad { border-color: var(--red2); }

.notice { border-radius: 12px; border: 1px solid var(--line); padding: 12px 16px; font-size: 14px; color: var(--soft); }
.notice.ok { border-color: rgba(34, 197, 94, 0.4); color: var(--green2); }
.notice.bad { border-color: rgba(248, 113, 113, 0.45); color: var(--red3); }

.pill { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill.company { color: #f9a8d4; background: rgba(244, 114, 182, 0.14); }
.pill.place { color: #fdba74; background: rgba(251, 146, 60, 0.14); }
.pill.source { color: #fde68a; background: rgba(250, 204, 21, 0.13); }

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .side { position: static; height: auto; flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 4px; padding: 14px 12px; border-right: 0; border-bottom: 2px dotted rgba(255, 255, 255, 0.14); }
  .brand { flex: 1 0 100%; margin-bottom: 6px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .nav a { min-height: 36px; padding: 0 10px; font-size: 14px; }
  .nav-label, .nav.resources, .side-foot { display: none; }
  .main { padding: 28px 18px 56px; }
}
