/* Should I Freak: a one-screen dashboard.
   Desktop: 100vh, no page scroll. Columns 360 / globe / 400; panels scroll inside themselves.
   Colour is status only: green calm, amber elevated, red major. Figures in Plex Mono. */
.dash {
  --ground: #0b0b0d; --panel: #121215; --panel-2: #18181c; --line: #232329; --line-2: #2e2e36;
  --text: #f4f4f6; --soft: #c3c5cc; --muted: #8b8d95; --accent: #6aa6ff;
  --calm: #4cd08a; --warning: #f2b347; --negative: #ff5d73;
  --font: "Public Sans", Inter, system-ui, sans-serif;
  --figures: "IBM Plex Mono", ui-monospace, monospace; /* taste-skill-ignore: figures only */
  --gap: 12px; --r: 12px;
  height: 100vh; height: 100dvh; display: grid; grid-template-rows: 52px minmax(0, 1fr) 44px; gap: var(--gap);
  padding: 0 var(--gap) var(--gap); background: var(--ground); color: var(--text); font: 400 14px/1.45 var(--font); overflow: hidden;
}
.dash[data-band="low"] { --mood: var(--calm); }
.dash[data-band="watch"] { --mood: var(--soft); }
.dash[data-band="elevated"] { --mood: var(--warning); }
.dash[data-band="high"] { --mood: var(--negative); }
.dash[data-band="unknown"] { --mood: var(--muted); }
.dash :is(h1, h2, h3) { font-family: var(--font); }
.dash a { color: inherit; text-underline-offset: 3px; }
.dash :is(a, button, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.dash ::selection { background: var(--accent); color: #000; }
.dash .num { font-family: var(--figures); font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }

/* Top bar */
.top { display: flex; align-items: center; gap: 20px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.top .brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; font: 700 16px var(--font); letter-spacing: -0.01em; text-decoration: none; }
.top .brand svg { width: 20px; height: 20px; color: var(--mood, var(--soft)); }
.live { margin: 0 0 0 auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live[data-state="live"] .live-dot { background: var(--calm); animation: pulse 2s ease-in-out infinite; }
.live[data-state="partial"] .live-dot { background: var(--warning); animation: pulse 2s ease-in-out infinite; }
.live[data-state="down"] .live-dot { background: var(--negative); }
@keyframes pulse { 50% { opacity: .3; } }
.clock { font-size: 13px; color: var(--muted); }

/* Grid */
.grid { display: grid; grid-template-columns: 360px minmax(0, 1fr) 400px; gap: var(--gap); min-height: 0; }
.col { display: grid; gap: var(--gap); min-height: 0; }
.col-left { grid-template-rows: auto auto minmax(0, 1fr); }
.p { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.p-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.p-head :is(h1, h2) { margin: 0; font-size: 13px; font-weight: 600; color: var(--soft); }
.p-meta { font: 500 12px var(--figures); color: var(--muted); }
.p-link { margin-left: auto; font-size: 12px; color: var(--muted) !important; }
.p-link:hover { color: var(--text) !important; }

/* Answer */
.answer-p { padding-bottom: 16px; }
.answer { margin: 0; padding: 0 16px; font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -0.045em; color: var(--mood, var(--text)); }
@media (prefers-reduced-motion: no-preference) {
  .answer { animation: rise .8s cubic-bezier(.16, 1, .3, 1) both; }
  @keyframes rise { from { opacity: .001; transform: translateY(12px); } }
}
.reason { margin: 10px 0 0; padding: 0 16px; font-size: 15px; font-weight: 500; line-height: 1.4; }
.gauge { margin: 16px 16px 0; padding: 12px; border-radius: 10px; background: var(--panel-2); }
.gauge-num { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); }
.gauge-num strong { font-size: 28px; font-weight: 600; line-height: 1; color: var(--mood, var(--text)); }
.imeter { position: relative; height: 6px; margin-top: 10px; border-radius: 3px; background: var(--line-2); }
.imeter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--mood, var(--soft)); transition: width .8s cubic-bezier(.16, 1, .3, 1); }
.imeter i { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ground); }
.band-row { display: grid; grid-template-columns: 20fr 20fr 30fr 30fr; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.band-row span[data-on] { color: var(--text); font-weight: 600; }
.evidence { margin: 12px 16px 0; font-size: 13px; color: var(--muted); }

/* Why */
.contributions { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 0 16px 12px; }
.contribution { display: grid; grid-template-columns: 74px 1fr 22px; align-items: center; gap: 8px; height: 26px; font-size: 12.5px; }
.contribution a { color: var(--soft); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contribution a:hover { color: var(--text); text-decoration: underline; }
.contribution-track { position: relative; height: 4px; border-radius: 2px; background: var(--line-2); }
.contribution-track span { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--soft); }
.contribution-value { font: 500 12px var(--figures); text-align: right; color: var(--soft); }

/* Banks */
.bank-list { list-style: none; margin: 0; padding: 0 16px; overflow-y: auto; flex: 1; min-height: 0; }
.bank { display: grid; grid-template-columns: 7px 1fr auto 30px; align-items: center; gap: 10px; height: 34px; border-top: 1px solid var(--line); font-size: 13px; }
.bank:first-child { border-top: 0; }
.bank-name { font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.bank-name:hover { text-decoration: underline; }
.bank-n, .bank-t { font-size: 12px; color: var(--muted); text-align: right; }
.bank[data-level="watch"] .dot { background: var(--soft); }
.bank[data-level="elevated"] .dot { background: var(--warning); }
.bank[data-level="panic"] .dot { background: var(--negative); }
.bank-none { padding: 8px 0; font-size: 13px; color: var(--muted); }
.status-row { list-style: none; margin: 0; padding: 10px 16px 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; border-top: 1px solid var(--line); }
.status-row li { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--soft); }
.status-row a { text-decoration: none; padding: 0 4px; margin: 0 -4px; min-width: 24px; }
.status-row a:hover { text-decoration: underline; }
.status-row li[data-indicator="none"] .dot { background: var(--calm); }
.status-row li[data-indicator="minor"] .dot { background: var(--warning); }
.status-row li:is([data-indicator="major"], [data-indicator="critical"]) .dot { background: var(--negative); }

/* Map */
.views { margin-left: auto; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); }
.view { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 500 12px var(--font); cursor: pointer; }
.view:hover { color: var(--text); }
.view[aria-selected="true"] { background: var(--text); color: #0b0b0d; }
.stage { position: relative; flex: 1; min-height: 0; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.stage canvas[data-dragging] { cursor: grabbing; }
.tip { position: absolute; z-index: 2; max-width: 260px; pointer-events: none; display: grid; gap: 2px; padding: 10px 12px;
  border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12.5px; }
.tip strong { line-height: 1.35; }
.tip span { color: var(--muted); }
.legend { position: absolute; left: 16px; bottom: 8px; display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c9cbd1; }
.legend li[data-level="elevated"]::before { background: var(--warning); }
.legend li[data-level="panic"]::before { background: var(--negative); }
.net-frame { position: absolute; inset: 0 12px 0; display: flex; flex-direction: column; }
.net-frame iframe { flex: 1; width: 100%; border: 0; border-radius: 8px; background: #0b0f1d; }
.net-credit { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.strip { position: relative; padding: 8px 16px 0; border-top: 1px solid var(--line); }
.strip svg { display: block; width: 100%; height: 40px; }
.strip .grid-line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.strip .base { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.strip .mark { fill: #c9cbd1; opacity: .7; cursor: pointer; }
.strip .mark:hover { opacity: 1; }
.strip .mark.lvl-elevated { fill: var(--warning); opacity: .95; }
.strip .mark.lvl-panic { fill: var(--negative); opacity: 1; }
.axis { position: relative; height: 18px; font: 12px var(--figures); color: var(--muted); }
.axis span { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }
.strip-read { margin: 0; padding: 2px 16px 12px; font-size: 12.5px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Feed */
.filters { display: grid; gap: 8px; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px;
  background: none; color: var(--soft); font: 500 12px var(--font); cursor: pointer; }
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #0b0b0d; }
.chip-n { font-size: 12px; opacity: .75; }
.search { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--ground); color: var(--text); font: 13px var(--font); }
.search::placeholder { color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.item { position: relative; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.item::before { content: ""; position: absolute; left: 8px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: #c9cbd1; }
.item[data-level="elevated"]::before { background: var(--warning); }
.item[data-level="panic"]::before { background: var(--negative); }
.item:hover { background: var(--panel-2); }
.item-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.item-level { font-weight: 600; color: var(--soft); }
.item[data-level="elevated"] .item-level { color: var(--warning); }
.item[data-level="panic"] .item-level { color: var(--negative); }
.item-cat { display: inline-flex; align-items: center; gap: 5px; }
.item-cat svg { width: 12px; height: 12px; }
.item-meta time { margin-left: auto; }
.item-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; text-decoration: none; }
a.item-title:hover { text-decoration: underline; }
.item-source { margin: 3px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { margin: 0; padding: 20px 16px; color: var(--muted); }

/* Bottom bar */
.bottom { display: flex; align-items: center; gap: 16px; padding: 0 4px; border-top: 1px solid var(--line); min-width: 0; }
.feeds { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.feed-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); font-size: 12px; color: var(--soft); text-decoration: none; white-space: nowrap; }
.feed-chip:hover { border-color: var(--muted); color: var(--text); }
.feed-chip .num { font-size: 12px; color: var(--muted); }
.feed-chip[data-current="true"] .dot { background: var(--calm); }
.feed-chip[data-current="true"][data-level="elevated"] .dot { background: var(--warning); }
.feed-chip[data-current="true"][data-level="panic"] .dot { background: var(--negative); }
.feed-chip[data-current="false"] .dot { background: transparent; border: 1px solid var(--warning); }
.maker { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.maker-mark { height: 22px; width: auto; display: block; }
.maker-by { font-size: 13px; font-weight: 600; }
.maker-site { font-size: 12px; color: #ffb15e; }
.maker:hover .maker-site { text-decoration: underline; }

/* Panic dialog */
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .75); }
.brief { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel, #121215); border: 1px solid #2e2e36; border-radius: 12px; padding: 22px 24px; color: #f4f4f6; font-family: "Public Sans", sans-serif; }
.brief-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brief h2 { margin: 0; font-size: 22px; }
.panic-close { height: 34px; padding: 0 14px; border: 1px solid #2e2e36; border-radius: 999px; background: none; color: inherit; font: 500 13px "Public Sans", sans-serif; cursor: pointer; }
.brief .score-number { display: flex; align-items: baseline; gap: 6px; }
.brief .score-value { font: 600 36px/1 "IBM Plex Mono", monospace; }
.brief .score-total { color: #8b8d95; }
.brief .score-track { height: 4px; background: #2e2e36; position: relative; }
.brief .score-track span { position: absolute; inset: 0 auto 0 0; background: #c3c5cc; }
.brief-facts, .brief-note, .score-context, .score-coverage { color: #c3c5cc; font-size: 13px; }
.drivers { list-style: none; padding: 0; margin: 12px 0; }
.driver { padding: 10px 0; border-top: 1px solid #232329; font-size: 13px; }
.driver-head { display: flex; justify-content: space-between; }
.driver-category { font-weight: 600; text-decoration: none; }
.driver-meta, .driver-note { margin: 2px 0 0; font-size: 12px; color: #8b8d95; }

/* Laptop */
@media (max-width: 1280px) {
  .grid { grid-template-columns: 320px minmax(0, 1fr) 340px; }
  .answer { font-size: 54px; }
}
@media (max-height: 820px) and (min-width: 1001px) {
  .answer { font-size: 48px; }
  .gauge { margin-top: 12px; }
  .evidence { display: none; }
  .contribution { height: 22px; }
}
/* Tablet and phone: the page scrolls, panels keep their order */
@media (max-width: 1000px) {
  .dash { height: auto; overflow: visible; grid-template-rows: 52px auto auto; }
  .grid { grid-template-columns: 1fr; }
  .col-left { display: contents; }
  .answer-p { order: -2; }
  .map-p { order: -1; height: 72vh; min-height: 420px; }
  .col-left { grid-template-rows: none; }
  .feed-p { max-height: 80vh; }
  .bank-list { max-height: 260px; }
  .bottom { flex-wrap: wrap; padding: 10px 4px; }
  .feeds { flex-wrap: wrap; overflow: visible; }
  .maker { margin-left: 0; }
}
@media (max-width: 560px) {
  .dash { --gap: 8px; }
  .live { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .top { gap: 12px; }
  .clock { display: none; }
  .map-p { height: 62vh; min-height: 360px; }
  .answer { font-size: 52px; }
  .chip { height: 32px; }
  .feed-chip { height: 32px; }
  .status-row li { min-height: 32px; }
  .top { padding: 0 8px; }
  .top .brand, .p-link, .status-row a, .bank-name { min-height: 32px; display: inline-flex; align-items: center; }
  .contribution { height: 34px; }
  .contribution a { min-height: 32px; display: flex; align-items: center; }
  .bank { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none !important; }
  .imeter-fill { transition: none; }
}
