:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #f2f5f7;
  --muted: #98a5ad;
  --panel: rgba(14, 20, 26, 0.92);
  --panel-strong: #111820;
  --line: rgba(255, 255, 255, 0.1);
  --gold: #e8b86d;
  --cyan: #5bc8d7;
  --blue: #7187ff;
  --green: #66d59e;
  --coral: #f1887b;
  --violet: #a58af5;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; min-height: 100%; background: #070b10; color: var(--ink); }
button, input, select { font: inherit; }
button, select, input { color: inherit; }

.app-shell { min-height: 100vh; background: radial-gradient(circle at 58% 32%, rgba(44, 88, 105, 0.19), transparent 32%), #070b10; }
.app-shell:has(main.is-timeline-view) { background: radial-gradient(circle at 78% 30%, rgba(232, 107, 53, .08), transparent 30%), #0b0d0f; }
.topbar { width: 100%; height: 68px; position: absolute; inset: 0 0 auto; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 0; background: transparent; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup > span:last-child { display: grid; gap: 2px; }
.brand-lockup strong { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.brand-lockup small { color: var(--muted); font-size: 12px; }
.brand-mark { display: flex; align-items: center; gap: 4px; color: var(--gold); }
.brand-mark i { display: block; width: 3px; height: 20px; background: currentColor; border-radius: 2px; }
.brand-mark b { font-size: 13px; letter-spacing: 0.04em; }
.view-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.035); }
.topbar .view-switch { grid-column: 2; }
.view-button, .quiet-button, .stage-button { border: 0; cursor: pointer; }
.view-button { padding: 9px 15px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.view-button.is-active { background: #f0f3f5; color: #10161c; }
.topbar-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; }
.quiet-link, .quiet-button { min-height: 38px; padding: 9px 13px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; }
.quiet-button { justify-self: end; }
.quiet-link:hover, .quiet-link:focus-visible, .quiet-button:hover, .quiet-button:focus-visible { color: var(--ink); border-color: rgba(255,255,255,.24); }
.sound-toggle[aria-pressed="true"] { border-color: rgba(232,184,109,.55); color: var(--gold); background: rgba(232,184,109,.08); }

main { height: 100vh; position: relative; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
main.is-timeline-view { grid-template-columns: minmax(0, 1fr); background: radial-gradient(circle at 78% 30%, rgba(232, 107, 53, .08), transparent 30%), #0b0d0f; }
main.is-timeline-view.has-detail { grid-template-columns: minmax(0, 1fr) 330px; }
main.is-timeline-view .control-rail { display: none; }
main.is-timeline-view:not(.has-detail) .detail-panel { display: none; }
.control-rail, .detail-panel { position: relative; z-index: 5; background: var(--panel); backdrop-filter: blur(18px); }
.control-rail { height: calc(100% - 172px); align-self: start; margin: 86px 0 86px 18px; padding: 22px 17px; border: 1px solid var(--line); border-radius: 16px; overflow-y: auto; box-shadow: 0 24px 70px rgba(0,0,0,.34); }
.control-heading { display: grid; gap: 4px; margin-bottom: 18px; }
.control-heading span, label > span, .eyebrow, .detail-kicker { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.control-heading strong { height: 48px; font-size: 18px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.stage-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 22px; }
.stage-button { min-height: 44px; display: grid; place-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 12px; }
.stage-button:first-child { grid-column: span 4; min-height: 36px; }
.stage-button:hover, .stage-button:focus-visible, .stage-button.is-active { border-color: rgba(232,184,109,.7); color: var(--ink); background: rgba(232,184,109,.12); }
.control-rail label { display: grid; gap: 7px; margin-top: 16px; }
.filter-control { display: grid; gap: 8px; margin-top: 16px; }
.filter-control > span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.option-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option-grid button { min-height: 38px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.035); color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1.25; }
.option-grid button:hover, .option-grid button:focus-visible { color: var(--ink); border-color: rgba(255,255,255,.24); }
.option-grid button[aria-pressed="true"] { color: var(--ink); border-color: rgba(232,184,109,.7); background: rgba(232,184,109,.12); }
.control-rail [hidden] { display: none; }
.control-rail select, .control-rail input { width: 100%; padding: 10px 11px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.045); outline: none; font-size: 13px; }
.control-rail select:focus, .control-rail input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,184,109,.11); }
.control-rail .toggle-control { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; cursor: pointer; }
.control-rail .toggle-control input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--gold); }
.control-rail .toggle-control span { color: inherit; font-size: inherit; font-weight: 500; text-transform: none; letter-spacing: 0; }
.scope-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.workspace { min-width: 0; position: relative; overflow: hidden; }
.workspace[hidden] { display: none; }
.graph-canvas { position: absolute; inset: 0; cursor: crosshair; }
.graph-canvas canvas { display: block; }
.node-label-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.node-screen-portrait { position: absolute; z-index: 3; left: 0; top: 0; display: block; border: 2px solid color-mix(in srgb, var(--orb-colour) 82%, white 18%); border-radius: 50%; background-image: radial-gradient(circle at 31% 24%, rgba(255,255,255,.32), transparent 22%, transparent 66%, rgba(3,7,12,.7) 100%), url("./synthetic-people-atlas.png"); background-repeat: no-repeat; background-size: 100% 100%, 400% 600%; background-position: center, var(--portrait-x) var(--portrait-y); box-shadow: inset 0 0 8px rgba(255,255,255,.16), inset 0 -7px 12px rgba(0,0,0,.42), 0 0 12px color-mix(in srgb, var(--orb-colour) 54%, transparent); transform: translate(-50%, -50%); filter: saturate(.9) contrast(1.03); }
.node-screen-portrait::after { content: ""; position: absolute; inset: -7px; border: 1px solid rgba(248,213,156,.82); border-radius: 50%; opacity: 0; transform: scale(.9); pointer-events: none; }
.node-screen-portrait.is-selected { border-color: #f8d59c; box-shadow: inset 0 0 8px rgba(255,255,255,.2), inset 0 -7px 12px rgba(0,0,0,.38), 0 0 16px rgba(232,184,109,.72), 0 0 34px rgba(232,184,109,.26); }
.node-screen-portrait.is-selected::after { animation: selected-orb-pulse 1.8s cubic-bezier(.22,.7,.24,1) infinite; }
.node-screen-portrait[hidden] { display: none; }
@keyframes selected-orb-pulse { 0% { opacity: .72; transform: scale(.88); } 68%, 100% { opacity: 0; transform: scale(1.34); } }
.node-reveal-layer, .connection-reveal-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.node-reveal-layer { z-index: 2; }
.node-reveal-orb { position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fff 0, var(--node-colour) 24%, var(--node-colour) 72%, #101821 100%); box-shadow: 0 0 10px color-mix(in srgb, var(--node-colour) 72%, transparent); opacity: 0; }
.connection-reveal-layer { z-index: 1; }
.connection-reveal-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-opacity: .9; filter: drop-shadow(0 0 3px currentColor); }
.node-screen-label { position: absolute; z-index: 4; left: 0; top: 0; max-width: 230px; padding: 4px 7px; border: 0; border-radius: 5px; background: rgba(8,12,17,.78); color: var(--ink); font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translate(-50%, calc(-100% - 11px)); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.node-screen-label[hidden] { display: none; }
.network-context { position: absolute; z-index: 4; top: 86px; left: 22px; right: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; pointer-events: none; }
.network-context h1 { margin: 5px 0 3px; font-size: 22px; line-height: 1.15; font-weight: 500; }
.network-context p { margin: 0; color: var(--muted); font-size: 12px; }
.network-context-metrics { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 14px; max-width: 520px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(8,12,17,.78); color: var(--muted); font-size: 11px; }
.network-context-metrics span { white-space: nowrap; }
.network-context-metrics b { color: var(--ink); font-weight: 600; }
.network-navigation-hint { width: 118px; position: absolute; z-index: 5; top: 174px; left: 22px; display: flex; flex-direction: column; align-items: stretch; gap: 9px; padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(7,11,16,.68); box-shadow: 0 10px 28px rgba(0,0,0,.18); backdrop-filter: blur(9px); pointer-events: none; }
.navigation-hint-title { margin-bottom: 1px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.navigation-gesture { width: 100%; display: flex; align-items: center; gap: 8px; }
.navigation-gesture > span { display: grid; gap: 1px; }
.navigation-gesture b { color: #d8e0e5; font-size: 9px; line-height: 1.1; font-weight: 600; white-space: nowrap; }
.navigation-gesture small { color: var(--muted); font-size: 8px; line-height: 1.1; }
.mouse-glyph { width: 15px; height: 21px; position: relative; display: block; flex: 0 0 15px; border: 1px solid rgba(216,224,229,.58); border-radius: 8px; }
.mouse-glyph::before { content: ""; position: absolute; top: 2px; height: 6px; background: var(--gold); box-shadow: 0 0 7px rgba(232,184,109,.42); }
.mouse-left::before { left: 2px; width: 5px; border-radius: 5px 1px 2px 1px; }
.mouse-right::before { right: 2px; width: 5px; border-radius: 1px 5px 1px 2px; }
.mouse-wheel::before { left: 6px; width: 2px; border-radius: 2px; }
.mouse-wheel::after { content: "↕"; position: absolute; left: 17px; top: 4px; color: var(--gold); font: 600 10px/1 sans-serif; }
.navigation-gesture:has(.mouse-wheel) { margin-right: 0; }
.orb-glyph { width: 15px; height: 15px; display: block; flex: 0 0 15px; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #f5feff 0 8%, #7be2ec 19%, #3eb7c6 49%, #176c78 78%, #102f37 100%); box-shadow: 0 0 0 3px rgba(91,200,215,.07), 0 0 10px rgba(91,200,215,.45); }
.network-overview { width: 220px; position: absolute; z-index: 6; left: 18px; bottom: 164px; padding: 10px 11px 9px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: rgba(7,11,16,.8); box-shadow: 0 14px 38px rgba(0,0,0,.28); backdrop-filter: blur(10px); pointer-events: none; }
.network-overview[hidden] { display: none; }
.network-overview > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.network-overview svg { width: 100%; height: 132px; display: block; overflow: visible; }
.overview-links line { stroke: rgba(190,205,215,.22); stroke-width: .75; }
.overview-nodes circle { filter: drop-shadow(0 0 2px currentColor); }
.overview-selection { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: .9; }
.network-opening { width: min(700px, calc(100% - 48px)); padding: 20px 28px; position: absolute; z-index: 5; left: 50%; top: calc(50% - 26px); transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.network-opening[hidden] { display: none; }
.network-opening.is-leaving { animation: network-opening-out .85s ease forwards; }
.network-opening .opening-kicker { display: block; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.opening-symbol { width: 88px; height: 54px; margin: 17px auto 13px; position: relative; }
.opening-symbol::before, .opening-symbol::after { content: ""; position: absolute; height: 1px; left: 18px; right: 18px; top: 27px; transform-origin: center; background: linear-gradient(90deg, transparent, rgba(91,200,215,.7), transparent); }
.opening-symbol::before { transform: rotate(26deg); }
.opening-symbol::after { transform: rotate(-26deg); }
.opening-symbol i, .opening-symbol b { position: absolute; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px rgba(232,184,109,.6); }
.opening-symbol i { width: 7px; height: 7px; animation: opening-node-pulse 2.8s ease-in-out infinite; }
.opening-symbol i:nth-child(1) { left: 10px; top: 23px; }
.opening-symbol i:nth-child(2) { right: 10px; top: 9px; animation-delay: .45s; }
.opening-symbol i:nth-child(3) { right: 10px; bottom: 8px; animation-delay: .9s; }
.opening-symbol b { width: 13px; height: 13px; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--cyan); box-shadow: 0 0 0 8px rgba(91,200,215,.08), 0 0 24px rgba(91,200,215,.55); }
.network-opening strong { display: block; color: var(--ink); font-size: clamp(28px, 2.5vw, 40px); line-height: 1.08; font-weight: 500; }
.network-opening strong span { display: inline-block; margin: 0 .08em; }
.network-opening p { max-width: 650px; margin: 18px auto 0; color: #c7d0d9; font-size: clamp(18px, 1.45vw, 22px); line-height: 1.45; }
.word-orb { width: .52em; height: .52em; display: inline-block; position: relative; margin: 0 .025em; border-radius: 50%; vertical-align: .01em; color: transparent; overflow: hidden; background: radial-gradient(circle at 34% 30%, #effeff 0 10%, #77e5f0 20%, #36aebe 48%, #167381 72%, rgba(22,115,129,.28) 100%); box-shadow: 0 0 0 .1em rgba(91,200,215,.08), 0 0 .58em rgba(91,200,215,.68); }
.word-orb::after { content: ""; width: 22%; height: 22%; position: absolute; left: 22%; top: 18%; border-radius: 50%; background: rgba(255,255,255,.92); }
.network-opening.is-sequencing .opening-kicker, .network-opening.is-sequencing .opening-symbol, .network-opening.is-sequencing strong, .network-opening.is-sequencing .opening-formation { opacity: 0; }
.network-opening.is-sequencing .opening-kicker { animation: opening-element-in .45s ease .12s forwards; }
.network-opening.is-sequencing .opening-symbol { animation: opening-element-in .6s ease .42s forwards; }
.network-opening.is-sequencing strong { animation: opening-phrase-in .62s cubic-bezier(.22,.8,.24,1) .95s forwards; }
.network-opening.is-sequencing .opening-formation { animation: opening-element-in .72s ease 1.9s forwards; }
.network-opening.is-sequencing .word-orb { animation: word-orb-breathe 2.2s ease-in-out 2.55s infinite; }
@keyframes opening-element-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes opening-phrase-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes network-opening-out { from { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); } to { opacity: 0; transform: translate(-50%, calc(-50% - 6px)); filter: blur(4px); } }
@keyframes opening-node-pulse { 0%, 100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes word-orb-breathe { 0%, 100% { box-shadow: 0 0 0 .12em rgba(91,200,215,.08), 0 0 .65em rgba(91,200,215,.58); } 50% { box-shadow: 0 0 0 .18em rgba(91,200,215,.12), 0 0 1em rgba(91,200,215,.9); } }
@media (prefers-reduced-motion: reduce) {
  .network-opening, .network-opening.is-leaving, .network-opening.is-sequencing .opening-kicker, .network-opening.is-sequencing .opening-symbol, .network-opening.is-sequencing strong, .network-opening.is-sequencing .opening-formation, .network-opening.is-sequencing .word-orb, .opening-symbol i { opacity: 1; animation: none; }
  .node-screen-portrait.is-selected::after { opacity: .7; transform: scale(1.12); animation: none; }
  .timeline-orb, .timeline-axis span, .timeline-cell::after { transition: none; }
}
.network-history { position: absolute; z-index: 5; left: 0; right: 0; bottom: 56px; display: grid; grid-template-columns: 38px minmax(260px,1fr); align-items: start; gap: 11px; padding: 34px 22px 16px; background: linear-gradient(180deg, transparent 0, rgba(7,11,16,.68) 32%, rgba(7,11,16,.96) 100%); }
.network-history > button, .network-week-ticks button { border: 0; color: var(--muted); cursor: pointer; }
.network-history > button { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.045); }
.network-history > button:hover, .network-history > button:focus-visible { color: var(--ink); background: rgba(255,255,255,.1); outline: none; }
.network-history > .history-play { margin-top: 13px; display: grid; place-items: center; border: 1px solid rgba(232,184,109,.45); background: rgba(232,184,109,.09); color: var(--ink); }
.network-history > .history-play:hover, .network-history > .history-play:focus-visible { border-color: rgba(232,184,109,.8); background: rgba(232,184,109,.16); }
.history-play span { width: 0; height: 0; margin-left: 2px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor; }
.history-play.is-playing span { width: 9px; height: 10px; margin-left: 0; border: 0; background: linear-gradient(90deg, currentColor 0 3px, transparent 3px 6px, currentColor 6px 9px); }
.history-journey { min-width: 0; display: grid; gap: 4px; }
.history-heading { min-height: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.history-heading label { color: var(--ink); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.history-heading span { color: var(--muted); font-size: 11px; }
.network-history input[type="range"] { width: 100%; height: 16px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.network-history input[type="range"]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) 0 var(--history-progress, 100%), rgba(255,255,255,.17) var(--history-progress, 100%) 100%); }
.network-history input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -5px; appearance: none; border: 2px solid #f8d59c; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(232,184,109,.12), 0 0 16px rgba(232,184,109,.42); }
.network-history input[type="range"]:focus-visible { outline: none; }
.network-history input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(242,245,247,.22), 0 0 18px rgba(232,184,109,.5); }
.network-week-ticks { display: grid; grid-template-columns: repeat(13, 1fr); }
.network-week-ticks button { min-width: 0; min-height: 26px; padding: 2px 0 0; display: grid; justify-items: center; align-content: start; gap: 3px; background: transparent; font-size: 10px; }
.network-week-ticks button i { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.28); transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease; }
.network-week-ticks button span { opacity: .62; transition: opacity .2s ease, color .2s ease; }
.network-week-ticks button:hover, .network-week-ticks button:focus-visible { color: var(--ink); outline: none; }
.network-week-ticks button:hover span, .network-week-ticks button:focus-visible span { opacity: 1; }
.network-week-ticks button.is-active { color: var(--gold); }
.network-week-ticks button.is-active i { background: var(--gold); transform: scale(2); box-shadow: 0 0 8px rgba(232,184,109,.65); }
.network-week-ticks button.is-active span { color: var(--ink); opacity: 1; font-weight: 600; }
.network-week-ticks button.is-opening span { letter-spacing: .02em; }
.network-legend { display: grid; gap: 5px; margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.35; }
.network-legend strong { margin-bottom: 2px; color: var(--ink); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.network-legend span { display: inline-flex; align-items: center; gap: 6px; }
.network-legend button { width: 100%; min-height: 27px; padding: 4px 6px; display: flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; font: inherit; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
.network-legend button:hover, .network-legend button:focus-visible { border-color: rgba(255,255,255,.11); background: rgba(255,255,255,.045); color: var(--ink); outline: none; }
.network-legend button[aria-pressed="true"] { border-color: rgba(232,184,109,.34); background: rgba(232,184,109,.09); color: var(--ink); }
.network-legend button:disabled { opacity: .34; cursor: default; }
.network-legend i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--legend-colour); box-shadow: 0 0 9px color-mix(in srgb, var(--legend-colour) 75%, transparent); }
.graph-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.graph-loading[hidden] { display: none; }
.graph-loading.is-error { padding: 32px; text-align: center; color: var(--coral); }

.detail-panel { width: min(360px, calc(100% - 36px)); max-height: calc(100% - 160px); position: absolute; z-index: 12; top: 142px; right: 18px; padding: 25px 22px 22px; overflow-y: auto; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(14,20,27,.9); box-shadow: 0 24px 70px rgba(0,0,0,.46); backdrop-filter: blur(18px); opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(18px) scale(.985); transform-origin: top right; transition: opacity .24s ease, transform .3s cubic-bezier(.22,.8,.24,1), visibility 0s linear .3s; }
.detail-panel.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0) scale(1); transition-delay: 0s; }
main.is-timeline-view .detail-panel { width: auto; height: auto; max-height: calc(100% - 104px); position: relative; top: auto; right: auto; grid-column: 2; grid-row: 1; align-self: start; margin: 86px 18px 18px 0; padding: 22px 20px 20px; border-width: 1px; border-radius: 16px; background: rgba(14,20,27,.92); box-shadow: 0 24px 70px rgba(0,0,0,.42); }
.detail-close { width: 30px; height: 30px; position: absolute; top: 12px; right: 12px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(255,255,255,.035); color: var(--muted); cursor: pointer; font: 400 20px/1 Arial, sans-serif; }
.detail-close:hover, .detail-close:focus-visible { border-color: rgba(255,255,255,.26); color: var(--ink); outline: none; }
.detail-panel h2 { margin: 7px 0 9px; font-size: 24px; line-height: 1.15; font-weight: 500; }
.detail-panel > p { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.detail-body { display: grid; gap: 16px; }
.detail-section { display: grid; gap: 7px; }
.detail-section h3 { margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.detail-section ul { margin: 0; padding-left: 16px; color: #c7d0d5; font-size: 12px; line-height: 1.55; }
.detail-section p { margin: 0; color: #c7d0d5; font-size: 12px; line-height: 1.55; }
.concentration-block { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
#concentration-list { display: grid; gap: 10px; margin-top: 12px; }
.concentration-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; font-size: 12px; }
.concentration-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.concentration-row b { color: var(--gold); font-size: 12px; font-weight: 600; }

.timeline-workspace { padding: 74px 22px 10px; overflow: hidden; display: grid; grid-template-rows: auto auto minmax(0, 1fr); align-content: stretch; background: radial-gradient(circle at 64% 42%, rgba(91,200,215,.055), transparent 30%), transparent; }
.timeline-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-bottom: 18px; }
.timeline-heading h1 { max-width: none; margin: 5px 0 0; font-size: 22px; line-height: 1.08; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; }
.timeline-heading-actions { display: grid; justify-items: end; align-self: end; }
.editor-button { min-height: 34px; padding: 8px 12px; border: 1px solid rgba(232,184,109,.5); border-radius: 8px; background: rgba(232,184,109,.13); color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 600; }
.plan-editor { margin-bottom: 25px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,11,16,.62); }
.plan-editor[hidden] { display: none; }
.plan-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.plan-editor-heading h2 { margin: 5px 0 0; font-size: 20px; font-weight: 500; }
.plan-editor-heading > span { color: var(--muted); font-size: 11px; }
.project-settings-form, .assignment-form { display: grid; gap: 9px; align-items: end; }
.project-settings-form { grid-template-columns: minmax(180px,1.4fr) repeat(4,minmax(135px,1fr)) auto; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.assignment-form { grid-template-columns: repeat(4,minmax(130px,1fr)); margin-top: 16px; }
.project-settings-form label, .assignment-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.project-settings-form input, .project-settings-form select, .assignment-form input, .assignment-form select { min-width: 0; width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.045); color: var(--ink); font-size: 12px; }
.assignment-actions { display: flex; align-items: center; gap: 7px; }
.assignment-actions .quiet-button { justify-self: auto; }
.assignment-list { display: grid; gap: 3px; max-height: 270px; margin-top: 16px; overflow: auto; }
.assignment-list-heading, .assignment-row { display: grid; align-items: center; gap: 12px; }
.assignment-list-heading { grid-template-columns: 1fr auto; padding: 7px 0; color: var(--muted); font-size: 11px; }
.assignment-row { grid-template-columns: minmax(210px,1fr) 65px 150px auto; padding: 7px 8px; border-top: 1px solid rgba(255,255,255,.06); color: var(--muted); font-size: 11px; }
.assignment-row > div:first-child { display: grid; gap: 2px; }
.assignment-row strong { color: var(--ink); font-weight: 500; }
.assignment-row button { border: 0; background: transparent; color: var(--gold); cursor: pointer; font-size: 11px; }
.timeline-chart { min-width: 760px; padding: 11px 16px 13px; display: grid; gap: 2px; position: relative; border: 1px solid rgba(255,255,255,.085); border-radius: 16px; background: radial-gradient(circle at 58% 44%, rgba(62,183,198,.055), transparent 34%), linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px), rgba(7,11,16,.68); background-size: auto, 28px 28px, 28px 28px, auto; box-shadow: inset 0 1px rgba(255,255,255,.035), 0 24px 70px rgba(0,0,0,.24); }
.timeline-axis, .timeline-row { display: grid; grid-template-columns: 190px repeat(7, minmax(72px, 1fr)); column-gap: 6px; }
.timeline-row { height: 45px; position: relative; }
.timeline-axis { margin-bottom: 7px; }
.timeline-axis span { padding: 7px 6px 9px; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.25; border-bottom: 1px solid rgba(255,255,255,.08); cursor: pointer; transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.timeline-axis span:first-child { padding-left: 0; text-align: left; cursor: default; }
.timeline-axis span.is-active { color: #f8d59c; border-color: var(--gold); background: linear-gradient(180deg, transparent, rgba(232,184,109,.1)); text-shadow: 0 0 13px rgba(232,184,109,.38); }
.timeline-role { min-height: 42px; padding-right: 12px; display: grid; grid-template-columns: 12px minmax(0,1fr); grid-template-rows: auto auto; align-content: center; column-gap: 8px; font-size: 11px; color: #cbd3d8; }
.timeline-role i { width: 7px; height: 7px; grid-row: 1 / 3; align-self: center; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #fff 0 8%, var(--role-colour) 32%, color-mix(in srgb, var(--role-colour) 66%, #071018) 100%); box-shadow: 0 0 10px color-mix(in srgb, var(--role-colour) 58%, transparent); }
.timeline-role small { color: var(--muted); font-size: 9px; }
.timeline-cell { min-height: 42px; display: grid; place-items: center; position: relative; border: 0; border-radius: 9px; background: transparent; cursor: pointer; isolation: isolate; }
.timeline-cell::after { content: ""; position: absolute; inset: 4px -3px; z-index: -2; border-radius: 8px; opacity: 0; background: linear-gradient(180deg, rgba(232,184,109,.09), rgba(232,184,109,.025)); transition: opacity .18s ease; }
.timeline-cell.is-stage-focus::after { opacity: 1; }
.timeline-cell.is-connected-next::before { content: ""; width: calc(100% + 9px); height: 1px; position: absolute; z-index: -1; left: 50%; top: 50%; background: linear-gradient(90deg, color-mix(in srgb, var(--role-colour) 72%, transparent), color-mix(in srgb, var(--role-colour) 28%, transparent)); box-shadow: 0 0 6px color-mix(in srgb, var(--role-colour) 26%, transparent); }
.timeline-orb { width: 35px; height: 35px; display: grid; place-content: center; gap: 0; position: relative; border: 1px solid color-mix(in srgb, var(--role-colour) 76%, white 12%); border-radius: 50%; background: radial-gradient(circle at 32% 25%, rgba(255,255,255,.92) 0 3%, color-mix(in srgb, var(--role-colour) 92%, white 8%) 12%, var(--role-colour) 43%, color-mix(in srgb, var(--role-colour) 48%, #071018) 100%); box-shadow: inset 0 0 7px rgba(255,255,255,.13), inset 0 -8px 11px rgba(0,0,0,.36), 0 0 0 4px color-mix(in srgb, var(--role-colour) 6%, transparent), 0 0 13px color-mix(in srgb, var(--role-colour) 32%, transparent); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.timeline-orb b { color: #fff; font-size: 13px; line-height: 1; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.timeline-orb small { margin-top: 2px; color: rgba(255,255,255,.78); font-size: 7px; line-height: 1; letter-spacing: .03em; text-transform: uppercase; }
.timeline-cell.is-active-role:hover, .timeline-cell.is-active-role:focus-visible { outline: none; }
.timeline-cell.is-active-role:hover .timeline-orb, .timeline-cell.is-active-role:focus-visible .timeline-orb { transform: translateY(-2px) scale(1.06); border-color: color-mix(in srgb, var(--role-colour) 55%, white 45%); box-shadow: inset 0 0 7px rgba(255,255,255,.18), inset 0 -8px 11px rgba(0,0,0,.3), 0 0 0 5px color-mix(in srgb, var(--role-colour) 10%, transparent), 0 0 22px color-mix(in srgb, var(--role-colour) 52%, transparent); }
.timeline-cell.is-empty { cursor: default; }
.timeline-cell.is-empty::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.1); }
.timeline-cell.is-selected .timeline-orb { border-color: #f8d59c; box-shadow: inset 0 0 8px rgba(255,255,255,.18), inset 0 -8px 11px rgba(0,0,0,.3), 0 0 0 5px rgba(232,184,109,.14), 0 0 25px rgba(232,184,109,.48); }
.timeline-lower { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-content: start; column-gap: 44px; row-gap: 22px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); overflow: hidden; }
.density-chart { display: grid; gap: 5px; margin-top: 8px; }
.density-row { width: 100%; display: grid; grid-template-columns: 70px minmax(0,1fr) 42px; gap: 9px; align-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 11px; color: var(--muted); }
.density-track { height: 5px; background: rgba(255,255,255,.055); border-radius: 99px; overflow: visible; }
.density-track i { display: block; height: 100%; position: relative; background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: inherit; box-shadow: 0 0 10px rgba(91,200,215,.2); }
.density-track i::after { content: ""; width: 8px; height: 8px; position: absolute; right: -3px; top: 50%; border: 1px solid rgba(248,213,156,.8); border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(232,184,109,.48); transform: translateY(-50%); }
.density-row b { color: var(--ink); font-weight: 500; text-align: right; }
.stage-summary { display: grid; gap: 7px; margin-top: 8px; }
.stage-summary h2 { margin: 0; font-size: 17px; font-weight: 500; }
.stage-summary p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.stage-summary p:last-child { max-width: 540px; }
.stage-summary strong { color: var(--gold); font-size: 12px; font-weight: 600; }

@media (max-width: 1050px) {
  main { grid-template-columns: 248px minmax(0, 1fr); }
  main.is-timeline-view { grid-template-columns: minmax(0, 1fr); }
  main.is-timeline-view.has-detail { grid-template-columns: minmax(0, 1fr) 300px; }
  .timeline-heading { grid-template-columns: 1fr; }
  .timeline-heading h1 { white-space: normal; }
  .project-settings-form, .assignment-form { grid-template-columns: repeat(2,minmax(140px,1fr)); }
}

@media (max-width: 760px) {
  .topbar { width: auto; height: auto; min-height: 68px; position: relative; inset: auto; grid-template-columns: 1fr auto; padding: 12px 15px; }
  .topbar .view-switch { grid-column: 1 / -1; order: 3; }
  .topbar-actions { grid-column: 2; }
  .view-button { flex: 1; }
  main { height: auto; min-height: calc(100vh - 112px); display: block; }
  .control-rail { height: auto; margin: 14px; border: 1px solid var(--line); }
  .network-context { top: 18px; }
  .stage-controls { grid-template-columns: repeat(8, 1fr); }
  .stage-button:first-child { grid-column: span 1; }
  .workspace { min-height: 620px; margin-right: 0; }
  .network-opening { width: calc(100% - 34px); padding: 22px 20px; }
  .network-overview { display: none !important; }
  .network-navigation-hint { top: 88px; right: 14px; left: 14px; justify-content: center; gap: 10px; }
  .timeline-workspace { padding-top: 30px; overflow: auto; }
  .timeline-heading, .timeline-lower { min-width: 760px; }
  .navigation-hint-title { display: none; }
  .detail-panel { width: auto; max-height: min(62vh, 520px); position: fixed; left: 14px; right: 14px; top: auto; bottom: 14px; border-radius: 16px; transform: translateY(18px) scale(.985); transform-origin: bottom center; }
  main.is-timeline-view.has-detail .detail-panel { width: auto; max-height: min(62vh, 520px); position: fixed; left: 14px; right: 14px; top: auto; bottom: 14px; margin: 0; transform: translateY(18px) scale(.985); }
  .detail-panel.is-open { transform: translateY(0) scale(1); }
  .timeline-lower { grid-template-columns: 1fr; }
}
