/* ============================================================================
   Safe Check-In SPA - styles.
   Styled to match the Safe Check-In marketing site: Space Grotesk + IBM Plex
   Sans, teal "brand" + amber "accent" on a calm light canvas, with a deep
   "night" header and footer echoing the site's dark hero/footer bands.
   Pill buttons, soft layered shadows, rounded surfaces, teal focus ring.
   Still a product UI: calm, high-contrast, mobile-first, large tap targets,
   visible focus, reduced-motion aware. Life-safety app: clarity over cleverness.

   The marketing site ships a single light theme (dark sections are by design,
   not a dark mode), so this app matches it: one theme, no prefers-color-scheme
   override. Class names below are exactly those emitted by js/*; only the look
   changes, never the structure or behaviour.
   ========================================================================== */

/* Same web fonts the marketing site loads (Space Grotesk + IBM Plex Sans). */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

/* ---- design tokens (mapped from the website's design system) -------------- */
:root {
  color-scheme: light;

  /* Site palette, in the site's OKLCH. App keeps its --c-* names so every
     existing rule resolves to the brand colours without rewiring selectors. */
  --bg:         oklch(0.985 0.006 250);
  --bg-2:       oklch(0.965 0.012 250);
  --paper:      oklch(1 0 0);
  --ink:        oklch(0.26 0.03 264);
  --ink-soft:   oklch(0.40 0.03 264);
  --muted:      oklch(0.52 0.025 264);
  --brand:      oklch(0.60 0.12 200);
  --brand-ink:  oklch(0.46 0.105 212);
  --brand-deep: oklch(0.30 0.07 235);
  --night:      oklch(0.22 0.04 264);
  --night-2:    oklch(0.27 0.05 262);
  --accent:     oklch(0.72 0.16 62);
  --accent-ink: oklch(0.58 0.16 54);
  --ok:         oklch(0.50 0.13 160);
  --ok-deep:    oklch(0.44 0.12 162);
  --line:       oklch(0.90 0.012 250);
  --line-soft:  oklch(0.93 0.008 250);
  --on-dark:    oklch(0.96 0.01 240);

  /* App-facing tokens (names referenced throughout the rules below). */
  --c-bg:           var(--bg);
  --c-surface:      var(--paper);
  --c-surface-2:    var(--bg-2);
  --c-ink:          var(--ink);
  --c-ink-soft:     var(--ink-soft);
  --c-line:         var(--line);

  --c-primary:      var(--brand);
  --c-primary-ink:  oklch(0.99 0.01 200);
  --c-primary-soft: oklch(0.95 0.03 200);

  --c-ok:           var(--ok);
  --c-ok-ink:       oklch(0.99 0.01 160);

  --c-warn:         var(--accent-ink);
  --c-warn-ink:     oklch(0.99 0.01 80);
  --c-danger:       oklch(0.52 0.20 25);
  --c-danger-ink:   oklch(0.99 0.01 25);
  --c-overdue:      oklch(0.52 0.20 25);

  --c-armed:        var(--ok-deep);
  --c-paused:       var(--muted);

  --focus:          var(--brand);
  --focus-ring:     0 0 0 3px oklch(0.60 0.12 200 / .22);

  /* Site radii + shadows. */
  --radius:    18px;
  --radius-lg: 26px;
  --radius-sm: 12px;
  --shadow:    0 2px 6px oklch(0.3 0.05 264 / .06), 0 26px 60px -28px oklch(0.25 0.06 264 / .32);
  --shadow-sm: 0 1px 3px oklch(0.3 0.05 264 / .07), 0 12px 26px -18px oklch(0.25 0.06 264 / .26);

  --tap: 48px;
  --maxw: 760px;
  --ease: cubic-bezier(.16,1,.3,1);

  --disp: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font: var(--sans);
}

/* ---- base ----------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--c-bg);
  color: var(--c-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 17px;
}
h1, h2, h3 {
  font-family: var(--disp);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .5rem;
}
p { margin: 0 0 .75rem; }
strong { font-weight: 700; }

::selection { background: oklch(0.60 0.12 200 / .26); }

:focus-visible {
  outline: none;
  border-radius: 6px;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--brand-deep); color: #fff;
  padding: .75rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---- app shell ------------------------------------------------------------ */
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* Header echoes the site's deep "night" band so the logged-in app reads as a
   continuation of the marketing site's chrome. */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem clamp(1rem, 4vw, 1.5rem);
  background: var(--night); color: var(--on-dark);
  border-bottom: 1px solid oklch(1 0 0 / .08);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem; text-decoration: none;
  color: var(--on-dark); font-family: var(--disp); font-weight: 600;
  font-size: 1.2rem; letter-spacing: -0.02em;
}
.brand-icon { color: var(--brand); display: inline-flex; }
.brand-name { letter-spacing: -0.01em; }
.logout {
  min-height: var(--tap); padding: 0 1.1rem;
  background: transparent; color: var(--on-dark);
  border: 1.6px solid oklch(1 0 0 / .28); border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color .25s, background-color .25s, transform .3s var(--ease);
}
.logout:hover { border-color: oklch(1 0 0 / .6); background: oklch(1 0 0 / .06); }

.app-view {
  flex: 1; width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 1.25rem clamp(1rem, 4vw, 1.5rem) 6.5rem;
}
.app-view:focus { outline: none; }

/* Footer mirrors the site's "night" footer. */
.app-footer {
  background: var(--night); color: oklch(0.74 0.02 240);
  text-align: center;
  padding: 1.6rem clamp(1rem, 4vw, 1.5rem) 7rem;
}
.app-footer > * { max-width: var(--maxw); margin-inline: auto; }
.app-footer .disclaimer { font-weight: 600; color: var(--on-dark); }
.brand-foot { font-size: .85rem; margin-bottom: 0; color: oklch(0.68 0.02 240); }

/* Bottom nav on mobile. */
.app-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  display: flex; justify-content: space-around; align-items: stretch;
  background: oklch(1 0 0 / .9); backdrop-filter: blur(12px) saturate(1.3);
  border-top: 1px solid var(--c-line);
  padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom));
  overflow-x: auto;
}
.nav-link {
  flex: 1 0 auto; min-width: 56px; min-height: var(--tap);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: .35rem .25rem; text-decoration: none;
  color: var(--c-ink-soft); font-weight: 500; font-size: .68rem;
  border-radius: 999px;
  transition: color .2s, background-color .2s;
}
.nav-icon { display: inline-flex; }
.nav-link.is-active { color: var(--brand-ink); background: var(--c-primary-soft); font-weight: 600; }
.nav-link:hover { color: var(--c-ink); }

/* Hide the shell entirely on the auth screen. */
body.is-auth-screen .app-header,
body.is-auth-screen .app-nav,
body.is-auth-screen .app-footer { display: none; }
body.is-auth-screen .app-view { padding-bottom: 1rem; max-width: 480px; }
/* The auth screen stands alone, so paint it on the site's light canvas. */
body.is-auth-screen { background: var(--c-bg); }

/* ---- buttons (site's pill + glow treatment) ------------------------------- */
.btn {
  min-height: var(--tap); padding: .85rem 1.5rem;
  font-family: var(--sans); font-weight: 600; line-height: 1; cursor: pointer;
  border-radius: 999px; border: 1.6px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  white-space: nowrap;
  transition: transform .35s var(--ease), background-color .25s, box-shadow .35s, border-color .25s, filter .25s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand); color: var(--c-primary-ink);
  box-shadow: 0 10px 26px -12px oklch(0.60 0.12 200 / .7);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-ink); transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px oklch(0.60 0.12 200 / .75);
}
.btn-secondary { background: transparent; color: var(--brand-ink); border-color: var(--c-line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--brand-ink); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--c-primary-soft); }
.btn-ok {
  background: var(--ok); color: var(--c-ok-ink);
  box-shadow: 0 10px 26px -12px oklch(0.50 0.13 160 / .7);
}
.btn-ok:hover:not(:disabled) { background: var(--ok-deep); transform: translateY(-2px); }
.btn-warn { background: var(--accent); color: var(--c-warn-ink); }
.btn-warn:hover:not(:disabled) { background: var(--accent-ink); color: #fff; transform: translateY(-2px); }
.btn-danger {
  background: var(--c-danger); color: var(--c-danger-ink);
  box-shadow: 0 10px 26px -12px oklch(0.52 0.20 25 / .55);
}
.btn-danger:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-2px); }
.btn-danger-ghost { background: transparent; color: var(--c-danger); border-color: transparent; }
.btn-danger-ghost:hover:not(:disabled) { background: oklch(0.52 0.20 25 / .10); }

/* The big "I'm OK" action. Pill, generous, unmistakable. */
.btn-huge {
  width: 100%; min-height: 92px; font-size: 1.5rem; font-weight: 700;
  border-radius: var(--radius-lg); letter-spacing: .2px;
}

/* ---- auth screen ---------------------------------------------------------- */
.auth { display: flex; min-height: 90vh; align-items: center; justify-content: center; }
.auth-card {
  width: 100%; background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 2.4rem 1.6rem; text-align: center;
}
.brand-mark { color: var(--brand); display: flex; justify-content: center; margin-bottom: .6rem; }
.auth-title { font-size: 1.9rem; }
.auth-lead { color: var(--c-ink-soft); margin-bottom: 1.4rem; font-size: 1.05rem; }
.auth-form { text-align: left; }
.auth-form .btn { width: 100%; margin-top: .5rem; }
.auth-fineprint { margin-top: 1.4rem; color: var(--c-ink-soft); font-size: .9rem; font-weight: 600; }

/* ---- page scaffolding ----------------------------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; }
.page-title { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2rem); }
.page-lead { color: var(--c-ink-soft); margin-bottom: 1rem; font-size: 1.05rem; }
.section-title { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
.loading { padding: 2rem 0; color: var(--c-ink-soft); text-align: center; }
.error-block {
  background: oklch(0.52 0.20 25 / .08); color: var(--c-overdue);
  border: 1px solid oklch(0.52 0.20 25 / .25); border-radius: var(--radius-sm);
  padding: .85rem 1rem; font-weight: 600;
}
.empty, .empty-inline {
  background: var(--c-surface); border: 1px dashed var(--c-line);
  border-radius: var(--radius); padding: 1.4rem; color: var(--c-ink-soft); text-align: center;
}
.empty-actions, .empty-lead { margin: 1rem 0; }
.muted { color: var(--c-muted, var(--muted)); font-size: .9rem; align-self: center; }
.plain-list { padding-left: 1.1rem; color: var(--c-ink-soft); }
.plain-list li { margin-bottom: .35rem; }

/* ---- cards ---------------------------------------------------------------- */
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.4rem;
}
.card-primary { border-color: var(--brand); border-width: 2px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.card-head-text { display: flex; flex-direction: column; gap: .35rem; }
.card-title { font-size: 1.25rem; margin: 0; }
.rel { color: var(--c-ink-soft); font-size: .92rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }

.dash { display: flex; flex-direction: column; gap: 1rem; }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid var(--c-line); white-space: nowrap;
}
.pill .dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.pill-armed { color: var(--c-armed); background: oklch(0.50 0.13 160 / .12); border-color: oklch(0.50 0.13 160 / .30); }
.pill-paused { color: var(--c-paused); background: var(--c-surface-2); }
.pill-pending { color: var(--accent-ink); background: oklch(0.72 0.16 62 / .14); border-color: oklch(0.72 0.16 62 / .35); }
.pill-declined { color: var(--c-danger); background: oklch(0.52 0.20 25 / .08); border-color: oklch(0.52 0.20 25 / .25); }

/* ---- countdown ------------------------------------------------------------ */
.countdown {
  text-align: center; background: var(--c-surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.3rem; margin: .35rem 0 .85rem;
}
.countdown-value {
  display: block; font-family: var(--disp); font-weight: 600;
  font-size: 2.7rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.countdown-sub { display: block; color: var(--c-ink-soft); font-size: .92rem; }
.countdown-overdue { background: oklch(0.52 0.20 25 / .10); border-color: oklch(0.52 0.20 25 / .3); }
.countdown-overdue .countdown-value { color: var(--c-overdue); }
.deadline-line { color: var(--c-ink-soft); text-align: center; }

.actions-primary { margin: .35rem 0 .5rem; }
.actions-row { display: flex; gap: .6rem; margin-top: .6rem; }
.actions-row .btn { flex: 1; }

.mini-schedule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius-sm); padding: .75rem .95rem;
}
.mini-row-main { display: flex; flex-direction: column; }
.mini-row-label { font-weight: 600; }
.mini-row-time { color: var(--c-ink-soft); font-size: .9rem; }
.mini-row-time.is-overdue { color: var(--c-overdue); font-weight: 700; }

.safety-note {
  margin-top: 1.4rem; text-align: center; font-weight: 600; color: var(--brand-ink);
  background: var(--c-primary-soft); border: 1px solid oklch(0.60 0.12 200 / .18);
  border-radius: var(--radius-sm); padding: .85rem 1rem;
}

/* ---- meta lists ----------------------------------------------------------- */
.meta { display: grid; grid-template-columns: 1fr; gap: .35rem; margin: .25rem 0 0; }
.meta-row { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--c-line); padding: .35rem 0; }
.meta-row:last-child { border-bottom: none; }
.meta-row dt { color: var(--c-ink-soft); margin: 0; }
.meta-row dd { margin: 0; font-weight: 600; text-align: right; }

/* ---- forms ---------------------------------------------------------------- */
.field { margin-bottom: 1.1rem; }
.field-label { display: block; font-family: var(--sans); font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.req { color: var(--c-danger); }
.field-hint { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
.control {
  width: 100%; min-height: var(--tap); padding: .85rem 1rem;
  font-family: var(--sans); font-size: 1rem; color: var(--c-ink); background: var(--c-bg);
  border: 1.5px solid var(--c-line); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.control:focus-visible { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
textarea.control { min-height: 7rem; resize: vertical; line-height: 1.55; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

.checkgroup, .toggles, .quiet { border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: .95rem; margin-bottom: 1.1rem; }
.checkgroup legend, .toggles legend, .quiet legend { padding: 0 .35rem; font-weight: 600; }
.checkgroup-items { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--tap); cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--brand); }
.toggle { display: flex; }

.confirm-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .6rem; flex-wrap: wrap; }
.confirm-actions .btn { flex: 1; }

/* ---- modal ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: oklch(0.22 0.04 264 / .55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal {
  background: var(--c-surface); width: 100%; max-width: 560px;
  max-height: 92vh; overflow: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow); padding: 1.4rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
}
.modal:focus { outline: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.modal-title { font-size: 1.3rem; margin: 0; }
.confirm-msg { font-size: 1.05rem; }

/* ---- toasts --------------------------------------------------------------- */
.toast-host {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tap) + 1rem); z-index: 80;
  display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: 90vw; padding: .8rem 1.2rem;
  border-radius: 999px; box-shadow: var(--shadow); font-weight: 600;
  background: var(--night); color: var(--on-dark);
  opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--ok-deep); color: #fff; }
.toast-error { background: var(--c-danger); color: var(--c-danger-ink); }

/* ---- escalation ladder ---------------------------------------------------- */
.ladder-block { margin-bottom: 1.6rem; }
.ladder-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.rungs { list-style: none; margin: 0; padding: 0; }
.rung { display: flex; gap: .9rem; padding-bottom: .25rem; }
.rung-rail { display: flex; flex-direction: column; align-items: center; }
.rung-node {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--brand); color: var(--c-primary-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 600; font-size: .9rem;
  flex: 0 0 auto;
}
.rung-rail::after { content: ""; flex: 1; width: 2px; background: var(--c-line); margin: 4px 0; }
.rung:last-child .rung-rail::after { display: none; }
.rung-body {
  flex: 1; background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius-sm); padding: .85rem .95rem; margin-bottom: .9rem;
  box-shadow: var(--shadow-sm);
}
.rung-release .rung-node { background: var(--accent); color: var(--c-warn-ink); }
.rung-release .rung-body { border-color: var(--accent); }
.rung-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.rung-title { font-weight: 700; }
.rung-delay { color: var(--c-ink-soft); font-size: .82rem; white-space: nowrap; }
.rung-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .55rem 0; }
.rung-actions { display: flex; gap: .4rem; }
.chip {
  display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--c-surface-2); color: var(--c-ink-soft); border: 1px solid var(--c-line);
}
.chip-chan { color: var(--brand-ink); background: var(--c-primary-soft); border-color: transparent; }
.chip-flag { color: var(--accent-ink); background: oklch(0.72 0.16 62 / .14); border-color: transparent; }
.chip-test, .chip-test.chip { color: var(--c-warn-ink); background: var(--accent); border-color: transparent; }

/* ---- docs ----------------------------------------------------------------- */
.doc-body {
  white-space: pre-wrap; background: var(--c-surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: .95rem; color: var(--c-ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92rem;
}

/* ---- self-test ------------------------------------------------------------ */
.test-banner {
  background: oklch(0.72 0.16 62 / .12); border: 1px solid oklch(0.72 0.16 62 / .35);
  border-radius: var(--radius-sm); padding: .95rem 1rem; margin-bottom: 1.1rem; color: var(--c-ink);
}

/* ---- audit timeline ------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: flex; gap: .9rem; padding-bottom: .25rem; }
.tl-dot { width: .85rem; height: .85rem; border-radius: 50%; background: var(--brand); margin-top: .35rem; flex: 0 0 auto; position: relative; }
.timeline-item:not(:last-child) .tl-dot::after { content: ""; position: absolute; left: 50%; top: 1rem; transform: translateX(-50%); width: 2px; height: calc(100% + .5rem); background: var(--c-line); }
.timeline-item.is-test .tl-dot { background: var(--accent); }
.tl-body { flex: 1; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: .75rem .95rem; margin-bottom: .9rem; box-shadow: var(--shadow-sm); }
.tl-top { display: flex; align-items: center; gap: .5rem; }
.tl-label { font-weight: 600; }
.tl-time { display: block; color: var(--c-ink-soft); font-size: .82rem; margin-top: .15rem; }
.tl-detail { margin: .35rem 0 0; color: var(--c-ink-soft); font-size: .9rem; }

/* ---- wider screens: top nav + roomier layout ------------------------------ */
@media (min-width: 720px) {
  .meta { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
  .app-nav {
    position: static; border-top: none; border-bottom: 1px solid var(--c-line);
    background: oklch(1 0 0 / .9);
    justify-content: center; gap: .35rem; padding: .4rem;
  }
  .nav-link { flex: 0 0 auto; flex-direction: row; gap: .45rem; font-size: .92rem; padding: .45rem 1rem; }
  .app-view { padding-bottom: 2rem; }
  .app-footer { padding-bottom: 2rem; }
  .toast-host { bottom: 1.5rem; }
  .modal-overlay { align-items: center; padding: 1rem; }
  .modal { border-radius: var(--radius-lg); }
}

/* ---- reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover { transform: none; }
}

/* ===========================================================================
   Auth + 2FA + tags + push (added by the SPA frontend build). Reuses the
   tokens above; no new colours invented. Plain hyphens only.
   ========================================================================== */

/* ---- shared small pieces -------------------------------------------------- */
.card-copy { color: var(--c-ink-soft); margin: 0 0 1rem; line-height: 1.55; }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.page-head-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.soft-rule { border: none; border-top: 1px solid var(--c-line); margin: 1.2rem 0; }
.warn-line {
  background: oklch(0.72 0.16 62 / .12); border: 1px solid oklch(0.72 0.16 62 / .35);
  color: var(--ink-soft); border-radius: var(--radius-sm);
  padding: .7rem .85rem; font-size: .9rem; margin: .9rem 0; line-height: 1.5;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }

/* ---- auth screen extras --------------------------------------------------- */
.auth-body { margin-top: .4rem; text-align: left; }
.btn-link {
  background: transparent; border: none; color: var(--brand-ink);
  font: inherit; font-weight: 600; cursor: pointer; padding: .2rem .15rem;
  min-height: auto; text-decoration: underline; text-underline-offset: 3px;
  border-radius: 6px;
}
.btn-link:hover { color: var(--brand-deep); }
.auth-switch { text-align: center; margin: 1rem 0 0; color: var(--c-ink-soft); font-size: .95rem; }
.auth-substep-title { font-family: var(--disp); font-size: 1.2rem; margin: 0 0 .25rem; text-align: center; }
.auth-note { color: var(--c-ink-soft); font-size: .92rem; margin: .4rem 0 0; line-height: 1.5; }
.auth-note-soft {
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  border-radius: var(--radius-sm); padding: .65rem .8rem;
}
.pw-strength { font-size: .85rem; margin: .3rem 0 0; min-height: 1.1em; color: var(--muted); }
.pw-weak { color: var(--c-danger); }
.pw-ok { color: var(--accent-ink); }
.pw-strong { color: var(--ok-deep); }

/* divider with centred "or" */
.auth-or { display: flex; align-items: center; text-align: center; gap: .8rem; margin: 1.1rem 0; color: var(--muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.auth-or span { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }

.btn-google { width: 100%; background: var(--c-surface); color: var(--ink); border-color: var(--c-line); }
.btn-google:hover { background: var(--c-surface-2); }
.g-glyph { display: inline-flex; }

/* 6-digit code input: large, spaced, centred */
.code-input {
  letter-spacing: .5em; text-align: center; font-size: 1.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding-left: .5em;
}

/* ---- account / settings meta rows ----------------------------------------- */
.kv-list { display: grid; gap: .7rem; margin: .4rem 0 0; }
.kv {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .6rem .75rem; background: var(--c-surface-2);
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
}
.kv-key { font-weight: 600; color: var(--ink-soft); font-size: .9rem; }
.kv-val { display: flex; align-items: center; gap: .5rem; flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.kv-val .mono { font-size: .92rem; }

/* ---- 2FA enrolment dialog ------------------------------------------------- */
.enroll { display: block; }
.enroll-steps { margin: 0 0 .9rem; padding-left: 1.2rem; color: var(--ink-soft); }
.qr-wrap {
  display: flex; justify-content: center; padding: 1rem;
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  margin: 0 auto 1rem; width: fit-content; max-width: 100%;
}
.qr-canvas { width: 220px; height: 220px; image-rendering: pixelated; max-width: 100%; }
.secret-details { margin-bottom: 1rem; }
.secret-details > summary {
  cursor: pointer; font-weight: 600; color: var(--brand-ink);
  padding: .5rem 0; min-height: var(--tap); display: flex; align-items: center;
}
.secret-box {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  border-radius: var(--radius-sm); padding: .6rem .75rem; margin-top: .4rem;
}
.secret-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.02rem; letter-spacing: .08em; word-break: break-all; flex: 1 1 auto;
}
.backup-block { margin: 1rem 0; }
.backup-codes {
  list-style: none; margin: .5rem 0; padding: .75rem;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .9rem;
  background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
}
.backup-codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem; letter-spacing: .05em;
}
.backup-actions { margin-top: .2rem; }

/* ---- tags ----------------------------------------------------------------- */
.tag-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.tag-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .75rem; border-radius: 999px; cursor: pointer;
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  color: var(--ink-soft); font-size: .9rem; font-weight: 500;
  min-height: 40px; transition: background-color .2s, border-color .2s, color .2s;
}
.tag-chip:hover { border-color: var(--brand); }
.tag-chip.is-static { cursor: default; }
.tag-check-input { accent-color: var(--brand); width: 16px; height: 16px; }
/* selected state via :has where supported */
.tag-chip:has(.tag-check-input:checked) {
  background: var(--c-primary-soft); border-color: var(--brand); color: var(--brand-deep);
}
.chip-tag { background: var(--c-primary-soft); color: var(--brand-deep); border-color: transparent; }
.tl-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }

.checkin-tags { margin: .2rem 0 .6rem; }
.checkin-tags > summary {
  cursor: pointer; font-weight: 600; color: var(--brand-ink);
  min-height: var(--tap); display: flex; align-items: center;
}

.tag-manage { display: block; }
.tag-manage-list { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .5rem; }
.tag-manage-row {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .4rem .25rem; border-bottom: 1px solid var(--line-soft);
}
.tag-add { margin-top: .4rem; }

/* ---- premium upsell ------------------------------------------------------- */
.upsell { margin-top: 1rem; }
.upsell-inner {
  display: flex; gap: .8rem; align-items: flex-start;
  background: linear-gradient(180deg, var(--c-primary-soft), var(--c-surface));
  border: 1px solid oklch(0.60 0.12 200 / .35); border-radius: var(--radius);
  padding: 1rem;
}
.upsell-badge {
  flex: 0 0 auto; align-self: flex-start;
  background: var(--accent); color: var(--c-warn-ink);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  padding: .25rem .6rem; border-radius: 999px; text-transform: uppercase;
}
.upsell-title { font-weight: 700; margin: 0 0 .3rem; color: var(--ink); }
.upsell-copy { margin: .3rem 0 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }

/* ---- push setup ----------------------------------------------------------- */
.steps-list { margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: .9rem; }
.steps-list li { line-height: 1.55; color: var(--ink-soft); }
.steps-list li strong { color: var(--ink); }
.steps-list code, .kv code, .secret-box code { background: oklch(0.60 0.12 200 / .10); padding: .1rem .35rem; border-radius: 6px; }

/* ---- filter bar (Activity) ------------------------------------------------ */
.filter-bar {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: .9rem; margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.filter-field { display: flex; flex-direction: column; gap: .3rem; }
.filter-label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.filter-row { display: flex; gap: .6rem; align-items: flex-end; margin-top: .7rem; }
.filter-search { flex: 1 1 auto; }
.timeline-region { min-height: 2rem; }

/* ---- wider screens for the new pieces ------------------------------------- */
@media (min-width: 720px) {
  .filter-grid { grid-template-columns: repeat(4, 1fr); }
  .backup-codes { grid-template-columns: repeat(3, 1fr); }
}
