/* =====================================================================
   HobbsBrew RC Track: same design system as the Crawlpass loyalty app
   Navy #00354B · Orange #FF4D0D · Cream #FFFDF5 · Sand #F9ECC7 / #F2E0B1
   Display: Archivo Expanded · Text: Avenir Next (Nunito Sans elsewhere)
   ===================================================================== */
:root {
  --navy: #00354b;
  --navy-2: #004b67;
  --navy-deep: #002536;
  --ink: #00354b;
  --ink-title: #0f3449;
  --muted: #4e6b77;
  --orange: #ff4d0d;
  --orange-text: #e2560c;
  --orange-deep: #c93a08;
  --orange-soft: #ffece3;
  --cream: #fffdf5;
  --cream-2: #fef8e7;
  --sand: #f9ecc7;
  --sand-brand: #f2e0b1;
  --line: #f2e0b1;
  --line-2: #ecdbb2;
  --page: #ffffff;
  --placeholder: #a9adb0;
  --olive: #605c2b;
  --olive-soft: #ecead2;

  --r: 8px;
  --r-panel: 16px;
  --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --font: 'Avenir Next', 'Avenir', 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-press: 90ms;
  --t-ui: 180ms;
  --t-panel: 260ms;
  --t-screen: 480ms;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--navy-deep);
  color: var(--ink);
  font: 500 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.app {
  max-width: 980px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  background: var(--page); position: relative; overflow-x: hidden;
}
@media (min-width: 1000px) { .app { box-shadow: 0 0 60px rgba(0, 0, 0, 0.45); } }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, select { font: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 800; }
a { color: inherit; }
.ic { width: 22px; height: 22px; flex: none; }
.eyebrow { font: 700 expanded 10.5px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange-text); }
.muted { color: var(--muted); font-size: 13px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- buttons (hard navy shadow; pressing pushes the face down onto it) ---------- */
.btn {
  --lift: 5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r);
  font: 700 16px/1 var(--font); text-decoration: none; white-space: nowrap;
  background: var(--cream); color: var(--navy); border: 2px solid var(--navy);
  box-shadow: 0 var(--lift) 0 var(--navy); margin-bottom: var(--lift);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out), background-color var(--t-ui);
}
.btn:active { transform: translateY(var(--lift)); box-shadow: 0 0 0 var(--navy); }
.btn.primary { --lift: 6px; min-height: 52px; background: var(--orange); color: var(--cream); }
.btn.dark { background: var(--navy); color: var(--cream); }
.btn.danger { background: var(--orange-soft); color: var(--orange-deep); border-color: var(--orange-deep); box-shadow: 0 var(--lift) 0 var(--orange-deep); }
.btn.block { width: 100%; }
.btn.big { --lift: 6px; min-height: 54px; font-size: 17px; }
.btn.small { min-height: 42px; padding: 0 14px; font-size: 15px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn .ic { width: 20px; height: 20px; }

.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border-radius: var(--r);
  font: 700 14px/1.26 var(--font); color: var(--cream); background: var(--navy-2); border: 1.5px solid var(--sand-brand);
  text-decoration: none; transition: transform var(--t-press) var(--ease-out);
}
.pill-btn:active { transform: scale(0.96); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: var(--ink); }
.field .opt { font-weight: 500; color: var(--muted); }
.input {
  width: 100%; min-height: 54px; padding: 0 16px; border-radius: var(--r);
  border: 2px solid var(--line-2); background: #fff; color: var(--ink);
  font: 600 16px var(--font); outline: none; appearance: none;
  transition: border-color var(--t-ui) var(--ease-out), box-shadow var(--t-ui) var(--ease-out);
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300354b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px;
}
.input::placeholder { color: var(--placeholder); font-weight: 500; font-size: 15px; }
.input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(255, 77, 13, 0.16); }
.input.invalid { border-color: var(--orange); }
.input.big { min-height: 60px; font: 800 expanded 22px var(--display); letter-spacing: 0.04em; }
.input.big::placeholder { font: 600 15px var(--font); letter-spacing: 0; }
.form-msg { min-height: 1.2em; font-weight: 700; font-size: 13px; margin: 0; text-align: center; }
.form-msg:empty { display: none; }
.form-msg.err { color: var(--orange-deep); }
.form-msg.ok { color: var(--olive); }
.form { display: grid; gap: 18px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: 13px; color: var(--ink); }

/* segmented choice (rental type / payment) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button {
  display: grid; gap: 2px; text-align: left; padding: 11px 12px; min-height: 58px; border-radius: var(--r);
  background: #fff; border: 2px solid var(--line-2); color: var(--navy);
  transition: border-color var(--t-ui), background-color var(--t-ui), transform var(--t-press);
}
.seg button b { font: 800 15px/1.2 var(--font); }
.seg button small { font: 600 12px/1.25 var(--font); color: var(--muted); }
.seg button[aria-pressed="true"] { border-color: var(--navy); background: var(--sand); box-shadow: inset 0 0 0 1px var(--navy); }
.seg button:active { transform: scale(0.98); }
.seg.pay button[data-v="free"][aria-pressed="true"] { border-color: var(--olive); background: var(--olive-soft); box-shadow: inset 0 0 0 1px var(--olive); }

/* time tier picker */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiers button {
  display: grid; justify-items: center; gap: 4px; padding: 12px 4px; border-radius: var(--r);
  background: #fff; border: 2px solid var(--line-2); color: var(--navy);
  transition: border-color var(--t-ui), background-color var(--t-ui), color var(--t-ui), transform var(--t-press);
}
.tiers b { font: 800 expanded 20px/1 var(--display); }
.tiers span { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tiers em { font: 800 14px/1 var(--font); font-style: normal; color: var(--orange-text); }
.tiers button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.tiers button[aria-pressed="true"] span { color: var(--sand-brand); }
.tiers button[aria-pressed="true"] em { color: var(--orange); }
.tiers button:active { transform: scale(0.97); }
.close-note { margin: -8px 0 0; padding: 9px 12px; border-radius: var(--r); background: var(--orange-soft); border: 1.5px solid var(--orange); font: 700 13px/1.35 var(--font); color: var(--orange-deep); }
.tier-note { margin: 4px 0 0; font: 600 12.5px/1.35 var(--font); color: var(--muted); }

.total-line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: var(--r); background: var(--sand); border: 1.5px solid var(--line);
}
.total-line span { font: 700 13px/1.3 var(--font); color: var(--navy); }
.total-line small { display: block; font-weight: 500; color: var(--muted); }
.total-line b { font: 800 expanded 22px/1 var(--display); color: var(--navy); white-space: nowrap; }
.total-line.free b { color: var(--olive); }

/* ---------- boot ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: var(--navy); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(242, 224, 177, 0.35); border-top-color: var(--orange); animation: spin 0.8s linear infinite; }

/* ---------- login ---------- */
.auth-screen {
  min-height: 100vh; min-height: 100dvh; background: var(--navy);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(64px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}
.auth-logo { width: 220px; max-width: 70vw; height: auto; display: block; animation: fade-in 420ms var(--ease-out) both; }
.auth-tag {
  margin-top: 16px; padding: 6px 12px; border-radius: 999px; background: var(--orange); color: var(--cream);
  font: 800 expanded 11px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.auth-tag .flag { width: 14px; height: 14px; }
.auth-card {
  width: min(360px, 100%); margin-top: 36px;
  background: var(--cream); border: 2px solid var(--line-2); border-radius: var(--r-panel); padding: 28px 20px;
  animation: rise-in var(--t-screen) var(--ease-out) 120ms both;
}
.auth-title { text-align: center; display: grid; gap: 10px; margin-bottom: 22px; }
.auth-title h1 { font: 800 expanded 22px/1.15 var(--display); color: var(--ink-title); }
.auth-title p { margin: 0; font: 500 14px/1.35 var(--font); color: var(--ink-title); }
.auth-fields { display: grid; gap: 16px; }
.auth-actions { display: grid; gap: 14px; margin-top: 20px; }
.demo-note { margin: 14px 0 0; text-align: center; font: 600 12px/1.4 var(--font); color: var(--muted); }

/* ---------- shell ---------- */
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--page); }
.demo-bar { flex: none; background: var(--sand); color: var(--navy); font-size: 12px; font-weight: 700; text-align: center; padding: calc(5px + env(safe-area-inset-top)) 12px 5px; }
.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px; background: var(--navy); color: var(--cream);
}
.demo-bar + .topbar { padding-top: 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { width: 105px; height: auto; display: block; flex: none; }
.brand-tag {
  padding: 5px 8px; border-radius: 6px; background: var(--orange); color: var(--cream);
  font: 800 expanded 10px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--font); color: var(--sand-brand); white-space: nowrap; }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7bd389; }
.sync.saving::before { background: var(--sand-brand); animation: blink 1s infinite; }
.sync.offline::before, .sync.error::before { background: var(--orange); }
.sync.demo::before { background: var(--sand-brand); }
@media (max-width: 400px) { .sync span { display: none; } }

.view { flex: 1; min-height: 0; overflow-y: auto; position: relative; -webkit-overflow-scrolling: touch; }
.view > * { animation: panel-in var(--t-panel) var(--ease-out) both; }
.tabbar { flex: none; display: grid; grid-template-columns: repeat(var(--tabs, 3), 1fr); background: var(--navy); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 10px 0 9px; font-size: 12px; font-weight: 700; color: rgba(242, 224, 177, 0.62); transition: color var(--t-ui) var(--ease-out); }
.tabbar button::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange);
  transform: scaleX(0); transition: transform var(--t-ui) var(--ease-out);
}
.tabbar button[aria-current="page"] { color: var(--orange); }
.tabbar button[aria-current="page"]::before { transform: scaleX(1); }
.tabbar .badge {
  position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--orange); color: var(--cream); font: 800 11px/18px var(--font);
  border: 2px solid var(--navy); box-sizing: content-box;
}
.tabbar .badge:empty { display: none; }

/* ---------- pages ---------- */
.page { padding: 20px 16px 32px; display: grid; gap: 16px; align-content: start; }
@media (min-width: 640px) { .page { padding: 26px 24px 40px; } }
.page > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font: 800 expanded 24px/1.1 var(--display); color: var(--ink-title); }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.section-title { font: 800 expanded 14px/1.2 var(--display); color: var(--navy); margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title span { font: 600 13px var(--font); color: var(--muted); }
.box { background: var(--cream); border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; }
.box h2 { font: 800 expanded 14px/1.26 var(--display); color: var(--navy); }
.box p { margin: 0; font: 500 13px/1.4 var(--font); color: var(--ink); }

.new-btn { justify-self: stretch; }
@media (min-width: 640px) { .new-btn { justify-self: start; min-width: 280px; } }

/* ---------- timer cards ---------- */
.timers { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.timer {
  --accent: var(--navy);
  position: relative; display: grid; gap: 10px; padding: 14px; border-radius: 12px;
  background: var(--cream); border: 2px solid var(--navy); box-shadow: 0 5px 0 var(--accent);
  margin-bottom: 5px; animation: item-in var(--t-panel) var(--ease-out) both;
  transition: background-color var(--t-ui), border-color var(--t-ui), box-shadow var(--t-ui);
}
.t-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.t-receipt { display: block; font: 800 expanded 18px/1.15 var(--display); color: var(--navy); word-break: break-all; }
.tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.tag {
  padding: 4px 7px; border-radius: 6px; font: 800 11px/1.1 var(--font); white-space: nowrap;
  background: var(--sand); color: var(--navy); border: 1.5px solid var(--line-2);
}
.tag.free { background: var(--olive-soft); color: var(--olive); border-color: #d8d5ad; }
.tag.own { background: #fff; }
.tag.void { background: #eee; color: #666; border-color: #ddd; }
.tag.live { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.t-time { font: 800 expanded clamp(44px, 13vw, 56px)/1 var(--display); color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.t-state { font: 700 13px/1.3 var(--font); color: var(--muted); margin-top: -4px; }
.bar { height: 8px; border-radius: 4px; background: var(--sand); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--navy); border-radius: 4px; transition: width 1s linear; }
.t-meta { font: 600 13px/1.35 var(--font); color: var(--ink); }
.t-meta b { font-weight: 800; }
.t-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }

.timer.warn { --accent: var(--orange); border-color: var(--orange); background: var(--orange-soft); }
.timer.warn .t-time { color: var(--orange-deep); }
.timer.warn .bar i { background: var(--orange); }
.timer.over { --accent: var(--navy); background: var(--orange); border-color: var(--navy); }
.timer.over .t-receipt, .timer.over .t-time, .timer.over .t-meta { color: var(--cream); }
.timer.over .eyebrow { color: var(--sand); }
.timer.over .t-state { color: var(--cream); }
.timer.over .t-time { animation: blink 1s steps(2, start) infinite; }
.timer.over .bar { background: rgba(255, 253, 245, 0.35); }
.timer.over .bar i { background: var(--cream); }

.empty {
  display: grid; justify-items: center; gap: 8px; text-align: center; padding: 30px 18px;
  border: 2px dashed var(--line-2); border-radius: 12px; background: var(--cream-2); color: var(--muted);
}
.empty .flag { width: 64px; height: 40px; }
.empty b { font: 800 expanded 15px var(--display); color: var(--navy); }
.empty p { margin: 0; max-width: 32ch; font-size: 14px; }

/* finished / records rows */
.rows { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; width: 100%;
  padding: 11px 12px; border-radius: var(--r); background: #fff; border: 1.5px solid var(--line); text-align: left;
  transition: background-color var(--t-ui), transform var(--t-press);
}
.row:active { transform: scale(0.99); background: var(--cream-2); }
.row .r-title { font: 800 15px/1.25 var(--font); color: var(--navy); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row .r-sub { grid-column: 1; font: 600 12.5px/1.3 var(--font); color: var(--muted); }
.row .r-amt { grid-row: 1 / span 2; grid-column: 2; font: 800 expanded 15px/1 var(--display); color: var(--navy); text-align: right; }
.row .r-amt small { display: block; margin-top: 5px; font: 700 11px var(--font); color: var(--muted); }
.row.void { opacity: 0.6; }
.row.void .r-amt { text-decoration: line-through; }

/* ---------- records ---------- */
.date-pick { display: flex; align-items: center; gap: 8px; }
.date-pick .input { min-height: 46px; width: auto; padding: 0 12px; font-size: 15px; }
.date-pick button { width: 46px; height: 46px; border-radius: var(--r); border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; color: var(--navy); }
.date-pick button:active { background: var(--sand); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
  background: var(--cream); border: 1.5px solid var(--line); border-radius: var(--r);
  min-height: 86px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0;
}
.stat b { font: 700 expanded clamp(22px, 7vw, 30px)/1 var(--display); color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font: 600 expanded 11px/1.26 var(--display); color: var(--muted); }
.stat.hero { background: var(--navy); border-color: var(--navy); }
.stat.hero b { color: var(--cream); }
.stat.hero span { color: var(--sand-brand); }

.breakdown { width: 100%; border-collapse: collapse; font-size: 14px; }
.breakdown th { text-align: left; font: 700 11px var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 0 8px; }
.breakdown th:not(:first-child), .breakdown td:not(:first-child) { text-align: right; }
.breakdown td { padding: 9px 0; border-top: 1px solid var(--line-2); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.breakdown td:first-child { padding-right: 8px; }
.breakdown td small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.breakdown tr.zero td { color: var(--placeholder); }
.breakdown tr.group td { font: 800 expanded 11px var(--display); color: var(--orange-text); letter-spacing: 0.08em; text-transform: uppercase; padding-top: 14px; border-top: 0; }
.breakdown tr.sum td { border-top: 2px solid var(--navy); font: 800 expanded 15px var(--display); color: var(--navy); padding-top: 12px; }
.rec-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- settings ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.price-grid label { display: grid; gap: 6px; font: 700 12px var(--font); color: var(--muted); }
.money { position: relative; }
.money::before { content: attr(data-cur); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font: 700 16px var(--font); color: var(--muted); pointer-events: none; }
.money .input { padding: 0 8px 0 28px; min-height: 50px; font-weight: 800; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- sheet (bottom drawer) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 37, 54, 0.6); opacity: 0; transition: opacity var(--t-panel) var(--ease-out); }
.sheet {
  position: relative; width: 100%; max-width: 520px; max-height: 94vh; max-height: 94dvh; overflow-y: auto;
  background: var(--cream); border-radius: var(--r-panel) var(--r-panel) 0 0; border-top: 2px solid var(--line-2);
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform var(--t-screen) var(--ease-out);
}
@media (min-width: 640px) { .sheet-wrap { align-items: center; } .sheet { border-radius: var(--r-panel); border: 2px solid var(--line-2); padding: 10px 22px 24px; } }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.closing .sheet { transform: translateY(100%); transition-duration: var(--t-panel); transition-timing-function: var(--ease-in-out); }
.sheet-wrap.closing .sheet-backdrop { opacity: 0; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 8px; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--sand); color: var(--navy); }
.sheet-head { text-align: center; padding: 4px 36px 16px; }
.sheet h2 { font: 800 expanded 20px/1.15 var(--display); margin-top: 6px; color: var(--ink-title); }
.sheet-head p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.sheet-actions { display: grid; gap: 12px; margin-top: 18px; }
.detail { display: grid; gap: 0; margin: 0; }
.detail div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; font-weight: 800; color: var(--navy); text-align: right; }

/* ---------- time's up alarm ---------- */
.alarm {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px 16px;
  background: var(--orange); color: var(--cream); animation: fade-in var(--t-ui) var(--ease-out) both;
}
.alarm::before, .alarm::after {
  content: ""; position: absolute; left: 0; right: 0; height: 22px;
  background: repeating-conic-gradient(var(--navy) 0 25%, var(--cream) 0 50%) 0 0 / 22px 22px;
}
.alarm::before { top: env(safe-area-inset-top); }
.alarm::after { bottom: env(safe-area-inset-bottom); }
.alarm-inner { width: min(420px, 100%); display: grid; gap: 14px; text-align: center; justify-items: center; }
.alarm .eyebrow { color: var(--navy); font-size: 13px; }
.alarm h2 { font: 800 expanded clamp(30px, 9vw, 44px)/1.05 var(--display); animation: pop var(--t-panel) var(--ease-out) both, ring 1.2s var(--ease-in-out) 300ms infinite; }
.alarm ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.alarm li { background: var(--navy); border-radius: var(--r); padding: 10px 12px; font: 700 15px/1.3 var(--font); text-align: left; }
.alarm li b { font: 800 expanded 15px var(--display); color: var(--orange); margin-right: 6px; }
.alarm p { margin: 0; font: 700 15px/1.4 var(--font); max-width: 30ch; }
.alarm .btn { margin-top: 6px; background: var(--cream); color: var(--navy); }
.alarm-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--orange); animation: ring 1.2s var(--ease-in-out) infinite; }
.alarm-icon svg { width: 40px; height: 40px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 80;
  transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  background: var(--navy); color: var(--cream); padding: 12px 18px; border-radius: var(--r); border: 1.5px solid var(--sand-brand);
  font-weight: 700; font-size: 14px; box-shadow: 0 12px 28px -14px rgba(0, 37, 54, 0.6);
  transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--orange); border-color: var(--navy); }
.toast.warn { background: var(--orange); border-color: var(--navy); }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-8deg); } 20% { transform: rotate(8deg); } 30% { transform: rotate(-5deg); } 40% { transform: rotate(5deg); } 50% { transform: rotate(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes item-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .timer.over .t-time { animation: none; }
}
