/* Excel Assistant web front end. Values are the design system's (mockup board 14): change them here, not in markup. */

:root {
  --accent: #0E7A5F;          /* ledger green: actions, bars (5.3:1 with white) */
  --accent-dark: #0A5C47;     /* hover, text on tint (8.0:1) */
  --accent-tint: #E6F4EF;     /* selected, ready */
  --accent-line: #A9D8C8;     /* borders on tint */
  --ink: #0F172A;             /* headings, body (17.9:1) */
  --text: #334155;            /* secondary (10.4:1) */
  --muted: #475569;           /* captions (7.6:1) */
  --border-strong: #CBD5E1;
  --border: #E2E8F0;
  --hairline: #EEF2F6;
  --hover: #F1F5F9;
  --page: #F8FAFC;
  --surface: #FFFFFF;
  --warn-bg: #FFF7E6; --warn-line: #F5D08A; --warn-text: #7A4A06; --warn-icon: #B45309; --warn-btn-line: #E3B766;
  --err-bg: #FEF2F2;  --err-line: #FBC9C9;  --err-text: #8F1D1D;  --err-icon: #B42318;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 22px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.text2 { color: var(--text); }
.link { color: var(--accent-dark); font-weight: 500; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pretty { text-wrap: pretty; }
.label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.spin { animation: spin 1s linear infinite; }
.skel { animation: pulse 1.6s ease-in-out infinite; height: 12px; border-radius: 6px; background: var(--hairline); }
@media (prefers-reduced-motion: reduce) { .spin, .skel { animation: none; } }

/* ---------------------------------------------------------------- shell */
.app { display: flex; min-height: 100vh; min-width: 1100px; }   /* desktop application */
.sidebar { flex: 0 0 264px; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.ws-switch { position: relative; }
.ws-switch select { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.ws-switch-face { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.ws-switch:focus-within .ws-switch-face { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-caption { font-size: 12px; color: var(--muted); line-height: 16px; display: block; }
.ws-name { font-size: 14px; font-weight: 600; line-height: 20px; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px;
  font-weight: 500; color: var(--text); }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { font-weight: 600; color: var(--accent-dark); background: var(--accent-tint); }
.nav a > span:first-of-type { flex: 1; }
.badge { font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--border); color: var(--text); font-weight: 600; }
.nav a[aria-current="page"] .badge { background: #fff; color: var(--accent-dark); }
.readonly-card { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: var(--page); border: 1px solid var(--border); margin-top: auto; }
.readonly-card strong { font-size: 13px; font-weight: 600; line-height: 18px; display: block; }
.readonly-card span { font-size: 12px; line-height: 18px; color: var(--muted); display: block; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; position: relative; }
.page { width: 100%; max-width: 1300px; margin: 0 auto; padding: 24px 32px 32px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.page-title { font-size: 24px; line-height: 32px; font-weight: 650; letter-spacing: -0.015em; }
.page-sub { font-size: 14px; line-height: 22px; color: var(--muted); max-width: 680px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; font-size: 14px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-md { height: 36px; padding: 0 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--ink); }
.btn-secondary:hover, .btn-ghost:hover, .icon-btn:hover { background: var(--hover); }
.btn-ghost { background: transparent; color: var(--accent-dark); }
.btn-danger { background: #fff; border-color: var(--border-strong); color: var(--err-icon); font-weight: 500; }
.btn-danger:hover { background: var(--err-bg); }
.btn:disabled, .btn-primary:disabled { background: var(--border-strong); color: #fff; border-color: transparent; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; }
.focus-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: #fff; font-size: 14px; font-weight: 500; max-width: 340px; }
.focus-btn:hover { background: var(--hover); }
.focus-pill { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--accent-line); border-radius: 10px;
  background: var(--accent-tint); color: var(--accent-dark); font-size: 14px; font-weight: 600; overflow: hidden; max-width: 380px; }
.focus-pill > button:first-child { display: inline-flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; height: 100%; border: 0; background: transparent; color: inherit; font-weight: 600; min-width: 0; }
.focus-pill > button:last-child { width: 32px; height: 100%; border: 0; background: transparent; color: inherit; display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- cards, tiles, chips, banners */
.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.card-pad { padding: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
a.kpi:hover { border-color: #94A3B8; }
.kpi-label, .kpi-sub { font-size: 12px; line-height: 16px; color: var(--muted); }
.kpi-value { font-size: 28px; line-height: 34px; font-weight: 650; letter-spacing: -0.02em; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-sm { height: 22px; padding: 0 8px; font-weight: 500; }
.chip-ok { background: var(--accent-tint); color: var(--accent-dark); }
.chip-neutral { background: var(--hover); color: var(--text); }
.chip-reading { background: #EEF2F6; color: var(--text); }
.chip-warn { background: var(--warn-bg); color: var(--warn-text); }
.chip-err { background: var(--err-bg); color: var(--err-text); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.status-ok { color: var(--accent-dark); }
.status-neutral { color: var(--text); }
.status-warn { color: var(--warn-text); }
.status-queued { color: var(--muted); }

.banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 22px; }
.banner > div { flex: 1; text-wrap: pretty; }
.banner svg { margin-top: 2px; }
.banner-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); }
.banner-warn .btn { background: #fff; border-color: var(--warn-btn-line); color: var(--warn-text); }
.banner-err { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err-text); }
.banner-note { background: var(--hover); color: var(--text); }
.focus-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 24px;
  background: var(--accent-tint); border-bottom: 1px solid var(--accent-line); color: var(--accent-dark); font-size: 14px; }
.focus-banner .btn { background: #fff; border-color: var(--accent-line); color: var(--accent-dark); }

/* ---------------------------------------------------------------- tables */
.table-box { border: 1px solid var(--border); border-radius: 12px; overflow: auto; background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { height: 40px; padding: 0 16px; background: var(--page); border-bottom: 1px solid var(--border); font-size: 12px;
  font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; }
table.data td { height: 48px; padding: 0 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
table.data tbody tr:hover { background: var(--page); }
table.data tbody tr:last-child td { border-bottom: 1px solid var(--border); }
table.data tfoot td { background: var(--page); font-weight: 600; border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .strong { font-weight: 500; }
table.data .cell-text { max-width: 360px; }
table.data.compact { font-size: 13px; }
table.data.compact td { height: 40px; }
table.data tr.selected td { background: var(--accent-tint); }
table.data tr.clickable { cursor: pointer; }
.bar-cell { width: 140px; min-width: 100px; }
.bar { display: block; height: 6px; background: var(--accent); border-radius: 0 4px 4px 0; }
.crumb { color: var(--muted); }

/* ---------------------------------------------------------------- chat: one centred column, like a chat app */
.conversation { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 32px 0; display: flex; flex-direction: column; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 28px; padding-bottom: 8px; }
.bubble { align-self: flex-end; max-width: 75%; background: var(--ink); color: #fff; padding: 12px 16px;
  border-radius: 16px 16px 4px 16px; font-size: 15px; line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg { display: flex; gap: 14px; align-items: flex-start; }
.msg-avatar { flex: none; margin-top: 2px; }
.msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.answer-text { font-size: 16px; line-height: 26px; text-wrap: pretty; overflow-wrap: anywhere; }
.answer-text strong { font-weight: 650; }
.scope-note { align-self: flex-start; height: 24px; }
.msg-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: -4px 0 0 -6px; }
.msg-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); }
.msg-toggle:hover, .msg-toggle[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.about { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.about .label { margin-bottom: 4px; }
.typing { display: inline-flex; gap: 5px; align-items: center; height: 26px; }
.typing span { width: 7px; height: 7px; border-radius: 999px; background: #94A3B8; animation: pulse 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }
.reading-list { margin: 0; padding: 0 0 0 20px; font-size: 13px; line-height: 22px; color: var(--text); }
.picker-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.picker { position: relative; width: 300px; max-width: 100%; }
.picker-trigger { width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; font-size: 14px; color: var(--muted); }
.picker-trigger[aria-expanded="true"] { border: 1.5px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.listbox { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.listbox.right { left: auto; right: 0; width: 320px; }
.option { width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 8px 12px; display: flex;
  flex-direction: column; gap: 2px; color: var(--ink); }
.option:hover, .option.active { background: var(--hover); }
.option[aria-selected="true"] { background: var(--accent-tint); }
.option-title { font-size: 14px; line-height: 20px; font-weight: 600; }
.option-meta { font-size: 12px; line-height: 16px; color: var(--muted); }
.followups { display: flex; flex-direction: column; gap: 8px; }
.followup { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; text-align: left; font-size: 14px; line-height: 20px; color: var(--ink); }
.followup:hover { border-color: #94A3B8; }
.dot-done { width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.dot-now { width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; }
.dot-now::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.dot-todo { width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--border-strong); }

.composer-wrap { position: sticky; bottom: 0; padding: 12px 0 24px; background: linear-gradient(to bottom, rgba(248,250,252,0), var(--page) 24px); }
.composer { background: #fff; border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px 12px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.composer textarea { border: 0; background: transparent; font-size: 15px; line-height: 24px; outline: none; padding: 0; resize: none; min-height: 24px; max-height: 160px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scope-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--hover); font-size: 12px; color: var(--text); border: 0; max-width: 70%; }
.scope-chip.on { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.send { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.send:hover { background: var(--accent-dark); }
.send:disabled { background: var(--border-strong); }

/* home + empty */
.home { width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 24px 0; display: flex; flex-direction: column; gap: 28px; flex: 1; }
.hero-title { font-size: 30px; line-height: 38px; font-weight: 650; letter-spacing: -0.02em; }
.suggestions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.suggestion { text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex;
  flex-direction: column; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 22px; color: var(--ink); text-wrap: pretty; }
.suggestion:hover { border-color: #94A3B8; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 56px 32px 24px; gap: 32px; }
.drop { width: 100%; max-width: 720px; border: 1.5px dashed #94A3B8; border-radius: 16px; background: #fff; padding: 40px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.drop.dragging { border-color: var(--accent); background: var(--accent-tint); }
.drop-icon { width: 48px; height: 48px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; }
.steps3 { width: 100%; max-width: 720px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.steps3 > div { display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 20px; color: var(--muted); }
.steps3 strong { font-size: 14px; line-height: 20px; color: var(--ink); font-weight: 600; }
.tile-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- files */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.tab { height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { background: var(--hover); }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); font-weight: 600; color: var(--ink); }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #EEF2F6; gap: 2px; flex-wrap: wrap; }
.segmented button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; color: var(--text); }
.segmented button[aria-pressed="true"] { background: #fff; font-weight: 600; color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,0.08); }
.search { position: relative; width: 240px; max-width: 100%; }
.search svg { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.search input { width: 100%; height: 36px; padding: 0 12px 0 36px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; font-size: 14px; outline: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.file-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.file-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; flex: none; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .grow { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.drawer { flex: 0 0 400px; max-width: 100%; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--hairline); }
.drawer-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.drawer h3 { font-size: 13px; line-height: 20px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; height: 32px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--hairline); }
.kv:last-child { border-bottom: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 3px 10px; border-radius: 999px; background: var(--hover); font-size: 12px; color: var(--text); }
.pill.money { background: var(--accent-tint); color: var(--accent-dark); font-weight: 500; }
.good-box { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--accent-tint); }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 20px; }
.stepper li { display: flex; align-items: center; gap: 8px; }
.stepper .line { flex: 0 0 28px; height: 2px; background: var(--border-strong); }
.stepper .line.done { background: var(--accent); }
.progress { height: 6px; border-radius: 999px; background: var(--accent-tint); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }

/* ---------------------------------------------------------------- models */
.order-item { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* ---------------------------------------------------------------- dialogs, toasts */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.48); z-index: 40; }
.dialog { position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px));
  background: #fff; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-pop); }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: 14px; line-height: 20px; box-shadow: var(--shadow-pop); }
.toast.warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line); }
.toast.err { background: var(--err-bg); color: var(--err-text); border: 1px solid var(--err-line); }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; padding: 0 2px; }

@media (max-width: 1100px) {
  .drawer { position: static; flex: 1 1 100%; max-height: none; }
}

/* ---------------------------------------------------------------- full-screen table (grid.js) */
.table-frame { position: relative; }
.table-expand { position: absolute; top: 6px; right: 6px; z-index: 2; width: 28px; height: 28px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--muted); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06); }
.table-expand:hover { color: var(--accent-dark); border-color: var(--accent-line); background: var(--accent-tint); }
.table-frame .table-box table.data thead th:last-child { padding-right: 44px; }
body.grid-open { overflow: hidden; }
.grid-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 28px; }
.grid-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.grid-panel { position: relative; width: 100%; height: 100%; max-width: 1800px; background: #fff; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28); display: flex; flex-direction: column; overflow: hidden; }
.grid-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--border); }
.grid-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.grid-scroll { flex: 1; overflow: auto; outline: none; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; user-select: none; }
table.grid th, table.grid td { border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 8px 12px; text-align: left; vertical-align: top; }
table.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--page); font-size: 12px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; padding: 0 6px 0 12px; height: 38px; vertical-align: middle; }
table.grid thead th.num .grid-th { justify-content: flex-end; }
.grid-th { display: flex; align-items: center; gap: 4px; }
.grid-th-label { cursor: pointer; }
.grid-sort { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: #94A3B8; display: flex; align-items: center; justify-content: center; }
.grid-sort:hover, .grid-sort.on { color: var(--accent-dark); background: var(--accent-tint); }
table.grid th.gutter { position: sticky; left: 0; z-index: 1; background: var(--page); color: var(--muted); font-weight: 500; font-size: 12px;
  text-align: right; min-width: 44px; cursor: pointer; font-variant-numeric: tabular-nums; }
table.grid thead th.gutter { z-index: 3; }
table.grid td { cursor: cell; color: var(--ink); }
table.grid td.txt { max-width: 520px; white-space: normal; overflow-wrap: anywhere; }
table.grid td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid td.sel { background: #E6F4EF; }
table.grid td.active { box-shadow: inset 0 0 0 2px var(--accent); }
table.grid th.sel { background: var(--accent-tint); color: var(--accent-dark); }
.grid-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 0 20px;
  border-top: 1px solid var(--border); background: var(--page); font-size: 13px; color: var(--muted); }
.grid-status [data-g="stats"] { display: flex; gap: 20px; margin-left: auto; }
.grid-status strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- landing and sign-in (before the app) */
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; font-size: 15px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input:disabled { background: var(--page); color: var(--muted); }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 64px; }
.input-btn { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.input-btn:hover { background: var(--hover); }

.lp { min-width: 1100px; min-height: 100vh; background: var(--surface); display: flex; flex-direction: column; }
.lp main { flex: 1; }
.lp-nav { height: 72px; padding: 0 48px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--hairline); position: sticky; top: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); z-index: 5; }
.lp-nav .brand { padding: 0; }
.lp-links { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; color: var(--text); }
.lp-links > a:not(.btn):hover { color: var(--ink); }
.lp-hero { max-width: 1200px; margin: 0 auto; padding: 72px 48px 88px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.lp-eyebrow { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.lp-hero h1 { margin-top: 20px; font-size: 48px; line-height: 56px; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.lp-hero h1 span { color: var(--accent); }
.lp-lede { margin-top: 20px; font-size: 18px; line-height: 30px; color: var(--text); max-width: 540px; text-wrap: pretty; }
.lp-cta { margin-top: 32px; display: flex; gap: 12px; }

.lp-preview { background: var(--page); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 60px rgba(15,23,42,.10); overflow: hidden; }
.lp-window { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 16px; border-bottom: 1px solid var(--border); background: #fff; }
.lp-window span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.lp-chat { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.lp-chat .bubble { max-width: 80%; }
.lp-answer { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lp-answer-head { display: flex; gap: 10px; align-items: flex-start; }
.lp-answer-head p { font-size: 14px; line-height: 22px; }
.lp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lp-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.lp-table td { padding: 7px 8px; border-bottom: 1px solid var(--hairline); }
.lp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lp-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); opacity: .85; margin-right: 10px; vertical-align: middle; }
.lp-source { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lp-source strong { color: var(--text); font-weight: 600; }

.lp-section { max-width: 1200px; margin: 0 auto; padding: 72px 48px; border-top: 1px solid var(--hairline); }
.lp-section h2, .lp-close h2 { font-size: 30px; line-height: 38px; font-weight: 700; letter-spacing: -0.02em; }
.lp-steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-step { position: relative; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--page); display: flex; flex-direction: column; gap: 10px; }
.lp-step-n { position: absolute; top: 20px; right: 22px; font-size: 13px; font-weight: 700; color: var(--muted); }
.lp-step h3, .lp-feature h3 { font-size: 16px; line-height: 24px; font-weight: 650; }
.lp-step p, .lp-feature p { font-size: 14px; line-height: 22px; }
.lp-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.lp-features { margin-top: 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 40px; }
.lp-feature { display: flex; gap: 14px; }
.lp-feature > div { display: flex; flex-direction: column; gap: 4px; }
.lp-close { max-width: 1104px; margin: 24px auto 72px; padding: 40px 48px; border-radius: 20px; background: var(--accent-tint);
  border: 1px solid var(--accent-line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.lp-close p { margin-top: 6px; font-size: 15px; }
.lp-foot { padding: 24px 48px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.lp-foot .brand { gap: 8px; padding: 0; font-weight: 600; }

.lp-login { background: var(--page); }
.lp-login .lp-nav { background: transparent; border-bottom: 0; backdrop-filter: none; }
.login-wrap { display: flex; flex-direction: column; align-items: center; padding: 48px 24px 96px; gap: 20px; }
.login-card { width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 36px;
  box-shadow: 0 12px 40px rgba(15,23,42,.06); display: flex; flex-direction: column; gap: 18px; }
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 6px; }
.login-head h1 { margin-top: 8px; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; }
.login-card .banner code { font-family: var(--mono); font-size: 12px; display: block; margin-top: 4px; word-break: break-all; }
.login-note { font-size: 13px; line-height: 20px; text-align: center; }
.login-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

/* the signed-in person, bottom of the sidebar */
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.me-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-dark);
  font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-name { font-size: 13px; font-weight: 600; line-height: 18px; }
.me-email { font-size: 12px; line-height: 16px; color: var(--muted); }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--page); }
