/* Concept preview: the window on the page, and the full-screen workspace behind it. */
.portal { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; width: 100%; min-height: clamp(380px, 60svh, 540px); padding: 36px 20px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: radial-gradient(70% 80% at 50% 50%, #16222f, #0a0f15 75%); transition: border-color .3s, box-shadow .3s; }
.portal:hover { border-color: #4c90f0; box-shadow: 0 0 60px rgba(76, 144, 240, .35); }
.portal canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
.portal.locked canvas { opacity: .32; filter: blur(1.5px); }
.portal > :not(canvas) { position: relative; }
.portal-tag { padding: 6px 14px; border: 1px solid rgba(209, 152, 11, .7); background: rgba(10, 15, 21, .85); color: #fbd065; font: 500 11px/1.5 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.portal-lock { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.portal-lock svg { width: 46px; height: 46px; color: var(--accent); filter: drop-shadow(0 0 12px var(--accent)); animation: portal-key 3s ease-in-out infinite; }
@keyframes portal-key { 50% { filter: drop-shadow(0 0 26px var(--accent)); } }
.portal-lock p { font: 400 12px/1.6 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.portal-lock p b { display: block; margin-top: 4px; color: var(--fg); font: 600 clamp(22px, 3.4vw, 40px)/1.25 var(--sans); font-stretch: 125%; letter-spacing: .04em; }
.portal-lock .portal-count { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; min-height: 1.6em; }
.portal-go { padding: 18px 44px; background: var(--fg); color: var(--bg); font: 600 14px/1.5 var(--sans); font-stretch: 122%; letter-spacing: .2em; text-transform: uppercase; box-shadow: 0 0 40px rgba(138, 187, 255, .55); animation: portal-pulse 2.6s ease-in-out infinite; }
.portal-go:hover { background: #4c90f0; color: #fff; }
@keyframes portal-pulse { 50% { box-shadow: 0 0 70px rgba(138, 187, 255, .9); } }
.portal-code { display: flex; width: min(420px, 100%); border: 1px solid rgba(238, 241, 244, .45); background: rgba(5, 8, 12, .92); }
.portal-code:focus-within { border-color: var(--accent); box-shadow: 0 0 36px rgba(127, 180, 255, .5); }
.portal-code input { flex: 1; min-width: 0; padding: 14px 16px; background: transparent; border: 0; outline: none; color: var(--fg); font: 400 14px var(--mono); letter-spacing: .14em; }
.portal-code button { padding: 0 24px; background: var(--fg); color: var(--bg); font: 500 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.portal-code button:hover { background: #4c90f0; color: #fff; }
.portal.busy .portal-code, .portal.busy .portal-go { opacity: .55; pointer-events: none; }
.portal-note { min-height: 1.5em; color: #ff9ea2; font: 400 12px/1.5 var(--mono); }
.portal.busy .portal-note { color: var(--muted); }
.portal.refused .portal-code { border-color: #ef6f74; animation: portal-shake .45s; }
@keyframes portal-shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

/* ---------- workspace frame ---------- */
.ws { --base: #111418; --panel: #1c2127; --raise: #252a31; --edge: #2f343c; --text: #f6f7f9; --dim: #8f99a8; --blue: #4c90f0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--base); color: var(--text); font: 400 13px/1.5 var(--sans); overflow: hidden; }
.ws[open] { display: grid; grid-template-columns: 76px minmax(0, 1fr) 0; grid-template-rows: 52px minmax(0, 1fr); grid-template-areas: "top top top" "rail main side"; transition: grid-template-columns .35s cubic-bezier(.2, .8, .2, 1); animation: ws-in .45s cubic-bezier(.2, .8, .2, 1); }
.ws[open].inspecting { grid-template-columns: 76px minmax(0, 1fr) 340px; }
@keyframes ws-in { from { opacity: 0; transform: scale(1.06); filter: blur(10px); } }
.ws::backdrop { background: #05070a; }
.ws button { border-radius: 3px; }
.ws svg { flex: none; }
.ws h3, .ws h4 { margin: 0; color: var(--dim); font: 600 11px/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.ws em { font-style: normal; }

.ws-top { grid-area: top; display: flex; align-items: center; gap: 14px; padding-inline: 18px 12px; background: var(--panel); border-bottom: 1px solid var(--edge); min-width: 0; position: relative; z-index: 4; }
.ws-top > svg { width: 22px; height: 22px; color: var(--blue); }
.ws-top strong { font-size: 15px; font-weight: 600; white-space: nowrap; }
#ws-crumb { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 14px; border-left: 1px solid var(--edge); min-width: 0; }
.ws-find { position: relative; margin-left: auto; width: min(340px, 28vw); }
.ws input { width: 100%; height: 32px; padding: 0 12px; background: var(--base); border: 1px solid var(--edge); border-radius: 3px; color: var(--text); font: inherit; }
.ws input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
#ws-results { position: absolute; top: 38px; left: 0; right: 0; z-index: 9; display: flex; flex-direction: column; padding: 6px; background: var(--raise); border: 1px solid #404854; box-shadow: 0 18px 40px rgba(0, 0, 0, .6); }
#ws-results button { display: flex; align-items: center; gap: 10px; padding: 7px 8px; text-align: left; }
#ws-results button:hover { background: #343a43; }
#ws-results span { flex: 1; }
#ws-results small, #ws-results p { color: var(--dim); }
.ws svg[viewBox="0 0 24 24"] { width: 17px; height: 17px; }
.ws-badge { padding: 3px 10px; border: 1px solid rgba(209, 152, 11, .7); border-radius: 3px; color: #fbd065; font: 500 10px/1.7 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
#ws-clock { font: 400 12px var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
#ws-exit { padding: 6px 14px; background: #cd4246; font-weight: 600; white-space: nowrap; }
#ws-exit:hover { background: #ac2f33; }

.ws-rail { grid-area: rail; display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; background: var(--panel); border-right: 1px solid var(--edge); }
.ws-rail button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 0 9px; color: var(--dim); font-size: 10.5px; font-weight: 500; }
.ws-rail svg { width: 21px; height: 21px; }
.ws-rail button:hover { background: var(--raise); color: var(--text); }
.ws-rail button[aria-selected="true"] { background: rgba(76, 144, 240, .2); color: #8abbff; box-shadow: inset 3px 0 0 var(--blue); }

.ws-main { grid-area: main; position: relative; min-width: 0; min-height: 0; background: var(--base); }
.ws-view { position: absolute; inset: 0; overflow: auto; scrollbar-width: thin; }
.ws-toast { position: absolute; left: 50%; bottom: 20px; translate: -50% 0; z-index: 6; padding: 10px 20px; background: #238551; font-weight: 600; white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: ws-up .35s cubic-bezier(.2, .8, .2, 1); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.pill.good { background: rgba(63, 191, 127, .18); color: #72d3a1; }
.pill.bad { background: rgba(239, 111, 116, .2); color: #ff9ea2; }
.pill.warn { background: rgba(224, 169, 58, .2); color: #f5c466; }
.pill.off { background: rgba(143, 153, 168, .18); color: var(--dim); }

/* ---------- command: the globe with panels floating above it ---------- */
#ws-command { overflow: hidden; background: radial-gradient(70% 70% at 50% 50%, #12223a, #070b12 75%); }
#cmd-globe { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#cmd-globe:active { cursor: grabbing; }
#ws-command > :not(canvas) { position: absolute; }
.cmd-alerts, .cmd-case, .cmd-answer { background: rgba(17, 24, 35, .86); border: 1px solid rgba(138, 187, 255, .22); border-radius: 6px; backdrop-filter: blur(10px); }
.cmd-figures { top: 14px; left: 14px; right: 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cmd-figures div { padding: 9px 14px; background: rgba(17, 24, 35, .84); border: 1px solid rgba(138, 187, 255, .2); border-top: 2px solid #3fbf7f; border-radius: 4px; min-width: 0; }
.cmd-figures div.bad { border-top-color: #ef6f74; }
.cmd-figures div.warn { border-top-color: #e0a93a; }
.cmd-figures span { display: block; color: var(--dim); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-figures b { font: 600 26px/1.35 var(--sans); font-variant-numeric: tabular-nums; }
.cmd-figures div.changed { animation: cmd-changed 1.5s ease-out; }
@keyframes cmd-changed { 0%, 30% { background: rgba(76, 144, 240, .75); box-shadow: 0 0 30px rgba(76, 144, 240, .9); } }
.cmd-alerts { top: 98px; left: 14px; bottom: 132px; width: 270px; display: flex; flex-direction: column; overflow: hidden; }
.cmd-alerts h4 { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid rgba(138, 187, 255, .18); }
.cmd-alerts h4 em { color: #ff9ea2; }
#cmd-queue { overflow-y: auto; scrollbar-width: thin; }
#cmd-queue button { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 11px 14px; text-align: left; border-radius: 0; border-bottom: 1px solid rgba(138, 187, 255, .1); }
#cmd-queue button:hover { background: rgba(76, 144, 240, .14); }
#cmd-queue button.on { background: rgba(76, 144, 240, .26); box-shadow: inset 3px 0 0 #fff; }
#cmd-queue i { width: 9px; height: 9px; margin-top: 5px; flex: none; border-radius: 50%; background: #e0a93a; }
#cmd-queue .high i { background: #ef6f74; animation: ws-alarm 1.6s ease-out infinite; }
#cmd-queue .done { opacity: .55; }
#cmd-queue .done i { background: #3fbf7f; }
#cmd-queue span { display: flex; flex-direction: column; min-width: 0; }
#cmd-queue small { color: var(--dim); }
.cmd-case, .cmd-answer { top: 98px; right: 14px; width: 320px; max-height: calc(100% - 230px); overflow-y: auto; scrollbar-width: thin; animation: cmd-in .45s cubic-bezier(.2, .8, .2, 1); }
.cmd-case:empty { display: none; }
@keyframes cmd-in { from { opacity: 0; transform: translateX(40px); } }
.cmd-case header, .cmd-answer header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(138, 187, 255, .18); }
.cmd-case header span { display: flex; flex-direction: column; }
.cmd-case header small { color: #ff9ea2; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.cmd-case header strong { font-size: 17px; line-height: 1.3; }
.cmd-answer header span { font-weight: 600; }
.ws [data-leave] { flex: none; width: 26px; height: 26px; font-size: 19px; line-height: 1; color: var(--dim); }
.ws [data-leave]:hover { background: var(--raise); color: var(--text); }
.cmd-case > p, .cmd-case h4 { padding: 10px 14px 0; }
.cmd-case .brief { color: #c5cbd3; }
.cmd-case .solved { margin: 12px 14px 16px; padding: 12px; border-left: 3px solid #3fbf7f; background: rgba(63, 191, 127, .14); }
.impact, .marks { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; }
.impact button, .marks button { display: flex; align-items: center; gap: 7px; padding: 4px 10px; background: var(--raise); border: 1px solid #3a414c; font-size: 12px; }
.impact button:hover, .marks button:hover { border-color: var(--blue); }
.remedy { margin: 8px 14px 0; padding: 12px; background: rgba(76, 144, 240, .1); border: 1px solid rgba(76, 144, 240, .45); border-radius: 4px; }
.remedy p { color: #c5cbd3; font-size: 12px; margin-top: 2px; }
.remedy ul { list-style: none; margin-block: 10px; }
.remedy ul li { display: flex; align-items: baseline; gap: 10px; padding-block: 2px; }
.remedy ul span { flex: 1; color: var(--dim); }
.remedy s { color: #ff9ea2; }
.remedy em { min-width: 24px; text-align: right; color: #72d3a1; font-weight: 700; font-size: 15px; }
.ws .apply { width: 100%; padding: 9px; background: var(--blue); font-weight: 600; }
.ws .apply:hover { background: #3b7ddb; }
.ws .apply:disabled { cursor: progress; background: #36495f; }
.remedy ol { list-style: none; margin-top: 10px; }
.remedy ol li { display: flex; align-items: center; gap: 9px; padding-block: 3px; color: var(--dim); }
.remedy ol li::before { content: ""; width: 11px; height: 11px; flex: none; border: 2px solid #4b5563; border-radius: 50%; }
.remedy ol li.now { color: var(--text); }
.remedy ol li.now::before { border-color: var(--blue); border-top-color: transparent; animation: spotlight .7s linear infinite; }
.remedy ol li.ok { color: #c5cbd3; }
.remedy ol li.ok::before { border-color: #3fbf7f; background: #3fbf7f; }
.ws .ghost { margin: 10px 14px 14px; padding: 7px 12px; border: 1px solid #3a414c; }
.ws .ghost:hover { background: var(--raise); }
.cmd-answer p { min-height: 4.5em; padding: 12px 14px 0; }
.cmd-answer .apply { width: calc(100% - 28px); margin: 12px 14px 0; }
.cmd-answer small { display: block; padding: 12px 14px; color: var(--dim); font-size: 11px; }
.cmd-ask { left: 50%; bottom: 44px; translate: -50% 0; width: min(660px, calc(100% - 28px)); display: flex; flex-direction: column; gap: 8px; }
#cmd-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
#cmd-chips button { padding: 4px 11px; background: rgba(17, 24, 35, .9); border: 1px solid rgba(138, 187, 255, .28); border-radius: 20px; font-size: 12px; color: #c9dcf7; }
#cmd-chips button:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
#cmd-form { display: flex; gap: 0; border: 1px solid rgba(138, 187, 255, .45); border-radius: 6px; background: rgba(10, 16, 26, .94); box-shadow: 0 0 30px rgba(76, 144, 240, .25); overflow: hidden; }
.ws #cmd-input { flex: 1; height: 40px; border: 0; background: transparent; outline: none; }
#cmd-form:focus-within { border-color: var(--blue); box-shadow: 0 0 40px rgba(76, 144, 240, .55); }
#cmd-form button { padding: 0 22px; background: var(--blue); font-weight: 600; border-radius: 0; }
.cmd-ticker { left: 0; right: 0; bottom: 0; display: flex; gap: 4px; height: 32px; padding: 3px 10px; overflow: hidden; background: rgba(10, 15, 24, .92); border-top: 1px solid rgba(138, 187, 255, .18); white-space: nowrap; }
.cmd-ticker button { display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 12px; animation: cmd-in .5s ease-out; }
.cmd-ticker button:hover { background: var(--raise); }
.cmd-ticker span { color: var(--dim); }
#ws-command.animate .cmd-figures div { animation: ws-up .5s cubic-bezier(.2, .8, .2, 1) backwards; }
#ws-command.animate .cmd-figures div:nth-child(2) { animation-delay: .08s; }
#ws-command.animate .cmd-figures div:nth-child(3) { animation-delay: .16s; }
#ws-command.animate .cmd-figures div:nth-child(4) { animation-delay: .24s; }
#ws-command.animate .cmd-figures div:nth-child(5) { animation-delay: .32s; }
#ws-command.animate .cmd-alerts { animation: ws-up .5s cubic-bezier(.2, .8, .2, 1) .35s backwards; }
#ws-command.animate #cmd-queue button { animation: ws-node .45s ease-out calc(.5s + var(--d)) backwards; }
#ws-command.animate .cmd-ask { animation: ws-up .55s cubic-bezier(.2, .8, .2, 1) .6s backwards; }

/* panels drop below the globe where they cannot float beside it */
@media (max-width: 1080px) {
  #ws-command { display: flex; flex-direction: column; overflow-y: auto; }
  #ws-command[hidden] { display: none; }
  #ws-command > :not(canvas) { position: static; translate: none; width: auto; max-height: none; flex: none; }
  #cmd-globe { position: static; flex: none; height: min(52dvh, 520px); order: 2; }
  .cmd-figures { order: 1; padding: 10px 10px 0; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
  .cmd-figures span { white-space: normal; font-size: 9.5px; letter-spacing: .06em; min-height: 2.8em; }
  .cmd-ask { order: 3; margin: 0 10px 10px; }
  #ws-command > .cmd-case, #ws-command > .cmd-answer { order: 4; margin: 0 10px 10px; }
  #ws-command > .cmd-case:empty, #ws-command > .cmd-answer[hidden] { display: none; }
  .cmd-alerts { order: 5; margin: 0 10px 10px; }
  .cmd-ticker { order: 6; display: none; }
}

/* ---------- overview ---------- */
#ws-overview { container-type: inline-size; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px; max-width: 1500px; margin-inline: auto; }
.card { display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; overflow: hidden; }
.card.wide { grid-column: span 3; }
.card.full { grid-column: 1 / -1; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--edge); }
.kpi { padding: 14px 16px 0; text-align: left; transition: border-color .2s, transform .2s; }
.kpi:hover { border-color: var(--blue); transform: translateY(-2px); }
.kpi p { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.kpi b { font: 600 38px/1.15 var(--sans); font-variant-numeric: tabular-nums; }
.kpi i { font-style: normal; font-size: 18px; color: var(--dim); }
.kpi small { color: var(--dim); }
.kpi svg { width: calc(100% + 32px); height: 42px; margin: 8px -16px 0; }
.ws .area { opacity: .14; stroke: none; }
.ws .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.key { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; flex-wrap: wrap; justify-content: flex-end; }
.key i { width: 14px; height: 3px; background: var(--c); margin-left: 8px; }
.chart { width: 100%; height: 190px; padding-top: 10px; }
.chart line { stroke: #2a3038; vector-effect: non-scaling-stroke; }
.card > footer { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 16px 10px; color: var(--dim); font: 400 11px var(--mono); letter-spacing: 0; text-transform: none; }
.donut { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 12px; padding: 14px 16px; }
.donut svg { width: min(150px, 70%); height: auto; }
.donut circle { fill: none; stroke-width: 5; }
.donut text { fill: var(--text); font: 600 9px var(--sans); text-anchor: middle; }
.donut text.sub { fill: var(--dim); font-size: 3.4px; font-weight: 400; }
.donut ul { list-style: none; width: 100%; }
.donut li { display: flex; align-items: center; gap: 9px; padding-block: 3px; }
.donut li i { width: 9px; height: 9px; background: var(--c); }
.donut li b { margin-left: auto; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 9px 16px; border-bottom: 1px solid #272c33; text-align: left; cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--raise); }
.row .pill { min-width: 62px; text-align: center; }
.grow { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row small { color: var(--dim); }
.row [data-resolve] { padding: 4px 12px; border: 1px solid #404854; background: var(--raise); }
.row [data-resolve]:hover { background: var(--blue); border-color: var(--blue); }
.empty { padding: 20px 16px; color: var(--dim); }
.bars { display: flex; flex-direction: column; justify-content: space-around; flex: 1; padding: 8px 10px; }
.bars button { display: grid; grid-template-columns: 74px minmax(0, 1fr) 38px; align-items: center; gap: 10px; padding: 4px 6px; text-align: left; }
.bars button:hover { background: var(--raise); }
.bars i, .ships i { display: block; height: 6px; background: #343a43; border-radius: 3px; overflow: hidden; }
.bars i b, .ships i b { display: block; height: 100%; background: var(--blue); }
.bars i b.hot, .ships i b.hot { background: #ef6f74; }
.bars em { text-align: right; font: 400 11px var(--mono); color: var(--dim); }
.ships .row { display: grid; grid-template-columns: 120px minmax(150px, 1fr) minmax(80px, 1.4fr) 60px 90px; border-radius: 0; }
.ships .from { color: var(--dim); }
.ships i b { background: #3fbf7f; }
.ships em { font: 400 11px var(--mono); color: var(--dim); }

/* ---------- network ---------- */
.graph { position: relative; background-image: radial-gradient(rgba(143, 166, 199, .14) 1px, transparent 1px); background-size: 24px 24px; }
.graph .wires { position: absolute; inset: 0; }
.graph .wires path { fill: none; stroke: rgba(143, 166, 199, .24); stroke-width: 1.2; transition: stroke .2s, opacity .2s; }
.graph h4 { position: absolute; top: 18px; display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid #404854; }
.node { position: absolute; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; background: var(--panel); border: 1px solid var(--edge); border-left: 3px solid var(--c); text-align: left; transition: opacity .2s, border-color .2s, box-shadow .2s, background .2s; }
.node span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.node u { width: 17px; height: 17px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #ef6f74; color: #1c0d0e; font: 700 11px/1 var(--sans); text-decoration: none; animation: ws-alarm 1.6s ease-out infinite; }
@keyframes ws-alarm { from { box-shadow: 0 0 0 0 rgba(239, 111, 116, .7); } to { box-shadow: 0 0 0 9px rgba(239, 111, 116, 0); } }
.node:hover { background: var(--raise); }
.focused .node { opacity: .4; }
.focused .node.lit { opacity: 1; border-color: var(--c); }
.focused .wires path { opacity: .4; }
.focused .wires path.lit { opacity: 1; stroke: #8abbff; stroke-width: 2; stroke-dasharray: 3 2.2; animation: ws-flow .9s linear infinite; }
.node.on { background: rgba(76, 144, 240, .28); box-shadow: 0 0 0 2px #fff, 0 0 22px rgba(138, 187, 255, .6); }
@keyframes ws-flow { to { stroke-dashoffset: -10.4; } }

/* ---------- map ---------- */
#ws-map { overflow: hidden; background: #10161d; }
#ws-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ws-float { position: absolute; left: 14px; top: 14px; right: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; pointer-events: none; }
.ws-float button { pointer-events: auto; padding: 6px 14px; background: var(--raise); border: 1px solid #404854; }
.ws-float button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); font-weight: 600; }
.ws-float .key { margin-left: auto; padding: 6px 12px; background: rgba(28, 33, 39, .92); }

/* ---------- objects ---------- */
#ws-table { display: flex; flex-direction: column; overflow: hidden; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 18px; }
.ws .filters button { display: flex; gap: 8px; padding: 5px 12px; background: var(--panel); border: 1px solid var(--edge); }
.ws .filters button[aria-pressed="true"] { background: rgba(76, 144, 240, .22); border-color: var(--blue); }
.filters em { color: var(--dim); }
.sheet { flex: 1; min-height: 0; overflow: auto; margin: 0 18px 18px; background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
.sheet table { width: 100%; border-collapse: collapse; min-width: 460px; }
.sheet th { position: sticky; top: 0; z-index: 1; padding: 0; background: var(--raise); text-align: left; }
.sheet th button { width: 100%; padding: 10px 14px; text-align: left; color: var(--dim); font-weight: 600; }
.sheet th button:hover { color: var(--text); }
.sheet td { padding: 8px 14px; border-bottom: 1px solid #272c33; }
.sheet tbody tr { cursor: pointer; }
.sheet tbody tr:hover { background: var(--raise); }
.sheet tr.on { background: rgba(76, 144, 240, .24); }
.who { display: flex; align-items: center; gap: 10px; }

/* ---------- details ---------- */
.ws-side { grid-area: side; min-width: 0; min-height: 0; overflow: hidden auto; background: var(--panel); border-left: 1px solid var(--edge); scrollbar-width: thin; visibility: hidden; }
.inspecting .ws-side { visibility: visible; }
.ws-side header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--edge); border-top: 3px solid var(--c); }
.ws-side header > svg { width: 28px !important; height: 28px !important; }
.ws-side header span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ws-side header small { color: var(--c); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.ws-side header strong { font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.ws-side [data-close] { width: 30px; height: 30px; font-size: 20px; color: var(--dim); }
.ws-side [data-close]:hover { background: var(--raise); color: var(--text); }
.tags, .tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 0; }
.tools button { padding: 6px 12px; background: var(--raise); border: 1px solid #404854; }
.tools button:hover { background: #343a43; }
.tools button.primary { background: var(--blue); border-color: var(--blue); font-weight: 600; }
.ws-side h3 { display: flex; justify-content: space-between; margin-top: 20px; padding: 0 16px 6px; }
.ws-side dl { padding-inline: 16px; }
.ws-side dl div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid #272c33; }
.ws-side dt { color: var(--dim); font: inherit; letter-spacing: 0; text-transform: none; flex: none; }
.ws-side dd { text-align: right; min-width: 0; }
.linked { display: flex; flex-direction: column; padding-inline: 8px; }
.linked button { display: flex; align-items: center; gap: 10px; padding: 7px 8px; text-align: left; }
.linked button:hover { background: var(--raise); }
.linked span:not(.pill) { flex: 1; min-width: 0; }
.trend { width: calc(100% - 32px); height: 48px; margin-inline: 16px; }
.trend path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ws-side ul { list-style: none; padding: 8px 16px 24px; }
.ws-side li { display: flex; gap: 12px; padding-block: 3px; }
.ws time { color: var(--dim); font: 400 11px/1.8 var(--mono); flex: none; }

/* ---------- movement ---------- */
.ws:not(.ready) > :is(.ws-top, .ws-rail, .ws-main) { opacity: 0; }
.ws.ready > .ws-top { animation: ws-down .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.ws.ready > .ws-rail { animation: ws-right .5s cubic-bezier(.2, .8, .2, 1) .1s backwards; }
.ws.ready > .ws-main { animation: ws-fade .6s ease .18s backwards; }
@keyframes ws-down { from { opacity: 0; transform: translateY(-100%); } }
@keyframes ws-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes ws-right { from { opacity: 0; transform: translateX(-100%); } }
@keyframes ws-fade { from { opacity: 0; } }
.animate .card { animation: ws-up .55s cubic-bezier(.2, .8, .2, 1) backwards; }
.animate .card:nth-child(2) { animation-delay: .06s; }
.animate .card:nth-child(3) { animation-delay: .12s; }
.animate .card:nth-child(4) { animation-delay: .18s; }
.animate .card:nth-child(n+5) { animation-delay: .26s; }
.animate .card:nth-child(n+7) { animation-delay: .36s; }
.animate .line, .ws-side .trend path { stroke-dasharray: 1; animation: ws-draw 1.3s ease-out .3s backwards; }
@keyframes ws-draw { from { stroke-dashoffset: 1; } }
.animate .bars i b, .animate .ships i b { transform-origin: left; animation: ws-grow .8s cubic-bezier(.2, .8, .2, 1) calc(.35s + var(--d)) backwards; }
@keyframes ws-grow { from { transform: scaleX(0); } }
.animate .node { animation: ws-node .45s cubic-bezier(.2, .8, .2, 1) var(--d) backwards; }
@keyframes ws-node { from { opacity: 0; transform: translateX(-18px); } }
.animate .wires path { stroke-dasharray: 100; animation: ws-line .8s ease-out calc(.35s + var(--d)) backwards; }
@keyframes ws-line { from { stroke-dashoffset: 100; } }
.animate tbody tr { animation: ws-node .35s ease-out var(--d) backwards; }

.ws-boot { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(60% 60% at 50% 45%, #1a2938, #0b0e12 75%); cursor: pointer; transition: opacity .55s, transform .55s; }
.ws-boot.done { opacity: 0; transform: scale(1.12); pointer-events: none; }
.ws-boot > svg { width: 72px; height: 72px; color: var(--blue); filter: drop-shadow(0 0 18px var(--blue)); }
.ws-boot svg .spin { transform-origin: 16px 16px; animation: spotlight 1.8s linear infinite; }
.ws-boot strong { font: 600 22px/1.3 var(--sans); font-stretch: 125%; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.ws-boot .track { width: min(360px, 78vw); height: 2px; background: #2f343c; }
.ws-boot .track i { display: block; height: 100%; background: var(--blue); box-shadow: 0 0 14px var(--blue); transform-origin: left; transition: transform .3s; }
#ws-boot-log { height: 96px; text-align: center; color: var(--dim); font: 400 11px/2.1 var(--mono); }

/* ---------- narrower workspaces ---------- */
@container (max-width: 900px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.wide, .board > .card:not(.kpi) { grid-column: 1 / -1; }
  .ships .row { grid-template-columns: 1fr auto; gap: 6px 14px; }
  .ships .row i { grid-column: 1 / -1; order: 5; }
}
@media (max-width: 1150px) {
  .ws-badge { font-size: 9px; }
  #ws-clock { display: none; }
  /* the details lie over the view instead of squeezing it */
  .ws[open].inspecting { grid-template-columns: 76px minmax(0, 1fr) 0; }
  .ws-side { position: fixed; top: 52px; right: 0; bottom: 0; z-index: 7; width: min(340px, 100vw); transform: translateX(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1), visibility .35s; box-shadow: -20px 0 50px rgba(0, 0, 0, .55); }
  .inspecting .ws-side { transform: none; }
}
@media (max-width: 760px) {
  .ws[open], .ws[open].inspecting { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) 62px; grid-template-areas: "top" "main" "rail"; }
  .ws-top { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
  .ws-top strong { margin-right: auto; }
  #ws-crumb { display: none; }
  .ws-find { order: 3; width: 100%; margin: 0; }
  .ws-badge { order: 4; width: 100%; text-align: center; }
  .ws-rail { flex-direction: row; padding: 0; border: 0; border-top: 1px solid var(--edge); }
  .ws-rail button { flex: 1; min-width: 0; justify-content: center; padding: 0; }
  .ws-rail button[aria-selected="true"] { box-shadow: inset 0 3px 0 var(--blue); }
  .ws-side { top: auto; left: 0; bottom: 62px; width: 100%; max-height: 64dvh; transform: translateY(110%); border-top: 1px solid #404854; }
  .ws-float .key { display: none; }
  .board { padding: 12px; gap: 10px; }
  .kpi b { font-size: 30px; }
  .sheet table { min-width: 0; }
  .sheet :is(th, td):nth-child(2) { display: none; }
  .sheet td, .sheet th button { padding-inline: 10px; }
}
