/* Avila Labs suite: the account dashboard's design system.
   One sans face (Inter, self-hosted), tabular figures for every number,
   hairline dividers rather than nested boxes, and colour only where it means
   something: the brand indigo for the primary action, amber for a decision
   that changed, blue for a moved margin, green for nothing that matters. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/suite/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/suite/fonts/inter-600.woff2") format("woff2"); }

:root {
  --bg: #ffffff;
  --bg-side: #f7f7f8;
  --bg-sunk: #f4f4f6;
  --bg-hover: #f1f1f4;
  --surface: #ffffff;
  --line: #e7e7eb;
  --line-strong: #d6d6dd;
  --ink: #17171c;
  --ink-2: #4b4d57;
  --ink-3: #80828d;
  --brand: #1700ab;
  --brand-hover: #2512c7;
  --brand-ink: #1700ab;
  --brand-tint: #ebeefc;
  --focus: #2a15d6;
  --amber-ink: #9a4a00; --amber-bg: #fdf1dc; --amber-line: #f3d5a4;
  --blue-ink: #1f4f99;  --blue-bg: #e8f0fb;  --blue-line: #c7d8f2;
  --green-ink: #1c6b3a; --green-bg: #e5f4ea; --green-line: #bfe2cb;
  --violet-ink: #4a2bc2; --violet-bg: #efebfd;
  --red-ink: #b42318; --red-bg: #fdecea;
  --shadow-pop: 0 1px 2px rgba(20, 20, 40, .06), 0 8px 24px rgba(20, 20, 40, .10);
  --radius: 8px;
  --radius-sm: 6px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111114; --bg-side: #0c0c0f; --bg-sunk: #18181d; --bg-hover: #1d1d23; --surface: #141418;
  --line: #26262e; --line-strong: #34343e;
  --ink: #ececf1; --ink-2: #b4b5c0; --ink-3: #7d7e8a;
  --brand: #2a15d6; --brand-hover: #3522e8; --brand-ink: #80dcff; --brand-tint: #0f1c33; --focus: #80dcff;
  --amber-ink: #f5b867; --amber-bg: #2d2012; --amber-line: #57391a;
  --blue-ink: #93b8f0; --blue-bg: #14213a; --blue-line: #233b63;
  --green-ink: #86d3a0; --green-bg: #11271a; --green-line: #1f4a2e;
  --violet-ink: #b9a9ff; --violet-bg: #211a44;
  --red-ink: #ff9b91; --red-bg: #33140f;
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111114; --bg-side: #0c0c0f; --bg-sunk: #18181d; --bg-hover: #1d1d23; --surface: #141418;
    --line: #26262e; --line-strong: #34343e;
    --ink: #ececf1; --ink-2: #b4b5c0; --ink-3: #7d7e8a;
    --brand: #2a15d6; --brand-hover: #3522e8; --brand-ink: #80dcff; --brand-tint: #0f1c33; --focus: #80dcff;
    --amber-ink: #f5b867; --amber-bg: #2d2012; --amber-line: #57391a;
    --blue-ink: #93b8f0; --blue-bg: #14213a; --blue-line: #233b63;
    --green-ink: #86d3a0; --green-bg: #11271a; --green-line: #1f4a2e;
    --violet-ink: #b9a9ff; --violet-bg: #211a44;
    --red-ink: #ff9b91; --red-bg: #33140f;
    --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num, td.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--ink-3); }
.i { width: 16px; height: 16px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shell ------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px; background: var(--bg-side); border-right: 1px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 600; letter-spacing: -.01em; }
.side-brand img { width: 26px; height: 26px; border-radius: 6px; display: block; }
.side-brand span { font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 1px; margin-top: 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 400;
}
.nav a:hover { background: var(--bg-hover); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.nav a svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.nav a[aria-current="page"] svg { color: var(--brand-ink); }
.nav .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600;
  background: var(--amber-bg); color: var(--amber-ink); font-variant-numeric: tabular-nums;
}
.nav-label { font-size: 11.5px; color: var(--ink-3); padding: 14px 10px 4px; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

/* workspace switcher */
.ws { position: relative; }
.ws > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius);
  cursor: pointer; border: 1px solid var(--line); background: var(--surface);
}
.ws > summary::-webkit-details-marker { display: none; }
.ws > summary:hover { border-color: var(--line-strong); }
.ws-avatar {
  width: 28px; height: 28px; flex: none; border-radius: 7px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 12.5px;
}
.ws-avatar.personal { background: var(--bg-sunk); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ws-text { min-width: 0; flex: 1; line-height: 1.25; }
.ws-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-sub { font-size: 12px; color: var(--ink-3); }
.ws-caret { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 6px;
}
.menu button, .menu a {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px; border: 0; background: none;
  border-radius: var(--radius-sm); text-align: left; cursor: pointer; font-size: 13.5px; color: var(--ink);
}
.menu button:hover, .menu a:hover { background: var(--bg-hover); }
.menu .check { margin-left: auto; color: var(--brand-ink); }
.menu .ws-text { min-width: 0; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 2px; }
.menu-up { top: auto; bottom: calc(100% + 6px); }

/* account row at the bottom of the sidebar */
.me { position: relative; }
.me > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); cursor: pointer;
}
.me > summary::-webkit-details-marker { display: none; }
.me > summary:hover { background: var(--bg-hover); }
.me-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--bg-sunk); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 600; font-size: 12px; color: var(--ink-2);
}
.me-text { min-width: 0; line-height: 1.25; }
.me-email { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { font-size: 12px; color: var(--ink-3); }

/* main column */
.main { min-width: 0; }
.topbar {
  display: none; position: sticky; top: 0; z-index: 25; height: 56px; padding: 0 16px;
  align-items: center; gap: 12px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.page { max-width: 1120px; margin: 0 auto; padding: 36px 40px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 640px; }
.page-head .aside { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

.section { margin-top: 36px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.section-head .hint { color: var(--ink-3); font-size: 12.5px; }
.section-head a, .link { color: var(--brand-ink); font-weight: 600; font-size: 13px; }
.section-head a:hover, .link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- controls ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--bg-hover); color: var(--ink); }
.btn.danger { color: var(--red-ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.input, .select {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); min-width: 0; font-size: 13.5px;
}
.input::placeholder { color: var(--ink-3); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; font-weight: 600; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin: 10px 0; cursor: pointer; }
.check-row input { margin-top: 3px; accent-color: var(--brand); }
.msg { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.msg:empty { display: none; }
.msg.err { color: var(--red-ink); }

.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: none; }
.switch input { appearance: none; margin: 0; width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.switch input:checked { background: var(--brand); }
.switch span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; pointer-events: none; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { transform: translateX(16px); }

/* ---- pills ------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg-sunk); color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.pill.changed { background: var(--amber-bg); color: var(--amber-ink); }
.pill.moved { background: var(--blue-bg); color: var(--blue-ink); }
.pill.same { background: var(--green-bg); color: var(--green-ink); }
.pill.wait { background: var(--violet-bg); color: var(--violet-ink); }
.pill.err { background: var(--red-bg); color: var(--red-ink); }
.pill.busy::before { animation: pulse 1.2s ease-in-out infinite; }

/* ---- statement labels (accuracy contract) ------------------------------- */
.lbl {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; margin-right: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; vertical-align: 1px;
  background: var(--bg-sunk); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line);
}
.lbl.verified { background: var(--green-bg); color: var(--green-ink); box-shadow: inset 0 0 0 1px var(--green-line); }
.lbl.screened { background: var(--blue-bg); color: var(--blue-ink); box-shadow: inset 0 0 0 1px var(--blue-line); }
.lbl.estimate { background: var(--amber-bg); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }
.lbl.unknown, .lbl.unlabelled { background: var(--bg-sunk); color: var(--ink-3); }
button.lbl { border: 0; font-family: inherit; line-height: 1; cursor: help; }
button.lbl:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lbl-wrap { display: inline-block; margin-right: 8px; }
.lbl-wrap .lbl { margin-right: 0; }
.lbl-pop {
  display: none; position: fixed; z-index: 60; box-sizing: border-box;
  width: min(320px, calc(100vw - 24px)); padding: 10px 12px; text-align: left; white-space: normal;
  font-size: 13px; font-weight: 400; line-height: 1.45; letter-spacing: 0; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.lbl-pop > span { display: block; overflow-wrap: anywhere; }
.lbl-pop > span + span { margin-top: 6px; }
.pop-means { color: var(--ink-2); }
.pop-next b { font-weight: 600; }
.stmt-why { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.stmt { margin: 0 0 10px; line-height: 1.5; }
.stmt-text { color: var(--ink); }
.stmt.withheld .stmt-text, .err-text { color: var(--red-ink); }
.stmts { margin-bottom: 14px; }
.fix .stmt { margin-bottom: 6px; }
.fix-list .stmt { margin: 0; }
.evidence { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.evidence summary { cursor: pointer; display: inline-block; }
.evidence ul { margin: 4px 0 0; padding-left: 16px; }
.hit-sum .lbl { height: 16px; font-size: 10.5px; margin-right: 6px; }
@keyframes pulse { 50% { opacity: .25; } }

/* tool glyph */
.glyph { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--bg-sunk); color: var(--ink-2); }
.glyph svg { width: 18px; height: 18px; }
.glyph.sm { width: 24px; height: 24px; border-radius: 6px; }
.glyph.sm svg { width: 14px; height: 14px; }
.glyph.lg { width: 40px; height: 40px; border-radius: 10px; }
.glyph.lg svg { width: 22px; height: 22px; }
.glyph.mark { background: none; }
.glyph.mark img { width: 80%; height: 80%; display: block; }

/* ---- panels, lists, tables --------------------------------------------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel + .panel { margin-top: 16px; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 16px 20px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--ink-2);
}
.empty h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.empty p { margin: 0 auto; max-width: 460px; }
.callout { border-radius: var(--radius); padding: 12px 14px; background: var(--bg-sunk); color: var(--ink-2); font-size: 13.5px; }
.callout b { color: var(--ink); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 0 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th:first-child, .t td:first-child { padding-left: 0; }
.t th:last-child, .t td:last-child { padding-right: 0; }
.t td.num, .t th.num { text-align: right; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--bg-hover); }
.t tr.click:hover td:first-child { box-shadow: -12px 0 0 var(--bg-hover); }
.t tr.click:hover td:last-child { box-shadow: 12px 0 0 var(--bg-hover); }
.cell-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-title b { font-weight: 600; display: block; }
.cell-title small { display: block; color: var(--ink-3); font-size: 12.5px; }

/* ---- overview ---------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); }
.stat { padding: 18px 20px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--ink-2); margin-top: 4px; font-size: 13px; }
.stat.hot .v { color: var(--amber-ink); }
a.stat:hover { background: var(--bg-hover); }
.stat:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stat:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

/* ---- watch ------------------------------------------------------------- */
.event { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.event + .event { margin-top: 16px; }
.event-head { padding: 16px 20px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
.event-kind { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.event-kind .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.event-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; grid-column: 1; }
.event-head h3 .rep { font-weight: 400; color: var(--ink-2); }
.event-head p { margin: 0; color: var(--ink-2); grid-column: 1; max-width: 720px; }
.event-head .pill { grid-column: 2; grid-row: 1 / span 2; align-self: start; }

.hit { border-top: 1px solid var(--line); }
.hit-row {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 12px 20px; background: none; border: 0; text-align: left; cursor: pointer;
}
.hit-row:hover { background: var(--bg-hover); }
.hit-title { font-weight: 600; }
.hit-sum { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit-row .chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform .15s; }
.hit[open] .hit-row .chev, .hit.open .hit-row .chev { transform: rotate(90deg); }
.hit-body { padding: 4px 20px 20px 66px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
.hit-body h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.ba { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ba th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 10px 6px 0; border-bottom: 1px solid var(--line); }
.ba td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.ba td:first-child { color: var(--ink-2); }
.ba tr.changed td.after { font-weight: 600; color: var(--ink); }
.ba tr.changed td:first-child { color: var(--ink); }
.ba .delta { font-size: 12px; font-weight: 400; margin-left: 8px; white-space: nowrap; color: var(--ink-3); }
.ba tr.decision td:first-child::after { content: "decision"; margin-left: 8px; font-size: 11px; color: var(--ink-3); }
.more-rows { margin-top: 8px; }
.fix { border-radius: var(--radius); background: var(--brand-tint); padding: 14px; }
.fix-label { font-size: 12px; font-weight: 600; color: var(--brand-ink); margin-bottom: 4px; }
.fix p { margin: 0; color: var(--ink); line-height: 1.5; }
.fix-list { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.fix-list li + li { margin-top: 4px; }
.fix-list .prov { display: inline; margin: 0; }
.fix.none { background: var(--bg-sunk); }
.fix.none .fix-label { color: var(--ink-3); }
.decide { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.decide .row .btn { flex: 1; }
.decided { margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.decided b { color: var(--ink); }
.prov { margin-top: 14px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.prov.warn { color: var(--ink-2); }
.state-line { color: var(--ink-2); font-size: 13.5px; }

.approvals { border: 1px solid var(--violet-bg); background: var(--surface); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; box-shadow: 0 0 0 1px var(--line); }
.approvals-head { padding: 12px 20px; background: var(--violet-bg); color: var(--violet-ink); font-weight: 600; font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.approval { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; }
.approval + .approval { border-top: 1px solid var(--line); }
.approval .who { color: var(--ink-2); font-size: 13px; }
.approval .why { color: var(--ink-3); font-size: 13px; font-style: italic; }

/* ---- drawer ------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(12, 12, 20, .28); z-index: 40; animation: fade .15s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 41; background: var(--bg);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slide .18s ease;
}
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; min-width: 0; }
.drawer-head small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-body .section { margin-top: 28px; }
.drawer-body .section:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* ---- tools --------------------------------------------------------------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tool { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.tool-head { display: flex; gap: 14px; align-items: flex-start; }
.tool-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.tool-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.tool-field { font-size: 12px; color: var(--ink-3); }
.tool .row { margin-top: auto; gap: 4px; }

/* ---- signed-out ---------------------------------------------------------- */
.pub-top { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); }
.pub-top .side-brand { padding: 0; }
.pub { max-width: 1080px; margin: 0 auto; padding: 48px 32px 80px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
.pub h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }
.pub .lede { margin: 8px 0 28px; color: var(--ink-2); font-size: 15px; max-width: 560px; }
.pub .tools { grid-template-columns: 1fr; }
.pitch { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; align-self: start; position: sticky; top: 24px; }
.pitch h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.pitch > p { margin: 0 0 14px; color: var(--ink-2); font-size: 13.5px; }
.pitch ul { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 12px; }
.pitch li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.pitch li b { color: var(--ink); font-weight: 600; display: block; }
.pitch li svg { width: 16px; height: 16px; color: var(--brand-ink); margin-top: 2px; }
.pitch .btn { width: 100%; }
.pitch .btn + .btn { margin-top: 8px; }
.pitch .fine { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---- toasts ---------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: var(--radius); font-size: 13.5px; box-shadow: var(--shadow-pop); animation: fade .15s ease;
}


/* ---- lists of rows (overview, drawer) ------------------------------------ */
.attn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; }
a.attn:hover { background: var(--bg-hover); }
.list > li:first-child > .attn { border-radius: var(--radius) var(--radius) 0 0; }
.list > li:last-child > .attn { border-radius: 0 0 var(--radius) var(--radius); }
.attn-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.attn-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-text span { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; }
.why { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.linkbox { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-sunk); }
.linkbox .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.armed { background: var(--red-bg); color: var(--red-ink); border-color: transparent; }

/* numbered steps (Watch when off) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.steps b { color: var(--ink); font-weight: 600; }

/* settings layout (organization) */
.setting { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; padding-top: 4px; }
.setting h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.setting > div > p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.meter { height: 8px; border-radius: 4px; background: var(--bg-sunk); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; margin-top: 8px; max-width: 420px; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.meter.full span { background: var(--amber-ink); }
.meter-line b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* field chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.chip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { color: var(--ink); background: var(--bg-hover); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* preview banner */
.preview-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 40px; background: var(--brand-tint); color: var(--ink-2); font-size: 13px; }
.preview-bar b { color: var(--ink); font-weight: 600; }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 1fr; padding: 22px 0; }
  .preview-bar { padding: 10px 16px; }
}

/* accounts-only launch: features that are not open yet */
.nav a.soon-link { color: var(--ink-3); font-weight: 400; }
.nav a.soon-link:hover, .nav a.soon-link[aria-current="page"] { color: var(--ink); }
.soon-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-badge { flex: none; display: inline-block; height: 16px; padding: 0 6px; border-radius: 8px; font-size: 10.5px; font-weight: 600; line-height: 16px; letter-spacing: .02em; background: var(--bg-sunk); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.pitch .soon-badge { margin-left: 8px; vertical-align: 1px; }
@media (pointer: coarse) { .nav .soon-link { height: 40px; } }
.soon-badge.lg { height: 20px; line-height: 20px; padding: 0 9px; font-size: 12px; border-radius: 10px; margin-left: 12px; vertical-align: 4px; }
.soon-can { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.soon-can li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.soon-can li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.soon-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.delete-form { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }

/* ---- small screens ------------------------------------------------------------ */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 45; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .app.nav-open .side { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(12, 12, 20, .28); z-index: 44; }
  .topbar { display: flex; }
  .page { padding: 24px 16px 64px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hit-body { grid-template-columns: 1fr; padding: 4px 16px 18px; gap: 18px; }
  .hit-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px 16px; }
  .hit-row .pill { grid-column: 2; grid-row: 2; justify-self: start; }
  .hit-row .chev { grid-column: 3; grid-row: 1 / span 2; }
  .event-head { padding: 14px 16px; grid-template-columns: 1fr; }
  .event-head .pill { grid-column: 1; grid-row: auto; justify-self: start; }
  .approval { grid-template-columns: auto minmax(0, 1fr); padding: 12px 16px; }
  .approval .row { grid-column: 1 / -1; }
  .stat { padding: 14px 12px; }
  .stat .v { font-size: 22px; }
  .stat .k { font-size: 12px; line-height: 1.3; }
  .attn { grid-template-columns: auto minmax(0, 1fr); }
  .attn > .pill { grid-column: 2; justify-self: start; }
  .ba .delta { display: block; margin-left: 0; }
  .approvals-head { flex-direction: column; align-items: flex-start; gap: 0; }
  .topbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pub { grid-template-columns: 1fr; padding: 28px 16px 64px; gap: 28px; }
  .pub-top { padding: 0 16px; }
  .pitch { position: static; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .t .hide-sm { display: none; }
}
.app { background: linear-gradient(to right, var(--bg-side) 248px, var(--bg) 248px); }
@media (max-width: 900px) { .app { background: var(--bg); } }
