/* ==========================================================================
   Shop SOS — design tokens
   Style: Dark Mode (OLED) / control-room. Type: Inter + JetBrains Mono.
   ========================================================================== */

:root {
  /* Surfaces — deep navy stack */
  --navy-950: #050A14;
  --navy-900: #0A1120;
  --navy-850: #0E1728;
  --navy-800: #131F35;
  --navy-700: #1B2A45;
  --line: #22314F;
  --line-soft: #17243C;

  /* Text */
  --text: #F2F6FC;
  --text-2: #A7B4CC;
  --text-3: #6E7E9B;

  /* Semantic */
  --red: #DC2626;
  --red-400: #EF4444;
  --red-300: #F87171;
  --red-wash: rgba(220, 38, 38, .13);
  --blue: #2563EB;
  --sky: #38BDF8;
  --sky-wash: rgba(56, 189, 248, .12);
  --green: #16A34A;
  --green-400: #22C55E;
  --green-wash: rgba(34, 197, 94, .12);
  --amber: #F59E0B;
  --amber-wash: rgba(245, 158, 11, .12);
  --white: #FFFFFF;

  /* Spacing — 4/8 rhythm, density 7/10 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, .6);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --dur: 200ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  /* z-index scale */
  --z-nav: 40;
  --z-sheet: 100;
  --z-alarm: 900;
  --z-lock: 1000;
  --z-toast: 1200;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--navy-950);
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--sky); }

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--navy-700); border-radius: 8px; }

/* ==========================================================================
   App shell
   ========================================================================== */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(37, 99, 235, .12), transparent 62%),
    var(--navy-950);
}

.screen {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + var(--s-4)) var(--s-4) var(--s-6);
}

.screen--nav { padding-bottom: calc(84px + var(--safe-b)); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: calc(var(--safe-t) * -1 - var(--s-4)) calc(var(--s-4) * -1) var(--s-4);
  padding: calc(var(--safe-t) + var(--s-3)) var(--s-4) var(--s-3);
  background: rgba(5, 10, 20, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-3);
}

.iconbtn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--text-2);
  background: transparent;
  transition: background var(--dur), color var(--dur);
  flex: none;
}
.iconbtn:hover { background: var(--navy-800); color: var(--text); }
.iconbtn:active { background: var(--navy-700); }

/* Bottom navigation — max 5 items, icon + label */
.bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: var(--z-nav);
  width: 100%;
  max-width: 560px;
  display: flex;
  padding: var(--s-2) var(--s-2) calc(var(--s-2) + var(--safe-b));
  background: rgba(10, 17, 32, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
}

.navitem {
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--r-md);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: color var(--dur), background var(--dur);
}
.navitem:active { background: var(--navy-800); }
.navitem[aria-current="page"] { color: var(--red-300); }
.navitem__dot {
  position: absolute;
  transform: translate(14px, -14px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-400);
  box-shadow: 0 0 0 2px var(--navy-900);
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin: 0 0 var(--s-1); }
.h2 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; margin: 0; }
.sub { color: var(--text-2); font-size: 14px; margin: 0; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }
.section { margin-top: var(--s-6); }
.stack { display: grid; gap: var(--s-3); }
.stack--sm { display: grid; gap: var(--s-2); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Cards, lists, tiles
   ========================================================================== */

.card {
  background: linear-gradient(180deg, var(--navy-850), var(--navy-900));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
}

.card--flat { background: var(--navy-900); }
.card--danger { border-color: rgba(220, 38, 38, .45); background: linear-gradient(180deg, rgba(220, 38, 38, .12), var(--navy-900)); }
.card--tap { width: 100%; text-align: left; transition: transform var(--dur) var(--ease-out), border-color var(--dur); }
.card--tap:active { transform: scale(.985); border-color: var(--line); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }

.tile {
  background: var(--navy-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  display: grid;
  gap: 2px;
}
.tile__value { font-family: var(--mono); font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile__label { font-size: 11px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase; color: var(--text-3); }
.tile--alert { border-color: rgba(220, 38, 38, .4); background: linear-gradient(180deg, var(--red-wash), var(--navy-900)); }
.tile--alert .tile__value { color: var(--red-300); }

.list { display: grid; gap: var(--s-2); }

.listitem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 60px;
  padding: var(--s-3);
  text-align: left;
  background: var(--navy-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  transition: transform var(--dur) var(--ease-out), border-color var(--dur), background var(--dur);
}
.listitem:active { transform: scale(.99); background: var(--navy-850); }
.listitem__title { font-size: 15px; font-weight: 600; }
.listitem__meta { font-size: 12.5px; color: var(--text-3); }

.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--navy-800);
  border: 1px solid var(--line);
  color: var(--sky);
}
.avatar--red { color: var(--red-300); background: var(--red-wash); border-color: rgba(220, 38, 38, .35); }
.avatar--green { color: var(--green-400); background: var(--green-wash); border-color: rgba(34, 197, 94, .3); }

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-2);
  padding: var(--s-8) var(--s-4);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  color: var(--text-3);
}
.empty svg { color: var(--navy-700); }

/* ==========================================================================
   Badges & chips
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--red { color: var(--red-300); background: var(--red-wash); border-color: rgba(220, 38, 38, .4); }
.badge--green { color: var(--green-400); background: var(--green-wash); border-color: rgba(34, 197, 94, .35); }
.badge--amber { color: var(--amber); background: var(--amber-wash); border-color: rgba(245, 158, 11, .35); }
.badge--sky { color: var(--sky); background: var(--sky-wash); border-color: rgba(56, 189, 248, .35); }
.badge--grey { color: var(--text-3); background: var(--navy-800); border-color: var(--line); }

.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--red .badge__dot { animation: blink 1s steps(1, end) infinite; }

.simtag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-wash);
  border: 1px dashed rgba(245, 158, 11, .5);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .1px;
  color: var(--text);
  background: var(--navy-800);
  border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease-out), background var(--dur), border-color var(--dur), opacity var(--dur);
}
.btn:active { transform: scale(.97); }
.btn--block { width: 100%; }
.btn--primary { background: var(--red); border-color: var(--red-400); color: var(--white); box-shadow: 0 6px 18px rgba(220, 38, 38, .28); }
.btn--primary:hover { background: var(--red-400); }
.btn--blue { background: var(--blue); border-color: #3B82F6; color: var(--white); }
.btn--green { background: var(--green); border-color: var(--green-400); color: var(--white); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn--ghost:hover { color: var(--text); background: var(--navy-850); }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); font-size: 13.5px; }
.btn[disabled] { opacity: .42; pointer-events: none; }
.btn--danger-text { color: var(--red-300); border-color: rgba(220, 38, 38, .35); background: transparent; }

.btnrow { display: flex; gap: var(--s-3); }
.btnrow > * { flex: 1; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { display: grid; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 650; color: var(--text-2); letter-spacing: .2px; }
.field__req { color: var(--red-300); }
.field__help { font-size: 12px; color: var(--text-3); }
.field__error { font-size: 12.5px; color: var(--red-300); display: flex; align-items: center; gap: 5px; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s-4);
  font-size: 16px; /* prevents iOS zoom-on-focus */
  color: var(--text);
  background: var(--navy-900);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--dur), background var(--dur);
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--sky); background: var(--navy-850); outline: none; }
.input[aria-invalid="true"] { border-color: var(--red); }
.input--pw { padding-right: 52px; }

.pwwrap { position: relative; }
.pwwrap .iconbtn { position: absolute; right: 2px; top: 0; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-1);
  padding: var(--s-1);
  background: var(--navy-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.segbtn {
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  transition: background var(--dur), color var(--dur);
}
.segbtn[aria-pressed="true"] { background: var(--navy-700); color: var(--text); box-shadow: var(--shadow-1); }
.segbtn[aria-pressed="true"] svg { color: var(--red-300); }

/* Selectable row (checkbox card) */
.check {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 58px;
  padding: var(--s-3);
  text-align: left;
  background: var(--navy-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  transition: border-color var(--dur), background var(--dur), transform var(--dur) var(--ease-out);
}
.check:active { transform: scale(.99); }
.check[aria-checked="true"] { border-color: rgba(56, 189, 248, .55); background: linear-gradient(180deg, var(--sky-wash), var(--navy-900)); }
.check__box {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 2px solid var(--line);
  color: transparent;
  transition: border-color var(--dur), background var(--dur), color var(--dur);
}
.check[aria-checked="true"] .check__box { background: var(--sky); border-color: var(--sky); color: var(--navy-950); }

/* ==========================================================================
   SOS button — press & hold 3s
   ========================================================================== */

.soswrap { display: grid; justify-items: center; gap: var(--s-4); padding: var(--s-4) 0; }

.sosbtn {
  position: relative;
  width: min(74vw, 268px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 34%, #F04444, #B91C1C 62%, #7F1D1D);
  border: 2px solid rgba(255, 255, 255, .18);
  box-shadow: 0 0 0 10px rgba(220, 38, 38, .09), 0 0 0 22px rgba(220, 38, 38, .05), 0 24px 60px rgba(220, 38, 38, .3);
  color: var(--white);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease-out), box-shadow var(--dur);
}
.sosbtn[disabled] { background: radial-gradient(circle at 50% 34%, #47506A, #2A3247 65%, #202739); box-shadow: none; opacity: .6; }
.sosbtn.is-holding { transform: scale(.955); box-shadow: 0 0 0 14px rgba(220, 38, 38, .16), 0 0 0 30px rgba(220, 38, 38, .08); }

.sosbtn__inner { display: grid; justify-items: center; gap: 2px; z-index: 2; pointer-events: none; }
.sosbtn__label { font-size: 44px; font-weight: 800; letter-spacing: 5px; line-height: 1; text-shadow: 0 0 18px rgba(0, 0, 0, .35); }
.sosbtn__hint { font-size: 12px; font-weight: 650; letter-spacing: 1.6px; text-transform: uppercase; opacity: .85; }

.sosring { position: absolute; inset: -3px; transform: rotate(-90deg); pointer-events: none; }
.sosring__track { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 5; }
.sosring__bar { fill: none; stroke: var(--white); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 80ms linear; }

.soscount {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--red-300);
  min-height: 20px;
}

/* PIN pad */
.pindots { display: flex; justify-content: center; gap: var(--s-3); margin: var(--s-4) 0 var(--s-5); }
.pindot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line); transition: background var(--dur), border-color var(--dur), transform var(--dur); }
.pindot.is-filled { background: var(--red-400); border-color: var(--red-400); transform: scale(1.12); }

.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.pinkey {
  min-height: 60px;
  border-radius: var(--r-md);
  background: var(--navy-800);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  transition: background var(--dur), transform 100ms var(--ease-out);
}
.pinkey:active { background: var(--navy-700); transform: scale(.96); }
.pinkey--fn { background: transparent; border-color: transparent; font-size: 13px; font-family: var(--font); font-weight: 650; color: var(--text-2); }

/* ==========================================================================
   Alarm screen (shop) — full bleed
   ========================================================================== */

.alarm {
  position: fixed;
  inset: 0;
  z-index: var(--z-alarm);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + var(--s-5)) var(--s-5) calc(var(--safe-b) + var(--s-5));
  background: linear-gradient(175deg, #3B0A0A, #170406 55%, #0A0203);
  animation: alarmflash 1.05s steps(1, end) infinite;
  overflow-y: auto;
}

@keyframes alarmflash {
  0%, 49% { background-color: #170406; box-shadow: inset 0 0 220px 40px rgba(220, 38, 38, .55); }
  50%, 100% { background-color: #2C0708; box-shadow: inset 0 0 260px 60px rgba(220, 38, 38, .8); }
}

.alarm__top { display: flex; align-items: center; gap: var(--s-3); }
.alarm__siren { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--r-md); background: rgba(255, 255, 255, .1); color: var(--white); animation: shake 1.05s ease-in-out infinite; }
.alarm__kicker { font-size: 12px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--red-300); }
.alarm__title { font-size: 34px; font-weight: 800; letter-spacing: -.8px; line-height: 1.05; margin: var(--s-6) 0 var(--s-2); }
.alarm__body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.alarm__meta {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(255, 255, 255, .12);
  margin-bottom: var(--s-4);
}
.alarm__metarow { display: flex; align-items: center; gap: var(--s-3); }
.alarm__metalabel { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255, 255, 255, .55); width: 82px; flex: none; }
.alarm__metavalue { font-size: 16px; font-weight: 650; }
.alarm__timer { font-family: var(--mono); font-size: 46px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; text-align: center; margin: var(--s-2) 0 var(--s-5); }

.ackbtn {
  width: 100%;
  min-height: 68px;
  border-radius: var(--r-lg);
  background: var(--white);
  color: #7F1D1D;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  transition: transform 120ms var(--ease-out);
}
.ackbtn:active { transform: scale(.975); }

@keyframes shake {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}
@keyframes blink { 50% { opacity: .15; } }
@keyframes pulsedot { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ==========================================================================
   Simulated lock screen
   ========================================================================== */

.lock {
  position: fixed;
  inset: 0;
  z-index: var(--z-lock);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + var(--s-6)) var(--s-4) calc(var(--safe-b) + var(--s-6));
  background:
    radial-gradient(700px 420px at 50% 8%, rgba(220, 38, 38, .3), transparent 66%),
    linear-gradient(190deg, #101725, #05080F);
  color: var(--white);
}
.lock__sim { align-self: center; margin-bottom: var(--s-6); }
.lock__clock { text-align: center; font-family: var(--mono); font-size: 62px; font-weight: 300; letter-spacing: -1px; line-height: 1; }
.lock__date { text-align: center; font-size: 14px; color: rgba(255, 255, 255, .6); margin-top: var(--s-2); }
.lock__notifs { margin-top: var(--s-8); display: grid; gap: var(--s-3); }

.locknotif {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  padding: var(--s-4);
  border-radius: 18px;
  background: rgba(255, 255, 255, .13);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .18);
  animation: notifin 380ms var(--ease-out) both;
}
.locknotif--critical { background: rgba(220, 38, 38, .34); border-color: rgba(248, 113, 113, .5); }
.locknotif__head { display: flex; align-items: center; gap: var(--s-2); font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.locknotif__title { font-size: 16px; font-weight: 700; }
.locknotif__text { font-size: 14px; color: rgba(255, 255, 255, .85); }

.lock__foot { margin-top: auto; display: grid; gap: var(--s-3); justify-items: center; }
.lock__swipe { font-size: 13px; color: rgba(255, 255, 255, .6); }
.lock__bar { width: 134px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .4); }

@keyframes notifin {
  from { opacity: 0; transform: translateY(-14px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Sheets, modals, toasts
   ========================================================================== */

.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(2, 5, 12, .68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadein 180ms var(--ease-out) both;
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: var(--s-3) var(--s-4) calc(var(--safe-b) + var(--s-5));
  background: var(--navy-850);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-3);
  animation: sheetin 260ms var(--ease-out) both;
}
.sheet__grip { width: 40px; height: 4px; border-radius: 3px; background: var(--navy-700); margin: 0 auto var(--s-4); }
.sheet__title { font-size: 19px; font-weight: 700; margin: 0 0 var(--s-1); }

@keyframes sheetin { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--safe-t) + var(--s-3));
  z-index: var(--z-toast);
  width: min(94vw, 520px);
  display: grid;
  gap: var(--s-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--navy-800);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  font-size: 14px;
  font-weight: 550;
  animation: toastin 240ms var(--ease-out) both;
}
.toast--ok { border-color: rgba(34, 197, 94, .45); }
.toast--ok svg { color: var(--green-400); }
.toast--err { border-color: rgba(220, 38, 38, .5); }
.toast--err svg { color: var(--red-300); }
.toast--info svg { color: var(--sky); }
.toast.is-out { animation: toastout 200ms var(--ease-out) both; }

@keyframes toastin { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(-10px); } }

/* In-app "push notification" banner (simulated foreground push) */
.pushbanner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--safe-t) + var(--s-3));
  z-index: var(--z-toast);
  width: min(94vw, 520px);
  display: grid;
  gap: 4px;
  padding: var(--s-3) var(--s-4);
  border-radius: 16px;
  background: rgba(220, 38, 38, .95);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: var(--shadow-3);
  color: var(--white);
  text-align: left;
  animation: toastin 260ms var(--ease-out) both;
}

/* ==========================================================================
   Misc
   ========================================================================== */

.divider { height: 1px; background: var(--line-soft); margin: var(--s-4) 0; }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; }
.kv + .kv { border-top: 1px solid var(--line-soft); }
.kv__k { font-size: 13px; color: var(--text-3); }
.kv__v { font-size: 14px; font-weight: 600; text-align: right; }

.timeline { display: grid; gap: var(--s-2); padding-left: var(--s-3); border-left: 2px solid var(--line); margin-left: 5px; }
.timeline__item { display: flex; gap: var(--s-2); align-items: baseline; font-size: 13px; position: relative; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(var(--s-3) * -1 - 5px);
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy-700);
  border: 2px solid var(--navy-950);
}
.timeline__item--ok::before { background: var(--green-400); }
.timeline__item--wait::before { background: var(--amber); animation: pulsedat 1.4s ease-in-out infinite; }
@keyframes pulsedat { 50% { opacity: .3; } }

.brandmark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--red), #7F1D1D);
  color: var(--white);
  box-shadow: 0 12px 32px rgba(220, 38, 38, .3);
}

.banner {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--amber-wash);
  border: 1px dashed rgba(245, 158, 11, .45);
  font-size: 13px;
  line-height: 1.45;
  color: #FDE68A;
}
.banner svg { flex: none; color: var(--amber); margin-top: 2px; }
.banner--info { background: var(--sky-wash); border-color: rgba(56, 189, 248, .4); border-style: solid; color: #BAE6FD; }
.banner--info svg { color: var(--sky); }

.chiprow { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--s-3);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  background: var(--navy-800);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: border-color var(--dur), color var(--dur);
}
.chip:active { border-color: var(--sky); color: var(--text); }

.statuspill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-full);
  background: var(--green-wash);
  border: 1px solid rgba(34, 197, 94, .35);
  color: var(--green-400);
  font-size: 13px;
  font-weight: 650;
}
.statuspill__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulsedot 2s ease-in-out infinite; }

.radar {
  position: relative;
  width: 148px;
  height: 148px;
  margin: var(--s-4) auto;
  display: grid;
  place-items: center;
}
.radar__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(34, 197, 94, .3); animation: radar 2.8s ease-out infinite; }
.radar__ring:nth-child(2) { animation-delay: .9s; }
.radar__ring:nth-child(3) { animation-delay: 1.8s; }
.radar__core { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--green-wash); border: 1px solid rgba(34, 197, 94, .4); color: var(--green-400); }
@keyframes radar { from { transform: scale(.42); opacity: .85; } to { transform: scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .alarm { background: #2C0708; }
}
