/* TieTrace web app (WebApp.md W1). Dark, calm, chat-style layout; plain CSS, no build step. */
:root {
  /* graphite + verdigris (Aaryan, Oct 18). */
  --bg: #16181B;
  --side: #1E2125;
  --panel: #262A2F;
  --panel-2: #2E3238;
  --line: #353A41;
  --line-soft: #2A2E34;
  --text: #E6E8EB;
  --muted: #9CA2AA;
  --body2: #B9BEC5;
  --accent: #5E9E94;
  --accent-hover: #73B3A9;
  --on-accent: #16181B;
  --ok: #8CC2A8; --ok-bg: #1F2E29; --ok-fg: #BFDCCD; --ok-line: #355247;
  --bad: #E0989B; --err-bg: #36262A; --err-fg: #F0C2C4; --err-line: #5A3B40;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Literata", Georgia, "Times New Roman", serif;
  --a1-bg: #3A2A2E; --a1-fg: #E7B7BF;
  --a2-bg: #2E2A3A; --a2-fg: #C9C1EA;
  --b-bg: #2A313B;  --b-fg: #B8C4D6;
  --c-bg: #2E3238;  --c-fg: #B9BEC5;
  --none-bg: #2A2E34; --none-fg: #C9CED4;
  /* WCAG AA (4.5:1) pairs checked with the WCAG 2 formula: text on bg/panel/panel-2; muted and body2 on bg, side,
     panel and panel-2; on-accent on accent and accent-hover; accent on bg, side and panel; each chip fg on its bg;
     ok-fg on ok-bg; err-fg on err-bg; ok and bad on panel. All pass. */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 18px/1.6 var(--sans); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--panel); padding: 6px 10px; z-index: 30; }
.lp-sr, .composer > label[for="story"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
svg[viewBox="0 0 20 20"] { stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

button {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-btn, 10px); padding: 7px 12px; cursor: pointer;
}
button:hover { border-color: #4A5059; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); }
button.danger { border-color: var(--err-line); }
button:disabled { opacity: .55; cursor: not-allowed; }
textarea, input[type="text"], input[type="password"], input[type="search"], select {
  width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px;
}
.linkish { background: none; border: 0; padding: 0; color: var(--accent-hover); text-decoration: underline; font-size: inherit; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; background: transparent; border: 0; color: var(--muted); border-radius: 8px; flex: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn svg { width: 26px; height: 26px; }
code { font: 13px var(--sans); background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.status { color: var(--muted); font-size: 15px; }

/* ---------- shell: sidebar | main | evidence ---------- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sb {
  width: 300px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 12px;
  background: var(--side); border-right: 1px solid var(--line-soft); overflow-y: auto;
}
body.sb-collapsed .sb { display: none; }
.sb-top { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.wordmark { font: 500 28px/1 var(--display); color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.sb-search { position: relative; margin: 0 2px 6px; }
.sb-search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.sb-search input { padding: 8px 10px 8px 34px; border-radius: 10px; background: var(--bg); border-color: var(--line-soft); font-size: 16px; }
.new-check {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 2px 0 8px; padding: 9px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; text-align: left;
}
.new-check svg { width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--accent); color: var(--on-accent); stroke-width: 2.2; }
.new-check:hover { background: var(--panel); }
.sb-nav { display: grid; gap: 1px; margin-bottom: 10px; }
.sb-nav a, .sb-nav summary {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--body2);
  text-decoration: none; font-size: 16px; cursor: pointer; list-style: none;
}
.sb-nav summary::-webkit-details-marker { display: none; }
.sb-nav svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.sb-nav a:hover, .sb-nav summary:hover { background: var(--panel); color: var(--text); }
.sb-cases .example { display: block; width: calc(100% - 28px); margin: 2px 0 2px 28px; padding: 6px 12px; text-align: left; font-size: 15px; background: transparent; border: 0; color: var(--body2); border-radius: 8px; }
.sb-cases .example:hover { background: var(--panel); color: var(--text); }
.sb-head { margin: 10px 12px 4px; font: 500 13px var(--sans); color: var(--muted); }
.recents { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.recents li { position: relative; display: flex; align-items: center; border-radius: 8px; }
.recents li:hover, .recents li:focus-within { background: var(--panel); }
.recents li[aria-current="true"] { background: var(--panel-2); }
.recents .open {
  flex: 1; min-width: 0; display: block; width: 100%; padding: 7px 36px 7px 12px; background: none; border: 0; border-radius: 8px; text-align: left;
  font-size: 16px; color: var(--body2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recents li[aria-current="true"] .open { color: var(--text); }
.recents .del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; padding: 0; font-size: 18px; background: none; border: 0; color: var(--muted); opacity: 0; }
.recents li:hover .del, .recents .del:focus-visible { opacity: 1; }
.recents .del:hover { color: var(--err-fg); }
@media (hover: none) { .recents .del { opacity: 1; } }
.sb-empty { margin: 2px 12px; font-size: 15px; color: var(--muted); }
.sb-foot { margin-top: auto; padding: 14px 12px 0; font-size: 14px; line-height: 17px; color: var(--muted); }
.sb-foot p { margin: 0 0 6px; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex: none; }
.top-title { flex: 1; min-width: 0; font-size: 19px; color: var(--body2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sb-open { visibility: hidden; }
body.sb-collapsed #sb-open { visibility: visible; }

/* thread: a centred column */
.thread { flex: 1; overflow-y: auto; padding: 8px 20px 24px; }
.thread > * { max-width: 960px; margin-left: auto; margin-right: auto; }
.greet { display: flex; align-items: center; justify-content: center; gap: 14px; }
.greet h1 { margin: 0; font: 400 clamp(34px, 4.8vw, 46px)/1.2 var(--display); letter-spacing: -.02em; text-align: center; }
.greet .lp-logo { flex: none; }
.dock { flex: none; padding: 0 20px 10px; }
.dock > * { max-width: 960px; margin-left: auto; margin-right: auto; }

/* empty state: the greeting and composer centred; Abdul's sections are in the About panel */
body.is-empty .main { overflow-y: auto; }
body.is-empty .thread { flex: none; overflow: visible; padding-top: max(40px, calc(36vh - 90px)); padding-bottom: 28px; }
body.is-empty .dock > * { max-width: 1100px; }
.chips { display: none; }
body.is-empty .chips { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 15px; color: var(--muted); }
.chips .example { padding: 5px 12px; border-radius: 8px; font-size: 15px; background: transparent; border-color: var(--line); color: var(--body2); }
.chips .example:hover { background: var(--panel); color: var(--text); }

/* composer */
.composer {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 10px 18px;
  display: grid; gap: 8px;
}
.composer:focus-within { border-color: #4A5059; outline: 2px solid var(--accent); outline-offset: 2px; }
.composer textarea {
  background: transparent; border: 0; padding: 4px 0; outline: 0; resize: none; font-size: 18px; line-height: 27px;
  min-height: 52px; max-height: 40vh; field-sizing: content;
}
body.is-empty .composer textarea { min-height: 76px; }
.c-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.provider { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.provider select { width: auto; max-width: 240px; padding: 5px 8px; font-size: 15px; color: var(--body2); background: transparent; border-color: var(--line-soft); border-radius: 8px; }
.provider .linkish { font-size: 14.5px; }
.send { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; flex: none; border-radius: 10px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.send:hover { background: var(--accent-hover); }
.send svg { width: 18px; height: 18px; stroke-width: 2.2; }
.keybox { display: grid; gap: 4px; font-size: 15px; color: var(--muted); }
.keybox input { background: var(--bg); padding: 7px 10px; }
.notice { margin: 0; color: var(--muted); font-size: 14px; }
.dock .status { margin: 6px 4px 0; min-height: 0; text-align: center; }
.dock .status:empty { display: none; }
.disclaimer { margin-top: 8px; text-align: center; font-size: 14px; color: var(--muted); }

/* messages */
.msg { margin-top: 0; margin-bottom: 16px; }
.msg.user {
  width: fit-content; max-width: min(85%, 720px); margin-left: auto; margin-right: 0; background: var(--panel-2);
  border-radius: 16px; padding: 10px 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 24px;
}
.thread > .msg.user { margin-right: max(0px, calc((100% - 960px) / 2)); }
.msg.reply { color: var(--body2); line-height: 26px; overflow-wrap: anywhere; }
.msg.reply strong { color: var(--text); }
.msg.reply p { margin: 0 0 10px; white-space: pre-wrap; }
.msg.reply ul, .msg.reply ol { margin: 0 0 10px; padding-left: 22px; }
.msg.reply li { margin: 2px 0; }
.msg.error { background: var(--err-bg); color: var(--err-fg); border-radius: 10px; padding: 10px 12px; }

.cards { display: grid; gap: 10px; margin: 8px 0; }
.cards:empty { display: none; }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px 18px; }
.card h3 { margin: 0 0 6px; font: 600 16px var(--sans); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text); }
.card .basis { color: var(--muted); font-size: 15px; margin: 0 0 6px; }
.card ul { margin: 6px 0 0; padding-left: 18px; }
.card li { margin: 3px 0; font-size: 16px; }
.card .meta { color: var(--muted); }
/* evidence rows: text left, the Exclude button right on the same line (Aaryan, Oct 18) */
.card ul:has(> li.ev) { list-style: none; padding-left: 0; }
.card li.ev { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); margin: 0; }
.card li.ev:last-child { border-bottom: 0; }
.card li.ev .ev-text { flex: 1 1 320px; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.card li.ev > button { flex: none; margin-left: auto; white-space: nowrap; }
.card li.ev > form, .card li.ev > .reviewer-form, .card li.ev > :not(.ev-text):not(button) { flex-basis: 100%; }
.scope { font-size: 15px; background: var(--none-bg); color: var(--none-fg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.chip { display: inline-block; font: 500 12px/1 var(--sans); padding: 5px 8px; border-radius: 8px; }
.chip.A1 { background: var(--a1-bg); color: var(--a1-fg); }
.chip.A2 { background: var(--a2-bg); color: var(--a2-fg); }
.chip.B { background: var(--b-bg); color: var(--b-fg); }
.chip.C { background: var(--c-bg); color: var(--c-fg); }
.chip.NONE { background: var(--none-bg); color: var(--none-fg); }
.chip.ERR { background: var(--err-bg); color: var(--err-fg); }

.inline-form { display: grid; gap: 6px; margin-top: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; }
.inline-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm-text { color: var(--a2-fg); font-size: 16px; margin: 0; }
pre.md { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 13px/1.55 var(--sans); max-height: 360px; overflow: auto; }
.picker fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 10px; }
.picker legend { padding: 0 4px; font-weight: 600; color: var(--text); }
.picker label { display: block; padding: 4px 0; }

.msg.auth { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.msg.auth ol { margin: 8px 0 8px 18px; padding: 0; }
.msg.auth .row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }

/* evidence panel (toggled from the top-right icon) */
.evidence { width: 400px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--side); border-left: 1px solid var(--line-soft); }
.pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 16px 16px 0 20px; }
.pane-head h2 { margin: 0; font: 600 17px var(--sans); }
.pane-sub { margin: 4px 20px 10px; color: var(--muted); font-size: 15px; }
.kicker { margin: 0 0 4px; font: 500 13px var(--sans); color: var(--muted); }
.evidence .scroll { flex: 1; overflow-y: auto; padding: 6px 20px 16px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; background: var(--panel); }
.step .name { font: 600 13px var(--sans); color: var(--text); }
.step .state { font: 400 13px var(--sans); color: var(--muted); margin-left: 6px; }
.step.failed .state { color: var(--err-fg); }
.step .line { font-size: 14.5px; color: var(--muted); margin: 4px 0 0; }
.step details { margin-top: 6px; }
.step summary { cursor: pointer; font-size: 14.5px; color: var(--muted); }
pre.cypher {
  margin: 6px 0 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  font: 12px/1.5 var(--mono); color: #D4D8DD; white-space: pre-wrap; word-break: break-word;
}
.empty { color: var(--muted); font-size: 16px; }
.protocol { border-top: 1px solid var(--line-soft); padding: 12px 20px 14px; font-size: 15px; color: var(--body2); }
.protocol ol { margin: 0; padding-left: 18px; }
.protocol strong { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  .dots i { animation: pulse 1.2s ease-in-out infinite; }
  .dots i:nth-child(2) { animation-delay: .2s; }
  .dots i:nth-child(3) { animation-delay: .4s; }
  @keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
  button.busy::before { animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .msg.progress { animation: fade-in .2s ease-out; }
  @keyframes fade-in { from { opacity: 0; } }
  .evidence { animation: slide-in .18s ease-out; }
  @keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
}

/* boundaries box (empty state, below the fold) */
.bounds { width: 100%; max-width: 896px; background: var(--side); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; text-align: left; }
.bounds .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bounds h3 { margin: 0 0 6px !important; font: 600 14px/20px var(--sans); }
.bounds ul { margin: 0; padding-left: 18px; font-size: 15px; line-height: 20px; }
.bounds .est, .bounds .not { border-radius: 6px; padding: 10px 12px; }
.bounds .est { background: var(--ok-bg); border: 1px solid var(--ok-line); } .bounds .est h3 { color: var(--ok); } .bounds .est ul { color: var(--ok-fg); }
.bounds .not { background: var(--err-bg); border: 1px solid var(--err-line); } .bounds .not h3 { color: var(--bad); } .bounds .not ul { color: var(--body2); }

/* narrow screens: the sidebar and the evidence panel become drawers */
@media (max-width: 900px) {
  .sb { position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s ease; }
  body.sb-open .sb { transform: none; }
  body.sb-open .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.5); }
  body.sb-collapsed .sb { display: flex; }
  #sb-open { visibility: visible; }
  .evidence { position: fixed; inset: 0 0 0 auto; z-index: 18; width: min(400px, 92vw); border-left: 1px solid var(--line); }
  .thread, .dock { padding-left: 16px; padding-right: 16px; }
  .bounds .cols { grid-template-columns: 1fr; }
  .greet { flex-direction: column; gap: 10px; }
  .provider select { max-width: 170px; }
}

/* ---------- How It Works page ---------- */
body.how-page { padding-bottom: 44px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); background: var(--side); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 500 20px var(--display); }
.brand svg { width: 34px; height: 24px; }
.top nav a { color: var(--muted); text-decoration: none; margin-left: 18px; }
.top nav a:hover { color: var(--text); }
.top nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.how { max-width: 860px; margin: 0 auto; padding: 24px 20px 40px; }
.hero { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: center; padding: 18px 0 26px; border-bottom: 1px solid var(--line); }
.hero h1 { font-family: var(--sans); font-size: 32px; line-height: 1.2; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0; }
.hero svg { width: 100%; height: auto; }
.how section { padding: 22px 0 6px; border-bottom: 1px solid var(--line); }
.how h2 { font-size: 21px; margin: 0 0 8px; }
.how h2 .n { font: 600 15px var(--sans); color: var(--accent); margin-right: 8px; }
.how ol, .how ul { padding-left: 20px; }
.how table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 8px 0 14px; }
.how th, .how td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.how th { color: var(--muted); font-weight: 600; }
.how .stat { font: 600 15px var(--sans); color: var(--accent); }
.fail { color: var(--err-fg); font-weight: 650; }
.pass { color: var(--none-fg); font-weight: 650; }
.foot {
  position: fixed; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--side); border-top: 1px solid var(--line-soft); color: var(--muted); font: 400 13px var(--sans); padding: 0 16px; text-align: center;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero svg { max-width: 260px; }
  .top { padding: 10px 16px; }
  .top nav a { margin-left: 12px; }
  .how table { display: block; overflow-x: auto; }
}

/* ---------- create-a-case wizard (Aaryan, Oct 18) ---------- */
.sb-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--body2); font-size: 16px; text-align: left; }
.sb-link svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.sb-link:hover { background: var(--panel); color: var(--text); }
body.wiz-on .thread, body.wiz-on .dock { display: none; }
.wizard { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.wizard > * { max-width: 960px; margin-left: auto; margin-right: auto; }
.wizard h1 { font: 600 24px var(--sans); margin: 12px auto 4px; }
.wz-sub { color: var(--muted); margin-top: 0; }
.wz-step { display: grid; gap: 6px; margin-top: 18px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; }
.wz-step h2 { margin: 0 0 4px; font: 600 16px var(--sans); }
.wz-step h3 { margin: 10px 0 0; font: 600 15px var(--sans); }
.wz-step .row, .wz-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 6px; }
.wz-row > span { display: grid; gap: 4px; }
.wz-step input[type="number"] { width: 8em; padding: 8px 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.wz-cand { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.wz-cand small { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.wz-cand select { width: auto; }
.wz-step dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.wz-step dt { color: var(--muted); }
.wz-step dd { margin: 0; }

/* Public demo banner (TIETRACE_PUBLIC=1; Aaryan, Oct 18) */
.public-banner { margin: 0; padding: 6px 14px; font-size: 15px; text-align: center; color: var(--body2); background: var(--panel); border-bottom: 1px solid var(--line); }

/* About TieTrace panel: a modal <dialog> opened from the bottom-left of the sidebar (Aaryan, Oct 18) */
.about-btn { margin: 0 0 10px; color: var(--text); }
.about {
  width: min(1100px, 100vw - 32px); max-width: none; height: calc(100dvh - 32px); max-height: none; margin: 16px auto; padding: 0;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 18px; overflow-y: auto; overscroll-behavior: contain;
}
.about::backdrop { background: rgba(10, 11, 13, .6); }
.about-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: var(--bg); border-bottom: 1px solid var(--line-soft);
}
.about-head h2 { margin: 0; font: 600 15px var(--sans); }
@media (max-width: 600px) { .about { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; border: 0; } }

/* progress row in the thread while a check runs (Aaryan, Oct 18). Without motion the dots stay still; the text still updates. */
.dots { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7; }
.msg.progress { color: var(--body2); font-size: 16px; }
.pg-head { display: flex; align-items: center; gap: 10px; }
.pg-secs { color: var(--muted); font-size: 14.5px; }
.pg-done { list-style: none; margin: 6px 0 0 28px; padding: 0; font-size: 14.5px; color: var(--muted); }
.pg-done .tick { color: var(--ok); margin-right: 6px; }
.pg-done .failed .tick { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button.busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
button.busy:disabled { opacity: .8; cursor: progress; }
.send.busy::before { margin: 0; }
.send.busy svg { display: none; }

/* Case graph: a modal <dialog> drawn from this check's expert results only (Aaryan, Oct 18) */
.g-head-btns { display: flex; align-items: center; gap: 8px; }
.graph-dlg { display: none; overflow: hidden; }
.graph-dlg[open] { display: flex; flex-direction: column; }
.g-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.g-wrap { overflow: auto; overscroll-behavior: contain; }
#graph-svg { display: block; width: 100%; height: auto; }
.g-side { overflow-y: auto; padding: 16px 20px; border-left: 1px solid var(--line-soft); background: var(--side); font-size: 16px; }
.g-side h3 { margin: 0 0 10px; font: 600 17px var(--sans); overflow-wrap: anywhere; }
.g-side dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.g-side dt { color: var(--muted); }
.g-side dd { margin: 0; color: var(--body2); overflow-wrap: anywhere; }
.g-note { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; }
.g-bg { fill: transparent; }
.ge { stroke: var(--line); stroke-width: 2; }
.ge.hub { stroke: var(--line-soft); stroke-dasharray: 4 6; }
.ge.fund { stroke: var(--accent); }
.ge.aff { stroke: var(--b-fg); stroke-dasharray: 7 5; }
.ge.thin { stroke-width: 1.25; opacity: .8; }
.gl, .gn text { font-family: var(--sans); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }
.gl { font-size: 15px; fill: var(--body2); text-anchor: middle; }
.gn { cursor: pointer; outline: none; }
.gn circle { fill: var(--panel-2); stroke: var(--line); stroke-width: 2; }
.gn text { font-size: 18px; font-weight: 600; fill: var(--text); text-anchor: middle; }
.gn text.sub { font-size: 15px; font-weight: 400; fill: var(--muted); }
.gn.paper text { text-anchor: start; font-size: 16px; font-weight: 500; }
.gn.paper text.sub { font-size: 14px; }
.gn.case circle { fill: var(--panel); stroke: var(--accent); stroke-width: 3; }
.gn.via circle { fill: var(--panel); stroke: var(--accent); }
.gn.paper circle { fill: var(--accent); stroke: var(--bg); }
.gn.t-A1 circle { fill: var(--a1-bg); stroke: var(--a1-fg); }
.gn.t-A2 circle { fill: var(--a2-bg); stroke: var(--a2-fg); }
.gn.t-B circle { fill: var(--b-bg); stroke: var(--b-fg); }
.gn.t-C circle { fill: var(--c-bg); stroke: var(--c-fg); }
.gn.t-NONE circle { fill: var(--none-bg); stroke: var(--muted); stroke-dasharray: 4 4; }
.gn:hover circle, .gn.sel circle { stroke-width: 4; }
.gn:focus-visible circle { stroke: var(--accent-hover); stroke-width: 5; }
.gn.paper:hover text:first-of-type, .gn.paper:focus-visible text:first-of-type { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .g-layer { animation: g-in .22s ease-out; }
  @keyframes g-in { from { opacity: 0; } }
}
@media (max-width: 760px) {
  .g-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .g-side { border-left: 0; border-top: 1px solid var(--line-soft); max-height: 38vh; }
}
