/* ═══════════════════════════════════════════════
   Recruit — "Night pantry"
   Shared look with Calorie Vision: deep spruce surfaces, saffron for action,
   Bricolage Grotesque for numbers & headings, Instrument Sans for UI.
   One signature element: the big unread-hits number on the feed.
   ═══════════════════════════════════════════════ */

:root {
    color-scheme: dark;

    /* Surfaces */
    --bg: #0E1715;
    --surface: #16211E;
    --surface-2: #1E2B27;
    --surface-3: #283833;
    --line: rgba(220, 240, 230, 0.08);
    --line-strong: rgba(220, 240, 230, 0.16);

    /* Ink */
    --ink: #ECF1EA;
    --ink-2: #A9B8B1;
    --ink-3: #74847D;

    /* Action */
    --saffron: #F4B33D;
    --saffron-ink: #1C1405;
    --saffron-soft: rgba(244, 179, 61, 0.14);

    /* Status */
    --good: #5FCB8A;
    --good-soft: rgba(95, 203, 138, 0.14);
    --info: #5AB8E8;
    --info-soft: rgba(90, 184, 232, 0.14);
    --over: #FF7A5C;
    --over-soft: rgba(255, 122, 92, 0.14);

    --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-num: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;

    --r-s: 10px;
    --r-m: 16px;
    --r-l: 26px;

    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --tabbar-h: 68px;
    --page: 600px;
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    min-height: 100dvh;
}
[hidden] { display: none !important; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--saffron); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
svg { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--saffron-soft); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; font-feature-settings: "tnum"; }
.hint { color: var(--ink-3); font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ─── Brand ─── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--saffron); text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-family: var(--font-num); font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -0.01em; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; padding: 0 20px;
    border-radius: 999px;
    font-weight: 600; font-size: 16px; white-space: nowrap;
    text-decoration: none !important;
    transition: transform 120ms var(--ease), background 160ms, color 160ms, opacity 160ms;
    user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--saffron); color: var(--saffron-ink); }
.btn-primary:hover { background: #F7BF55; }
.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--surface); }
.btn-danger { background: var(--over-soft); color: var(--over); }
.btn-good { background: var(--good-soft); color: var(--good); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-sm svg { width: 18px; height: 18px; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy svg { visibility: hidden; }
.btn.is-busy::after {
    content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 2.5px solid var(--saffron-ink); border-color: var(--saffron-ink) transparent;
    animation: spin 0.8s linear infinite;
}
.btn-secondary.is-busy::after { border-color: var(--ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    width: 44px; height: 44px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-3);
    transition: background 140ms, color 140ms;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.is-danger:hover { color: var(--over); background: var(--over-soft); }
.icon-btn.is-good:hover { color: var(--good); background: var(--good-soft); }

/* ─── Chips & segmented controls ─── */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 4px; padding: 2px 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 14px;
    border-radius: 999px;
    background: var(--surface); color: var(--ink-2);
    font-size: 14px; font-weight: 500;
    border: 1px solid transparent;
    transition: background 140ms, color 140ms, border-color 140ms;
    white-space: nowrap;
}
.chip:hover { color: var(--ink); }
.chip.is-on { background: var(--saffron-soft); color: var(--saffron); border-color: rgba(244, 179, 61, 0.4); }
.chip-count { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13px; }
.chip.is-on .chip-count { color: inherit; opacity: 0.75; }

.seg { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-btn { flex: 1; white-space: nowrap; min-height: 42px; border-radius: 999px; color: var(--ink-3); font-weight: 600; font-size: 15px; padding: 0 14px; transition: background 160ms, color 160ms; }
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.is-on { background: var(--surface-3); color: var(--ink); }

/* ─── Forms ─── */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.field-help { font-size: 13px; color: var(--ink-3); }
.input {
    width: 100%; min-height: 50px; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-s);
    font-size: 16px; color: var(--ink);
    transition: border-color 140ms, background 140ms;
    appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--saffron); background: var(--surface-2); }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 70px; }
.input-affix { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 8px 10px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.input-affix:hover { color: var(--ink); }
.form-error { color: var(--over); font-size: 14px; }
.form-note { color: var(--ink-2); font-size: 14px; }
.form-note.is-good { color: var(--good); }
.form-note.is-bad { color: var(--over); }

/* ─── Callouts ─── */
.callout {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 14px 14px 16px; border-radius: var(--r-m);
    background: var(--saffron-soft); border: 1px solid rgba(244, 179, 61, 0.28);
}
.callout-ico { width: 24px; height: 24px; color: var(--saffron); }
.callout-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.callout-text strong { font-size: 15px; }
.callout-text span { font-size: 13.5px; color: var(--ink-2); line-height: 1.35; }
.callout-quiet { background: var(--surface); border-color: var(--line); }
.callout-quiet .callout-ico { color: var(--ink-2); }

/* ─── Auth ─── */
.auth { min-height: 100dvh; display: flex; justify-content: center; padding: calc(var(--sat) + 48px) 20px calc(var(--sab) + 32px); }
.auth-inner { width: 100%; max-width: 400px; display: grid; gap: 28px; align-content: start; }
.auth-title { font-family: var(--font-num); font-weight: 750; font-stretch: 80%; font-size: 44px; line-height: 1; letter-spacing: -0.02em; margin: 24px 0 10px; }
.auth-sub { margin: 0 0 24px; color: var(--ink-2); max-width: 34ch; }
.auth-alt { margin-top: 20px; color: var(--ink-2); font-size: 15px; }

/* ─── App chrome: top bar ─── */
.app-page { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 32px); }
.topbar {
    position: sticky; top: 0; z-index: 15;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    max-width: var(--page); margin: 0 auto;
    padding: calc(var(--sat) + 12px) 20px 12px;
    background: rgba(14, 23, 21, 0.86);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.topbar .brand-mark { width: 28px; height: 28px; }
.live {
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 30px; padding: 0 12px; border-radius: 999px;
    background: var(--surface); color: var(--ink-2);
    font-size: 13px; font-weight: 600;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.live.is-off { color: var(--over); }
.live.is-off .live-dot { background: var(--over); }

/* ─── Tab bar ─── */
.tabbar {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + var(--sab)); padding: 0 8px var(--sab);
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center;
    background: rgba(14, 23, 21, 0.9);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid var(--line);
}
.tabbar-btn {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-3); font-size: 11.5px; font-weight: 600;
    text-decoration: none !important; transition: color 140ms;
}
.tabbar-btn:hover { color: var(--ink-2); }
.tabbar-btn svg { width: 24px; height: 24px; }
.tabbar-btn.is-on { color: var(--saffron); }
.tabbar-ico { position: relative; display: inline-flex; }
.tab-badge {
    position: absolute; top: -4px; left: 15px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--saffron); color: var(--saffron-ink);
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
    box-shadow: 0 0 0 2px var(--bg);
}
@media (min-width: 640px) {
    .tabbar { left: 50%; right: auto; width: 480px; transform: translateX(-50%); bottom: 16px; border-radius: 24px; border: 1px solid var(--line); height: var(--tabbar-h); padding: 0 8px; }
}

/* ─── Page + tabs ─── */
.page { max-width: var(--page); margin: 0 auto; padding: 4px 20px 0; display: grid; gap: 18px; }
.tab { display: grid; gap: 18px; align-content: start; animation: tab-in 220ms var(--ease); }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } }
.tab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 10px; }
.tab-title { font-family: var(--font-num); font-weight: 750; font-stretch: 80%; font-size: 34px; letter-spacing: -0.02em; line-height: 1.05; }
.tab-sub { margin-top: 6px; color: var(--ink-2); font-size: 15px; max-width: 42ch; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.section-title { font-family: var(--font-num); font-weight: 700; font-size: 22px; font-stretch: 85%; letter-spacing: -0.01em; line-height: 1.15; }
.section-note { font-size: 13px; color: var(--ink-3); }

/* ─── Feed hero (the signature element) ─── */
.greet { color: var(--ink-2); font-size: 17px; font-weight: 500; padding-top: 10px; margin-bottom: -10px; }
.hero { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; color: var(--ink); text-decoration: none !important; border-radius: var(--r-m); }
.big-num {
    font-family: var(--font-num); font-weight: 760; font-stretch: 75%;
    font-size: clamp(76px, 24vw, 104px); line-height: 0.86; letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
}
.hero.has-new .big-num { color: var(--saffron); }
.hero-caption { font-size: 17px; color: var(--ink-2); font-weight: 500; }
.hero:hover .hero-caption { color: var(--ink); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-m); overflow: hidden; }
.stat { background: var(--surface); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-val { font-family: var(--font-num); font-weight: 700; font-stretch: 80%; font-size: 28px; line-height: 1.05; font-variant-numeric: tabular-nums; order: -1; }
.stat-label { font-size: 13px; color: var(--ink-3); }

/* ─── Lists: feed, hits ─── */
.list { display: grid; }
.mail { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.mail:last-child { border-bottom: 0; }
.mail-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mail-subj { font-weight: 600; font-size: 16px; line-height: 1.35; }
.mail-summ {
    color: var(--ink-2); font-size: 15px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mail-summ.is-open { -webkit-line-clamp: unset; display: block; }
/* A student's own slot from the attached shortlist sheet — the one line that
   says when and where they must actually report. Saffron = act on this. */
.slots { display: grid; gap: 6px; margin-top: 2px; }
.slot {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  padding: 8px 11px; border-radius: var(--r-s);
  background: var(--saffron-soft); border: 1px solid rgba(244, 179, 61, 0.28);
  color: var(--ink); font-size: 13px; line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.slot-pin { display: none; }   /* the pin emoji read as noise; the box is signal enough */
.slot-text { font-weight: 600; }
.slot-code {
  font-family: var(--font-num); font-size: 12px; font-weight: 700;
  letter-spacing: .02em; color: var(--saffron);
  padding: 1px 7px; border-radius: 999px; background: rgba(244, 179, 61, 0.16);
}
.more-btn { justify-self: start; color: var(--ink-3); font-size: 13px; font-weight: 600; padding: 2px 0; }
.more-btn:hover { color: var(--ink); }
.mail-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.link-chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    min-height: 34px; padding: 0 12px; border-radius: 999px;
    background: var(--surface-2); color: var(--ink); font-size: 13.5px; font-weight: 600;
    text-decoration: none !important;
}
.link-chip:hover { background: var(--surface-3); }
.link-chip svg { width: 15px; height: 15px; color: var(--saffron); }
.link-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; text-transform: capitalize; }
.tag-shortlist, .tag-selection { background: var(--good-soft); color: var(--good); }
.tag-selection { box-shadow: inset 0 0 0 1px rgba(95, 203, 138, 0.45); }
.tag-announcement { background: var(--info-soft); color: var(--info); }
.tag-admin { background: var(--saffron-soft); color: var(--saffron); }
.tag-off { color: var(--ink-3); }

.hit { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.hit:last-child { border-bottom: 0; }
.hit-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; background: transparent; border: 1.5px solid var(--line-strong); }
.hit.is-unread .hit-dot { background: var(--saffron); border-color: var(--saffron); }
.hit-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.hit-id { font-family: var(--font-num); font-weight: 700; font-size: 15px; color: var(--saffron); letter-spacing: 0.02em; }
.hit:not(.is-unread) .hit-id { color: var(--ink-2); }
/* header row: your code + the company, same chip style, one line */
.hit-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hit-company { font-family: var(--font-num); font-weight: 700; font-size: 15px; letter-spacing: 0.02em; color: var(--ink); }
.hit:not(.is-unread) .hit-company { color: var(--ink-2); }
.hit-subj { font-weight: 600; line-height: 1.35; }
.hit:not(.is-unread) .hit-subj { color: var(--ink-2); font-weight: 500; }
/* the student's own sheet row is the card body — the thing they act on */
.hit-row { font-size: 14px; line-height: 1.5; margin: 2px 0 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.hit:not(.is-unread) .hit-row { color: var(--ink-2); }
/* fallback body when the mail carried no sheet row */
.hit-summ { font-weight: 600; font-size: 14.5px; line-height: 1.4; margin: 2px 0 0; }
.hit:not(.is-unread) .hit-summ { color: var(--ink-2); font-weight: 500; }
/* "Details" toggle: the mail subject + summary on demand, never competing with the row */
.hit-more {
  justify-self: start; margin-top: 2px; padding: 2px 0; border: 0; background: none;
  color: var(--ink-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
.hit-more:hover { color: var(--ink); }
.hit-more:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
.hit-extra {
  margin-top: 6px; padding: 10px 12px; border-left: 2px solid var(--line-strong);
  display: grid; gap: 6px; background: rgba(220, 240, 230, 0.02);
}
.hit-extra[hidden] { display: none; }
.hit-extra-subj { font-size: 13.5px; font-weight: 600; line-height: 1.4; margin: 0; }
.hit-extra-summ { font-size: 13.5px; line-height: 1.5; margin: 0; color: var(--ink-2); }

.empty { padding: 28px 0 8px; display: grid; gap: 14px; justify-items: start; }
.empty p { color: var(--ink-2); max-width: 36ch; }
.empty strong { font-family: var(--font-num); font-size: 20px; font-weight: 700; font-stretch: 85%; }

/* ─── Register IDs ─── */
.id-add { display: flex; gap: 10px; }
.id-add .input { flex: 1; text-transform: uppercase; font-size: 18px; font-weight: 600; }
.id-add .input::placeholder { text-transform: none; font-weight: 400; font-size: 16px; }
.id-list { list-style: none; padding: 0; display: grid; }
.id-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.id-list li:last-child { border-bottom: 0; }
.id-list li.empty { display: grid; border-bottom: 0; }
.id-badge { width: 40px; height: 40px; border-radius: 12px; background: var(--saffron-soft); color: var(--saffron); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.id-badge svg { width: 20px; height: 20px; }
.privacy-note { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); }
.privacy-note svg { width: 14px; height: 14px; }
.id-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.id-kind { font-size: 13px; color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.id-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.id-fields legend { padding: 0; margin-bottom: 6px; }
.id-fields .input { text-transform: uppercase; }
.id-fields .input::placeholder { text-transform: none; }
.id-val { font-family: var(--font-num); font-weight: 700; font-size: 20px; font-stretch: 90%; letter-spacing: 0.03em; }

/* ─── Admin ─── */
.admin-user { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-user:last-child { border-bottom: 0; }
.admin-user-info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.admin-user-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-user-meta { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Profile ─── */
.me-section { padding: 6px 0 26px; }
.me-section + .me-section { border-top: 1px solid var(--line); padding-top: 22px; }
.me-section h2 { font-family: var(--font-num); font-weight: 700; font-size: 21px; font-stretch: 85%; margin: 0 0 4px; }
.me-section p:not(.form-note) { margin: 0 0 16px; color: var(--ink-3); font-size: 14px; }
.me-section em { color: var(--ink-2); font-style: normal; font-weight: 600; }
.push-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-m); background: var(--surface); }
.push-row-ico { width: 24px; height: 24px; color: var(--ink-3); }
.push-row.is-on .push-row-ico { color: var(--good); }
.push-row.is-blocked .push-row-ico { color: var(--over); }
.push-row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }

/* ─── Landing ─── */
.landing { max-width: 960px; margin: 0 auto; padding: calc(var(--sat) + 18px) 20px calc(var(--sab) + 48px); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.landing-hero { padding: 72px 0 40px; max-width: 640px; }
.eyebrow { color: var(--saffron); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.landing-title { font-family: var(--font-num); font-weight: 760; font-stretch: 78%; font-size: clamp(48px, 10vw, 84px); line-height: 0.95; letter-spacing: -0.03em; }
.landing-title .accent { color: var(--saffron); }
.lead { margin-top: 22px; font-size: 18px; color: var(--ink-2); max-width: 46ch; }
.lead strong { color: var(--ink); }
.hero-actions { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }

.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-m); overflow: hidden; }
.step { background: var(--surface); padding: 18px; display: grid; gap: 4px; align-content: start; }
.step-num { font-family: var(--font-num); font-weight: 760; font-stretch: 80%; font-size: 34px; line-height: 1; color: var(--saffron); margin-bottom: 8px; }
.step strong { font-size: 16px; }
.step span:last-child { font-size: 14px; color: var(--ink-3); }

/* Install routes: the same divided band as .steps below it, so the page reads as one
   rhythm instead of a narrow strip floating above a wide grid. */
.install-lead-line {
  margin: 26px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 74ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.install-lead-line svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--saffron); }
.install-lead-line b { color: var(--ink); font-weight: 620; }

.install-strip {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}
.install-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px 12px;
  padding: 18px;
  min-height: 100%;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}
.install-tile:hover { background: var(--surface-2); }
.install-tile:focus-visible { outline: 2px solid var(--saffron); outline-offset: -2px; }
.install-tile .tile-ico { width: 22px; height: 22px; color: var(--ink-2); margin-top: 1px; }
.install-tile .tile-body { display: grid; gap: 3px; min-width: 0; }
.install-tile .tile-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-width: 0;
}
.install-tile .tile-head b { min-width: 0; font-size: 16px; font-weight: 620; color: var(--ink); }
.install-tile .tile-sub {
  display: block; min-width: 0; font-size: 14px; line-height: 1.45; color: var(--ink-3);
  overflow-wrap: anywhere;
}
.install-tag {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700;
  color: var(--saffron); background: rgba(244, 179, 61, .14);
  border-radius: 99px; padding: 3px 8px; white-space: nowrap;
}
/* The band clips to a radius, but the "your device" ring is painted on the tile — so the
   end tiles have to carry the rounded corners themselves, or the gold stops square where
   the band curves. */
.install-tile:first-child { border-top-left-radius: var(--r-m); border-bottom-left-radius: var(--r-m); }
.install-tile:last-child { border-top-right-radius: var(--r-m); border-bottom-right-radius: var(--r-m); }
.install-tile.is-you {
  background: linear-gradient(180deg, rgba(244, 179, 61, .08), transparent 65%), var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(244, 179, 61, .45);
}
.install-tile.is-you .tile-ico { color: var(--saffron); }

.install { margin-top: 64px; display: grid; gap: 14px; }
.install-lead { color: var(--ink-2); max-width: 56ch; }
.install-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.install-card { background: var(--surface); border-radius: var(--r-m); padding: 18px; }
.install-ico { width: 24px; height: 24px; color: var(--ink-2); margin-bottom: 10px; }
.install-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.install-card ol { padding-left: 18px; display: grid; gap: 6px; }
.install-card li { font-size: 14px; color: var(--ink-2); }
.install-card strong { color: var(--ink); font-weight: 600; }
.install-card--app { background: linear-gradient(180deg, rgba(244,179,61,.06), transparent 60%), var(--surface); }
.install-line {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
.install-btn { margin-top: 14px; }
/* An inline icon where a character used to be: ⋮ rendered as ":" in some fonts. */
.kbd {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  vertical-align: -5px;
  margin-right: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.kbd svg { width: 13px; height: 13px; }
.install-hint {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
.install-card .mono { color: var(--saffron); }
.install-note { margin-top: 4px; }

/* ─── Toasts ─── */
.toasts { position: fixed; z-index: 100; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--sab) + 14px); display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
@media (min-width: 640px) { .toasts { bottom: calc(var(--tabbar-h) + 30px); } }
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 14px;
    max-width: min(480px, calc(100vw - 32px)); width: max-content; min-height: 48px; padding: 10px 10px 10px 18px;
    border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    animation: toast-in 260ms var(--ease);
}
.toast.is-error { background: var(--over); color: #1d0a05; }
.toast.is-out { animation: fade-out 200ms ease forwards; }
.toast button { padding: 8px 12px; border-radius: 9px; font-weight: 700; color: inherit; background: rgba(0, 0, 0, 0.08); }
.toast:not(:has(button)) { padding-right: 18px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes fade-out { to { opacity: 0; } }

/* ─── Skeleton ─── */
.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: skel 1.4s ease infinite; border-radius: 10px; }
.skel-row { height: 76px; margin: 10px 0; }
@keyframes skel { to { background-position: -200% 0; } }

/* ─── Small screens ─── */
@media (max-width: 640px) {
    .steps, .install-grid, .install-strip { grid-template-columns: 1fr; }
    .install-tile:first-child { border-top-right-radius: var(--r-m); border-bottom-left-radius: 0; }
    .install-tile:last-child { border-bottom-left-radius: var(--r-m); border-top-right-radius: 0; }
    .landing-hero { padding-top: 48px; }
    .tab-head { flex-wrap: wrap; }
}
@media (max-width: 380px) {
    .stat { padding: 12px 10px 10px; }
    .stat-val { font-size: 24px; }
    .tabbar-btn { font-size: 10.5px; }
}

/* Free iOS reminder: no app install, no Apple account — Calendar fires the VALARM.
   Sits where "Details" does so it reads as an action on the row, not a decoration. */
.hit-ics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, rgba(220, 240, 230, .16));
  color: var(--saffron, #f4b33d);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.hit-ics:hover { background: rgba(244, 179, 61, .10); }
.hit-ics svg { width: 14px; height: 14px; }

/* ─── The app download page (/app) ──────────────────────────────────────────
   A sideload deserves one screen that states the trade honestly: what it does
   better than the browser, and the three taps it takes. */
.app-hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 56px 0 12px;
}
.app-icon {
  flex: 0 0 auto;
  width: 92px; height: 92px;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
}
.app-hero-text { min-width: 0; }
.app-hero .landing-title { font-size: clamp(30px, 5vw, 44px); margin: 0; }
.app-hero .lead { margin-top: 12px; font-size: 17px; }
.app-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.app-meta {
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.app-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 44px 0 8px;
  background: var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}
.app-fact { background: var(--surface); padding: 20px 18px; }
.app-fact svg { width: 20px; height: 20px; color: var(--saffron); margin-bottom: 12px; }
.app-fact h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.app-fact p { font-size: 13.5px; line-height: 1.55; color: var(--ink-3); margin: 0; }

.app-ios { margin-top: 44px; }

/* Compact strip under the login form and on the dashboard — one tappable row. */
.appstrip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 11px 13px;
  border-radius: var(--r-s);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background .15s ease, border-color .15s ease;
}
.appstrip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.appstrip-icon { border-radius: 9px; flex: 0 0 auto; }
.appstrip-text { flex: 1 1 auto; display: grid; gap: 2px; min-width: 0; }
.appstrip-text strong { font-size: 14px; font-weight: 600; }
.appstrip-text em {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appstrip-chev { width: 15px; height: 15px; color: var(--ink-3); flex: 0 0 auto; }

@media (max-width: 620px) {
  .app-hero { flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 40px; }
  .app-facts { grid-template-columns: 1fr; }
  .app-cta .btn { width: 100%; justify-content: center; }
}

/* A freshly minted reset link: the raw token exists only in this response, so it is
   shown with a copy button rather than hidden behind a toast. */
.reset-link-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: var(--r-s);
  background: var(--surface);
  border: 1px solid rgba(244, 179, 61, .28);
}
.reset-link-card .input { font-size: 13px; }
.reset-link-card .btn { justify-self: start; }

/* Verification code: a wide, monospaced box so six digits read as six digits. */
.code-input{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:22px; letter-spacing:.34em; text-align:center; padding:14px 12px;
}
.linklike{
  background:none; border:0; padding:0; font:inherit; color:var(--saffron,#F4B33D);
  cursor:pointer; text-decoration:underline; text-underline-offset:2px;
}
.linklike:disabled{opacity:.55; cursor:default; text-decoration:none;}
