/* ===========================================================================
   Suara: "Sealed Horizon" bones, Suara identity
   The same engineering bones as Selo (light-first, self-hosted Onest variable
   sans, hand-written CSS tokens, no UI library, data-driven theming via CSS
   custom properties) but a warm, human organising identity: a confident
   voice-amber / terracotta action accent in place of Selo's cool teal data
   room, and a woven "many voices, one pattern" mark in place of the wax seal.

   Token model: this :root defines the full palette as fallbacks. ThemeStyle.razor
   (document head) overrides the coalition-themeable subset (--accent,
   --accent-strong, --bg, --surface, --ink, --muted, --line) and follows this file
   in the cascade so its values win when present. The quoted --font-sans token is
   owned HERE, never emitted from a Razor <style> block (Razor encodes the quotes
   and silently falls back to serif).
   =========================================================================== */

/* Onest: variable sans, self-hosted. No external font dependency. */
@font-face {
    font-family: 'Onest';
    src: url('/fonts/Onest-VariableFont_wght.woff2') format('woff2-variations'),
         url('/fonts/Onest-VariableFont_wght.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Action accent: voice-amber / terracotta */
    --amber: #c2570c;
    --amber-strong: #9a4309;
    --amber-soft: #fbe9d8;
    --amber-glow: rgba(194, 87, 12, 0.22);

    /* Warm neutral canvas */
    --canvas: #faf8f5;
    --ink-base: #1c1917;
    --muted-base: #57534e;
    --line-base: #e3ddd5;
    --surface-base: #ffffff;
    --surface-sunk-base: #f1ede8;

    /* Depth + motion */
    --shadow-ring: 0 0 0 1px rgba(28, 25, 23, 0.06);
    --shadow-lift: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 12px rgba(28, 25, 23, 0.07);
    --shadow-hover: 0 2px 4px rgba(28, 25, 23, 0.06), 0 10px 28px rgba(28, 25, 23, 0.10);
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-pill: 9999px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* ---- Coalition-themeable aliases (ThemeStyle overrides these) ---- */
    --accent: var(--amber);
    --accent-strong: var(--amber-strong);
    --accent-soft: var(--amber-soft);
    --bg: var(--canvas);
    --surface: var(--surface-base);
    --surface-soft: var(--canvas);
    --surface-sunk: var(--surface-sunk-base);
    --ink: var(--ink-base);
    --ink-soft: var(--muted-base);
    --muted: var(--muted-base);
    --line: var(--line-base);

    /* The only quoted token: owned here, never emitted from a Razor <style>. */
    --font-sans: 'Onest', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Status */
    --ok: #15803d;
    --warn: #b45309;
    --danger: #b91c1c;
    --radius: var(--r-md);

    /* Consent identity */
    --consent-granted-bg: #e9f6ee;
    --consent-granted-fg: #15803d;
    --consent-pending-bg: #fdf3e3;
    --consent-pending-fg: #b45309;
    --consent-withdrawn-bg: #f6e7e7;
    --consent-withdrawn-fg: #b91c1c;
}

/* ---- Blazor framework boilerplate ---- */
h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--accent); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); }

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem 1.5rem;
    color: #fff;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff4e5;
    border-top: 1px solid var(--warn);
    color: var(--ink);
    padding: 0.7rem 1.25rem;
    box-shadow: 0 -1px 6px rgba(28, 25, 23, 0.12);
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ---- Base + typography ---- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font-sans);
    font-feature-settings: "calt" 1;
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Barely-there warm wash: a faint amber atmosphere, no hard edges. */
    background-image:
        radial-gradient(60rem 40rem at 90% -12%, rgba(194, 87, 12, 0.05), transparent 60%),
        radial-gradient(50rem 36rem at -10% 6%, rgba(154, 67, 9, 0.04), transparent 55%);
    background-attachment: fixed;
}

h1, h2, h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink);
}
h1 { font-size: 1.65rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Shared primary button: amber fill, white text (the accent is dark enough). */
.btn {
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: var(--r-pill);
    padding: 0.55rem 1.15rem;
    text-decoration: none;
    text-align: center;
    transition: transform 150ms var(--ease), box-shadow 150ms ease, background 150ms ease;
}
.btn:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 6px 18px var(--amber-glow); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--accent-strong); border: 1px solid var(--accent); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); box-shadow: none; transform: none; }

/* A plain text/link button used in topbars and rows. No resting underline; a
   subtle underline on hover keeps the affordance without the cluttered default. */
.link { background: none; border: none; color: var(--accent-strong); cursor: pointer; font: inherit; padding: 0; text-decoration: none; }
.link:hover { color: var(--accent); text-decoration: underline; }

/* ===========================================================================
   Shell 1: staff sidebar (deep altitude)
   These mirror the class names StaffLayout.razor / StaffLayout.razor.css use, so
   the scoped layout CSS and this sheet agree on structure; tokens come from here.
   =========================================================================== */
.staff-shell { display: flex; min-height: 100vh; background: var(--surface-soft); color: var(--ink); }
.staff-content { padding: 1.5rem; flex: 1 1 auto; max-width: 70rem; }
.staff-content > h1:first-child { margin-top: 0; }

/* Content-stack rhythm: a body of PageHeader + SummaryCards + panels breathes
   consistently without per-page margins. The page header sits flush to the top. */
.staff-content > * + * { margin-top: 1.25rem; }
.staff-content > .page-header { margin-top: 0; }

/* ---- Sidebar shell (GLOBAL on purpose: scoped CSS never reaches the <NavLink>
   anchors, and a scoped .staff-sidebar[b-xxx] would also outrank the responsive
   @media rules by specificity. Keeping these global fixes both.) ---- */
.staff-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.staff-sidebar { width: 248px; flex: 0 0 248px; background: var(--surface); border-right: 1px solid var(--line); padding: 1.1rem 0.75rem; display: flex; flex-direction: column; gap: 0.85rem; }
.staff-brand { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.4rem; font-weight: 700; }
.brand-accent { color: var(--accent); display: inline-flex; }
.brand-word { font-size: 1.15rem; letter-spacing: 0.01em; flex: 1 1 auto; min-width: 0; }
.sidebar-toggle { display: none; }

.workspace-switcher { display: flex; flex-direction: column; gap: 0.3rem; padding: 0 0.4rem; }
.switcher-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.switcher-control { position: relative; display: flex; align-items: center; gap: 0.45rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0.55rem; background: var(--surface); color: var(--ink-soft); transition: border-color 150ms ease, box-shadow 150ms ease; }
.switcher-control:hover { border-color: var(--accent); }
.switcher-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--amber-glow); }
.switcher-lead { display: inline-flex; flex: 0 0 auto; }
.switcher-control select { flex: 1 1 auto; min-width: 0; border: none; background: none; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink); padding: 0.5rem 0; appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher-control select:focus { outline: none; }
.switcher-caret { display: inline-flex; flex: 0 0 auto; pointer-events: none; }
.switcher-sub { font-size: 0.7rem; color: var(--ink-soft); padding: 0 0.4rem; }
.switcher-action { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; color: var(--accent-strong); text-decoration: none; padding: 0.1rem 0.4rem; }
.switcher-action:hover { text-decoration: underline; }

.staff-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 auto; }
.nav-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.65rem; border-radius: var(--radius); color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.nav-item:hover { background: var(--surface-sunk); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.nav-item-sub { margin-left: 0.9rem; font-size: 0.9rem; }
.nav-group-label { margin-top: 0.75rem; padding: 0 0.65rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }

.staff-account { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.65rem; border-top: 1px solid var(--line); margin-top: auto; }
.account-icon { color: var(--ink-soft); display: inline-flex; }
.account-who { flex: 1 1 auto; font-size: 0.9rem; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout-form { margin: 0; }

/* Compact mobile header (revealed below 768px). */
.staff-mobilebar { display: none; align-items: center; justify-content: space-between; padding: 0.65rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.mobile-brand { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--accent); }
.mobile-who { font-size: 0.85rem; color: var(--ink-soft); }

/* ---- Collapsible desktop sidebar. Toggle is window.suaraSidebar (App.razor);
   it adds .sidebar-collapsed to <html>. Only meaningful at >=1024px (tablet is
   already a rail, mobile hides the sidebar). ---- */
@media (min-width: 1024px) {
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; flex: 0 0 auto; border: none; background: none; color: var(--ink-soft); border-radius: var(--radius); cursor: pointer; }
    .sidebar-toggle:hover { background: var(--surface-sunk); color: var(--ink); }
    .sidebar-collapsed .staff-sidebar { width: 72px; flex: 0 0 72px; padding: 1.1rem 0.4rem; }
    .sidebar-collapsed .brand-word,
    .sidebar-collapsed .switcher-label,
    .sidebar-collapsed .switcher-control select,
    .sidebar-collapsed .switcher-caret,
    .sidebar-collapsed .switcher-sub,
    .sidebar-collapsed .switcher-action,
    .sidebar-collapsed .nav-item span,
    .sidebar-collapsed .nav-group-label,
    .sidebar-collapsed .account-who,
    .sidebar-collapsed .signout-form { display: none; }
    .sidebar-collapsed .staff-brand { justify-content: center; padding: 0; }
    .sidebar-collapsed .workspace-switcher { padding: 0; }
    .sidebar-collapsed .switcher-control { justify-content: center; padding: 0.45rem; }
    .sidebar-collapsed .nav-item { justify-content: center; padding: 0.55rem 0; }
    .sidebar-collapsed .nav-item-sub { margin-left: 0; }
    .sidebar-collapsed .staff-account { flex-direction: column; gap: 0.3rem; padding: 0.6rem 0.2rem; align-items: center; }
}

/* ---- PageHeader band (the per-page context the topbar used to carry) ---- */
.page-header { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.page-breadcrumb { font-size: 0.82rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.35rem; }
.page-breadcrumb a { color: var(--ink-soft); }
.page-breadcrumb a:hover { color: var(--accent); }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-header-titles { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.page-title { margin: 0; }
.page-header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.page-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.page-tabs a { padding: 0.4rem 0.7rem; border-radius: var(--r-pill); color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.page-tabs a:hover { background: var(--surface-sunk); color: var(--ink); }
.page-tabs a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* ---- Summary cards (the at-a-glance metric layer) ---- */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; }
.metric-card { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.metric-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.metric-value { font-size: 1.7rem; font-weight: 700; color: var(--accent-strong); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric-detail { font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Empty state ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.6rem; padding: 2.5rem 1rem; color: var(--ink-soft); }
.empty-state-icon { color: var(--line); }
.empty-state-message { margin: 0; max-width: 28rem; }
.empty-state-action { margin-top: 0.25rem; }

/* ---- Progress bar (the reusable component; distinct from the plan .bar) ---- */
.progress { height: 0.5rem; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 220ms var(--ease); }
@media (prefers-reduced-motion: reduce) {
    .progress-fill { transition: none; }
}

/* ---- Bottom nav (mobile) + its "More" sheet. Hidden until <768px. ---- */
.bottom-nav { display: none; }
.bottom-more, .bottom-more-backdrop { display: none; }
.bottom-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; flex: 1 1 0; min-height: 56px; border: none; background: none; color: var(--ink-soft); font: inherit; font-size: 0.7rem; cursor: pointer; text-decoration: none; }
.bottom-item span { font-size: 0.7rem; }
.bottom-item.active { color: var(--accent-strong); }
.bottom-more-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.5rem; color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.bottom-more-item:hover { background: var(--surface-sunk); }

/* ---- Staggered page-load reveal, reduced-motion-gated ---- */
@media (prefers-reduced-motion: no-preference) {
    .staff-content > * { animation: reveal-up 320ms var(--ease) both; }
    .staff-content > *:nth-child(2) { animation-delay: 40ms; }
    .staff-content > *:nth-child(3) { animation-delay: 80ms; }
    .staff-content > *:nth-child(4) { animation-delay: 120ms; }
    .staff-content > *:nth-child(n+5) { animation-delay: 160ms; }
}
@keyframes reveal-up {
    from { opacity: 0; transform: translateY(0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===========================================================================
   Shell 2: volunteer thin surface
   =========================================================================== */
.vol-shell { max-width: 640px; margin: 0 auto; padding: 1rem; min-height: 100vh; }
.vol-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.vol-brand { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--accent); }
.vol-content { padding: 0.5rem 0; }
.vol-content h1 { font-size: 1.4rem; }

/* ===========================================================================
   Shell 3: minimal public RSVP
   =========================================================================== */
.public-shell { max-width: 560px; margin: 0 auto; padding: 1.5rem 1rem; min-height: 100vh; display: flex; flex-direction: column; }
.public-head { display: flex; justify-content: center; padding-bottom: 1.25rem; }
.public-brand { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; color: var(--accent); }
.public-content { flex: 1 1 auto; }
.public-foot { color: var(--ink-soft); font-size: 0.8rem; text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--line); margin-top: 1.5rem; }

/* ---- Cards (dashboard) ---- */
.cards { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 2rem; }
.card { display: flex; flex-direction: column; gap: 0.25rem; min-width: 150px; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-lift); transition: transform 200ms var(--ease), box-shadow 200ms ease, border-color 200ms ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
.card-num { font-size: 1.8rem; font-weight: 700; color: var(--accent-strong); letter-spacing: -0.02em; }
.card-label { color: var(--ink-soft); font-size: 0.85rem; }
.plain { list-style: none; padding: 0; margin: 0.5rem 0 1.5rem; }
.plain li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }

/* ---- Generic surface panel ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-lift); margin: 1rem 0; }

/* ---- Consent badges (granted / pending / withdrawn) ---- */
.consent-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.18rem 0.6rem; border-radius: var(--r-pill);
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.consent-badge.granted { background: var(--consent-granted-bg); color: var(--consent-granted-fg); }
.consent-badge.pending { background: var(--consent-pending-bg); color: var(--consent-pending-fg); }
.consent-badge.withdrawn { background: var(--consent-withdrawn-bg); color: var(--consent-withdrawn-fg); }
/* Pending sits in quarantine: a small dotted ring underlines that it is not contactable. */
.consent-badge.pending { box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.35); }

/* ---- Shift capacity chips ---- */
.shift { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0.5rem 0; }
.shift-role { font-weight: 600; }
.capacity-chip {
    display: inline-flex; align-items: baseline; gap: 0.25rem;
    padding: 0.2rem 0.6rem; border-radius: var(--r-pill);
    font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums;
    background: var(--surface-sunk); color: var(--ink-soft);
}
.capacity-chip .filled { color: var(--ink); }
.capacity-chip.open { background: var(--consent-granted-bg); color: var(--consent-granted-fg); }
.capacity-chip.full { background: var(--consent-withdrawn-bg); color: var(--consent-withdrawn-fg); }
.capacity-chip.mine { background: var(--accent-soft); color: var(--accent-strong); }

/* ---- Campaign plan layout ---- */
.plan-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.plan-head .back { font-size: 0.85rem; }
.plan-head h1 { margin: 0; }
.status-pill { padding: 0.2rem 0.65rem; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-strong); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.plan-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-lift); margin: 1.25rem 0; }
.plan-block h2 { margin-top: 0; }
.goal { margin: 0.6rem 0 1rem; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.goal-pct { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }
.bar { height: 0.55rem; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; margin: 0.35rem 0; }
.bar-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 200ms var(--ease); }
.milestone { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.milestone.done span:first-child { text-decoration: line-through; color: var(--ink-soft); }
.done-tag { color: var(--ok); font-size: 0.8rem; font-weight: 700; }
.tactic-date { display: inline-block; min-width: 5rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.toc textarea { width: 100%; min-height: 7rem; resize: vertical; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }

/* ---- Login (static SSR page; matches Login.razor's class names) ---- */
.login { max-width: 360px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 0.5rem; }
.login h1 { margin-bottom: 0; }
.login .lede { color: var(--ink-soft); margin-top: 0; }
.login-form { display: flex; flex-direction: column; gap: 0.4rem; }
.login-form label { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5rem; }
.login-form input { padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--surface); }
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--amber-glow); }
.login-form button { margin-top: 1rem; padding: 0.6rem; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; }
.login-form button:hover { background: var(--accent-strong); }

/* ---- Import wizard ---- */
.import-steps { display: flex; gap: 0.5rem; margin: 0.5rem 0 1.5rem; flex-wrap: wrap; }
.import-step { padding: 0.25rem 0.7rem; border-radius: var(--r-pill); background: var(--surface-sunk); color: var(--ink-soft); font-size: 0.8rem; }
.import-step.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.quarantine { background: var(--consent-pending-bg); border: 1px solid rgba(180, 83, 9, 0.35); border-radius: var(--radius); padding: 0.6rem 0.85rem; color: var(--consent-pending-fg); font-size: 0.88rem; }

/* ===========================================================================
   Responsive: desktop (>=1024) / tablet (768-1023) / mobile (<768)
   Supersedes the interim first-pass rules where they overlap.
   =========================================================================== */

/* Tablet: the sidebar collapses to a compact icon rail (icons only). */
@media (max-width: 1023px) and (min-width: 768px) {
    .staff-sidebar { width: 68px; flex: 0 0 68px; padding: 1rem 0.4rem; align-items: stretch; }
    .brand-word, .switcher-label { display: none; }
    .workspace-switcher { padding: 0; }
    .switcher-control { justify-content: center; }
    .switcher-control select { display: none; }
    .switcher-control .switcher-caret { display: none; }
    .switcher-sub, .switcher-action { display: none; }
    .nav-item span, .nav-group-label { display: none; }
    .nav-item { justify-content: center; padding: 0.55rem 0; }
    .staff-brand { justify-content: center; padding: 0; }
    .staff-account { flex-direction: column; gap: 0.3rem; padding: 0.6rem 0.2rem; text-align: center; }
    .account-who { display: none; }
    .staff-content { padding: 1.25rem; }
}

/* Mobile: hide the sidebar, show the compact header and the bottom tab bar. */
@media (max-width: 767px) {
    .staff-shell { flex-direction: column; }
    .staff-sidebar { display: none; }
    .staff-mobilebar { display: flex; }
    .staff-content { padding: 1rem 1rem 5rem; max-width: none; }
    /* The volunteer shell also carries the fixed bottom nav on mobile, so clear it. */
    .vol-shell { padding-bottom: 5rem; }

    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        background: var(--surface);
        border-top: 1px solid var(--line);
        box-shadow: 0 -1px 6px rgba(28, 25, 23, 0.08);
        z-index: 50;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .bottom-more-backdrop { display: block; position: fixed; inset: 0; background: rgba(28, 25, 23, 0.42); z-index: 55; }
    .bottom-more { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 56px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-hover); z-index: 56; padding: 0.5rem; }

    /* Retained reflow from the first pass (not superseded). */
    .cards { flex-direction: column; }
    .card { flex: 1 1 auto; min-width: 0; }
    .summary-cards { grid-template-columns: 1fr; }
    .shift, .shift-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .plan-head { gap: 0.5rem; }
    .grid { display: block; overflow-x: auto; }
    .row-form { flex-direction: column; align-items: stretch; }
    .row-form input, .row-form select, .row-form button, .row-form textarea { width: 100%; }
    .row-form .check { width: auto; flex-direction: row; align-items: center; }
    .link { display: inline-block; padding: 0.4rem 0.25rem; }
    .chip-x { min-width: 1.6rem; min-height: 1.6rem; padding: 0.2rem; }
}

@media (max-width: 380px) {
    h1 { font-size: 1.4rem; }
}
