:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1b1f24;
  --ink-2: #4a525c;
  --ink-3: #737d88;
  --line: #e3e1da;
  --accent: #1f6feb;
  --in-use: #23875c;
  --configured: #2f6fb3;
  --likely: #b07812;
  --account: #8a929c;
  --reporting: #8b5cb8;
  --risk: #c2362f;
  --warning: #a8700e;
  --note: #6b7480;
  --code-bg: #f1efe9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .05), 0 4px 16px rgba(20, 24, 28, .05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #161a20;
    --ink: #e7eaee;
    --ink-2: #b4bcc6;
    --ink-3: #8a94a0;
    --line: #262c34;
    --accent: #5b9dff;
    --in-use: #3fbf86;
    --configured: #5a9be0;
    --likely: #d9a23a;
    --account: #7d8792;
    --reporting: #b58ae0;
    --risk: #f06b63;
    --warning: #e0a53c;
    --note: #8a94a0;
    --code-bg: #1d2229;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top, main, .bottom { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.wordmark svg { width: 28px; height: 28px; }
.wm-core { fill: var(--in-use); }
.wm-ring { fill: none; stroke: var(--configured); stroke-width: 2; }
.wm-dot { fill: var(--likely); }
.top nav { display: flex; gap: 18px; font-size: .95rem; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 12px; }
.lede { color: var(--ink-2); font-size: 1.12rem; margin: 0 auto 28px; max-width: 34em; }
.lookup { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.lookup input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.08rem; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
}
.lookup input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 14px;
}
button:hover { border-color: var(--ink-3); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lookup button { background: var(--ink); color: var(--bg); border-color: var(--ink); padding: 14px 22px; min-height: 48px; }
.lookup button:hover { opacity: .9; }
.hint { color: var(--ink-3); font-size: .9rem; margin-top: 12px; }

.progress { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink-2); padding: 18px 0; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--configured); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.error { max-width: 560px; margin: 8px auto; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--risk); color: var(--ink); }

.result { padding: 12px 0 40px; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 8px; }
.result-head > div:nth-child(2) { flex: 1; min-width: 220px; }
.logo { width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 1px solid var(--line); }
.result h2 { font-size: 1.7rem; letter-spacing: -.02em; margin: 0; word-break: break-all; }
.summary { margin: 2px 0 0; color: var(--ink-2); }
.story { margin: 16px 0 0; max-width: 72ch; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { font-size: .9rem; font-weight: 500; padding: 8px 12px; min-height: 40px; }

.map-wrap { margin: 18px 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 10px 16px; }
#map { width: 100%; height: auto; max-height: 720px; display: block; }
.ring { fill: none; stroke: var(--line); stroke-width: 1; }
.ring-label { fill: var(--ink-3); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.spoke { stroke: var(--line); stroke-width: 1; }
.divider { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; }
.core { fill: var(--ink); }
.core-text { fill: var(--bg); font-weight: 700; font-size: 13px; }
.sector-label { fill: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.node { cursor: pointer; }
.node circle { stroke: var(--surface); stroke-width: 3; }
.node text.initials { fill: #fff; font-size: 11px; font-weight: 700; pointer-events: none; }
.node text.name { fill: var(--ink); font-size: 12.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.node:hover circle, .node:focus circle { stroke: var(--ink); }
.node:focus { outline: none; }
.t-in-use { fill: var(--in-use); } .t-configured { fill: var(--configured); }
.t-likely { fill: var(--likely); } .t-account { fill: var(--account); }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; color: var(--ink-2); font-size: .9rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot.in-use { background: var(--in-use); } .dot.configured { background: var(--configured); }
.dot.likely { background: var(--likely); } .dot.account { background: var(--account); }

.section-title { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 30px 0 10px; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; scroll-margin-top: 20px; }
.card.flash { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card h3 { margin: 0; font-size: 1.05rem; }
.badge { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #fff; white-space: nowrap; }
.b-in-use { background: var(--in-use); } .b-configured { background: var(--configured); }
.b-likely { background: var(--likely); } .b-account { background: var(--account); } .b-reporting { background: var(--reporting); }
.meta { color: var(--ink-3); font-size: .85rem; margin: 2px 0 8px; }
.chip { display: inline-block; font-size: .78rem; background: var(--code-bg); border-radius: 6px; padding: 1px 6px; margin: 0 4px 4px 0; color: var(--ink-2); }
.claims { list-style: none; padding: 0; margin: 0; }
.claims li { padding: 6px 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.claims li:first-child { border-top: none; }
.claims .kind { color: var(--ink-2); }
.claims .ev { display: block; color: var(--ink-3); word-break: break-all; margin-top: 2px; }
.claims li.decider .kind { color: var(--ink); font-weight: 600; }
.more { background: none; border: none; color: var(--accent); padding: 4px 0; font-weight: 500; font-size: .88rem; min-height: 32px; }

.finding { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.finding.risk { border-left-color: var(--risk); } .finding.warning { border-left-color: var(--warning); } .finding.note { border-left-color: var(--note); }
.finding h3 { margin: 0 0 2px; font-size: 1rem; }
.finding p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.finding .ev { color: var(--ink-3); font-size: .82rem; word-break: break-all; margin-top: 4px; display: block; }

details.asked, details.unknowns { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
details.asked summary, details.unknowns summary { cursor: pointer; font-weight: 600; min-height: 32px; display: list-item; }
details.asked ul, details.unknowns ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: .9rem; }
details.unknowns li { margin: 3px 0; word-break: break-all; }
details.unknowns .ev { display: block; color: var(--ink-3); font-size: .82rem; }
details.asked li { margin: 3px 0; overflow-wrap: anywhere; }
details.asked h4 { margin: 12px 0 0; font-size: .9rem; word-break: break-all; }
.gaps { margin: 0 0 16px; padding-left: 18px; color: var(--ink-2); font-size: .9rem; }
.gaps li { margin: 3px 0; overflow-wrap: anywhere; }
.absences .ev { display: block; color: var(--ink-3); font-size: .82rem; }
.footnote { color: var(--ink-3); font-size: .88rem; margin-top: 24px; }

.how { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0 20px; }
.how h2 { margin: 0 0 18px; letter-spacing: -.015em; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px 28px; }
.how h3 { margin: 0 0 4px; font-size: 1rem; }
.how p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.bottom { color: var(--ink-3); font-size: .9rem; padding-top: 16px; padding-bottom: 40px; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  /* The map scales to half size: names give way to bigger nodes; a tap opens the card. */
  .node text.name, .divider, .sector-label { display: none; }
  .node circle { r: 26px; }
  .node text.initials { font-size: 17px; }
  .core { r: 66px; }
  .core-text { font-size: 16px; }
  .lookup { flex-direction: column; }
  .hero { padding-top: 32px; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
  .cards { grid-template-columns: 1fr; }
}
