/* =========================================================
   Med-Link — shared styles
   Palette: turquoise / white / grey
   ========================================================= */
:root {
  /* turquoise taken from the logo (#0fa196) */
  --teal-700: #0a6e67;
  --teal-600: #0c8a80;
  --teal-500: #10a397;
  --teal-400: #3cc2b6;
  --teal-100: #d1f1ed;
  --teal-50:  #eaf8f6;

  /* dark grey taken from the logo background */
  --ink-900: #1f2326;
  --ink-800: #272c30;
  --ink-700: #30363b;

  --grey-900: #1d2830;
  --grey-700: #43515c;
  --grey-500: #73818c;
  --grey-300: #c5ced5;
  --grey-200: #dde3e8;
  --grey-100: #eef1f4;
  --grey-50:  #f6f8f9;
  --white:    #ffffff;
  --on-accent: #ffffff;   /* text on turquoise/red fills — stays white in dark mode */

  --red:    #e0464c;
  --red-50: #fdeced;
  --amber:  #e59a12;
  --amber-50: #fdf4e3;
  --green:  #23a26d;
  --green-50: #e6f6ef;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(29, 40, 48, .05), 0 6px 24px rgba(29, 40, 48, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Exo 2", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--grey-900);
  background: var(--grey-50);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-600); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.container.wide { max-width: 1180px; }
.container.narrow { max-width: 620px; }

/* ---------- Fade-in on scroll (js/reveal.js) ---------- */
.reveal {
  opacity: 0; transform: translateY(28px);
  /* !important: the fade wins over an element's own transition (buttons, cards) */
  transition: opacity .7s ease var(--reveal-delay, 0ms), transform .7s cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms) !important;
}
.reveal.from-above { transform: translateY(-28px); }   /* scrolling back up: drop in from above */
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.is-visible.btn:active { transform: translateY(1px); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--grey-200);
}
.topbar > :first-child { justify-self: start; }
.topbar > :last-child { justify-self: end; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--grey-900); text-decoration: none; letter-spacing: .02em;
}

/* ---------- Logo (image with drawn fallback) ---------- */
.logo {
  position: relative; display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex: none;
}
.logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 24%; }
.logo--fallback { border-radius: 30%; background: var(--teal-500); }
.logo--fallback::before, .logo--fallback::after {
  content: ""; position: absolute; background: var(--white); border-radius: 2px;
}
.logo--fallback::before { width: 22%; height: 60%; }
.logo--fallback::after  { width: 60%; height: 22%; }
.logo-xl { width: 170px; height: 170px; }
.logo-xl img { border-radius: 0; -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 70%); mask-image: radial-gradient(circle, #000 52%, transparent 70%); }
.logo-lg { width: 64px; height: 64px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  font: 600 .95rem/1 var(--font);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--teal-100); outline-offset: 1px;
}

.btn-primary { background: var(--teal-500); color: var(--on-accent); }
.btn-primary:hover { background: var(--teal-600); }
.btn-ghost { background: var(--white); color: var(--grey-900); border-color: var(--grey-200); }
.btn-ghost:hover { border-color: var(--teal-400); color: var(--teal-700); }
.btn-soft { background: var(--teal-50); color: var(--teal-700); }
.btn-soft:hover { background: var(--teal-100); }
.btn-danger-ghost { background: var(--white); color: var(--red); border-color: var(--grey-200); }
.btn-danger-ghost:hover { border-color: var(--red); }
.btn.is-armed, .btn.is-armed:hover { background: var(--red); border-color: var(--red); color: var(--on-accent); }
.btn-sm { padding: 8px 12px; font-size: .875rem; }
.btn-lg { padding: 15px 24px; font-size: 1.05rem; }
.btn-xl {
  padding: 20px 40px; font-size: 1.2rem; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(16, 163, 151, .4);
}
.btn-xl svg { width: 22px; height: 22px; }
.btn-block { width: 100%; }

/* ---------- Demo banner ---------- */
.demo-banner {
  padding: 8px 16px; text-align: center; font-size: .85rem;
  background: var(--amber-50); color: #7a5208; border-bottom: 1px solid #f3dfb5;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(82vh, 780px);
  display: flex; align-items: center;
  padding: 40px 0 64px; text-align: center;
  color: var(--on-accent);
  background: var(--ink-800);
}
.hero-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }

/* ---------- Interactive grid background (js/grid-bg.js) ---------- */
.hero-grid { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }
.hero-shade { /* keeps the text readable on top of the grid */
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 560px 400px at 50% 50%, rgba(39,44,48,.72), rgba(39,44,48,0) 100%),
    linear-gradient(to bottom, rgba(39,44,48,0) 75%, rgba(39,44,48,.9));
}
.hero .lead { text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.hero .logo-xl { margin-bottom: 4px; }
.wordmark {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.8rem, 9vw, 5rem); letter-spacing: .05em;
  color: var(--on-accent);
}
.wordmark span { color: var(--teal-400); }
.tagline {
  margin: 6px 0 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.15rem, 3.6vw, 1.6rem); letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal-400);
}
.lead { max-width: 560px; margin: 22px auto 30px; font-size: 1.1rem; color: #b9c3ca; }
.lead strong { color: var(--on-accent); }

.pills {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 30px 0 0; padding: 0; list-style: none;
}
.pills li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  font-size: .875rem; font-weight: 500; color: #d5dce1;
}
.pills li::before { content: "✓"; color: var(--teal-400); font-weight: 700; }

.active-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  margin: 0 auto 20px; padding: 10px 16px; max-width: 520px;
  background: rgba(16,163,151,.14); border: 1px solid var(--teal-400); border-radius: 999px;
  font-size: .925rem; color: var(--on-accent);
}
.active-banner a { color: var(--teal-400); font-weight: 600; }

/* ---------- How it works ---------- */
.how { padding: 48px 0 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 18px; background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius); }
.step-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 8px;
  border-radius: 50%; background: var(--teal-50); color: var(--teal-700); font-weight: 700; font-size: .875rem;
}
.steps h3 { font-size: 1rem; margin-bottom: 4px; }
.steps p { margin: 0; font-size: .9rem; color: var(--grey-500); }

/* ---------- Cards & sections ---------- */
.section { padding: 40px 0 64px; scroll-margin-top: 70px; }
.section-title { font-family: var(--font-display); font-size: 1.75rem; margin-bottom: 6px; }
.section-sub { margin: 0 0 22px; color: var(--grey-500); }
.card {
  background: var(--white); border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 28px; }

/* ---------- Form ---------- */
.form-block { padding: 22px 26px; border-bottom: 1px solid var(--grey-100); }
.form-block:last-of-type { border-bottom: 0; }
.form-block > h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; margin-bottom: 14px;
}
.form-block > h3 .n {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--teal-500); color: var(--on-accent); font-size: .78rem;
}
.form-block > h3 .opt { font-weight: 500; font-size: .8rem; color: var(--grey-500); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > span, .label { font-size: .875rem; font-weight: 600; color: var(--grey-700); }
.req-star { color: var(--red); }
.hint { font-size: .8rem; color: var(--grey-500); font-weight: 400; }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px;
  font: 400 1rem/1.3 var(--font); color: var(--grey-900);
  background: var(--white); border: 1px solid var(--grey-300); border-radius: var(--radius-sm);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal-500); outline: none; box-shadow: 0 0 0 3px var(--teal-100); }
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--grey-500) 50%), linear-gradient(135deg, var(--grey-500) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* Help-type tiles */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { position: relative; cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-body {
  display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%;
  padding: 16px 10px; text-align: center;
  border: 1.5px solid var(--grey-200); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color .15s, background .15s;
}
.tile-body svg { width: 30px; height: 30px; color: var(--teal-500); }
.tile-body b { font-size: .95rem; }
.tile-body small { font-size: .78rem; color: var(--grey-500); line-height: 1.3; }
.tile:hover .tile-body { border-color: var(--teal-400); }
.tile input:checked + .tile-body { border-color: var(--teal-500); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--teal-500); }
.tile input:focus-visible + .tile-body { outline: 3px solid var(--teal-100); }

/* Segmented control & chips */
.seg, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label, .chips label { position: relative; cursor: pointer; }
.seg input, .chips input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .chips span {
  display: inline-block; padding: 9px 14px;
  border: 1.5px solid var(--grey-200); border-radius: 999px; background: var(--white);
  font-size: .9rem; font-weight: 500; color: var(--grey-700);
  transition: all .15s;
}
.seg label:hover span, .chips label:hover span { border-color: var(--teal-400); }
.seg input:checked + span, .chips input:checked + span { background: var(--teal-500); border-color: var(--teal-500); color: var(--on-accent); }
.seg input:focus-visible + span, .chips input:focus-visible + span { outline: 3px solid var(--teal-100); }
.seg .danger input:checked + span { background: var(--red); border-color: var(--red); }
.seg .warn input:checked + span { background: var(--amber); border-color: var(--amber); }
.seg .ok input:checked + span { background: var(--green); border-color: var(--green); }

.inline-num { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; color: var(--grey-700); }
.inline-num input { width: 90px; }

.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; cursor: pointer; font-size: .925rem; color: var(--grey-700); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal-500); flex: none; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check-row .check { margin-top: 4px; }

.sub-panel { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--grey-50); border: 1px dashed var(--grey-200); }

.form-foot { padding: 22px 26px 26px; background: var(--grey-50); border-top: 1px solid var(--grey-200); border-radius: 0 0 var(--radius) var(--radius); }
.form-foot p { margin: 10px 0 0; text-align: center; font-size: .82rem; color: var(--grey-500); }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 14px; }
.alert-error { background: var(--red-50); color: #9d2227; border: 1px solid #f5c5c7; }
.alert-error ul { margin: 4px 0 0; padding-left: 18px; }
.alert-info { background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-100); }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 16px 40px; text-align: center; font-size: .82rem; color: var(--grey-500); border-top: 1px solid var(--grey-200); background: var(--white); }
.site-footer p { margin: 4px 0; }

/* ---------- Status page ---------- */
.page { padding: 36px 0 64px; }
.status-head { padding: 28px 28px 22px; text-align: center; border-bottom: 1px solid var(--grey-100); }
.status-head .big { font-family: var(--font-display); font-size: 1.6rem; margin: 10px 0 4px; color: var(--grey-900); }
.status-head p { margin: 0; color: var(--grey-500); }
.pulse {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--teal-500);
  box-shadow: 0 0 0 0 rgba(18,168,181,.6); animation: pulse 1.6s infinite;
}
.pulse.ok { background: var(--green); animation: none; }
.pulse.off { background: var(--grey-300); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 14px rgba(18,168,181,0); } 100% { box-shadow: 0 0 0 0 rgba(18,168,181,0); } }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 22px 28px; margin: 0; list-style: none; }
.stepper li { text-align: center; font-size: .8rem; color: var(--grey-500); }
.stepper li::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--grey-200); margin-bottom: 8px; }
.stepper li.done::before { background: var(--teal-500); }
.stepper li.now { color: var(--grey-900); font-weight: 600; }
.stepper li.now::before { background: var(--teal-500); }

.status-body { padding: 0 28px 28px; }
.tips { margin: 0 0 20px; padding: 14px 16px 14px 34px; background: var(--teal-50); border-radius: var(--radius-sm); color: var(--teal-700); font-size: .9rem; }
.tips li { margin: 2px 0; }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------- Countdown ---------- */
.countdown {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 108px; padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--grey-100); color: var(--grey-900);
}
.cd-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--grey-500); }
.cd-time { font: 700 1.5rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.countdown.is-warn { background: var(--amber-50); color: #8a5a00; }
.countdown.is-crit, .countdown.is-over { background: var(--red-50); color: var(--red); }
.countdown.is-crit .cd-time { animation: blink 1s steps(2) infinite; }
.countdown.is-none { background: var(--green-50); color: var(--green); }
.countdown.is-none .cd-time { font-size: 1rem; }
@keyframes blink { 50% { opacity: .45; } }
.status-countdown { display: flex; justify-content: center; margin: 0 0 22px; }
.status-countdown .countdown { min-width: 180px; padding: 12px 22px; }
.status-countdown .cd-time { font-size: 2.2rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; letter-spacing: .01em;
  background: var(--grey-100); color: var(--grey-700);
}
.badge-teal { background: var(--teal-50); color: var(--teal-700); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: #8a5a00; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-solid { background: var(--teal-500); color: var(--on-accent); }

/* ---------- Facts list (summary) ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-500); }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.facts dd.bad { color: var(--red); font-weight: 700; }
.facts dd.good { color: var(--green); }

/* ---------- Login ---------- */
.login-wrap { min-height: calc(100vh - 58px); display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 32px; text-align: center; }
.login-card .logo-lg { margin: 0 auto 14px; }
.login-card h1 { font-family: var(--font-display); font-size: 1.6rem; }
.login-card > p { margin: 6px 0 22px; color: var(--grey-500); font-size: .925rem; }
.login-card form { text-align: left; }
.login-note { margin-top: 20px; font-size: .82rem; color: var(--grey-500); }

/* ---------- Medic dashboard ---------- */
body.is-loading main { visibility: hidden; }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 28px 0 18px; }
.dash-head h1 { font-family: var(--font-display); font-size: 1.6rem; }
.dash-head p { margin: 2px 0 0; color: var(--grey-500); font-size: .9rem; }
.tabs { display: inline-flex; padding: 4px; background: var(--grey-100); border-radius: 999px; }
.tabs button {
  padding: 8px 16px; border: 0; border-radius: 999px; background: transparent;
  font: 600 .9rem var(--font); color: var(--grey-700); cursor: pointer;
}
.tabs button.is-active { background: var(--white); color: var(--grey-900); box-shadow: var(--shadow); }
.tabs .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--teal-500); color: var(--on-accent); font-size: .75rem; }
.tabs .count.zero { background: var(--grey-300); }

.me-chip { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; color: var(--grey-700); }
.me-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.req-list { display: grid; gap: 14px; padding-bottom: 48px; }
.req { overflow: hidden; }
.req.is-new { animation: flash 1.2s ease 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px var(--teal-400); } }
.req.status-open { border-left: 4px solid var(--red); }
.req.status-accepted { border-left: 4px solid var(--teal-500); }
.req.status-arrived { border-left: 4px solid var(--green); }
.req-main { padding: 18px 20px; }
.req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.req-age { margin-left: auto; font-size: .8rem; color: var(--grey-500); }
.req-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.req-who h3 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; overflow-wrap: anywhere; }
.req-loc { margin: 4px 0 0; font-weight: 600; color: var(--teal-700); }
.req-details { margin: 2px 0 0; color: var(--grey-700); font-size: .925rem; }
.player-note { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--grey-50); border: 1px solid var(--grey-100); font-size: .9rem; color: var(--grey-700); white-space: pre-wrap; overflow-wrap: anywhere; }
.player-note b { color: var(--grey-900); }
.responders { margin: 12px 0 0; font-size: .875rem; color: var(--grey-700); }
.responders b { color: var(--teal-700); }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--grey-200); border-radius: 7px; background: var(--white); color: var(--grey-500); cursor: pointer; }
.icon-btn:hover { color: var(--teal-600); border-color: var(--teal-400); }
.icon-btn svg { width: 15px; height: 15px; }

.req-notes { padding: 14px 20px 16px; background: var(--grey-50); border-top: 1px solid var(--grey-100); }
.req-notes h4 { margin: 0 0 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-500); }
.notes-list { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 6px; }
.notes-list li { font-size: .9rem; overflow-wrap: anywhere; }
.notes-list b { color: var(--teal-700); }
.notes-list time { margin-left: 6px; font-size: .75rem; color: var(--grey-500); }
.notes-empty { font-size: .85rem; color: var(--grey-500); }
.note-form { display: flex; gap: 8px; }
.note-form input { padding: 8px 12px; font-size: .9rem; }

.history-row { padding: 14px 18px; }
.history-row .req-head { margin-bottom: 6px; }
.history-row p { margin: 0; font-size: .9rem; color: var(--grey-700); }

.empty { padding: 48px 16px; text-align: center; color: var(--grey-500); }
.empty b { display: block; margin-bottom: 4px; font-size: 1.05rem; color: var(--grey-700); }

.sound-on { color: var(--teal-700); border-color: var(--teal-400); background: var(--teal-50); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 50;
  padding: 10px 18px; border-radius: 999px; background: var(--grey-900); color: var(--grey-50);
  font-size: .9rem; opacity: 0; pointer-events: none; transition: all .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand-text { display: none; }
  .hide-sm { display: none; }
  .hero { padding: 44px 0 52px; }
  .btn-xl { padding: 18px 30px; width: 100%; max-width: 340px; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .grid-2 .field { margin-bottom: 14px; }
  .form-block, .form-foot { padding-left: 18px; padding-right: 18px; }
  .card-pad, .status-head, .stepper, .status-body { padding-left: 18px; padding-right: 18px; }
  .req-main { padding: 16px; }
  .req-top { flex-direction: column; }
  .req-notes { padding: 12px 16px; }
  .stepper li { font-size: .7rem; }
  .login-card { padding: 26px 20px; }
}

/* =========================================================
   Site navigation
   ========================================================= */
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav > a:not(.btn) { font-size: .9rem; font-weight: 600; color: var(--grey-700); text-decoration: none; }
.topnav > a:not(.btn):hover, .topnav > a.is-current { color: var(--teal-600); }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-bottom: 14px; }
.footer-nav a { color: var(--grey-700); font-weight: 600; text-decoration: none; }
.footer-nav a:hover { color: var(--teal-600); }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--teal-600); cursor: pointer; text-decoration: underline; }

/* =========================================================
   Home: live strip (medics on duty, counter, ticker)
   ========================================================= */
.live-strip { background: var(--white); border-bottom: 1px solid var(--grey-200); }
.live-inner { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 36px; padding-top: 16px; padding-bottom: 16px; max-width: 1180px; }
.live-stat { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--grey-700); }
.live-stat b { font-family: var(--font-display); font-size: 1.25rem; color: var(--grey-900); font-variant-numeric: tabular-nums; }
.live-stat svg { width: 20px; height: 20px; color: var(--teal-500); flex: none; }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--grey-300); }
.live-dot.on { background: var(--green); box-shadow: 0 0 0 0 rgba(35,162,109,.5); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgba(35,162,109,0); } 100% { box-shadow: 0 0 0 0 rgba(35,162,109,0); } }

.ticker { display: flex; align-items: center; border-top: 1px solid var(--grey-100); background: var(--grey-50); overflow: hidden; }
.ticker-tag {
  display: flex; align-items: center; gap: 8px; flex: none; padding: 10px 16px;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; color: var(--teal-700);
  background: var(--teal-50); border-right: 1px solid var(--teal-100);
}
.ticker-tag .live-dot { width: 8px; height: 8px; }
.ticker-viewport { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: inline-flex; white-space: nowrap; animation: ticker 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick-item { padding: 10px 28px; font-size: .875rem; color: var(--grey-700); position: relative; }
.tick-item::after { content: "•"; position: absolute; right: -3px; color: var(--teal-400); }
.tick-item b { color: var(--grey-900); font-weight: 600; }
.tick-item time { margin-left: 6px; font-size: .78rem; color: var(--grey-500); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-viewport { overflow-x: auto; }
}

/* =========================================================
   Home: holographic system map (js/holo-map.js)
   ========================================================= */
.holo { padding: 64px 0; background: var(--ink-800); color: var(--on-accent); overflow: hidden; }
.holo-inner { display: grid; grid-template-columns: 1.75fr 1fr; gap: 40px; align-items: center; }
.holo-stage {
  position: relative; aspect-ratio: 16 / 11; border-radius: 20px; overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 50% 56%, #30373d, #1d2124 72%);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 0 80px rgba(0,0,0,.45);
}
.holo-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-stage { aspect-ratio: 21 / 9; background: #1b2023; }
/* battle scene: full-width strip on top, copy + live numbers in a row below */
.scene-layout { grid-template-columns: 1.2fr 1fr; gap: 28px 56px; align-items: start; }
.scene-layout .scene-stage { grid-column: 1 / -1; }
.scene-layout .holo-copy .btn { margin-top: 22px; }
.scene-layout .holo-stats { margin: 0; }
/* 3D rescue scene (js/rescue-3d.js): light studio backdrop shown while Three.js loads */
.scene3d { background: radial-gradient(ellipse 80% 70% at 50% 45%, #d2d6d8, #b9bfc2); box-shadow: none; border-color: rgba(255,255,255,.12); }
.scene3d canvas { display: block; }
.scene3d .holo-tag { z-index: 1; }
.scene-fallback { position: absolute; inset: 0; display: none; place-items: center; margin: 0; color: #4b555c; font-size: .9rem; }
.scene3d.is-failed .scene-fallback { display: grid; }
.holo-tag {
  position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px; pointer-events: none;
  background: rgba(22,26,29,.75); border: 1px solid rgba(255,255,255,.1);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #cfd8dd;
}
.holo-tag .live-dot { width: 8px; height: 8px; }
.holo-hint { position: absolute; right: 14px; bottom: 12px; font-size: .75rem; color: rgba(207,216,221,.55); pointer-events: none; }
.eyebrow { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-400); }
.holo-copy h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.3rem); color: var(--on-accent); }
.holo-copy > p { margin: 12px 0 0; color: #b9c3ca; }
.holo-stats { display: grid; gap: 14px; margin: 26px 0 28px; }
.holo-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.holo-stats dt { font-size: .9rem; color: #b9c3ca; }
.holo-stats dd { margin: 0; font: 700 2.4rem/1 var(--font-display); color: var(--on-accent); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .holo-inner { grid-template-columns: 1fr; gap: 28px; }
  .holo { padding: 44px 0; }
}
@media (max-width: 560px) {
  .holo-stage { aspect-ratio: 16 / 10; border-radius: 14px; }
  .holo-stats dd { font-size: 2rem; }
}

/* =========================================================
   Help request form: every step is its own card
   ========================================================= */
.form-steps { display: grid; gap: 16px; }
.form-steps .form-block {
  position: relative; overflow: hidden;
  padding: 22px 26px 24px;
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.form-steps .form-block:last-of-type { border-bottom: 1px solid var(--grey-200); }
.form-steps .form-block::before {   /* turquoise accent on the left edge */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--teal-100); transition: background .2s;
}
.form-steps .form-block:focus-within { border-color: var(--teal-400); box-shadow: 0 0 0 3px var(--teal-50), var(--shadow); }
.form-steps .form-block:focus-within::before { background: var(--teal-500); }
.form-steps .form-block > h3 {
  margin: -2px 0 18px; padding-bottom: 14px;
  font-size: 1.05rem; border-bottom: 1px dashed var(--grey-200);
}
.form-steps .form-block > h3 .n { width: 28px; height: 28px; font-size: .85rem; }
.form-steps .form-foot {
  border: 1px solid var(--grey-200); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow);
}
@media (max-width: 560px) {
  .form-steps { gap: 12px; }
  .form-steps .form-block { padding: 18px 18px 20px; }
}

/* Request form: remember me */
.remember-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--grey-200); }
.remember-row .check { margin-top: 0; }
.remember-row .link-btn { font-size: .85rem; }

/* =========================================================
   Status page: alerts, chat, thanks
   ========================================================= */
.stack { display: grid; gap: 16px; }
.alert-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--teal-50); border: 1px solid var(--teal-100);
}
.alert-bar b { display: block; color: var(--teal-700); }
.alert-bar span { font-size: .875rem; color: var(--grey-700); }
.alert-bar.is-on { background: var(--green-50); border-color: #bfe7d4; }
.alert-bar.is-on b { color: var(--green); }

.chat-card { overflow: hidden; }
.chat-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--grey-100); }
.chat-head h2, .card-title { font-family: var(--font-display); font-size: 1.2rem; }
.chat-head p, .card-sub { margin: 2px 0 0; font-size: .875rem; color: var(--grey-500); }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; margin: 0; padding: 16px 22px; list-style: none; }
.chat-small { max-height: 200px; padding: 0; margin-bottom: 10px; }
.msg { align-self: flex-start; max-width: 85%; padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: var(--grey-100); }
.msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: var(--teal-50); }
.msg-who { display: block; font-size: .72rem; font-weight: 700; color: var(--teal-700); }
.msg-text { display: block; font-size: .925rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg time { display: block; margin-top: 2px; font-size: .7rem; color: var(--grey-500); text-align: right; }
.chat-empty { font-size: .875rem; color: var(--grey-500); }
.chat-form { display: flex; gap: 8px; padding: 12px 22px 18px; }
.chat-form input { padding: 9px 12px; font-size: .925rem; }
.req-comms .chat-form { padding: 0; }

.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-bottom: 16px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 2.1rem; line-height: 1; color: var(--grey-300); cursor: pointer; transition: color .1s, transform .1s; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f5b301; }
.star-input label:hover { transform: scale(1.1); }
.star-input input:focus-visible + label { outline: 3px solid var(--teal-100); border-radius: 4px; }
.stars-show { margin: 6px 0; font-size: 1.3rem; letter-spacing: 2px; color: #f5b301; }
.thanks-quote { margin: 8px 0; font-size: 1.05rem; font-style: italic; color: var(--grey-700); }

/* =========================================================
   Medic header: on-duty switch, theme button
   ========================================================= */
.duty-switch {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px;
  border: 1px solid var(--grey-200); border-radius: 999px; background: var(--white);
  font: inherit; color: var(--grey-900); cursor: pointer; text-align: left;
}
.duty-knob {
  position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px;
  background: var(--grey-300); transition: background .2s;
}
.duty-knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s;
}
.duty-switch.is-on .duty-knob { background: var(--green); }
.duty-switch.is-on .duty-knob::after { transform: translateX(16px); }
.duty-text { display: flex; flex-direction: column; line-height: 1.15; }
.duty-text b { font-size: .85rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty-text small { font-size: .72rem; font-weight: 600; color: var(--grey-500); }
.duty-switch.is-on small { color: var(--green); }

#themeBtn .i-sun { display: none; }   /* light theme shows the moon (switch to dark) */
html:not([data-theme="light"]) #themeBtn .i-sun { display: block; }
html:not([data-theme="light"]) #themeBtn .i-moon { display: none; }

.tabs a {
  padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  color: var(--grey-700); text-decoration: none;
}
.tabs a:hover { color: var(--grey-900); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 14px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-label { margin-right: 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-500); }
.filter-group button {
  padding: 6px 12px; border: 1px solid var(--grey-200); border-radius: 999px; background: var(--white);
  font: 500 .85rem var(--font); color: var(--grey-700); cursor: pointer;
}
.filter-group button:hover { border-color: var(--teal-400); }
.filter-group button.is-active { background: var(--teal-500); border-color: var(--teal-500); color: var(--on-accent); }
.filter-note { margin: -4px 0 14px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--amber-50); font-size: .875rem; color: #7a5208; }

/* Chat + notes inside a request card */
.req-comms { display: grid; grid-template-columns: 1fr 1fr; background: var(--grey-50); border-top: 1px solid var(--grey-100); }
.comm { padding: 14px 20px 16px; min-width: 0; }
.comm + .comm { border-left: 1px solid var(--grey-100); }
.comm h4 { margin: 0 0 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-500); }
.comm h4 small { margin-left: 6px; font-size: .7rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--grey-500); opacity: .8; }
.comm .msg { background: var(--white); border: 1px solid var(--grey-100); }
.comm .msg.mine { background: var(--teal-50); border-color: var(--teal-100); }

/* =========================================================
   Stats page
   ========================================================= */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; }
.kpi-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-500); }
.kpi-value { font: 700 2rem/1.15 var(--font-display); color: var(--grey-900); font-variant-numeric: tabular-nums; }
.kpi-note { font-size: .82rem; color: var(--grey-500); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 48px; }
.stats-wide { grid-column: 1 / -1; }
.stats-card .card-sub { margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-size: .925rem; }
.board th { padding: 0 10px 8px; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-500); border-bottom: 1px solid var(--grey-200); }
.board td { padding: 10px; border-bottom: 1px solid var(--grey-100); vertical-align: middle; }
.board tr:last-child td { border-bottom: 0; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board .rank { width: 32px; color: var(--grey-500); font-variant-numeric: tabular-nums; }
.board td:nth-child(3) { width: 40%; min-width: 160px; }

.hbar-list { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; align-items: center; gap: 12px; padding: 2px 0; }
.hbar-label { font-size: .9rem; color: var(--grey-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { position: relative; display: block; height: 14px; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; min-width: 4px; border-radius: 0 4px 4px 0; background: var(--teal-500); transition: width .4s ease; }
.hbar:hover .hbar-fill, .cell-bar:hover .hbar-fill, .hbar:focus-visible .hbar-fill { background: var(--teal-600); }
.hbar-val { min-width: 2ch; font-size: .9rem; font-weight: 600; color: var(--grey-900); text-align: right; font-variant-numeric: tabular-nums; }
.cell-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.hbar:focus-visible, .cell-bar:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 4px; border-radius: 4px; }
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none; padding: 6px 10px; border-radius: 6px;
  background: var(--grey-900); color: var(--grey-50); font-size: .82rem; font-weight: 500; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* =========================================================
   Wall of thanks + Join pages
   ========================================================= */
.page-hero {
  padding: 56px 0 52px; text-align: center; color: var(--on-accent);
  background: radial-gradient(700px 300px at 50% 0%, var(--ink-700), transparent 80%), var(--ink-800);
}
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3rem); }
.page-hero p { max-width: 600px; margin: 12px auto 24px; color: #b9c3ca; font-size: 1.05rem; }
.page-hero p b { color: var(--teal-400); }
.section-alt { background: var(--white); border-top: 1px solid var(--grey-200); border-bottom: 1px solid var(--grey-200); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card svg { width: 30px; height: 30px; color: var(--teal-500); margin-bottom: 10px; }
.info-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.info-card p { margin: 0; color: var(--grey-700); }
.rule-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; max-width: 760px; }
.rule-list li { position: relative; padding: 12px 16px 12px 44px; background: var(--grey-50); border: 1px solid var(--grey-100); border-radius: var(--radius-sm); color: var(--grey-700); }
.rule-list li::before { content: "✓"; position: absolute; left: 16px; top: 11px; font-weight: 700; color: var(--teal-500); }
.rule-list b { color: var(--grey-900); }
.steps-4 { grid-template-columns: repeat(4, 1fr); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.thanks-grid { columns: 3 300px; column-gap: 16px; }
.thanks-card { break-inside: avoid; margin: 0 0 16px; padding: 20px 22px; }
.thanks-card blockquote { margin: 8px 0 14px; font-size: 1.02rem; color: var(--grey-900); }
.thanks-card blockquote.muted { color: var(--grey-500); font-style: italic; }
.thanks-card figcaption { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--grey-500); }
.thanks-card figcaption b { color: var(--teal-700); font-size: .925rem; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .steps-4 { grid-template-columns: 1fr 1fr; }
  .req-comms { grid-template-columns: 1fr; }
  .comm + .comm { border-left: 0; border-top: 1px solid var(--grey-100); }
}
@media (max-width: 760px) {
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topnav { gap: 10px; }
  .duty-text b { max-width: 70px; }
  .duty-switch { padding-right: 8px; }
  .topbar-right { gap: 4px; }
  .topbar-right .btn-sm { padding: 8px 9px; }
  .steps-4 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.6rem; }
  .comm { padding: 12px 16px 14px; }
  .live-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}


/* =========================================================
   DARK GLASS THEME (default)
   Near-black background with a drifting starfield, frosted
   glass cards and turquoise glows. Medic pages can switch to
   the light look with the sun/moon button (data-theme="light").
   ========================================================= */
html:not([data-theme="light"]) {
  color-scheme: dark;
  --page: #06080a;
  --white:    rgba(255, 255, 255, 0.045);
  --grey-50:  rgba(255, 255, 255, 0.025);
  --grey-100: rgba(255, 255, 255, 0.065);
  --grey-200: rgba(255, 255, 255, 0.1);
  --grey-300: rgba(255, 255, 255, 0.2);
  --grey-500: #8d99a1;
  --grey-700: #b9c3ca;
  --grey-900: #eef3f5;
  --teal-50:  rgba(25, 179, 166, 0.1);
  --teal-100: rgba(25, 179, 166, 0.24);
  --teal-500: #14ab9f;
  --teal-600: #3cc2b6;
  --teal-700: #77dcd2;
  --red-50:   rgba(224, 70, 76, 0.14);
  --amber-50: rgba(229, 154, 18, 0.14);
  --green-50: rgba(35, 162, 109, 0.16);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02));
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  background: var(--page);
}
html:not([data-theme="light"]) body { background: transparent; }
html:not([data-theme="light"]) ::selection { background: rgba(25, 179, 166, 0.45); color: #fff; }

/* glass surfaces */
html:not([data-theme="light"]) :is(.card, .form-steps .form-block, .form-steps .form-foot, .steps li, .alert-bar, .live-inner, .ticker, .duty-switch, .tabs) {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
html:not([data-theme="light"]) .tabs button.is-active { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
html:not([data-theme="light"]) .req.status-open { border-left: 4px solid var(--red); }
html:not([data-theme="light"]) .req.status-accepted { border-left: 4px solid var(--teal-500); }
html:not([data-theme="light"]) .req.status-arrived { border-left: 4px solid var(--green); }
html:not([data-theme="light"]) .form-steps .form-block:focus-within { border-color: rgba(60, 194, 182, 0.55); box-shadow: 0 0 0 3px rgba(25, 179, 166, 0.15), var(--glass-shadow); }

/* floating glass navigation */
html:not([data-theme="light"]) .topbar {
  top: 12px; margin: 12px auto 0; width: calc(100% - 24px); max-width: 1180px;
  border: 1px solid var(--glass-border); border-radius: 999px;
  background: rgba(14, 17, 20, 0.62);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
html:not([data-theme="light"]) .btn { border-radius: 999px; }
html:not([data-theme="light"]) .btn-ghost { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); color: var(--grey-900); }
html:not([data-theme="light"]) .btn-ghost:hover { border-color: rgba(60, 194, 182, 0.6); color: #fff; background: rgba(25, 179, 166, 0.12); }
html:not([data-theme="light"]) .btn-primary { box-shadow: 0 6px 24px rgba(20, 171, 159, 0.35); }
html:not([data-theme="light"]) .demo-banner { background: rgba(229, 154, 18, 0.12); color: #f3c46b; border-color: rgba(229, 154, 18, 0.25); }

/* sections float on the starfield instead of solid bands */
html:not([data-theme="light"]) :is(.hero, .holo, .page-hero) { background: transparent; }
html:not([data-theme="light"]) .hero {
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(25, 179, 166, 0.14), transparent 70%);
}
html:not([data-theme="light"]) .hero-shade {
  background:
    radial-gradient(ellipse 560px 400px at 50% 50%, rgba(6, 8, 10, 0.72), rgba(6, 8, 10, 0) 100%),
    linear-gradient(to bottom, rgba(6, 8, 10, 0) 70%, var(--page));
}
html:not([data-theme="light"]) .page-hero { background: radial-gradient(ellipse 55% 70% at 50% 0%, rgba(25, 179, 166, 0.16), transparent 70%); }
html:not([data-theme="light"]) .live-strip { background: transparent; border: 0; padding: 18px 16px 0; }
html:not([data-theme="light"]) .live-inner { max-width: 1148px; border-radius: 999px; padding: 14px 28px; }
html:not([data-theme="light"]) .ticker { max-width: 1148px; margin: 12px auto 0; border-radius: 999px; }
html:not([data-theme="light"]) .ticker-tag { border-right-color: rgba(255, 255, 255, 0.08); }
html:not([data-theme="light"]) .section-alt { background: transparent; border-color: transparent; }
html:not([data-theme="light"]) .site-footer { background: transparent; border-top-color: rgba(255, 255, 255, 0.07); }
html:not([data-theme="light"]) .logo-xl img { filter: contrast(1.45) brightness(0.95); }   /* blend the logo's dark square into the page */

/* forms */
html:not([data-theme="light"]) :is(input[type=text], input[type=email], input[type=password], input[type=number], select, textarea) {
  background-color: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.13); color: var(--grey-900);
}
html:not([data-theme="light"]) :is(input, textarea)::placeholder { color: rgba(185, 195, 202, 0.45); }
html:not([data-theme="light"]) :is(input, select, textarea):focus { border-color: var(--teal-400); box-shadow: 0 0 0 3px rgba(25, 179, 166, 0.2); }
html:not([data-theme="light"]) select option { background: #12161a; color: var(--grey-900); }
html:not([data-theme="light"]) .tile input:checked + .tile-body { background: rgba(25, 179, 166, 0.14); box-shadow: inset 0 0 0 1px var(--teal-500), 0 0 24px rgba(25, 179, 166, 0.25); }

/* status colours that were tuned for white */
html:not([data-theme="light"]) :is(.badge-amber, .countdown.is-warn, .filter-note) { color: #f3c46b; }
html:not([data-theme="light"]) :is(.countdown.is-crit, .countdown.is-over, .badge-red, .facts dd.bad) { color: #ff7b80; }
html:not([data-theme="light"]) :is(.badge-green, .countdown.is-none, .facts dd.good) { color: #4fd49a; }
html:not([data-theme="light"]) .alert-error { background: var(--red-50); color: #ffb3b6; border-color: rgba(224, 70, 76, 0.35); }
html:not([data-theme="light"]) .alert-bar.is-on { border-color: rgba(35, 162, 109, 0.4); }
html:not([data-theme="light"]) .toast, html:not([data-theme="light"]) .chart-tip {
  background: rgba(16, 20, 23, 0.92); color: var(--grey-900); border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
html:not([data-theme="light"]) .duty-knob::after { background: #e9eef1; }
html:not([data-theme="light"]) .hbar-fill { background: var(--teal-400); }
html:not([data-theme="light"]) :is(.hbar, .cell-bar):hover .hbar-fill { background: #77dcd2; }

/* 3D scene: dark studio while it loads */
html:not([data-theme="light"]) .scene3d { background: radial-gradient(ellipse 80% 70% at 50% 45%, #1b2125, #0d1012); border-color: rgba(255, 255, 255, 0.08); }
html:not([data-theme="light"]) .scene-fallback { color: var(--grey-500); }

/* headings: italic accent word + small turquoise line on top (like a label) */
:is(h1, h2) em {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 400; letter-spacing: 0;
  color: var(--teal-400);
}
.section-title::before, .holo-copy h2::before {
  content: ""; display: block; width: 32px; height: 2px; margin-bottom: 14px; border-radius: 2px;
  background: linear-gradient(90deg, var(--teal-400), transparent);
}

/* =========================================================
   Ambient motion (js/ambient.js)
   ========================================================= */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; will-change: transform; }
.orb-1 { width: 520px; height: 520px; left: -140px; top: 10%; background: rgba(20, 171, 159, 0.22); animation: orb-a 28s ease-in-out infinite alternate; }
.orb-2 { width: 460px; height: 460px; right: -160px; top: 45%; background: rgba(40, 90, 160, 0.2); animation: orb-b 34s ease-in-out infinite alternate; }
.orb-3 { width: 380px; height: 380px; left: 35%; bottom: -160px; background: rgba(20, 171, 159, 0.14); animation: orb-a 40s ease-in-out infinite alternate-reverse; }
@keyframes orb-a { to { transform: translate(120px, 80px) scale(1.15); } }
@keyframes orb-b { to { transform: translate(-140px, -60px) scale(0.9); } }
html[data-theme="light"] .ambient { display: none; }

/* spotlight that follows the mouse over glass cards */
.spot { position: relative; }
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(60, 194, 182, 0.13), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.spot:hover::after { opacity: 1; }
.spot.edge-glow:hover { border-color: rgba(60, 194, 182, 0.35); }

/* shine sweeping across turquoise buttons */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg); animation: shine 4.5s ease-in-out infinite;
}
.btn-primary:hover::after { animation-duration: 1.4s; }
@keyframes shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* gentle float on icons, numbers that glow */
.tile:hover .tile-body svg, .info-card:hover svg { animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.step-num { box-shadow: 0 0 0 0 rgba(25, 179, 166, 0.4); animation: ring 3s ease-out infinite; }
.steps li:nth-child(2) .step-num { animation-delay: 1s; }
.steps li:nth-child(3) .step-num { animation-delay: 2s; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(25, 179, 166, 0.45); } 60%, 100% { box-shadow: 0 0 0 10px rgba(25, 179, 166, 0); } }
html:not([data-theme="light"]) .holo-stats dd, html:not([data-theme="light"]) .kpi-value { text-shadow: 0 0 24px rgba(60, 194, 182, 0.35); }

@media (prefers-reduced-motion: reduce) {
  .orb, .btn-primary::after, .step-num, .tile:hover .tile-body svg, .info-card:hover svg { animation: none !important; }
}
@media (max-width: 560px) {
  html:not([data-theme="light"]) .topbar { top: 8px; margin-top: 8px; width: calc(100% - 16px); }
  html:not([data-theme="light"]) .live-inner { border-radius: var(--radius); padding: 14px 18px; }
  .orb { filter: blur(60px); }
}
