/* Dogstar Mission Control. One dark look on purpose: it is a night sky.
   Rebuilt from the mock-up (claude.ai/artifact/52rt5jrmArffF95Eky4ssi).
   Looks: ok (bright, filled), drift (hollow ring), lost (filled with a red
   ring: off target / overdue), off (dashed and faint: not connected or not
   measured - never shown with a number). */
:root {
  color-scheme: dark;
  --bg: #060a14;
  --panel: #0d1424;
  --panel-2: #131c31;
  --line: #22304d;
  --fg: #e7edf9;
  --muted: #8e9bb8;
  --sirius: #bfdcff;
  --ok: #6ee7a8;
  --warn: #f6c75e;
  --lost: #f2777a;
  --off: #6b7899;
  --todo: #33415f;
  --active: #8fbcff;
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.5; }
.wrap {
  max-width: 1520px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--sirius); }
code { font-family: var(--mono); font-size: .85em; }
.mono { font-family: var(--mono); font-size: 0.8rem; }
.label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb2 { margin-bottom: 2px; }

header { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; justify-content: space-between; }
header .lede { color: var(--muted); max-width: 62ch; margin-top: 6px; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.who { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: .78rem; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.readout { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.8rem; color: var(--fg); }
.chip b { font-weight: 500; font-size: 1rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.drift { background: transparent; border: 2px solid var(--warn); }
.dot.lost { background: var(--lost); box-shadow: 0 0 0 2px #060a14, 0 0 0 3px var(--lost); }
.dot.off { background: transparent; border: 2px dashed var(--off); }

.notice { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; color: var(--muted); font-size: 0.88rem; }
.notice strong { color: var(--fg); font-weight: 600; }
.notice:empty { display: none; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.map-scroll { overflow-x: auto; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(ellipse at 50% 48%, #0f1a33 0%, #080d1b 55%, #050811 100%); }
.map { position: relative; min-width: 900px; aspect-ratio: 1280 / 940; }
.map canvas, .map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* map marks */
.node { cursor: pointer; transition: opacity .18s; outline: none; }
.node:focus-visible .hit { stroke: var(--sirius); stroke-width: 2; stroke-dasharray: 3 3; }
.hit { fill: transparent; stroke: transparent; }
.thread { fill: none; stroke-width: 1; opacity: .26; transition: opacity .18s, stroke-width .18s; }
.spoke { stroke: var(--line); stroke-width: 1; opacity: .7; }
.orbit { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; opacity: .8; }
.maptext { font-family: var(--body); font-size: 12px; fill: var(--fg); paint-order: stroke; stroke: #070c18; stroke-width: 4px; stroke-linejoin: round; }
.maptext.small { font-size: 11px; fill: var(--muted); }
.maptext.offtext { fill: var(--muted); }
.maptext.system { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.maptext.core { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .14em; fill: var(--sirius); }
.maptext.empty { font-size: 13px; fill: var(--muted); }
.initials { font-family: var(--mono); font-size: 9.5px; fill: var(--fg); }
svg.focus .node:not(.hot) { opacity: .2; }
svg.focus .thread:not(.hot) { opacity: .04; }
svg.focus .thread.hot { opacity: .95; stroke-width: 1.6; }
.node.sel .selring { opacity: 1; }
.selring { fill: none; stroke: var(--fg); stroke-width: 1.2; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 5s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
  @keyframes pulse { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.12); } }
}

/* detail panel */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); min-width: 0; }
.panel .eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel .head { display: flex; flex-direction: column; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-family: var(--mono); font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; border: 1px solid; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.pill.drift { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill.lost { color: var(--lost); border-color: color-mix(in srgb, var(--lost) 55%, transparent); }
.pill.off { color: var(--muted); border-color: var(--off); border-style: dashed; }
.sens { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 4px; padding: 1px 6px; }
.read { border-left: 2px solid var(--sirius); padding-left: 12px; }
.read p + p { margin-top: 8px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts .v { font-family: var(--mono); font-size: 0.92rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--todo); gap: 2px; }
.bar span { display: block; height: 100%; }
.seg-ok { background: var(--ok); } .seg-drift { background: var(--warn); } .seg-lost { background: var(--lost); } .seg-off { background: var(--off); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.timeline { position: relative; height: 8px; border-radius: 4px; background: var(--todo); margin: 6px 0 4px; }
.timeline .el { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: color-mix(in srgb, var(--active) 45%, transparent); }
.timeline .now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--fg); }
.timeline-l { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.progress { height: 8px; border-radius: 4px; background: var(--todo); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; }
.list li:first-child { border-top: 0; }
.list a { text-decoration: none; color: var(--fg); min-width: 0; overflow-wrap: anywhere; }
.list a:hover { text-decoration: underline; }
.list .st { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.list .act { display: flex; flex-direction: column; min-width: 0; }
.crew { display: flex; flex-wrap: wrap; gap: 6px; }
button.tag { font: inherit; font-size: 0.85rem; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; cursor: pointer; text-align: left; }
button.tag:hover, button.tag:focus-visible { border-color: var(--sirius); outline: none; }
button.link { all: unset; cursor: pointer; color: var(--sirius); font-family: var(--mono); font-size: .78rem; }
button.link:hover, button.link:focus-visible { text-decoration: underline; }

/* lower sections */
.lower { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
section.block { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.signals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.signals li { border-top: 1px solid var(--line); }
.signals li.none { padding: 12px 4px; color: var(--muted); }
.signals button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 12px 4px; width: 100%; align-items: start; }
.signals button:hover .t, .signals button:focus-visible .t { text-decoration: underline; }
.signals .dot { margin-top: 6px; }
.signals .t { font-weight: 600; }
.signals .d { color: var(--muted); font-size: 0.9rem; }
.table-scroll { overflow-x: auto; min-width: 0; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.9rem; }
th { text-align: left; font-family: var(--mono); font-size: 0.7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 400; padding: 6px 10px 6px 0; }
td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); vertical-align: middle; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.grp td { border-top: 0; padding-top: 18px; font-family: var(--display); font-weight: 600; }
tr.grp .dot { margin-right: 8px; }
tr.row { cursor: pointer; }
tr.row:hover td:first-child, tr.row:focus-visible td:first-child { text-decoration: underline; }
tr.row:focus-visible { outline: 1px dashed var(--sirius); outline-offset: -1px; }
footer { color: var(--muted); font-size: 0.85rem; max-width: 90ch; }
.btn { display: inline-block; font: inherit; font-weight: 600; color: #060a14; background: var(--sirius); border: 0; border-radius: 8px; padding: 8px 16px; text-decoration: none; cursor: pointer; }
.btn.ghost { color: var(--fg); background: transparent; border: 1px solid var(--line); font-weight: 500; padding: 3px 10px; font-size: .78rem; }
.err { color: var(--lost); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* sign-in and message pages */
.msg { max-width: 520px; margin: 12vh auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.msg .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.msg form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; }
.msg input { font: inherit; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; display: block; margin-top: 4px; }
.msg details summary { cursor: pointer; color: var(--muted); }

@media (max-width: 1080px) {
  .main, .lower { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .right { align-items: flex-start; }
  .readout, .who { justify-content: flex-start; }
}
