/* NOVACARE — interface styles.
   Direction: a premium clinic you carry into orbit. Calm ivory and white surfaces (a dark
   mode for the sleep cycle), one deep-teal brand colour for action, status colours used only
   for health and always paired with a symbol or label. Fraunces for headlines and key
   numbers, Inter for everything you read and tap. Motion is quick, eased, and optional. */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- tokens ---------- */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #eaf5fc; --surface: #ffffff; --surface-2: #f1f7fd; --surface-3: #e2edf9;
  --line: #dde9f6; --line-strong: #c3d5ea; --glass-line: rgb(255 255 255 / 0.9);
  --ink: #0c1f6b; --muted: #55648f; --faint: #64729b;
  --brand: #0b2a8f; --brand-hover: #081f6e; --on-brand: #ffffff; --brand-soft: #e3ecff; --brand-ink: #0b2a8f;
  --accent: #ff4f9a; --accent-soft: #ffe4f0; --accent-ink: #cf2274;
  --ok: #157347; --warn: #9a5a00; --alert: #c03d0c; --crit: #bf2430; --none: #8a97b5;
  --sos: #c42530; --sos-hover: #a51e28; --sos-soft: #fdecec; --sos-ink: #9b1c25;
  --sh-1: 0 1px 2px rgb(20 50 120 / 0.04), 0 10px 28px -16px rgb(20 50 120 / 0.22);
  --sh-2: 0 2px 4px rgb(20 50 120 / 0.04), 0 18px 40px -18px rgb(20 50 120 / 0.3);
  --sh-3: 0 30px 70px -24px rgb(12 31 107 / 0.45);
  --overlay: rgb(12 24 70 / 0.38);
  --hero: linear-gradient(120deg, #e4f1ff 0%, #ffffff 58%, #ffeef6 100%);
  --holo: linear-gradient(180deg, #eaf6fe, #dcefff);
  --crew-0: #2f6bff; --crew-1: #cf2274; --crew-2: #7c5cff; --crew-3: #5b6788; --crew-4: #12806f; --crew-5: #c2540a;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070d24; --surface: #101a3d; --surface-2: #15214a; --surface-3: #1c2a5a;
  --line: #22316a; --line-strong: #31437f; --glass-line: rgb(255 255 255 / 0.07);
  --ink: #e9eeff; --muted: #a6b3da; --faint: #8f9cc6;
  --brand: #8fb0ff; --brand-hover: #aec6ff; --on-brand: #06103a; --brand-soft: #1b2b66; --brand-ink: #a9c2ff;
  --accent: #ff7ab5; --accent-soft: #3c1b3d; --accent-ink: #ff9cc8;
  --ok: #46cf8f; --warn: #f0b44a; --alert: #f5925a; --crit: #f47378; --none: #7482ad;
  --sos: #d9343e; --sos-hover: #ef4650; --sos-soft: #3a1618; --sos-ink: #ffb3b6;
  --sh-1: 0 0 0 1px rgb(255 255 255 / 0.02), 0 12px 30px -18px rgb(0 0 0 / 0.7);
  --sh-2: 0 14px 36px -14px rgb(0 0 0 / 0.7);
  --sh-3: 0 30px 80px -20px rgb(0 0 0 / 0.8);
  --overlay: rgb(2 5 18 / 0.72);
  --hero: linear-gradient(120deg, #16245a 0%, #101a3d 60%, #2a1a45 100%);
  --holo: linear-gradient(180deg, #eaf6fe, #cfe6fb);
  --crew-0: #8fb0ff; --crew-1: #ff9cc8; --crew-2: #b9a6ff; --crew-3: #cbd5e1; --crew-4: #6fe0cf; --crew-5: #fdba74;
}
@property --tab { syntax: "<color>"; inherits: true; initial-value: #2f6bff; }
:root {
  --r-xs: 8px; --r-sm: 14px; --r: 24px; --r-lg: 28px;
  --serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head-h: 72px; --nav-w: 150px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 140ms; --t: 220ms;
  transition: --tab 520ms ease;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); min-height: 100vh; -webkit-font-smoothing: antialiased; transition: background-color var(--t) ease, color var(--t) ease; }
::selection { background: var(--brand); color: var(--on-brand); }
body.lock { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font: 750 32px/1.12 var(--serif); letter-spacing: -0.02em; text-wrap: balance; font-variation-settings: "opsz" 72; }
h2 { font-size: 16.5px; font-weight: 620; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
button, select { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.num, td, dd, .md b, .tile-v b, .kpi b, .row-val, .v-val, .d-val, .stats b, .crew-score b, .mh-day, .heat td, .counts b { font-feature-settings: "tnum" 1; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic.lg { width: 40px; height: 40px; stroke-width: 1.3; color: var(--brand-ink); }
.grow { flex: 1; min-width: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.hide-s { display: inline-flex; }

/* status colours (always paired with a symbol or a word) */
.l0 { --c: var(--ok); } .l1 { --c: var(--warn); } .l2 { --c: var(--alert); } .l3 { --c: var(--crit); } .ln { --c: var(--none); }
.mk { color: var(--c); display: inline-block; width: 1em; text-align: center; font-size: 0.82em; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
b.l0, b.l1, b.l2, b.l3, span.l0, span.l1, span.l2, span.l3, td.l0, td.l1, td.l2, td.l3, p.l2 { color: var(--c); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--head-h); display: flex; align-items: center; gap: 16px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand circle { fill: var(--brand); stroke: none; }
.brand path { fill: none; stroke: var(--on-brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand b { display: block; font: 750 17px/1.1 var(--serif); letter-spacing: 0.01em; }
.brand span { font-size: 12px; color: var(--muted); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.chip .ic { width: 16px; height: 16px; }
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.icon-only { width: 36px; padding: 0; justify-content: center; }
.chip.sync.synced .ic { color: var(--ok); } .chip.sync.offline .ic, .chip.sync.pending .ic { color: var(--warn); }
.chip.sync.relink, .chip.sync.error { border-color: color-mix(in srgb, var(--alert) 50%, var(--line)); color: var(--ink); } .chip.sync.relink .ic, .chip.sync.error .ic { color: var(--alert); }
.chip.sync.syncing .ic { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.md { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.md b { font: 750 16px var(--serif); color: var(--ink); }
.md button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; color: var(--brand-ink); transition: background var(--t-fast), color var(--t-fast); }
.md button:hover { background: var(--brand); color: var(--on-brand); }
.md .ic { width: 16px; height: 16px; }
.user-chip { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 11px; }
.user-chip .uname { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; color: var(--muted); transition: color var(--t-fast), background var(--t-fast); }
.user-chip button:hover { background: var(--sos-soft); color: var(--crit); }
.user-chip .ic { width: 16px; height: 16px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--head-h)); }
body.signed-out .shell { grid-template-columns: minmax(0, 1fr); } body.signed-out #nav { display: none; }
#nav { position: sticky; top: var(--head-h); height: calc(100vh - var(--head-h)); padding: 20px 14px; display: flex; flex-direction: column; }
#nav ul { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ind { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; border-radius: 12px; background: var(--surface); box-shadow: var(--sh-1), 0 0 0 1px var(--line); transition: transform 380ms var(--ease), width 380ms var(--ease), height 380ms var(--ease), opacity var(--t); }
.nav-i .ls { display: none; }
.nav-i .ic { transition: transform 380ms var(--ease), color var(--t-fast); } .nav-i.on .ic { transform: scale(1.12); } .nav-i:active { transform: scale(0.97); }
.brand[data-act] { cursor: pointer; border-radius: 12px; }
.nav-i { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--muted); font-size: 14.5px; font-weight: 550; transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.nav-i:hover { color: var(--ink); background: var(--surface-3); }
.nav-i.on { color: var(--ink); }
.nav-i.on .ic { color: var(--brand-ink); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sos); color: #fff; font: 700 11px/20px var(--sans); font-style: normal; text-align: center; }
.nav-foot { margin-top: auto; padding: 0 14px; font-size: 12px; color: var(--faint); }

#banner:empty { display: none; }
.banner { display: flex; align-items: center; gap: 12px; padding: 11px 24px; background: var(--sos); color: #fff; font-size: 14px; }
.banner + .banner { border-top: 1px solid rgb(255 255 255 / 0.25); }
.banner p { flex: 1; min-width: 0; } .banner .ic { width: 20px; height: 20px; }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 56px; display: grid; gap: 20px; align-content: start; outline: none; }
.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 8px 20px 28px; }
body:not(.signed-out) .foot { display: none; }

/* page header & personal sub-navigation */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-h p { color: var(--muted); font-size: 14.5px; margin-top: 6px; max-width: 70ch; }
.page-a { display: flex; gap: 8px; flex-wrap: wrap; }
.subnav { position: relative; display: inline-flex; gap: 2px; padding: 4px; background: var(--surface-3); border-radius: 999px; justify-self: start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.subnav button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--muted); white-space: nowrap; transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.subnav button:hover { color: var(--ink); }
.subnav button { position: relative; z-index: 1; }
.subnav button.on { color: var(--ink); }
.subnav .ind { border-radius: 999px; box-shadow: var(--sh-1), 0 1px 3px rgb(16 32 31 / 0.08); }
.subnav button.on .ic { color: var(--brand-ink); }
.subnav .ic { width: 16px; height: 16px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; min-width: 0; box-shadow: var(--sh-1); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pad { padding: 0 2px; }
.empty { color: var(--muted); padding: 8px 0; }
.empty-state { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 56px 24px; }
.empty-state p { color: var(--muted); max-width: 52ch; }
.code { letter-spacing: 0.06em; color: var(--brand-ink); }
.foot-note { display: flex; align-items: center; gap: 8px; } .foot-note .ic { width: 16px; height: 16px; color: var(--brand-ink); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; text-align: center; text-decoration: none; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.btn .ic { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgb(15 92 88 / 0.25); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.primary:disabled { background: var(--surface-3); color: var(--faint); box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.quiet { color: var(--brand-ink); background: transparent; }
.btn.quiet:hover { background: var(--brand-soft); }
.btn.danger:hover { color: var(--crit); border-color: var(--crit); }
.btn.sos { background: var(--sos); color: #fff; } .btn.sos:hover { background: var(--sos-hover); }
.btn.light { background: #fff; color: #8f1a22; } .btn.light:hover { background: #ffe9ea; }
.btn.ghost-light { border: 1px solid rgb(255 255 255 / 0.6); color: #fff; } .btn.ghost-light:hover { background: rgb(255 255 255 / 0.12); }
.btn.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; gap: 6px; } .btn.sm .ic { width: 15px; height: 15px; }
.btn.lg { min-height: 48px; padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn-note { font-weight: 500; opacity: 0.8; padding-left: 8px; margin-left: 2px; border-left: 1px solid currentColor; }
.btn.big { width: 100%; padding: 12px; font-size: 16px; flex-direction: column; gap: 0; } .btn.big small { font-weight: 500; font-size: 12px; opacity: 0.8; }
.btn.more { margin-top: 10px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; } .btnrow.end { justify-content: flex-end; margin-top: 18px; } .btnrow.col { flex-direction: column; } .btnrow.col .btn { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent); }
.tag { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.sm { font-size: 10.5px; padding: 1px 7px; }
.tag.link { transition: border-color var(--t-fast), color var(--t-fast); } .tag.link:hover { border-color: var(--brand); color: var(--ink); }
.tag.link.l0, .tag.link.l1, .tag.link.l2, .tag.link.l3 { color: var(--c); }
.due { font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-ink); background: var(--brand-soft); border-radius: 4px; padding: 1px 6px; margin-left: 8px; }
.meter { display: block; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width 500ms var(--ease); }
.meter.big { height: 8px; }
details > summary { cursor: pointer; list-style: none; } details > summary::-webkit-details-marker { display: none; }
.about { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.about summary { font-size: 13.5px; font-weight: 600; color: var(--brand-ink); display: inline-flex; align-items: center; gap: 6px; }
.about summary::after { content: "+"; font-weight: 500; transition: transform var(--t-fast); }
.about[open] summary::after { transform: rotate(45deg); }
.about p { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 70ch; } .about p b { color: var(--ink); }
.disclose > summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.disclose > summary .ic { margin-left: auto; align-self: center; color: var(--muted); transition: transform var(--t) var(--ease); }
.disclose[open] > summary .ic { transform: rotate(90deg); }
.disclose[open] > summary { margin-bottom: 14px; }

/* forms */
.fields { display: grid; gap: 18px; align-content: start; }
.field { display: grid; gap: 7px; } .field > label { font-size: 13px; font-weight: 600; color: var(--muted); } .field > label.sm { font-size: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: -6px; }
input.text, select.text { width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font: inherit; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
input.text:hover, select.text:hover { border-color: var(--muted); }
input.text:focus, select.text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
input.text::placeholder { color: var(--faint); }
select.text { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356676a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.remember { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.remember input { accent-color: var(--brand); width: 17px; height: 17px; }

/* ---------- personal: overview ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding: 30px 32px; background: var(--hero); }
.hero-greet { font-size: 14px; font-weight: 600; color: var(--brand-ink); }
.hero-title { font: 750 30px/1.2 var(--serif); letter-spacing: -0.02em; margin: 6px 0 20px; max-width: 24ch; font-variation-settings: "opsz" 72; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-facts { display: flex; gap: 32px; flex-wrap: wrap; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line)); }
.hero-facts dt { font-size: 12px; color: var(--muted); }
.hero-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 550; min-width: 120px; }
.hero-ring { padding-right: 8px; }
.ring { position: relative; width: 176px; margin: 0 auto; }
.ring svg { display: block; width: 100%; }
.ring circle { fill: none; stroke-width: 9; } .ring .bg { stroke: color-mix(in srgb, var(--ink) 7%, transparent); }
.ring .fg { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease); }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-in b { font: 750 52px/1 var(--serif); letter-spacing: -0.03em; }
.ring-in span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ring-word { text-align: center; font-weight: 600; color: var(--c); margin-top: 10px; font-size: 14px; }
.alldone { display: inline-flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 600; padding: 11px 16px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.alldone .ic { width: 17px; height: 17px; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: grid; gap: 4px; align-content: start; text-align: left; padding: 16px 16px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.tile:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.tile-l { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.tile-v { display: flex; align-items: baseline; gap: 4px; }
.tile-v b { font: 750 30px/1.1 var(--serif); letter-spacing: -0.02em; }
.tile-v small { font-size: 12px; color: var(--faint); }
.tile-s { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.tile-s .dot { width: 7px; height: 7px; }
.tile .spark { position: absolute; right: 10px; top: 14px; width: 64px; height: 24px; opacity: 0.9; }
.spark { width: 110px; height: 32px; flex: none; } .spark path { fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; } .spark circle { fill: var(--c); }

.grid-over { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sys-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: start; }
.bodycard { display: flex; justify-content: center; }
.body { width: 100%; max-height: 330px; }
.body .sil { fill: var(--surface-2); stroke: var(--line-strong); }
.part { cursor: pointer; outline: none; }
.part > * { fill: var(--c); fill-opacity: 0.32; stroke: var(--c); stroke-width: 1.5; transition: fill-opacity var(--t-fast); }
.part:hover > *, .part:focus-visible > * { fill-opacity: 0.6; }
.part.sel > * { fill-opacity: 0.75; stroke: var(--ink); stroke-width: 2.4; }
.part .shield { fill: none; stroke-dasharray: 3 7; stroke-width: 3; stroke-linecap: round; fill-opacity: 1; }
.part .hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; }
.part.sel .shield { stroke: var(--ink); } .part.sel .hit { stroke: transparent; }
.part.l2 > *, .part.l3 > * { animation: throb 2.2s ease-in-out infinite; }
.beat { transform-box: fill-box; transform-origin: center; animation: beat 1s ease-in-out infinite !important; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.14); } 24% { transform: scale(1); } 36% { transform: scale(1.08); } 48% { transform: scale(1); } }
@keyframes throb { 50% { fill-opacity: 0.6; } }
.sysinfo { display: grid; gap: 14px; min-width: 0; }
.syslist { display: flex; flex-wrap: wrap; gap: 6px; }
.sysbtn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 550; color: var(--muted); transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast); }
.sysbtn .dot { width: 7px; height: 7px; box-shadow: none; }
.sysbtn:hover { color: var(--ink); border-color: var(--line-strong); }
.sysbtn.on { color: var(--ink); background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.sys-name { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: -0.01em; font-size: 16px; color: var(--ink); }
.rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.rows button { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; transition: border-color var(--t-fast), background var(--t-fast); }
.rows button:hover { border-color: var(--line-strong); background: var(--surface); }
.rows .rbar { grid-column: 1 / -1; }
.row-name { font-size: 14px; font-weight: 550; }
.row-val { font: 750 17px var(--serif); color: var(--c); } .row-val small { font: 500 12px var(--sans); color: var(--faint); }
.hz { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.rbar { position: relative; display: flex; gap: 2px; height: 6px; margin: 8px 0 2px; width: 100%; }
.rbar i { background: var(--c); opacity: 0.35; border-radius: 2px; min-width: 0; }
.rbar i:first-child { border-radius: 99px 2px 2px 99px; } .rbar i:last-of-type { border-radius: 2px 99px 99px 2px; }
.rbar b { position: absolute; top: -4px; width: 4px; height: 14px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); transition: left 300ms var(--ease); }

/* advisories */
.adv { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-top: 8px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.adv:first-of-type { margin-top: 0; }
.adv[open] { border-color: color-mix(in srgb, var(--c) 35%, var(--line)); box-shadow: var(--sh-2); }
.adv summary { display: flex; gap: 12px; align-items: center; padding: 13px 14px; }
.adv-sym { width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); font-size: 13px; flex: none; }
.adv-main { flex: 1; display: grid; min-width: 0; } .adv-main b { font-weight: 600; } .adv-main small { color: var(--muted); font-size: 13px; }
.adv-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.adv-body { padding: 0 16px 16px 56px; display: grid; gap: 12px; justify-items: start; }
.adv-body ol { margin: 0; padding-left: 18px; display: grid; gap: 5px; max-width: 70ch; font-size: 14.5px; }
.esc { font-size: 13.5px; background: color-mix(in srgb, var(--c, var(--brand)) 8%, var(--surface)); border-radius: 12px; padding: 10px 14px; max-width: 72ch; }
.esc b { color: var(--c, var(--brand-ink)); }

/* vitals */
.grid-vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.vital { cursor: pointer; display: grid; gap: 6px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.vital:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.vital header { display: flex; justify-content: space-between; align-items: center; }
.vital h3 { color: var(--ink); font-size: 13.5px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.v-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.v-val { font: 750 30px/1.1 var(--serif); letter-spacing: -0.02em; } .v-val small { font: 500 13px var(--sans); color: var(--faint); }
.vital footer { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 4px; } .vital footer .btn { margin-left: auto; }

/* today */
.grid-routine { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.col { display: grid; gap: 20px; }
.tasks { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.tasks button { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; min-height: 60px; transition: border-color var(--t-fast), background var(--t-fast); }
.tasks button:hover { border-color: var(--line-strong); background: var(--surface); }
.box { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-content: center; color: var(--on-brand); transition: background var(--t-fast), border-color var(--t-fast); }
.box .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.done .box { background: var(--ok); border-color: var(--ok); }
.done .t-main b { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.t-main { flex: 1; display: grid; } .t-main b { font-weight: 600; } .t-main small { color: var(--muted); font-size: 13px; }
.t-side { display: grid; text-align: right; font-size: 13px; color: var(--brand-ink); font-weight: 600; } .t-side em { font-style: normal; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.done .t-side { color: var(--ok); }
.rank h2 { font: 750 26px var(--serif); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stats div { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; display: grid; }
.stats b { font: 750 24px var(--serif); } .stats span { font-size: 12px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 12px 6px; border-radius: 12px; background: var(--surface-2); opacity: 0.45; }
.badge.got { opacity: 1; }
.badge i { font-style: normal; width: 44px; height: 44px; border-radius: 50%; display: grid; place-content: center; font: 750 16px var(--serif); border: 1.5px dashed var(--line-strong); margin-bottom: 4px; }
.badge.got i { border: 1.5px solid var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.badge b { font-size: 13px; font-weight: 600; } .badge small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.strip { display: flex; gap: 4px; align-items: flex-end; }
.sd { flex: 1; display: grid; gap: 4px; text-align: center; }
.sd span { height: 60px; background: var(--surface-2); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.sd i { width: 100%; background: var(--c); opacity: 0.75; border-radius: 4px 4px 0 0; } .sd small { font-size: 10px; color: var(--faint); }

/* hazards */
.envcard .card-h { align-items: center; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts.wide { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; gap: 14px; }
.facts dt { font-size: 12px; color: var(--muted); } .facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 550; }
.grid-haz { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.haz { display: grid; gap: 10px; align-content: start; } .haz p { font-size: 14px; color: var(--muted); } .haz p b { color: var(--ink); }
.haz-h { display: flex; align-items: center; gap: 12px; }
.haz-h i { font: 750 20px var(--serif); font-style: normal; width: 40px; height: 40px; border-radius: 12px; display: grid; place-content: center; background: var(--brand-soft); color: var(--brand-ink); }
.haz-h h3 { font-size: 16px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }

/* ---------- modal sheets ---------- */
#modal { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: grid; place-items: center; padding: 20px; overflow: auto; }
#modal[hidden] { display: none; }
#modal.fresh { animation: fade var(--t) ease both; } #modal.fresh .sheet { animation: pop 260ms var(--ease) both; }
#modal.out { animation: fadeout 160ms ease both; } #modal.out .sheet { animation: sink 160ms ease both; }
@keyframes fade { from { opacity: 0; } } @keyframes fadeout { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes sink { to { opacity: 0; transform: translateY(8px) scale(0.99); } }
.sheet { width: min(980px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); }
.sheet.narrow { width: min(580px, 100%); }
.sheet > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 22px 24px 14px; }
.sheet > header h2 { font: 750 24px/1.2 var(--serif); letter-spacing: -0.015em; }
.sheet > .meter { margin: 0 24px; }
.x { width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; color: var(--muted); background: var(--surface-2); flex: none; transition: background var(--t-fast), color var(--t-fast); }
.x:hover { color: var(--ink); background: var(--surface-3); }
.sheet-b { padding: 16px 24px 22px; overflow: auto; min-height: 0; flex: 1 1 auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.sheet-b.one { display: flex; flex-direction: column; gap: 16px; } .sheet-b.one > * { flex: none; }
.sheet > footer { display: flex; justify-content: space-between; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.sheet.narrow > footer { justify-content: center; }
.stepper { display: grid; grid-template-columns: 56px 1fr auto 56px; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px; transition: border-color var(--t-fast); }
.stepper:focus-within { border-color: var(--brand); }
.stepper button { height: 52px; border-radius: 10px; background: var(--surface); text-align: center; font-size: 24px; color: var(--brand-ink); box-shadow: var(--sh-1); } .stepper button:hover { background: var(--brand-soft); }
.stepper input { width: 100%; min-width: 0; background: none; border: 0; color: var(--ink); font: 750 36px var(--serif); text-align: right; outline: none; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input::placeholder { color: var(--line-strong); }
.stepper span { color: var(--muted); font-size: 14px; padding-right: 4px; }
.scale { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.scale button { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; text-align: center; color: var(--muted); min-height: 72px; transition: border-color var(--t-fast), background var(--t-fast); }
.scale button b { font: 750 22px var(--serif); color: var(--ink); } .scale button:hover { border-color: var(--line-strong); }
.scale button.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .scale button.on b { color: var(--on-brand); }
.readout p { font-size: 13.5px; margin-top: 6px; }
.guide { display: grid; gap: 8px; align-content: start; border-left: 1px solid var(--line); padding-left: 28px; }
.guide ol, .d-cols ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; } .guide p, .d-cols p { font-size: 14px; color: var(--muted); }
.guide h3:not(:first-child), .d-cols h3:not(:first-child) { margin-top: 8px; }
.envs { display: grid; gap: 6px; }
.envs button { display: grid; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color var(--t-fast), background var(--t-fast); } .envs b { font-weight: 600; } .envs small { color: var(--muted); font-size: 12px; }
.envs button:hover { border-color: var(--line-strong); } .envs button.on { border-color: var(--brand); background: var(--brand-soft); }
.done-top { display: grid; justify-items: center; gap: 10px; }
.d-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; } .d-top .btn { margin-left: auto; }
.d-val { font: 750 46px/1 var(--serif); color: var(--c); letter-spacing: -0.02em; } .d-val small { font: 500 15px var(--sans); color: var(--faint); }
.d-side { display: grid; gap: 4px; justify-items: start; font-size: 13px; }
.seg { display: inline-flex; gap: 2px; background: var(--surface-3); border-radius: 999px; padding: 3px; justify-self: start; margin-top: 6px; }
.seg button { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background var(--t-fast), color var(--t-fast); } .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.d-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 6px; }
.d-cols > div { display: grid; gap: 8px; align-content: start; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
.d-cols td { padding: 5px 6px 5px 0; border-bottom: 1px solid var(--line); } .d-cols td:first-child { color: var(--muted); white-space: nowrap; }

/* charts */
.chart { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 680 / 250); background: var(--surface-2); border-radius: 14px; }
.chart .grid { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 5; } .chart .ax { fill: var(--muted); font: 11px var(--sans); }
.chart .band { fill: var(--c); opacity: 0.1; } .chart .band.l0 { opacity: 0.12; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .pt { fill: var(--c); stroke: var(--surface); stroke-width: 2; transition: r var(--t-fast); } .chart .pt:hover { r: 7; }
.chart .range { fill: var(--brand); opacity: 0.12; }
.chart .cline { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dlabel { font: 600 12px var(--sans); }
.chart-empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface-2); border-radius: 14px; }
.chart-key { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.chart-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); opacity: 0.45; margin-right: 6px; vertical-align: -1px; }
.chart-key .key-line { background: var(--brand); opacity: 1; height: 3px; vertical-align: 3px; } .chart-key .key-range { background: var(--brand); opacity: 0.22; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 12px; margin-top: 10px; } .legend span { color: var(--c); }

/* toast */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); z-index: 60; max-width: calc(100vw - 32px); box-shadow: var(--sh-3); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sign-in ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; max-width: 1020px; width: 100%; margin: 5vh auto; }
.auth-side h2 { font: 750 44px/1.08 var(--serif); letter-spacing: -0.025em; margin-bottom: 14px; font-variation-settings: "opsz" 96; }
.auth-side > p { font-size: 16px; color: var(--muted); max-width: 46ch; }
.locked { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 4px; }
.locked li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.locked li:last-child { border-bottom: 0; }
.locked li > .ic { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); }
.locked b { display: block; font-size: 14.5px; font-weight: 600; } .locked small { color: var(--muted); font-size: 13px; }
.auth-card { padding: 28px; display: grid; gap: 18px; box-shadow: var(--sh-2); border-radius: var(--r-lg); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-3); border-radius: 999px; padding: 4px; }
.auth-tabs button { text-align: center; padding: 9px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), 0 1px 3px rgb(16 32 31 / 0.08); }
#auth-form { gap: 14px; }
.auth-err { color: var(--crit); font-size: 13.5px; min-height: 1.2em; margin: -4px 0; } .auth-err:empty { display: none; }
button.link { color: var(--brand-ink); font-weight: 600; } button.link:hover { text-decoration: underline; }
.conn { font-size: 12.5px; color: var(--muted); padding: 9px 12px; border-radius: 12px; margin: 0; background: color-mix(in srgb, var(--c) 8%, var(--surface)); }

/* ---------- avatars ---------- */
.av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-content: center; font: 600 14px var(--sans); color: var(--av); background: color-mix(in srgb, var(--av) 15%, var(--surface)); }
.av.sm { width: 30px; height: 30px; font-size: 11px; }

/* ---------- crewmates ---------- */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.crew-card { display: flex; flex-direction: column; gap: 16px; transition: box-shadow var(--t-fast), border-color var(--t-fast); }
.crew-card:hover { box-shadow: var(--sh-2); border-color: var(--line-strong); }
.crew-h { display: flex; align-items: center; gap: 12px; }
.crew-id { flex: 1; min-width: 0; } .crew-id h2 { font-size: 16px; } .crew-id p { font-size: 13px; color: var(--muted); }
.crew-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.crew-score > div { display: grid; }
.crew-score b { font: 750 44px/1 var(--serif); letter-spacing: -0.03em; }
.crew-score span { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mini { width: 132px; height: 38px; } .mini path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.crew-concern { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 550; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.crew-vitals { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.crew-vitals > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.crew-vitals dt { font-size: 11.5px; color: var(--muted); }
.crew-vitals dd { margin: 2px 0 0; display: flex; align-items: baseline; gap: 4px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.crew-vitals dd small { font-size: 11px; color: var(--faint); font-weight: 500; }
.crew-vitals.col { grid-template-columns: repeat(2, 1fr); }
.crew-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); } .crew-meta .ic { width: 15px; height: 15px; }
.crew-card footer { display: flex; gap: 8px; margin-top: auto; }
.crew-card footer .btn { flex: 1; }
.sys-mini, .adv-mini { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.sys-mini li { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; }
.sys-mini li span { margin-left: auto; font-size: 12.5px; color: var(--c); font-weight: 550; }
.adv-mini li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px; background: var(--surface-2); border-radius: 12px; }
.adv-mini b { font-weight: 600; } .adv-mini small { display: block; color: var(--muted); font-size: 12.5px; }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; } .tbl small { color: var(--faint); font-size: 11.5px; }
.tbl td.l0, .tbl td.l1, .tbl td.l2, .tbl td.l3 { color: var(--c); }
.who { display: flex; align-items: center; gap: 10px; } .who > span { display: grid; } .who b { font-weight: 600; } .who small { color: var(--muted); }
.dlt { margin-left: 6px; color: var(--ok); font-size: 12px; } .dlt.neg { color: var(--alert); }
.ok-t { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-weight: 550; } .ok-t .ic { width: 15px; height: 15px; }

/* ---------- mission status ---------- */
.mission-hero { display: grid; gap: 22px; padding: 28px 30px; background: var(--hero); }
.mh-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mh-day { display: flex; align-items: baseline; gap: 10px; }
.mh-day b { font: 750 64px/0.95 var(--serif); letter-spacing: -0.035em; }
.mh-day span { font-size: 18px; color: var(--muted); }
.mh-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.mh-meta span { font-size: 13px; font-weight: 550; color: var(--muted); padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.track { position: relative; height: 8px; background: color-mix(in srgb, var(--ink) 8%, transparent); border-radius: 4px; overflow: hidden; }
.track i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 4px; transition: width 600ms var(--ease); }
.track em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); opacity: 0.8; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 2px; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi b { font: 750 32px/1.1 var(--serif); letter-spacing: -0.02em; }
.kpi small { font-size: 12.5px; color: var(--faint); }
.kpi.down small { color: var(--alert); }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.mlog { list-style: none; margin: 0; padding: 0; display: grid; }
.mlog > li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.mlog > li:first-child { border-top: 0; padding-top: 2px; }
.mlog-d { display: grid; align-content: start; } .mlog-d b { font-size: 14px; font-weight: 600; } .mlog-d small { font-size: 12px; color: var(--faint); }
.mlog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.mlog ul li { display: flex; gap: 9px; align-items: baseline; } .mlog ul li .dot { width: 7px; height: 7px; transform: translateY(-1px); box-shadow: none; }
.mlog .quiet { color: var(--faint); }

/* ---------- analysis ---------- */
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.verdicts, .findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.verdicts > li { display: grid; gap: 10px; justify-items: start; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.vd-h { display: flex; align-items: center; gap: 12px; width: 100%; }
.vd-h b { display: block; font-weight: 600; } .vd-h small { color: var(--muted); font-size: 12.5px; }
.reasons { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 14px; color: var(--muted); }
.findings > li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--c) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 20%, var(--line)); }
.findings > li > .mk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-content: center; background: color-mix(in srgb, var(--c) 14%, transparent); font-size: 11px; }
.findings b { display: block; margin-bottom: 2px; font-weight: 600; }
.findings p { font-size: 14px; color: var(--muted); max-width: 68ch; }
.findings .act { margin-top: 10px; color: var(--ink); }
.findings .act span { display: block; font-size: 12px; font-weight: 600; color: var(--brand-ink); margin-bottom: 1px; }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12.5px; }
.heat th { font-weight: 600; color: var(--muted); padding: 6px 4px; white-space: nowrap; text-align: center; font-size: 11.5px; }
.heat th.grp { color: var(--ink); border-bottom: 1px solid var(--line); }
.heat th.ind { font-weight: 500; }
.heat th.who { text-align: left; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; padding-right: 10px; }
.heat td { text-align: center; padding: 9px 5px; border-radius: 8px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); white-space: nowrap; }
.heat td.ln { background: var(--surface-2); color: var(--faint); }
.heat td .mk { margin-right: 2px; }
.legend .ln { color: var(--none); }

/* ---------- emergency ---------- */
.emg > header { align-items: center; }
.emg-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-content: center; background: var(--sos-soft); color: var(--sos-ink); flex: none; }
.emg-ic .ic { width: 22px; height: 22px; }
.emg-h { background: color-mix(in srgb, var(--sos) 7%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--sos) 22%, var(--line)); border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: 18px !important; }
.emg-h p { color: var(--sos-ink); font-weight: 550; }
.emg-sent { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; }
.emg-sent .ic { width: 15px; height: 15px; color: var(--sos); }
.emg-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.emg-pick button { display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 62px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 14px; font-weight: 550; transition: border-color var(--t-fast), background var(--t-fast); }
.emg-pick button:hover { border-color: color-mix(in srgb, var(--sos) 50%, var(--line)); background: var(--sos-soft); }
.emg-pick .ic { color: var(--sos); width: 22px; height: 22px; }
.steps { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 8px; }
.steps button { width: 100%; display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; font-size: 15px; line-height: 1.5; transition: border-color var(--t-fast), opacity var(--t); }
.steps button:hover { border-color: var(--line-strong); }
.steps .n { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-content: center; font-weight: 700; font-size: 13px; background: var(--sos-soft); color: var(--sos-ink); transition: background var(--t-fast); }
.steps button.done { opacity: 0.55; } .steps button.done .n { background: var(--ok); color: #fff; } .steps .n .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.emg .esc { --c: var(--crit); }
.emg-side { display: grid; gap: 14px; align-content: start; }
.hints { margin: 0; padding: 12px 14px 12px 32px; background: var(--sos-soft); border-radius: 12px; font-size: 14px; display: grid; gap: 4px; color: var(--ink); }
.emg-foot { padding: 12px 24px 18px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); }

/* ---------- motion ---------- */
#app.enter > * { animation: rise 340ms var(--ease) both; }
#app.enter > *:nth-child(2) { animation-delay: 30ms; } #app.enter > *:nth-child(3) { animation-delay: 60ms; } #app.enter > *:nth-child(4) { animation-delay: 90ms; } #app.enter > *:nth-child(n+5) { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
/* page changes: only the content area animates; header and navigation stay put while the tab highlight glides */
#app { view-transition-name: page; } .top { view-transition-name: top; } #nav { view-transition-name: nav; }
::view-transition-old(root), ::view-transition-old(top), ::view-transition-old(nav) { display: none; }
::view-transition-new(root), ::view-transition-new(top), ::view-transition-new(nav) { animation: none; mix-blend-mode: normal; }
::view-transition-group(page) { animation-duration: 300ms; animation-timing-function: var(--ease); }
::view-transition-old(page) { animation: 150ms ease both vt-out; }
::view-transition-new(page) { animation: 360ms var(--ease) 60ms both vt-in; }
::view-transition-old(page), ::view-transition-new(page) { height: auto; }
@keyframes vt-out { to { opacity: 0; transform: translate(calc(var(--vt-x, 0px) * -0.5), calc(var(--vt-y, 0px) * -0.5)); } }
@keyframes vt-in { from { opacity: 0; transform: translate(var(--vt-x, 0px), var(--vt-y, 0px)); } }

/* ---------- mission lobby ---------- */
.lobby-hero { position: relative; overflow: hidden; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.lobby-hero .hero-title { font-size: 38px; margin: 6px 0 8px; }
.lobby-lead { color: var(--muted); max-width: 52ch; margin-bottom: 20px; } .lobby-lead b { color: var(--ink); font-weight: 600; }
.lobby-orb { align-self: center; height: 150px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #0b1626, #16263d); box-shadow: var(--sh-2); }
.lobby-orb svg, .mcard-art svg { display: block; width: 100%; height: 100%; }
.art-move { animation: drift 7s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-5px, 2px); } to { transform: translate(6px, -3px); } }
.lobby-sec { display: grid; gap: 14px; }
.lobby-h { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; } .lobby-h h2 { font: 750 22px/1.2 var(--serif); letter-spacing: -0.01em; } .lobby-h p { color: var(--muted); font-size: 14px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.mcard { display: flex; flex-direction: column; text-align: left; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); overflow: hidden; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast); }
.mcard:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--line-strong); }
.mcard:active { transform: translateY(-1px) scale(0.99); }
.mcard.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand), var(--sh-2); }
.mcard-art { position: relative; display: block; height: 124px; background: linear-gradient(160deg, #0b1626, #16263d); overflow: hidden; }
.mcard-art svg { transition: transform 600ms var(--ease); } .mcard:hover .mcard-art svg { transform: scale(1.07); }
.mcard-badge { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 999px; background: #fff; color: #0f5c58; font-size: 12px; font-weight: 700; }
.mcard-badge .ic { width: 13px; height: 13px; stroke-width: 2.8; }
.mcard-b { display: grid; gap: 4px; padding: 16px 18px 16px; flex: 1; align-content: start; }
.mcard-k { font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.mcard-b > b { font: 750 19px/1.25 var(--serif); letter-spacing: -0.01em; }
.mcard-facts { display: grid; gap: 5px; margin: 8px 0 12px; font-size: 13px; color: var(--muted); }
.mcard-facts span { display: flex; gap: 8px; align-items: flex-start; } .mcard-facts .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--faint); }
.mcard-go { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--brand-ink); }
.mcard-go .ic, .jcard-go { width: 16px; height: 16px; transition: transform var(--t) var(--ease); }
.mcard:hover .mcard-go .ic, .jcard:hover .jcard-go { transform: translateX(4px); }
.mcard.on .mcard-go { justify-content: center; padding: 9px 14px; border-radius: var(--r-sm); background: var(--brand); color: var(--on-brand); }
.jgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.jcard { display: grid; gap: 8px; text-align: left; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast); }
.jcard:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--brand); }
.jcard-h { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.jcard-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-content: center; background: var(--brand-soft); color: var(--brand-ink); } .jcard-ic .ic { width: 17px; height: 17px; }
.jcard-go { margin-left: auto; color: var(--faint); }
.jcard-n { display: flex; align-items: baseline; gap: 8px; } .jcard-n b { font: 750 34px/1 var(--serif); letter-spacing: -0.02em; } .jcard-n small { font-size: 13px; color: var(--muted); }
.jcard-s { font-size: 13px; color: var(--faint); }
.jcard.hot { border-color: var(--sos); } .jcard.hot .jcard-s { color: var(--sos-ink); font-weight: 600; } .jcard.hot .jcard-ic { background: var(--sos-soft); color: var(--sos-ink); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .an-grid, .grid-2, .grid-over { grid-template-columns: minmax(0, 1fr); }
  .kpis, .jgrid { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  #nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgb(16 32 31 / 0.25); }
  #nav ul { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  #nav .ind { background: var(--brand-soft); box-shadow: none; } .nav-i .ll { display: none; } .nav-i .ls { display: inline; }
  .nav-i { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11.5px; text-align: center; justify-content: center; border-radius: 12px; }
  .nav-i.on { color: var(--brand-ink); }
  .nav-i .ic { width: 22px; height: 22px; }
  .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
  .nav-foot { display: none; }
  body:not(.signed-out) { padding-bottom: 80px; } #toast { bottom: 96px; }
  main { padding: 22px 20px 40px; }
}
@media (max-width: 760px) {
  .lobby-hero { grid-template-columns: 1fr; } .lobby-hero .hero-main { display: block; } .lobby-hero .hero-title { font-size: 30px; margin: 6px 0 8px; } .lobby-orb { height: 120px; order: -1; }
  .auth { grid-template-columns: 1fr; gap: 24px; margin: 0 auto; } .auth-side h2 { font-size: 32px; }
  .hero { grid-template-columns: 1fr auto; padding: 20px; gap: 12px; align-items: start; }
  .hero-main { display: contents; } .hero-greet { grid-column: 1; } .hero-ring { grid-column: 2; grid-row: 1 / span 2; padding: 0; }
  .hero-title { grid-column: 1; font-size: 22px; margin: 0; } .hero-cta, .hero-facts { grid-column: 1 / -1; } .hero-facts { margin-top: 4px; gap: 12px 24px; }
  .ring { width: 104px; } .ring circle { stroke-width: 10; } .ring-in b { font-size: 32px; } .ring-in span { font-size: 10px; } .ring-word { font-size: 12px; margin-top: 6px; }
  .sys-wrap { grid-template-columns: 1fr; } .body { max-height: 260px; }
}
@media (max-width: 720px) {
  main { padding: 18px 14px 32px; gap: 16px; }
  .top { padding: 0 12px; gap: 8px; } .brand span, .brand div { display: none; } .hide-s { display: none; }
  .user-chip .uname { display: none; }
  h1 { font-size: 26px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles .tile:last-child { grid-column: span 2; }
  .crew-grid { grid-template-columns: 1fr; }
  .grid-routine, .sheet-b, .d-cols { grid-template-columns: 1fr; }
  .guide { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .adv summary { flex-wrap: wrap; } .adv-body { padding-left: 16px; }
  .scale { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
  .emg-pick { grid-template-columns: 1fr; }
  .mh-day b { font-size: 48px; } .mission-hero { padding: 22px; }
  .mlog > li { grid-template-columns: 1fr; gap: 6px; }
  .banner { flex-wrap: wrap; padding: 10px 14px; }
  .page-a .btn { flex: 1; }
  .card { padding: 18px; }
  .sheet > header, .sheet-b { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .chart .line { stroke-dashoffset: 0; }
}


/* =====================================================================
   NovaCare look: icy glass surfaces, navy type, pink accent, and an
   animated tab bar whose coloured bubble glides to the active tab.
   ===================================================================== */
body { background: radial-gradient(900px 540px at 88% -10%, color-mix(in srgb, var(--tab) 15%, transparent), transparent 70%), radial-gradient(760px 520px at -6% 108%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
h1 { position: relative; font: 800 40px/1.1 var(--sans); letter-spacing: -0.03em; color: var(--brand-ink); padding-top: 14px; }
h2 { font-size: 18px; font-weight: 700; color: var(--brand-ink); }
.swoosh { position: absolute; top: -8px; left: 28px; width: 170px; height: 34px; pointer-events: none; overflow: visible; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.card { background: color-mix(in srgb, var(--surface) 84%, transparent); border-color: var(--glass-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.btn { border-radius: 14px; } .btn.lg, .btn.big { border-radius: 999px; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand)); box-shadow: 0 12px 22px -14px var(--accent), 0 2px 4px rgb(11 42 143 / 0.25); }
.btn.primary:hover { background: var(--brand-hover); }
.hero-greet { color: var(--accent-ink); }
.subnav { background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--glass-line); box-shadow: var(--sh-1); }
.subnav button.on .ic { color: var(--accent-ink); }
.subnav .ind { background: var(--brand-soft); box-shadow: none; }

/* header */
.top { background: color-mix(in srgb, var(--surface) 62%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom-color: var(--glass-line); box-shadow: 0 6px 24px -20px rgb(20 50 120 / 0.5); }
.brand .logo { width: 46px; height: 38px; flex: none; overflow: visible; }
.brand .lg-plus { fill: var(--brand); stroke: none; } .brand .lg-ring { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.brand b { font: 800 24px/1.05 var(--sans); letter-spacing: -0.03em; color: var(--brand-ink); }
.brand span { display: block; font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sysline { margin: 0 auto; display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 18px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--glass-line); box-shadow: var(--sh-1); font-size: 14px; font-weight: 550; color: var(--brand-ink); white-space: nowrap; }
.sysline i { width: 10px; height: 10px; border-radius: 50%; background: #1fc46b; box-shadow: 0 0 0 0 rgb(31 196 107 / 0.5); animation: ping 2.4s ease-out infinite; }
.sysline.off i { background: var(--warn); animation: none; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 9px rgb(31 196 107 / 0); } }
.chip, .md, .user-chip { background: color-mix(in srgb, var(--surface) 82%, transparent); border-color: var(--glass-line); box-shadow: var(--sh-1); }
.user-chip .avatar { background: var(--accent-soft); color: var(--accent-ink); }

/* animated tab bar */
.nav-i .ic, .nav-i.on .ic { transform: none; color: inherit; }
.nav-ic { width: 42px; height: 42px; flex: none; display: grid; place-content: center; border-radius: 50%; color: var(--brand-ink); transition: transform 420ms var(--ease), background-color 320ms ease, color 200ms ease, box-shadow 320ms ease; }
.nav-ic .ic { width: 26px; height: 26px; }
.nav-i.on .nav-ic { background: var(--tab); color: #fff; box-shadow: 0 10px 18px -8px var(--tab); animation: tabpop 460ms var(--ease); }
@keyframes tabpop { 0% { transform: scale(0.6); } 60% { transform: scale(1.1); } }
.nav-set { display: grid; place-content: center; height: 64px; margin-top: auto; border-radius: 24px; color: var(--brand-ink); background: color-mix(in srgb, var(--surface) 72%, transparent); border: 1px solid var(--glass-line); box-shadow: var(--sh-1); transition: transform var(--t) var(--ease), color var(--t-fast); }
.nav-set .ic { width: 28px; height: 28px; transition: transform 600ms var(--ease); } .nav-set:hover .ic { transform: rotate(60deg); } .nav-set:hover { color: var(--accent-ink); }
@media (min-width: 1024px) {
  #nav { padding: 20px 10px 20px 18px; gap: 14px; }
  #nav ul { padding: 10px; gap: 6px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 72%, transparent); border: 1px solid var(--glass-line); box-shadow: var(--sh-1); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .nav-i { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px 12px; border-radius: 20px; font-size: 15px; font-weight: 600; color: var(--brand-ink); }
  .nav-i:hover { background: color-mix(in srgb, var(--tab) 7%, transparent); color: var(--brand-ink); }
  .nav-i.on { color: var(--brand-ink); }
  #nav .ind { border-radius: 20px; background: color-mix(in srgb, var(--tab) 15%, var(--surface)); box-shadow: none; transition: transform 460ms var(--ease), width 460ms var(--ease), height 460ms var(--ease), background-color 420ms ease; }
  .nav-badge { position: absolute; top: 8px; right: 10px; margin: 0; }
}
@media (max-width: 1023px) {
  #nav { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); background: none; border: 0; box-shadow: none; }
  #nav ul { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 6px 6px 7px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 14px 34px -14px rgb(20 50 120 / 0.45); }
  .nav-i, .nav-i.on { flex-direction: column; gap: 0; padding: 2px 2px 0; font-size: 11.5px; font-weight: 600; color: var(--muted); background: none; }
  .nav-i.on { color: var(--ink); }
  .nav-i.on .nav-ic { transform: translateY(-16px); animation: none; }
  #nav .ind { background: none; box-shadow: none; transition: transform 460ms var(--ease), width 460ms var(--ease); }
  #nav .ind::before { content: ""; position: absolute; left: 50%; top: -24px; width: 62px; height: 62px; margin-left: -31px; border-radius: 50%; background: var(--surface); box-shadow: 0 -1px 0 0 var(--line); }
  .nav-set { display: none; }
  body:not(.signed-out) { padding-bottom: 104px; } #toast { bottom: 112px; }
  .sysline { display: none; }
}

/* personal overview: profile, key vitals, health shortcuts, body view */
.ov { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) minmax(0, 1.25fr); gap: 20px; align-items: stretch; }
.ov-col { display: grid; gap: 20px; align-content: start; }
.ov-id { display: flex; align-items: center; gap: 20px; }
.ov-id .portrait { width: 124px; height: 132px; flex: none; border-radius: 24px; box-shadow: var(--sh-2); }
.ov-id h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; overflow-wrap: anywhere; }
.ov-id p { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14.5px; margin-top: 4px; } .ov-id p .ic { color: var(--brand-ink); }
.ov-kv h2 { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.ov-hr { display: flex; align-items: center; gap: 16px; width: 100%; }
.ov-heart { width: 58px; height: 58px; flex: none; display: grid; place-content: center; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.ov-heart .ic { width: 30px; height: 30px; stroke-width: 2; animation: beat 1.3s ease-in-out infinite; transform-origin: center; }
.ov-n { display: flex; align-items: baseline; gap: 6px; } .ov-n b { font: 800 46px/1 var(--sans); letter-spacing: -0.03em; color: var(--brand-ink); } .ov-n small { font-size: 18px; color: var(--brand-ink); }
.ecg { flex: 1; min-width: 60px; height: 58px; padding-left: 14px; border-left: 1px solid var(--line-strong); }
.ecg path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 300; animation: ecg 2.6s linear infinite; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 50%, transparent)); }
@keyframes ecg { from { stroke-dashoffset: 300; } 60%, to { stroke-dashoffset: 0; } }
.ov-health { display: grid; gap: 12px; align-content: start; } .ov-health h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.hl { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); font-size: 16px; font-weight: 600; color: var(--brand-ink); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast); }
.hl > .ic { width: 28px; height: 28px; } .hl .hl-go { margin-left: auto; width: 20px; height: 20px; color: var(--accent); stroke-width: 2.4; transition: transform var(--t) var(--ease); }
.hl:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--accent); } .hl:hover .hl-go { transform: translateX(4px); }
.ov-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ov-holo { flex: 1; min-height: 300px; display: grid; place-items: center; padding: 10px 6px 0; background: var(--holo); overflow: hidden; }
.bodyscan { width: 100%; height: 100%; max-height: 430px; overflow: visible; }
.bodyscan .skin { fill: url(#bs-skin); opacity: 0.68; } .bodyscan .rim { fill: none; stroke: #e8f6ff; stroke-width: 1.4; opacity: 0.95; filter: drop-shadow(0 0 5px rgb(79 155 245 / 0.8)); }
.bodyscan .anat { fill: none; stroke: #fff; stroke-width: 1; stroke-linecap: round; opacity: 0.4; }
.bodyscan .floor ellipse { fill: none; stroke: #4f9bf5; stroke-width: 1.2; opacity: 0.45; }
.bodyscan .scan { opacity: 0.55; animation: scan 4.5s ease-in-out infinite; }
@keyframes scan { 0% { transform: translateY(-60px); } 100% { transform: translateY(520px); } }
.bodyscan .sys { --c: var(--none); fill: var(--c); fill-opacity: 0.72; transition: fill-opacity var(--t); }
.bodyscan .sys.l0 { --c: #19a463; } .bodyscan .sys.l1 { --c: #e59a1a; } .bodyscan .sys.l2 { --c: #ee6a2c; } .bodyscan .sys.l3 { --c: #e23645; } .bodyscan .sys.ln { --c: #6f86c9; }
.bodyscan .bone { fill: none; stroke: var(--c); stroke-width: 4.5; stroke-linecap: round; stroke-opacity: 0.6; } .bodyscan .fold { fill: none; stroke: #fff; stroke-width: 0.9; stroke-opacity: 0.7; }
.bodyscan .sys.sel { fill-opacity: 1; } .bodyscan .sys.sel .bone { stroke-opacity: 1; }
.bodyscan .beat { transform-box: fill-box; transform-origin: center; animation: beat 1s ease-in-out infinite; }
.bodyscan .orbit { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-opacity: 0.4; stroke-linecap: round; } .bodyscan .orbit.front { stroke-opacity: 0.9; filter: drop-shadow(0 0 4px var(--accent)); }
.bodyscan .orbit.l1, .bodyscan .orbit.l2, .bodyscan .orbit.l3 { stroke: var(--c); } .bodyscan .orbit.sel { stroke-width: 3.4; }
.bodyscan .lbl { cursor: pointer; outline: none; } .bodyscan .lbl .hit { fill: transparent; stroke: none; transition: fill var(--t-fast); }
.bodyscan .lbl text { font: 650 12.5px var(--sans); fill: #0c1f6b; fill-opacity: 1; }
.bodyscan .lbl .lead { fill: none; stroke: #0c1f6b; stroke-width: 0.8; stroke-opacity: 0.35; stroke-dasharray: 2 3; }
.bodyscan .lbl .pt { fill: var(--c); fill-opacity: 1; stroke: #fff; stroke-width: 1.2; } .bodyscan .lbl .pulse { fill: var(--c); fill-opacity: 0.5; transform-box: fill-box; transform-origin: center; animation: hot 2.2s ease-out infinite; }
@keyframes hot { to { transform: scale(3.2); fill-opacity: 0; } }
.bodyscan .lbl:hover .hit, .bodyscan .lbl:focus-visible .hit { fill: rgb(255 255 255 / 0.7); } .bodyscan .lbl.sel .hit { fill: #0b2a8f; } .bodyscan .lbl.sel text { fill: #fff; } .bodyscan .lbl.sel .lead { stroke-opacity: 0.9; stroke-dasharray: none; }
.ov-sys { padding: 16px 18px 18px; min-height: 96px; }
.ov-sys-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; } .ov-sys-h h2 { font-size: 18px; font-weight: 800; }
.ov-ind { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-ind button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 550; color: var(--muted); transition: border-color var(--t-fast), transform var(--t) var(--ease); }
.ov-ind button b { color: var(--ink); font-weight: 700; } .ov-ind button:hover { border-color: var(--brand); transform: translateY(-1px); }
.ov-hint { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14.5px; padding-top: 6px; } .ov-hint .ic { width: 22px; height: 22px; color: var(--accent-ink); }

/* sign-in */
body.signed-out main { max-width: none; padding: 0; display: block; }
.auth { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: 0; max-width: none; margin: 0; align-items: stretch; min-height: calc(100vh - var(--head-h)); }
.auth-photo { position: relative; min-height: 420px; background: linear-gradient(180deg, #ff8fc0, var(--accent)); clip-path: polygon(0 0, 68% 0, 100% 38%, 58% 100%, 0 100%); }
.auth-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 35% center; clip-path: polygon(0 0, calc(68% - 5px) 0, calc(100% - 8px) 38%, calc(58% - 7px) 100%, 0 100%); }
.auth-main { display: grid; justify-items: center; align-content: center; gap: 26px; padding: 40px 24px 48px; }
.auth-title { text-align: center; } .auth-title h1 { display: inline-block; font-size: clamp(48px, 6.4vw, 84px); letter-spacing: -0.04em; padding-top: 26px; }
.auth-title .swoosh { top: -6px; left: 22%; width: 74%; height: 44px; }
.auth-title p { font-size: clamp(20px, 2.4vw, 30px); font-weight: 500; color: var(--brand-ink); margin-top: 2px; }
.auth-card { width: min(560px, 100%); padding: 30px 34px; border-radius: 34px; }
.inp { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line-strong); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.inp > .ic { width: 24px; height: 24px; color: var(--brand-ink); }
.inp input, .inp select { flex: 1; min-width: 0; height: 54px; border: 0; outline: 0; background: none; color: var(--ink); font: 500 16px var(--sans); }
.inp input::placeholder { color: var(--faint); }
.inp:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.eye { width: 36px; height: 36px; display: grid; place-content: center; border-radius: 50%; color: var(--muted); } .eye .ic { width: 22px; height: 22px; } .eye.on { color: var(--accent-ink); background: var(--accent-soft); }
.auth-card .btn.big { min-height: 60px; font-size: 20px; font-weight: 700; }
.auth-tabs button.on { color: var(--brand-ink); }

/* lobby: missions */
.lobby-hero .hero-title { font: 800 40px/1.1 var(--sans); padding-top: 14px; }
.mcard { padding: 0; } .mcard-main { display: flex; flex-direction: column; flex: 1; text-align: left; }
.mcard-badge { color: #0b2a8f; }
.mcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.codechip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; transition: background var(--t-fast), color var(--t-fast); }
.codechip .ic { width: 14px; height: 14px; } .codechip:hover { background: var(--brand); color: var(--on-brand); }
.codechip.lg { min-height: 44px; justify-content: center; border-radius: var(--r-sm); font-size: 14.5px; }
.mcard.add { display: grid; place-content: center; justify-items: center; gap: 8px; min-height: 230px; padding: 24px; text-align: center; background: color-mix(in srgb, var(--surface) 45%, transparent); border: 2px dashed var(--line-strong); box-shadow: none; }
.mcard.add b { font-size: 17px; font-weight: 700; color: var(--brand-ink); } .mcard.add small { color: var(--muted); font-size: 13.5px; max-width: 28ch; }
.add-ic { width: 60px; height: 60px; display: grid; place-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 4px; transition: transform var(--t) var(--ease); } .add-ic .ic { width: 28px; height: 28px; }
.mcard.add.join .add-ic { background: var(--accent-soft); color: var(--accent-ink); }
.mcard.add:hover { border-color: var(--brand); border-style: solid; } .mcard.add:hover .add-ic { transform: scale(1.1) rotate(8deg); }
.jcard-ic { background: color-mix(in srgb, var(--tabc, var(--brand)) 14%, var(--surface)); color: var(--tabc, var(--brand-ink)); }
.jcard:hover { border-color: var(--tabc, var(--brand)); }
.envopt { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.envopt input { accent-color: var(--brand); width: 17px; height: 17px; flex: none; } .envopt span { display: grid; } .envopt b { font-weight: 600; } .envopt small { color: var(--muted); font-size: 12px; }
.envopt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.code-in { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; font-size: 18px; }
.bigcode { padding: 26px 16px; border-radius: 22px; background: var(--brand-soft); color: var(--brand-ink); text-align: center; font: 800 clamp(30px, 8vw, 46px)/1 var(--sans); letter-spacing: 0.1em; user-select: all; }

/* ship inventory */
.inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.chips button small { font-size: 12px; opacity: 0.75; } .chips button:hover { color: var(--ink); border-color: var(--line-strong); }
.chips button.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.inv-card { padding: 6px 22px; }
.inv { list-style: none; margin: 0; padding: 0; }
.inv > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.inv > li:last-child { border-bottom: 0; } .inv-none { display: block !important; padding: 22px 0 !important; }
.inv-ic { width: 46px; height: 46px; display: grid; place-content: center; border-radius: 15px; background: var(--brand-soft); color: var(--brand-ink); } .inv-ic .ic { width: 22px; height: 22px; }
.inv > li.l1 .inv-ic { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); } .inv > li.l3 .inv-ic { background: var(--sos-soft); color: var(--sos-ink); }
.inv-main { min-width: 0; } .inv-main b { display: block; font-size: 15.5px; font-weight: 650; overflow-wrap: anywhere; } .inv-main small { display: block; font-size: 13px; color: var(--muted); } .inv-main .inv-by { font-size: 12px; color: var(--faint); }
.inv-qty { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.inv-qty button { width: 34px; height: 34px; display: grid; place-content: center; border-radius: 50%; background: var(--surface); color: var(--brand-ink); box-shadow: var(--sh-1); transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.inv-qty button:hover:not(:disabled) { background: var(--brand); color: var(--on-brand); } .inv-qty button:active:not(:disabled) { transform: scale(0.9); } .inv-qty button:disabled { opacity: 0.4; cursor: not-allowed; }
.inv-qty span { min-width: 84px; text-align: center; white-space: nowrap; } .inv-qty b { font-size: 17px; font-weight: 750; } .inv-qty small { margin-left: 5px; font-size: 12.5px; color: var(--muted); }
.inv-acts { display: flex; align-items: center; gap: 6px; } .x.sm { width: 32px; height: 32px; } .x.sm .ic { width: 15px; height: 15px; }
.x.sm:hover { background: var(--sos-soft); color: var(--crit); }

@media (max-width: 1180px) {
  .sysline { display: none; }
  .ov { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .ov-body { grid-column: 1 / -1; } .bodyscan { max-height: 400px; }
}
@media (max-width: 760px) {
  h1 { font-size: 30px; } .swoosh { width: 130px; left: 18px; }
  .ov { grid-template-columns: minmax(0, 1fr); } .ov-body { grid-column: auto; } .ov-id .portrait { width: 92px; height: 98px; border-radius: 20px; }
  .auth { grid-template-columns: minmax(0, 1fr); min-height: 0; } .auth-photo { min-height: 0; height: 190px; clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%); }
  .auth-photo img { clip-path: polygon(0 0, 100% 0, 100% calc(72% - 6px), 0 calc(100% - 6px)); object-position: 60% 40%; }
  .auth-main { padding: 22px 16px 36px; gap: 18px; } .auth-card { padding: 22px 18px; border-radius: 26px; }
  .lobby-hero .hero-title { font-size: 30px; }
  .inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .inv-kpis .kpi { padding: 12px; } .inv-kpis .kpi b { font-size: 26px; }
  .inv-card { padding: 4px 16px; }
  .inv > li { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; } .inv-qty { grid-column: 1 / span 2; justify-self: start; } .inv-acts { justify-self: end; }
}

@media (max-width: 900px) { .hide-s { display: none; } .brand span { display: none; } }
.brand { flex: none; }
@media (max-width: 760px) { .lobby-hero { display: flex; flex-direction: column; align-items: stretch; gap: 16px; } .lobby-orb { order: -1; width: 100%; height: 130px; align-self: auto; } }

/* NASA OSDR studies for a body system */
.osdr { margin-top: 18px; display: grid; gap: 14px; }
.osdr h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.osdr h2 .ic { width: 18px; height: 18px; color: var(--brand-ink); }
.osdr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.osdr-list li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); display: grid; gap: 6px; min-width: 0; }
.osdr-list a { color: var(--ink); text-decoration: none; display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.osdr-list a b { font-weight: 600; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.osdr-list a:hover b { color: var(--brand-ink); text-decoration: underline; }
.osdr-id { flex: none; font-size: 11.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 6px; padding: 1px 6px; }
.osdr-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.osdr-list p { margin: 0; }

/* guest sign-in and the shared mission list */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; color: var(--faint); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.guest-btn { width: 100%; justify-content: center; }
.nav-i.locked { opacity: 0.45; }
.mcard.dir .mcard-main { cursor: default; }
.codechip.static { cursor: default; }
