/* BioOrbit — Astronaut Health OS · Clean blue theme
   Desktop: sidebar dashboard · Mobile: app layout with bottom tab bar
   SI disclosure: styles written with the assistance of an AI coding assistant (Claude, Anthropic). */

:root {
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface2: #f6f9ff;
  --panel: #ffffff;
  --panel2: #f4f7fd;
  --panel-solid: #ffffff;
  --line: #e4eaf5;
  --line2: #d3ddef;
  --text: #0b1f3a;
  --text2: #4a5878;
  --muted: #8a96b3;
  --accent: #0b6bed;
  --accent-600: #0857c9;
  --accent-700: #0b2f6b;
  --accent2: #0ea5e9;
  --accent-soft: #e8f0ff;
  --accent-soft2: #dbe7ff;
  --grad: linear-gradient(135deg, #0b1f3a 0%, #0b4fb8 45%, #0b6bed 80%, #3b9bff 120%);
  --ok: #10b981;
  --watch: #f59e0b;
  --alert: #f97316;
  --critical: #ef4444;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(15, 28, 63, .04), 0 8px 24px -12px rgba(15, 28, 63, .12);
  --shadow-lg: 0 24px 60px -20px rgba(11, 79, 184, .35);
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#stars { display: none; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.mono, .num { font-family: var(--font); font-variant-numeric: tabular-nums; }
h1, h2 { font-weight: 700; letter-spacing: -.005em; margin: 0; }
h3, h4 { margin: 0; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 21px; line-height: 1.25; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; }
::selection { background: var(--accent-soft2); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ============ LAYOUT ============ */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px;
  padding: 24px 18px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 2px 8px 6px; }
.brand-logo { width: 176px; height: auto; display: block; }
.top-logo { height: 34px; width: auto; display: block; }
.welcome-logo { width: 240px; height: auto; display: block; margin: 0 auto 14px; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-mark .orbit { transform-origin: 32px 32px; animation: spin 8s linear infinite; }
.brand-name { font-weight: 700; font-size: 24px; line-height: 1; color: var(--text); }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-top: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; padding: 0 12px; margin-bottom: -10px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
  color: var(--text2); text-decoration: none; font-weight: 600; font-size: 14px; transition: background .2s, color .2s, box-shadow .2s;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent-600); }
.nav a.active { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -10px rgba(11, 107, 237, .8); }
.nav .badge-dot { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; font-size: 11px; display: grid; place-items: center; background: var(--critical); color: #fff; font-weight: 700; padding: 0 6px; }
.nav a.active .badge-dot { background: #fff; color: var(--critical); }

.env-card {
  margin-top: auto; text-align: left; border: 0; border-radius: 18px; padding: 16px; cursor: pointer;
  background: var(--grad); color: #fff; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden; transition: transform .2s;
}
.env-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.env-card:hover { transform: translateY(-2px); }
.env-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.env-name { font-weight: 700; font-size: 19px; }
.env-sub { font-size: 12px; opacity: .85; }
.env-change { font-size: 12px; font-weight: 700; margin-top: 8px; opacity: .95; }
.side-foot { display: flex; flex-direction: column; gap: 10px; }
.partners { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface2); }
.pt-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pt-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.pt-row img, .pt-nasa { display: block; height: auto; mix-blend-mode: multiply; }
.pt-liastra { width: 46%; }
.pt-icbs { width: 48%; }
.pt-nasa { width: 70%; }
.partner-band { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 16px; }
.partner-band img { height: 40px; width: auto; mix-blend-mode: multiply; }
.partner-band .sep { width: 1px; height: 32px; background: var(--line2); }
.about-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.about-logos { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.about-logos .row img { height: 52px; width: auto; }
.about-logos img { mix-blend-mode: multiply; }
@media (max-width: 980px) { .about-card { grid-template-columns: 1fr; } .partner-band img { height: 32px; } }
.disclaimer { font-size: 11px; color: var(--muted); padding: 0 6px; }

.main { min-width: 0; padding: 0 32px 56px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 16px 0;
  background: rgba(243, 246, 252, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.menu-btn { display: none; }
.top-brand { display: none; }
.mission { display: flex; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.mi { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 7px 14px 7px 8px; }
.mi .mi-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mi .mi-ico svg { width: 17px; height: 17px; }
.mi .mi-txt { display: flex; flex-direction: column; line-height: 1.2; }
.mi .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mi .v { font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; font-size: 14px; }
.sig { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: ping 2s infinite; display: inline-block; }
.sig.delay { background: var(--watch); animation-name: pingw; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); } 100% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); } }
@keyframes pingw { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); } 100% { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0); } }

.who { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 40px; padding: 5px 14px 5px 5px; cursor: pointer; box-shadow: var(--shadow); }
.who:hover { border-color: var(--line2); }
.who-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.who-txt b { font-size: 14px; }
.who-txt small { color: var(--muted); font-size: 11.5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: #fff; flex: none; }
.caret { color: var(--muted); font-size: 12px; }
.who-menu { position: absolute; right: 0; top: 66px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px; min-width: 260px; box-shadow: 0 24px 60px -16px rgba(15, 28, 63, .25); z-index: 30; }
.who-menu[hidden], .prompt-bar[hidden] { display: none; }
.who-menu button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 12px; padding: 9px; cursor: pointer; text-align: left; }
.who-menu button:hover, .who-menu button[aria-selected="true"] { background: var(--accent-soft); }

.prompt-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; margin-bottom: 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--accent-soft2); box-shadow: var(--shadow); animation: rise .4s ease;
}
.prompt-bar .pb-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.prompt-bar .pb-txt { flex: 1; }
.prompt-bar .pb-txt small { display: block; color: var(--text2); }

.view { display: none; animation: rise .35s ease; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.page-head p { color: var(--text2); margin-top: 6px; max-width: 720px; }
.eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 4px; }

/* ============ CARDS & UI ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { display: flex; align-items: center; gap: 10px; }
.card-head { flex-wrap: wrap; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.ch-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ch-ico svg { width: 18px; height: 18px; }
.grid { display: grid; gap: 20px; }
.g-hero { grid-template-columns: 1fr 1fr; }
.g-body { grid-template-columns: minmax(300px, .85fr) 1.15fr; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.mt { margin-top: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: 14px;
  padding: 11px 20px; font-weight: 700; font-size: 14px; background: var(--accent); color: #fff;
  box-shadow: 0 10px 22px -10px rgba(11, 107, 237, .75); transition: transform .15s, background .2s, box-shadow .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-600); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sec { background: var(--surface); color: var(--accent-600); border: 1px solid var(--line2); box-shadow: none; }
.btn.sec:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn.light { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; border: 1px solid rgba(255, 255, 255, .35); }
.btn.light:hover { background: rgba(255, 255, 255, .28); }
.btn.white { background: #fff; color: var(--accent-600); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .35); }
.btn.white:hover { background: #f0f5ff; }
.btn.danger { background: var(--critical); box-shadow: none; }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 11px; }
.btn.lg { padding: 14px 26px; font-size: 15px; border-radius: 16px; }
.btn svg.i { width: 18px; height: 18px; }
.ghost-btn { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; cursor: pointer; color: var(--text2); text-align: left; font-weight: 600; }
.ghost-btn:hover { border-color: var(--line2); color: var(--accent-600); background: var(--accent-soft); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #047857; background: #e3f8ef; }
.pill.watch { color: #b45309; background: #fef3dc; }
.pill.alert { color: #c2410c; background: #ffeddf; }
.pill.critical { color: #b91c1c; background: #fde6e6; }
.pill.none { color: var(--muted); background: #eef1f7; }
.pill.plain::before { display: none; }
.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-600); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 30px; padding: 7px 14px; cursor: pointer; font-size: 13px; color: var(--text2); font-weight: 600; transition: all .2s; }
.chip:hover { color: var(--accent-600); border-color: var(--accent-soft2); background: var(--accent-soft); }
.chip.on { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 18px -10px rgba(11, 107, 237, .8); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { background: none; border: 0; padding: 7px 13px; border-radius: 10px; cursor: pointer; color: var(--text2); font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--accent-soft); color: var(--accent-600); }

/* ============ HERO (bridge) ============ */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 30px 32px; color: #fff; background: var(--grad);
  box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
.hero::before { content: ''; position: absolute; width: 380px; height: 380px; right: -120px; top: -160px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero::after { content: ''; position: absolute; width: 240px; height: 240px; left: 38%; bottom: -170px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: rgba(255, 255, 255, .8); }
.hero h1 { font-size: 34px; }
.hero p { color: rgba(255, 255, 255, .85); margin-top: 8px; max-width: 560px; }
.hero .row { margin-top: 20px; }
.hero-stats { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hstat { background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .2); border-radius: 16px; padding: 10px 14px; min-width: 120px; backdrop-filter: blur(6px); }
.hstat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 700; }
.hstat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hstat .v small { font-size: 12px; font-weight: 600; opacity: .8; }
.hero-ring { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-ring .ring .track { stroke: rgba(255, 255, 255, .2); }
.hero-ring .ring-lbl { color: rgba(255, 255, 255, .8); }
.hero-ring .ring { background: rgba(255, 255, 255, .08); border-radius: 50%; }
.hero-ring .pill { background: #fff; }

/* ============ READINESS RING ============ */
.ring { position: relative; width: 176px; height: 176px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: #edf1f8; }
.ring .bar { transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1), stroke .4s; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-val { font-weight: 700; font-size: 54px; line-height: 1; }
.ring-lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv b { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dose-bar { height: 7px; border-radius: 7px; background: #edf1f8; overflow: hidden; margin-top: 6px; }
.dose-bar i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--ok), var(--watch), var(--critical)); background-size: 600px 100%; }

/* routine */
.routine { display: flex; flex-direction: column; gap: 4px; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; transition: background .2s; }
.task:hover { background: var(--surface2); }
.task .chk { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line2); display: grid; place-items: center; flex: none; font-size: 13px; color: #fff; transition: all .3s; }
.task.done .chk { background: var(--accent); border-color: var(--accent); }
.task.done .t-name { color: var(--muted); text-decoration: line-through; }
.task .t-name { font-weight: 600; font-size: 14px; }
.task .t-desc { font-size: 12px; color: var(--muted); }
.task .t-time { font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.task .t-xp { font-size: 11px; color: var(--accent); font-weight: 700; }
.task.due { background: #fffaf0; }
.task.due .t-time { color: var(--watch); }
.progress { height: 8px; border-radius: 8px; background: #edf1f8; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .8s ease; }

/* alerts */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert-item { border-radius: 16px; padding: 13px 15px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: box-shadow .2s, border-color .2s; position: relative; padding-left: 19px; }
.alert-item::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--muted); }
.alert-item:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.alert-item.watch::before { background: var(--watch); }
.alert-item.alert::before { background: var(--alert); }
.alert-item.critical::before { background: var(--critical); }
.alert-item.critical { background: #fff6f6; }
.alert-item .a-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.alert-item .a-title { font-weight: 700; font-size: 14px; }
.alert-item .a-detail { font-size: 13px; color: var(--text2); margin-top: 4px; }
.alert-item ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.alert-item li { margin: 2px 0; }
.alert-item .esc { margin-top: 10px; font-size: 12.5px; color: var(--accent-600); background: var(--accent-soft); padding: 8px 10px; border-radius: 10px; font-weight: 600; }
.alert-item .a-body { display: none; }
.alert-item.open .a-body { display: block; }
.empty { color: var(--muted); font-size: 14px; padding: 18px; text-align: center; border: 1px dashed var(--line2); border-radius: 16px; background: var(--surface2); }
.allgood { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: #e9f9f2; color: #047857; }

/* ============ BODY MAP ============ */
.body-wrap { display: flex; justify-content: center; position: relative; padding: 8px 0; background: radial-gradient(circle at 50% 45%, var(--accent-soft) 0, transparent 62%); border-radius: 20px; }
.body-svg { width: 100%; max-width: 250px; max-height: 520px; height: auto; overflow: visible; }
.body-svg .sil-out { fill: none; stroke: #9db8f2; }
.body-svg .sil-in { fill: none; stroke: #f1f6ff; }
.body-svg .torso { fill: #f1f6ff; stroke: #9db8f2; stroke-width: 1.5; }
.body-svg .organ { transition: fill .4s, opacity .3s; opacity: .5; cursor: pointer; }
.body-svg .organ:hover, .body-svg .organ.sel { opacity: .9; }
.body-svg .hs { cursor: pointer; outline: none; }
.body-svg .hs .dot { transition: r .2s; stroke: #fff; stroke-width: 2.5; }
.body-svg .hs:hover .dot, .body-svg .hs.sel .dot, .body-svg .hs:focus .dot { r: 9; }
.body-svg .hs .halo { animation: halo 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.body-svg .hs.critical .halo, .body-svg .hs.alert .halo { animation-duration: 1.1s; }
@keyframes halo { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
.body-svg .scan { animation: scan 4s linear infinite; }
@keyframes scan { 0% { transform: translateY(-40px); } 100% { transform: translateY(460px); } }
.body-svg .hs-label { paint-order: stroke; stroke: #fff; stroke-width: 3px; font-weight: 700; font-size: 9px; fill: var(--text); font-family: var(--font); pointer-events: none; opacity: 0; transition: opacity .2s; }
.body-svg .hs:hover .hs-label, .body-svg .hs.sel .hs-label { opacity: 1; }
.body-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.body-legend span { display: inline-flex; align-items: center; gap: 6px; }
.body-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.region-panel h2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.region-panel .r-sec { margin-top: 16px; }
.region-panel .r-sec h4 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.region-panel .r-sec p { color: var(--text2); font-size: 14px; }
.r-inds { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.r-ind { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface2); cursor: pointer; transition: border-color .2s, background .2s; }
.r-ind:hover { border-color: var(--accent-soft2); background: var(--accent-soft); }
.r-ind .n { font-size: 12px; color: var(--muted); font-weight: 600; }
.r-ind .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.r-ind .val small { font-size: 12px; color: var(--muted); font-weight: 600; }
.r-actions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.r-actions li { display: flex; gap: 10px; font-size: 14px; color: var(--text); }
.r-actions li::before { content: '✓'; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }

/* ============ INDICATOR TILES ============ */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile { position: relative; overflow: hidden; border-radius: 20px; padding: 16px 16px 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; box-shadow: var(--shadow); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(11, 79, 184, .35); border-color: var(--accent-soft2); }
.tile .t-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile .t-name { font-size: 13px; color: var(--text2); font-weight: 600; }
.tile .t-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.tile .t-val { font-size: 28px; font-weight: 700; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile .t-val small { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.tile .t-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); margin-top: 4px; gap: 6px; }
.tile .spark { width: 100%; height: 36px; margin-top: 6px; display: block; }
.tile.stale { opacity: .6; }
.drift-badge { font-size: 10.5px; padding: 2px 8px; border-radius: 6px; background: #fef3dc; color: #b45309; font-weight: 800; letter-spacing: .04em; }

/* ============ FORMS ============ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.field { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: var(--surface); transition: border-color .25s, box-shadow .25s; position: relative; box-shadow: var(--shadow); }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11, 107, 237, .12); }
.field[data-st="ok"] { border-color: #8fe0c2; }
.field[data-st="watch"] { border-color: #f8cf7f; }
.field[data-st="alert"] { border-color: #fbb184; }
.field[data-st="critical"] { border-color: #f59a9a; box-shadow: 0 0 0 4px rgba(239, 68, 68, .1); }
.field label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text2); font-weight: 600; gap: 8px; }
.field .in-row { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.field input[type=number], .field input[type=text], .field textarea, .field select {
  width: 100%; background: transparent; border: 0; outline: 0; color: var(--text); font-family: var(--font); font-size: 26px; font-weight: 700; padding: 0; min-width: 0; font-variant-numeric: tabular-nums;
}
.field textarea { font-size: 14px; font-weight: 400; resize: vertical; min-height: 70px; }
.input { width: 100%; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; font-family: var(--font); color: var(--text); background: var(--surface); outline: 0; margin-top: 4px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11, 107, 237, .12); }
.field input::placeholder { color: #c6cfe2; }
.field .unit { color: var(--muted); font-size: 13px; font-weight: 600; }
.field .f-st { font-size: 11.5px; font-weight: 700; min-height: 16px; margin-top: 2px; }
.help-btn { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 800; display: grid; place-items: center; flex: none; }
.help-btn:hover { background: var(--accent); color: #fff; }
.howto { display: none; margin-top: 10px; font-size: 12.5px; color: var(--text2); border-top: 1px dashed var(--line2); padding-top: 10px; }
.howto ol { margin: 0; padding-left: 16px; }
.field.help .howto { display: block; }
.field .cam-link { font-size: 12px; color: var(--accent); background: var(--accent-soft); border: 0; cursor: pointer; padding: 5px 10px; border-radius: 8px; font-weight: 700; margin-top: 4px; }
.scale { display: flex; gap: 6px; margin-top: 10px; }
.scale button { flex: 1; aspect-ratio: 1; max-width: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); cursor: pointer; font-size: 22px; transition: all .2s; filter: grayscale(.6); }
.scale button:hover { filter: none; transform: translateY(-2px); border-color: var(--accent-soft2); }
.scale button.on { border-color: var(--accent); background: var(--accent-soft); filter: none; box-shadow: 0 0 0 3px rgba(11, 107, 237, .12); }
.scale.num button { font-size: 16px; font-weight: 700; filter: none; color: var(--text2); }
.scale.num button.on { background: var(--accent); color: #fff; }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sym { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; cursor: pointer; background: var(--surface); user-select: none; transition: all .2s; font-weight: 600; font-size: 13.5px; color: var(--text2); }
.sym:hover { border-color: var(--accent-soft2); }
.sym input { accent-color: var(--alert); width: 17px; height: 17px; }
.sym.on { border-color: #fbb184; background: #fff6ef; color: #c2410c; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; }
.section-title h3 { font-weight: 700; font-size: 22px; }
.section-title .line { flex: 1; height: 1px; background: var(--line2); }
.form-actions { position: sticky; bottom: 16px; margin-top: 24px; display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding: 12px 12px 12px 18px; border-radius: 20px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); box-shadow: 0 20px 50px -20px rgba(15, 28, 63, .3); backdrop-filter: blur(10px); z-index: 5; }
.form-actions .fa-info { margin-right: auto; font-size: 13px; color: var(--text2); font-weight: 600; }

/* ============ TRENDS ============ */
.chart-wrap { position: relative; }
.chart-tip { position: absolute; display: none; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 12.5px; box-shadow: 0 16px 40px -16px rgba(15, 28, 63, .3); white-space: nowrap; z-index: 3; }
.chart-tip .tt-date { color: var(--muted); font-size: 11px; margin-bottom: 4px; font-weight: 700; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { border-radius: 16px; padding: 12px 14px; background: var(--surface2); border: 1px solid var(--line); }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.insight { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-700); font-size: 14px; }

/* ============ PULSE ============ */
.pulse-stage { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: center; }
.cam { position: relative; width: 260px; height: 260px; margin: 0 auto; }
.cam video { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #1f2a44; transform: scaleX(-1); }
.cam .cam-ring { position: absolute; inset: -10px; }
.cam .cam-ring circle { transition: stroke-dashoffset .3s; }
.cam .cam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 40px; font-size: 13px; color: #fff; border-radius: 50%; font-weight: 600; }
.bpm-big { font-weight: 700; font-size: 88px; line-height: 1; display: flex; align-items: baseline; gap: 10px; }
.bpm-big small { font-family: var(--font); font-size: 18px; color: var(--muted); font-weight: 600; }
.bpm-big .heart { color: #ef4466; font-size: 40px; display: inline-block; animation: beat 1s infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }
.wave { width: 100%; height: 110px; display: block; border-radius: 16px; background: repeating-linear-gradient(90deg, rgba(239, 68, 102, .07) 0 1px, transparent 1px 24px), repeating-linear-gradient(0deg, rgba(239, 68, 102, .07) 0 1px, transparent 1px 24px), #fffafb; border: 1px solid #fde1e7; }
.quality { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text2); font-weight: 600; }
.quality .progress { flex: 1; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; font-size: 14px; color: var(--text2); }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.tap-pad { width: 100%; height: 150px; border-radius: 20px; border: 2px dashed #f6b6c4; background: #fff6f8; display: grid; place-items: center; cursor: pointer; font-size: 15px; color: #be3a58; font-weight: 600; user-select: none; transition: background .1s, transform .1s; }
.tap-pad:active, .tap-pad.hit { background: #ffe3ea; transform: scale(.99); }

/* ============ PVT ============ */
.pvt-area { position: relative; height: 340px; border-radius: 24px; background: radial-gradient(circle at 50% 50%, #eef4ff, #f8faff 70%); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; user-select: none; overflow: hidden; touch-action: manipulation; }
.pvt-target { width: 176px; height: 176px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line2); box-shadow: var(--shadow); transition: background .08s, border-color .08s, box-shadow .08s; }
.pvt-area.go .pvt-target { background: radial-gradient(circle, #ffd166, #f59e0b); border-color: #f59e0b; box-shadow: 0 0 0 16px rgba(245, 158, 11, .15), 0 0 60px rgba(245, 158, 11, .5); }
.pvt-area.hit .pvt-target { border-color: var(--ok); box-shadow: 0 0 0 12px rgba(16, 185, 129, .12); }
.pvt-area.early .pvt-target { border-color: var(--critical); box-shadow: 0 0 0 12px rgba(239, 68, 68, .12); }
.pvt-counter { font-size: 30px; font-weight: 800; color: #3d2a00; font-variant-numeric: tabular-nums; }
.pvt-area:not(.go) .pvt-counter { color: var(--accent-600); font-size: 18px; letter-spacing: .08em; }
.pvt-area .pvt-hint { position: absolute; bottom: 18px; font-size: 13px; color: var(--muted); text-align: center; padding: 0 16px; }
.pvt-area .pvt-prog { position: absolute; top: 0; left: 0; height: 4px; background: var(--accent); }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.hist div { flex: 1; background: linear-gradient(180deg, var(--accent), #93c5fd); border-radius: 6px 6px 0 0; min-height: 2px; }
.hist div.lapse { background: linear-gradient(180deg, var(--alert), #fed7aa); }
.hist-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* ============ CREW ============ */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.crew-card { cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; position: relative; }
.crew-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -22px rgba(11, 79, 184, .4); }
.crew-card.me { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft2), var(--shadow); }
.crew-top { display: flex; align-items: center; gap: 12px; }
.crew-top .avatar { width: 46px; height: 46px; font-size: 14px; }
.mini-ring { width: 64px; height: 64px; margin-left: auto; position: relative; flex: none; }
.mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring .track { stroke: #edf1f8; }
.mini-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.crew-dots { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.crew-dots span { font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; color: var(--text2); background: var(--surface2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.crew-dots i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.crew-alert { margin-top: 12px; font-size: 13px; color: var(--text2); min-height: 20px; }
.heat { width: 100%; border-collapse: separate; border-spacing: 5px; font-size: 13px; }
.heat th { font-weight: 700; color: var(--muted); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; white-space: nowrap; }
.heat td { padding: 9px; border-radius: 10px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.heat td.name { text-align: left; font-weight: 600; background: none; white-space: nowrap; }
.heat td.ok { background: #e3f8ef; color: #047857; }
.heat td.watch { background: #fef3dc; color: #b45309; }
.heat td.alert { background: #ffeddf; color: #c2410c; }
.heat td.critical { background: #fde6e6; color: #b91c1c; }
.heat td.none { background: #f2f4f9; color: var(--muted); }
.table-scroll { overflow-x: auto; }

/* ============ DOWNLINK ============ */
.report { font-family: var(--mono); font-size: 12px; line-height: 1.65; white-space: pre-wrap; color: var(--text2); background: var(--surface2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; max-height: 520px; overflow: auto; margin: 0; }
.transmit { position: relative; height: 160px; border-radius: 20px; background: linear-gradient(180deg, #0f1f4d, #1d3a8a); overflow: hidden; }
.transmit svg { width: 100%; height: 100%; }
.tx-status { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 14px; gap: 10px; flex-wrap: wrap; }
.dl-list { display: flex; flex-direction: column; gap: 8px; }
.dl-item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface2); }

/* ============ LIBRARY ============ */
.hazard { position: relative; overflow: hidden; }
.hazard .hz-ico { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.hazard h3 { font-weight: 700; font-size: 21px; }
.hazard p { color: var(--text2); font-size: 14px; }
.hazard h4 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; font-weight: 700; }
.hazard ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.hazard.feature { background: var(--grad); color: #fff; border: 0; }
.hazard.feature p { color: rgba(255, 255, 255, .88); }
.hazard.feature .hz-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.ind-ref { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.ind-ref summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.ind-ref summary::-webkit-details-marker { display: none; }
.ind-ref summary .t-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.ind-ref summary::after { content: '▸'; margin-left: auto; color: var(--muted); transition: transform .2s; }
.ind-ref[open] summary::after { transform: rotate(90deg); }
.ind-ref .ir-body { padding: 0 18px 18px; font-size: 14px; color: var(--text2); display: grid; gap: 12px; }
.range-bar { display: flex; height: 28px; border-radius: 10px; overflow: hidden; font-size: 10.5px; }
.range-bar div { display: grid; place-items: center; color: #fff; font-weight: 700; min-width: 0; overflow: hidden; white-space: nowrap; }
.refs { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text2); }
.refs li { margin: 7px 0; }

/* ============ ACHIEVEMENTS ============ */
.level-card { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--grad); color: #fff; border: 0; box-shadow: var(--shadow-lg); }
.level-card .eyebrow { color: rgba(255, 255, 255, .8); }
.level-card .small { color: rgba(255, 255, 255, .85); }
.level-card .progress { background: rgba(255, 255, 255, .2); }
.level-card .progress i { background: #fff; }
.level-badge { width: 108px; height: 108px; border-radius: 32px; display: grid; place-items: center; background: #fff; color: var(--accent-600); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .4); flex: none; }
.level-badge div { text-align: center; }
.level-badge b { font-size: 48px; line-height: 1; display: block; font-weight: 700; }
.level-badge small { font-size: 10px; letter-spacing: .2em; font-weight: 800; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.badge { text-align: center; border: 1px solid var(--line); border-radius: 20px; padding: 18px 12px; background: var(--surface); box-shadow: var(--shadow); transition: transform .2s; }
.badge:hover { transform: translateY(-2px); }
.badge .b-ico { width: 56px; height: 56px; border-radius: 18px; font-size: 28px; display: grid; place-items: center; margin: 0 auto 10px; background: var(--accent-soft); }
.badge .b-name { font-weight: 700; font-size: 14px; }
.badge .b-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge.locked { opacity: .5; }
.badge.locked .b-ico { filter: grayscale(1); background: #f0f2f7; }
.badge.got { border-color: var(--accent-soft2); }
.cal { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.cal div { aspect-ratio: 1; border-radius: 8px; background: #edf1f8; }
.cal div[data-l="1"] { background: #cfe0ff; }
.cal div[data-l="2"] { background: #9fc0ff; }
.cal div[data-l="3"] { background: #5b8ff5; }
.cal div[data-l="4"] { background: var(--accent); }
.cal div.today { outline: 2px solid var(--accent-700); outline-offset: 2px; }
.streak { font-weight: 700; font-size: 46px; display: flex; align-items: center; gap: 8px; line-height: 1.1; }

/* ============ MODAL / TOAST ============ */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(15, 28, 63, .35); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal-back[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 28px; padding: 28px; box-shadow: 0 40px 100px -24px rgba(15, 28, 63, .45); animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.x-btn { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; width: 36px; height: 36px; cursor: pointer; flex: none; color: var(--text2); }
.x-btn:hover { background: var(--accent-soft); color: var(--accent); }
.env-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.env-opt { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: all .2s; }
.env-opt:hover { border-color: var(--accent-soft2); background: var(--surface2); }
.env-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(11, 107, 237, .12); }
.env-opt .eo-ico { font-size: 26px; }
.env-opt b { font-weight: 700; font-size: 18px; }
.env-opt small { color: var(--text2); font-size: 12px; }
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: 0 20px 50px -18px rgba(15, 28, 63, .35); display: flex; align-items: center; gap: 10px; animation: slidein .3s ease; max-width: 360px; font-size: 14px; }
.toast.xp { border-color: var(--accent-soft2); }
.toast b { color: var(--accent-600); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.result-score { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 18px; background: var(--surface2); border: 1px solid var(--line); margin-bottom: 16px; }
.breath { width: 220px; height: 220px; margin: 10px auto 22px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #dbe7ff, #eef4ff 60%, transparent 71%); border: 2px solid #bcd2ff; color: var(--accent-700); transition: transform 4s ease-in-out; font-size: 18px; font-weight: 700; }
.welcome-hero { text-align: center; padding: 6px 0 12px; }
.welcome-hero .brand-mark { width: 74px; height: 74px; margin: 0 auto 12px; display: block; }
.welcome-hero h1 { font-size: 44px; }
.feat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.feat div { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 13px; color: var(--text2); background: var(--surface2); }
.feat b { color: var(--text); display: block; font-size: 14px; }
.small { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ============ MOBILE TAB BAR ============ */
.tabbar { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .hero-ring { flex-direction: row; justify-content: flex-start; }
}
@media (max-width: 980px) {
  body { background: var(--bg); }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 286px; transform: translateX(-105%); transition: transform .3s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 30px 0 80px rgba(15, 28, 63, .25); }
  .main { padding: 0 16px 110px; }
  .g-body, .g-2, .g-3, .g-hero, .pulse-stage { grid-template-columns: 1fr; }
  .topbar { padding: 12px 0; gap: 10px; }
  .top-brand { display: flex; align-items: center; gap: 8px; flex: 1; }
  .top-brand span { font-weight: 700; font-size: 22px; }
  .mission { display: none; }
  .who { padding: 4px; box-shadow: none; }
  .who-txt, .caret { display: none; }

  /* app-style hero: full-bleed with the curved corner of the reference design */
  .hero { margin: 0 -16px; border-radius: 0 0 0 56px; padding: 22px 20px 28px; gap: 18px; }
  .hero h1 { font-size: 30px; }
  .hero-ring { flex-direction: row; align-items: center; gap: 18px; }
  .hero-ring .ring { width: 128px; height: 128px; }
  .hero-ring .ring-val { font-size: 40px; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hstat { min-width: 0; padding: 9px 12px; }
  .hero .row { margin-top: 16px; }

  .tabbar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; height: 66px; padding: 0 8px;
    background: var(--surface); border-radius: 24px; box-shadow: 0 16px 40px -12px rgba(15, 28, 63, .3); border: 1px solid var(--line);
    align-items: center; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 700; background: none; border: 0; cursor: pointer; padding: 6px 0; position: relative; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active::after { content: ''; position: absolute; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
  .tabbar .fab { flex: none; width: 58px; height: 58px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; margin-top: -30px; box-shadow: 0 14px 28px -10px rgba(11, 79, 184, .7); }
  .tabbar .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .tabbar .fab span { display: none; }
  .tabbar a.fab.active { color: #fff; }
  .tabbar a.fab.active::after { display: none; }
  .form-actions { bottom: 90px; }
  .toasts { bottom: 92px; right: 12px; left: 12px; align-items: stretch; }
  .prompt-bar { margin-top: 16px; }
}
@media (max-width: 640px) {
  h1 { font-size: 28px; }
  .page-head { margin-top: 4px; }
  .card { padding: 18px; border-radius: 20px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile { padding: 14px 13px 8px; border-radius: 18px; }
  .tile .t-val { font-size: 23px; }
  .tile .t-ico { width: 30px; height: 30px; }
  .feat { grid-template-columns: 1fr; }
  .bpm-big { font-size: 64px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .fa-info { display: none; }
  .form-actions { padding: 10px; }
  .form-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .form-grid .field:has(.scale) { grid-column: 1 / -1; }
  .field { padding: 12px; border-radius: 16px; }
  .field input[type=number] { font-size: 22px; }
  .field label span { font-size: 12px; }
  .scale button { font-size: 18px; border-radius: 11px; }
  .modal { padding: 22px; border-radius: 24px; }
  .page-head .seg { width: 100%; }
  .page-head .seg button { flex: 1; }
  .pvt-area { height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
@media print {
  .sidebar, .topbar, .tabbar, .prompt-bar, .no-print { display: none !important; }
  .app { display: block; }
  .card { box-shadow: none; }
  .report { max-height: none; background: #fff; }
}

/* sidebar: never squeeze cards when the menu grows */
.sidebar > * { flex-shrink: 0; }
.nav a { padding: 9px 14px; }
