:root {
  color-scheme: dark;
  font-size: clamp(18px, 0.35vw + 16px, 19px);
  --bg: #061316;
  --bg-deep: #030b0d;
  --surface: #0d2024;
  --surface-2: #112a2f;
  --surface-3: #17343a;
  --line: rgba(169, 226, 221, 0.16);
  --line-strong: rgba(169, 226, 221, 0.34);
  --text: #eef8f5;
  --muted: #a8bfbc;
  --faint: #76928f;
  --cyan: #63e6d5;
  --cyan-strong: #21bea9;
  --teal: #2ec6a4;
  --amber: #f0c36b;
  --red: #ff8d83;
  --blue: #83b9ff;
  --clinical: #64d3a8;
  --research: #8ab6ff;
  --mechanism: #d1a2ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
  --radius: 18px;
  --radius-sm: 12px;
  --topbar: 84px;
  --nav: 92px;
  --content-max: 1680px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 15% -10%, rgba(34, 143, 133, 0.13), transparent 34%), linear-gradient(180deg, var(--bg), var(--bg-deep)); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.62; text-rendering: optimizeLegibility; }
body[data-text-scale="large"] { font-size: 1.1rem; }
body[data-text-scale="xlarge"] { font-size: 1.2rem; }
body.high-contrast { --line: rgba(222, 250, 246, 0.3); --line-strong: rgba(222, 250, 246, 0.62); --muted: #c7d8d5; --faint: #a8bfbc; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { scroll-behavior: auto !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--cyan); text-underline-offset: 0.2em; }
img, canvas { max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.is-hidden { display: none !important; }

.skip-link { position: fixed; z-index: 500; top: 0.5rem; left: 0.5rem; transform: translateY(-160%); padding: 0.65rem 0.9rem; border-radius: 10px; background: var(--text); color: #071518; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }

.boot-screen, .fatal-screen { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; text-align: center; }
.boot-screen h1, .fatal-screen h1 { margin: 1rem 0 0.35rem; font-size: clamp(1.7rem, 3vw, 2.6rem); }
.boot-screen p, .fatal-screen p { color: var(--muted); }
.boot-mark { display: flex; align-items: center; gap: 0.55rem; justify-content: center; }
.boot-mark span { width: 15px; height: 15px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 24px rgba(99, 230, 213, 0.6); animation: pulse 1.2s infinite alternate; }
.boot-mark span:nth-child(2) { animation-delay: 0.2s; }
.boot-mark span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { to { opacity: 0.25; transform: scale(0.72); } }
.fatal-card { max-width: 680px; padding: 2rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }

.eyebrow { margin: 0 0 0.35rem; color: var(--cyan); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.68rem 1rem; border: 1px solid transparent; border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 800; transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.48; }
.button.primary { background: linear-gradient(135deg, var(--cyan), #78f1c7); color: #05201c; box-shadow: 0 10px 30px rgba(48, 205, 181, 0.18); }
.button.secondary { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.035); color: var(--text); }
.button.danger { border-color: rgba(255, 141, 131, 0.45); background: rgba(255, 141, 131, 0.1); color: #ffd2ce; }
.button.large { min-height: 58px; padding: 0.9rem 1.3rem; font-size: 1.05rem; }

.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--text); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.02rem; line-height: 1.15; }
.brand small { margin-top: 0.12rem; color: var(--muted); font-size: 0.67rem; letter-spacing: 0.05em; }
.brand-mark { width: 48px; height: 48px; position: relative; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: radial-gradient(circle, rgba(99, 230, 213, 0.22), transparent 70%); }
.brand-mark i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); }
.brand-mark i:nth-child(1) { transform: translate(-9px, 6px); }
.brand-mark i:nth-child(2) { transform: translate(8px, -8px); opacity: 0.72; }
.brand-mark i:nth-child(3) { transform: translate(7px, 10px); opacity: 0.45; }

.landing { min-height: 100vh; position: relative; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(circle at 75% 35%, rgba(53, 183, 166, 0.12), transparent 30%), linear-gradient(145deg, #07181b, #031012 72%); }
.landing-noise { position: absolute; inset: 0; pointer-events: none; opacity: 0.2; background-image: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 90%); }
.landing-header, .landing-footer { position: relative; z-index: 2; width: min(100% - 3rem, var(--content-max)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.landing-header { min-height: 92px; }
.landing-links { display: flex; align-items: center; gap: 1rem; }
.landing-links a, .text-button { color: var(--muted); font-size: 0.82rem; font-weight: 750; text-decoration: none; }
.text-button { border: 1px solid var(--line); border-radius: 10px; background: transparent; padding: 0.45rem 0.7rem; cursor: pointer; }
.landing-main { position: relative; z-index: 1; width: min(100% - 3rem, var(--content-max)); margin: auto; display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(520px, 1.08fr); gap: clamp(2rem, 5vw, 6rem); align-items: center; padding: 3rem 0 5rem; }
.landing-copy h1 { max-width: 900px; margin: 0; font-size: clamp(3rem, 5.7vw, 6.4rem); line-height: 0.98; letter-spacing: -0.055em; }
.landing-copy h1 em { color: var(--cyan); font-style: normal; }
.landing-lead { max-width: 720px; margin: 1.4rem 0 0; color: #c4d8d5; font-size: clamp(1.1rem, 1.25vw, 1.36rem); }
.landing-actions { margin-top: 1.8rem; }
.boundary-strip { max-width: 760px; margin-top: 1.4rem; display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; padding: 0.85rem 1rem; border: 1px solid rgba(240, 195, 107, 0.27); border-radius: 12px; background: rgba(240, 195, 107, 0.07); font-size: 0.82rem; }
.boundary-strip strong { color: var(--amber); white-space: nowrap; }
.boundary-strip span { color: var(--muted); }
.landing-visual { position: relative; min-height: 610px; display: grid; place-items: center; }
.landing-visual canvas { width: min(100%, 760px); aspect-ratio: 1.22; border-radius: 50%; filter: drop-shadow(0 25px 60px rgba(0,0,0,0.38)); }
.visual-caption { position: absolute; bottom: 1rem; right: 0; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(5, 16, 18, 0.8); color: var(--muted); font-size: 0.7rem; backdrop-filter: blur(10px); }
.visual-caption span { color: var(--cyan); }
.landing-footer { min-height: 70px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.72rem; }

.app-shell { min-height: 100vh; }
.topbar { position: fixed; z-index: 80; inset: 0 0 auto 0; height: var(--topbar); display: grid; grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr); align-items: center; gap: 1rem; padding: 0 1.2rem; border-bottom: 1px solid var(--line); background: rgba(5, 17, 20, 0.9); backdrop-filter: blur(20px); }
.compact-brand .brand-mark { width: 42px; height: 42px; }
.status-strip { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.status-strip div { min-width: 120px; padding: 0.42rem 0.75rem; text-align: center; border-right: 1px solid var(--line); }
.status-strip div:last-child { border-right: 0; }
.status-strip span, .status-strip strong { display: block; line-height: 1.25; }
.status-strip span { color: var(--faint); font-size: 0.61rem; letter-spacing: 0.08em; text-transform: uppercase; }
.status-strip strong { margin-top: 0.12rem; font-size: 0.78rem; }
.top-actions { justify-self: end; display: flex; gap: 0.45rem; }
.icon-button { min-width: 46px; height: 44px; padding: 0 0.7rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.035); color: var(--muted); cursor: pointer; font-size: 0.72rem; font-weight: 800; }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }
.side-nav { position: fixed; z-index: 70; top: var(--topbar); bottom: 0; left: 0; width: var(--nav); display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 0.55rem; border-right: 1px solid var(--line); background: rgba(5, 17, 20, 0.88); backdrop-filter: blur(18px); }
.nav-button { min-height: 70px; display: grid; place-items: center; gap: 0.05rem; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--faint); cursor: pointer; }
.nav-button span { font-size: 1.3rem; line-height: 1; }
.nav-button b { font-size: 0.66rem; }
.nav-button:hover, .nav-button.is-active { border-color: var(--line); background: rgba(99, 230, 213, 0.07); color: var(--cyan); }
.workspace { min-height: calc(100vh - 62px); margin-left: var(--nav); padding: calc(var(--topbar) + 2rem) 1.4rem 5.5rem; }
.view { width: min(100%, var(--content-max)); margin-inline: auto; display: none; }
.view.is-active { display: block; animation: fade-in 0.22s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } }
.view-head { min-height: 92px; display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; }
.view-head h2 { margin: 0; font-size: clamp(1.7rem, 2.5vw, 2.5rem); line-height: 1.15; }
.view-subtitle { max-width: 900px; margin: 0.45rem 0 0; color: var(--muted); font-size: 0.88rem; }
.view-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; padding-top: 0.3rem; }

.progress-rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.55rem; margin-bottom: 1rem; }
.progress-node { min-width: 0; padding: 0.58rem 0.7rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); color: var(--faint); font-size: 0.7rem; }
.progress-node strong, .progress-node span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-node strong { color: inherit; font-size: 0.78rem; }
.progress-node.is-current { border-color: rgba(99, 230, 213, 0.48); background: rgba(99, 230, 213, 0.09); color: var(--cyan); }
.progress-node.is-complete { color: #b6dbd4; }

.command-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "case hypothesis" "pathway evidence" "prediction events"; gap: 1rem; align-items: start; }
.command-grid > .panel { min-width: 0; }
.case-panel { grid-area: case; }
.hypothesis-panel { grid-area: hypothesis; }
.pathway-panel { grid-area: pathway; }
.evidence-plan-panel { grid-area: evidence; }
.prediction-panel { grid-area: prediction; }
.event-panel { grid-area: events; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17, 39, 43, 0.95), rgba(8, 24, 28, 0.96)); box-shadow: 0 12px 42px rgba(0,0,0,0.14); }
.panel-head { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.panel-head > div { min-width: 0; display: flex; align-items: center; gap: 0.65rem; }
.panel-head h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.panel-index { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--cyan); font-size: 0.72rem; font-weight: 900; }
.panel-body { padding: 1rem; }
.panel-note { margin: 0.85rem 1rem 0; color: var(--muted); font-size: 0.78rem; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0.2rem 0.5rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 0.63rem; font-weight: 800; white-space: nowrap; }
.badge.clinical { border-color: rgba(100, 211, 168, 0.32); color: var(--clinical); }
.badge.research { border-color: rgba(138, 182, 255, 0.32); color: var(--research); }

.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; }
.fact { min-height: 92px; padding: 0.7rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); }
.fact span, .fact strong, .fact small { display: block; }
.fact span { color: var(--faint); font-size: 0.64rem; }
.fact strong { margin-top: 0.25rem; font-size: 0.92rem; }
.fact small { margin-top: 0.2rem; color: var(--muted); font-size: 0.65rem; }
.risk-list { margin: 0.8rem 0 0; padding: 0; list-style: none; }
.risk-list li { display: grid; grid-template-columns: 10px 1fr; gap: 0.55rem; padding: 0.48rem 0; color: var(--muted); font-size: 0.76rem; border-top: 1px solid rgba(255,255,255,0.045); }
.risk-list li::before { content: ""; width: 8px; height: 8px; margin-top: 0.4rem; border-radius: 50%; background: var(--amber); }

.hypothesis-list, .pathway-list { display: grid; gap: 0.65rem; padding: 0.85rem 1rem 1rem; }
.hypothesis, .pathway { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,0.025); cursor: pointer; transition: border-color 0.18s ease, background 0.18s ease; }
.hypothesis:hover:not(:disabled), .pathway:hover:not(:disabled) { border-color: var(--line-strong); }
.hypothesis.is-selected, .pathway.is-selected { border-color: rgba(99, 230, 213, 0.56); background: rgba(99, 230, 213, 0.075); }
.hypothesis:disabled, .pathway:disabled { cursor: not-allowed; }
.hypothesis { display: grid; grid-template-columns: 48px 1fr; gap: 0.7rem; padding: 0.75rem; }
.hypothesis > span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--cyan); font-size: 0.72rem; font-weight: 900; }
.hypothesis strong, .hypothesis p, .hypothesis small { display: block; }
.hypothesis strong { font-size: 0.87rem; }
.hypothesis p { margin: 0.16rem 0; color: var(--muted); font-size: 0.72rem; }
.hypothesis small { color: var(--faint); font-size: 0.61rem; }
.pathway { display: grid; grid-template-columns: 58px 1fr auto; gap: 0.75rem; align-items: center; padding: 0.8rem; }
.pathway-code { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: rgba(99, 230, 213, 0.08); color: var(--cyan); font-size: 0.72rem; font-weight: 900; }
.pathway strong, .pathway p, .pathway small, .pathway em { display: block; }
.pathway strong { font-size: 0.85rem; }
.pathway p { margin: 0.16rem 0; color: var(--muted); font-size: 0.7rem; }
.pathway small { color: var(--faint); font-size: 0.61rem; }
.pathway em { color: var(--muted); font-size: 0.64rem; font-style: normal; text-align: right; }
.pathway-summary { margin: 0 1rem 1rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,0.12); color: var(--muted); font-size: 0.72rem; }
.pathway-summary strong { color: var(--text); }

.test-options { display: grid; gap: 0.5rem; padding: 0.85rem 1rem; }
.test-option { display: grid; grid-template-columns: auto 1fr; gap: 0.65rem; align-items: start; padding: 0.65rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.02); }
.test-option input { width: 20px; height: 20px; margin-top: 0.2rem; accent-color: var(--cyan-strong); }
.test-option strong, .test-option p, .test-option small { display: block; }
.test-option strong { font-size: 0.8rem; }
.test-option p { margin: 0.1rem 0; color: var(--muted); font-size: 0.68rem; }
.test-option small { color: var(--faint); font-size: 0.6rem; }
.timeline-scroll { overflow-x: auto; border-top: 1px solid var(--line); scrollbar-color: var(--line-strong) transparent; }
.timeline { min-width: 840px; display: grid; grid-template-columns: repeat(9, 1fr); padding: 0.85rem 0.8rem 1rem; }
.timeline-week { min-width: 0; position: relative; padding: 0.45rem 0.45rem 0.6rem; border-left: 1px solid var(--line); }
.timeline-week:last-child { border-right: 1px solid var(--line); }
.timeline-week::before { content: ""; position: absolute; top: 22px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.timeline-week.is-current { background: rgba(99, 230, 213, 0.055); }
.timeline-week.is-current::before { background: var(--cyan); box-shadow: 0 0 14px rgba(99,230,213,0.7); }
.timeline-week strong { display: block; color: var(--muted); font-size: 0.68rem; }
.timeline-event { margin-top: 0.45rem; padding: 0.38rem 0.4rem; border-radius: 7px; background: rgba(255,255,255,0.045); color: #cfe2df; font-size: 0.58rem; line-height: 1.35; }
.timeline-event.research { color: #c8d8ff; background: rgba(131,185,255,0.08); }
.timeline-event.clinical { color: #bbf1dc; background: rgba(100,211,168,0.08); }

.prediction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; padding: 0.85rem 1rem; }
.prediction { min-height: 84px; text-align: left; padding: 0.65rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); cursor: pointer; }
.prediction.is-selected { border-color: rgba(99, 230, 213, 0.55); background: rgba(99,230,213,0.07); }
.prediction span, .prediction strong { display: block; }
.prediction span { color: var(--faint); font-size: 0.6rem; text-transform: uppercase; }
.prediction strong { margin-top: 0.22rem; font-size: 0.77rem; }
.forecast { margin: 0 1rem 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.forecast-item { padding: 0.65rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,0.12); }
.forecast-item span, .forecast-item strong { display: block; }
.forecast-item span { color: var(--faint); font-size: 0.59rem; }
.forecast-item strong { margin-top: 0.2rem; font-size: 0.72rem; }

.event-head { align-items: flex-start; }
.filter-group { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.filter-group button, .layer-tabs button { min-height: 30px; padding: 0.25rem 0.48rem; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer; font-size: 0.58rem; }
.filter-group button.is-active, .layer-tabs button.is-active { border-color: rgba(99,230,213,0.45); background: rgba(99,230,213,0.08); color: var(--cyan); }
.event-list { max-height: 560px; overflow: auto; padding: 0.35rem 1rem 1rem; }
.event-item { display: grid; grid-template-columns: 52px 10px 1fr; gap: 0.55rem; padding: 0.72rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.event-item > time { color: var(--faint); font-size: 0.62rem; }
.event-dot { width: 9px; height: 9px; margin-top: 0.38rem; border-radius: 50%; background: var(--mechanism); }
.event-item[data-type="clinical"] .event-dot { background: var(--clinical); }
.event-item[data-type="research"] .event-dot { background: var(--research); }
.event-item strong, .event-item p { display: block; }
.event-item strong { font-size: 0.75rem; }
.event-item p { margin: 0.12rem 0 0; color: var(--muted); font-size: 0.67rem; }
.empty-state { color: var(--muted); }

.ecology-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.7fr); gap: 1rem; align-items: start; }
.map-panel canvas { width: 100%; height: min(66vh, 700px); display: block; background: radial-gradient(circle at 50% 50%, #112a2f, #061214 78%); cursor: crosshair; }
.layer-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.region-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--line); }
.region-buttons button { min-height: 38px; padding: 0.35rem 0.62rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,0.025); color: var(--muted); cursor: pointer; font-size: 0.65rem; }
.region-buttons button.is-selected { border-color: var(--cyan); color: var(--cyan); }
.inspector-panel { position: sticky; top: calc(var(--topbar) + 1rem); }
.inspector-grid { display: grid; gap: 0.55rem; }
.inspector-grid div { padding: 0.6rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.02); }
.inspector-grid span, .inspector-grid strong { display: block; }
.inspector-grid span { color: var(--faint); font-size: 0.61rem; }
.inspector-grid strong { margin-top: 0.15rem; font-size: 0.77rem; }
.notice { margin: 0.85rem 1rem 1rem; display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.7rem; border: 1px solid rgba(240,195,107,0.25); border-radius: 10px; background: rgba(240,195,107,0.055); font-size: 0.68rem; }
.notice b { color: var(--amber); white-space: nowrap; }
.notice span { color: var(--muted); }

.evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.evidence-card { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17,39,43,0.95), rgba(8,24,28,0.95)); }
.evidence-card header { display: grid; grid-template-columns: 48px 1fr; gap: 0.7rem; align-items: center; }
.evidence-card header > span { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--cyan); font-weight: 900; }
.evidence-card h3 { margin: 0; font-size: 0.92rem; }
.evidence-card header p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.68rem; }
.evidence-card dl { margin: 0.8rem 0 0; }
.evidence-card dl div { padding: 0.6rem 0; border-top: 1px solid var(--line); }
.evidence-card dt { color: var(--faint); font-size: 0.6rem; font-weight: 800; text-transform: uppercase; }
.evidence-card dd { margin: 0.15rem 0 0; color: #d4e4e1; font-size: 0.71rem; }
.evidence-card footer { margin-top: 0.7rem; }
.evidence-card footer a { font-size: 0.65rem; font-weight: 800; }

.compare-empty { padding: 1.5rem; }
.compare-empty h3 { margin: 0; }
.compare-empty p { margin: 0.4rem 0 0; color: var(--muted); }
.compare-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.compare-card { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17,39,43,0.95), rgba(8,24,28,0.95)); }
.compare-card.is-current { border-color: rgba(99,230,213,0.52); }
.compare-card h3 { margin: 0; font-size: 0.95rem; }
.compare-card > p { color: var(--muted); font-size: 0.68rem; }
.dimension-list { display: grid; gap: 0.55rem; margin-top: 0.8rem; }
.dimension { padding: 0.65rem; border: 1px solid var(--line); border-radius: 10px; }
.dimension span, .dimension strong, .dimension small { display: block; }
.dimension span { color: var(--faint); font-size: 0.59rem; }
.dimension strong { margin-top: 0.12rem; font-size: 0.75rem; }
.dimension small { margin-top: 0.15rem; color: var(--muted); font-size: 0.62rem; }

.app-footer { margin-left: var(--nav); min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem 1.4rem; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.66rem; }
.app-footer a { color: var(--muted); }

.modal { width: min(94vw, 760px); max-height: 88vh; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #0b2024; color: var(--text); box-shadow: var(--shadow); }
.modal.wide { width: min(94vw, 1120px); }
.modal::backdrop { background: rgba(0, 5, 7, 0.76); backdrop-filter: blur(7px); }
.modal-frame { display: flex; flex-direction: column; max-height: 88vh; }
.modal header, .modal footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.85rem 1rem; }
.modal header { border-bottom: 1px solid var(--line); }
.modal footer { border-top: 1px solid var(--line); }
.modal h2 { margin: 0; font-size: 1.35rem; }
.modal-content { overflow: auto; padding: 1rem; }
.modal footer { justify-content: flex-end; }
.method-grid, .recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.method-grid > div, .recap-card { padding: 0.8rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); }
.method-grid b, .recap-card strong { color: var(--cyan); }
.method-grid p, .recap-card p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.72rem; }
.prediction-review { margin-top: 0.8rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: 11px; }
.prediction-review h3 { margin: 0 0 0.55rem; font-size: 0.9rem; }
.prediction-result { display: flex; justify-content: space-between; gap: 0.7rem; padding: 0.4rem 0; color: var(--muted); font-size: 0.69rem; border-top: 1px solid rgba(255,255,255,0.05); }
.prediction-result b.supported { color: var(--clinical); }
.prediction-result b.not-supported { color: var(--amber); }
.settings-list { display: grid; gap: 0.65rem; }
.settings-list label { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 0.75rem; border: 1px solid var(--line); border-radius: 11px; }
.settings-list strong, .settings-list small { display: block; }
.settings-list small { margin-top: 0.1rem; color: var(--muted); font-size: 0.65rem; }
.settings-list select { min-width: 130px; padding: 0.45rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.settings-list input[type="checkbox"] { width: 23px; height: 23px; accent-color: var(--cyan-strong); }
.save-toolbar { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.save-list { display: grid; gap: 0.6rem; margin-top: 1rem; }
.save-record { display: grid; grid-template-columns: 1fr auto; gap: 0.7rem; align-items: center; padding: 0.75rem; border: 1px solid var(--line); border-radius: 11px; }
.save-record strong, .save-record small { display: block; }
.save-record small { color: var(--muted); font-size: 0.64rem; }
.save-record-actions { display: flex; gap: 0.4rem; }
.save-record-actions button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.62rem; }

.toast-region { position: fixed; z-index: 300; right: 1rem; bottom: 1rem; width: min(360px, calc(100vw - 2rem)); display: grid; gap: 0.55rem; }
.toast { padding: 0.75rem 0.85rem; border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(10, 31, 35, 0.96); box-shadow: var(--shadow); }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 0.76rem; }
.toast span { margin-top: 0.12rem; color: var(--muted); font-size: 0.66rem; }
.update-banner { position: fixed; z-index: 260; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 12px; background: #102d31; box-shadow: var(--shadow); font-size: 0.7rem; }
.update-banner button { border: 0; border-radius: 8px; background: var(--cyan); color: #05201c; padding: 0.4rem 0.65rem; cursor: pointer; font-weight: 850; }
.noscript { position: fixed; inset: auto 0 0; z-index: 999; padding: 1rem; background: #7c2f2b; color: white; text-align: center; }

@media (max-width: 1450px) {
  .status-strip div { min-width: 104px; }
  .evidence-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1250px) {
  .landing-main { grid-template-columns: 1fr; }
  .landing-copy { padding-top: 2rem; }
  .landing-visual { min-height: 480px; }
  .topbar { grid-template-columns: minmax(230px,1fr) auto; }
  .status-strip { display: none; }
  .command-grid { grid-template-columns: 1fr; grid-template-areas: "case" "hypothesis" "pathway" "evidence" "prediction" "events"; }
  .compare-board { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --topbar: 76px; --nav: 0px; }
  .landing-header, .landing-footer, .landing-main { width: min(100% - 1.5rem, var(--content-max)); }
  .landing-header { min-height: 76px; }
  .landing-links a { display: none; }
  .landing-main { padding-top: 1rem; }
  .landing-copy h1 { font-size: clamp(2.7rem, 13vw, 5rem); }
  .landing-visual { min-height: 390px; }
  .topbar { padding: 0 0.7rem; }
  .compact-brand small { display: none; }
  .top-actions { gap: 0.25rem; }
  .icon-button { min-width: 42px; padding: 0 0.5rem; }
  .side-nav { top: auto; right: 0; bottom: 0; width: auto; height: 72px; flex-direction: row; padding: 0.35rem; border-right: 0; border-top: 1px solid var(--line); }
  .nav-button { flex: 1; min-height: 60px; }
  .workspace { margin-left: 0; padding: calc(var(--topbar) + 1rem) 0.75rem 6rem; }
  .app-footer { margin-left: 0; padding-bottom: 5.2rem; flex-direction: column; align-items: flex-start; }
  .view-head { min-height: 0; flex-direction: column; }
  .view-actions { width: 100%; }
  .view-actions .button { flex: 1; }
  .progress-rail { grid-template-columns: repeat(5, 130px); overflow-x: auto; padding-bottom: 0.3rem; }
  .fact-grid, .forecast, .prediction-grid, .method-grid, .recap-grid, .evidence-grid { grid-template-columns: 1fr; }
  .ecology-layout { grid-template-columns: 1fr; }
  .inspector-panel { position: static; }
  .map-panel canvas { height: 55vh; }
  .modal footer { flex-direction: column; align-items: stretch; }
  .modal footer .button { width: 100%; }
}

@media (max-width: 620px) {
  .brand-mark { width: 40px; height: 40px; }
  .brand strong { font-size: 0.83rem; }
  .landing-copy h1 { letter-spacing: -0.045em; }
  .landing-lead { font-size: 1.05rem; }
  .landing-actions .button { width: 100%; }
  .boundary-strip { grid-template-columns: 1fr; }
  .landing-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
  .top-actions #installButton { display: none; }
  .panel-head { align-items: flex-start; }
  .panel-head > div { align-items: flex-start; }
  .pathway { grid-template-columns: 52px 1fr; }
  .pathway em { grid-column: 2; text-align: left; }
  .event-item { grid-template-columns: 45px 9px 1fr; }
  .toast-region { bottom: 5rem; }
  .update-banner { bottom: 5rem; width: calc(100vw - 1.5rem); }
  .save-record { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .side-nav, .view-actions, .app-footer, .toast-region, .update-banner { display: none !important; }
  .workspace { margin: 0; padding: 1cm; }
  body { background: white; color: black; }
  .panel, .evidence-card, .compare-card { break-inside: avoid; background: white; box-shadow: none; border-color: #888; }
}

.static-page { min-height: 100vh; }
.static-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem; border-bottom: 1px solid var(--line); background: rgba(5,17,20,.92); }
.static-header .brand-mark { width: 40px; height: 40px; }
.static-header nav { display: flex; flex-wrap: wrap; gap: .8rem; }
.static-header nav a { color: var(--muted); font-size: .72rem; font-weight: 750; text-decoration: none; }
.static-main { width: min(100% - 2rem, 980px); margin: 0 auto; padding: 3rem 0 5rem; }
.static-main h1 { margin: 0; font-size: clamp(2.2rem,5vw,4.4rem); line-height: 1.05; letter-spacing: -.04em; }
.static-main h2 { margin: 2.2rem 0 .6rem; font-size: 1.35rem; }
.static-main h3 { margin: 1.5rem 0 .4rem; font-size: 1rem; }
.static-main p, .static-main li { color: #c7d8d5; }
.static-main li { margin: .35rem 0; }
.static-lead { font-size: 1.05rem; color: var(--muted) !important; }
.static-card { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(15,38,42,.8); }
.static-card h2, .static-card h3 { margin-top: 0; }
.reference-list { display: grid; gap: .8rem; margin-top: 1rem; }
.reference-item { padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.reference-item strong, .reference-item span, .reference-item a { display: block; }
.reference-item span { margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.reference-item a { margin-top: .45rem; overflow-wrap: anywhere; font-size: .68rem; }
.static-footer { padding: 1rem; border-top: 1px solid var(--line); color: var(--faint); text-align: center; font-size: .65rem; }
@media (max-width:620px){.static-header{align-items:flex-start;flex-direction:column;padding:.8rem}.static-main{padding-top:2rem}.static-header nav{gap:.55rem}}
