/* =========================================================================
   TRPL Marketing Dashboard
   --------------------------------------------------------------------------
   Visual direction: warm, professional, Badlands-rooted. Friendly but
   serious — the "knowledgeable park ranger" voice in visual form. Colors
   should be swapped to TRPL official brand palette once we pull values
   from the style guide; the variables below are tasteful placeholders.
   ========================================================================= */

:root {
  /* Brand-leaning palette — replace with official TRPL values */
  --color-bg:           #FAF7F2;   /* warm off-white */
  --color-bg-card:      #FFFFFF;
  --color-bg-subtle:    #F1EBE0;
  --color-ink:          #1F2A30;   /* deep charcoal */
  --color-ink-soft:     #4A5460;
  --color-muted:        #8A8377;
  --color-line:         #E5DDD0;

  --color-brand:        #8B2E1F;   /* TR-era earthy red */
  --color-brand-soft:   #C7724B;
  --color-sage:         #6E7A4F;   /* outdoor green */
  --color-sky:          #6989A4;   /* big-sky blue */
  --color-gold:         #B8893A;   /* warm accent */

  --color-good:         #4F7A4D;
  --color-good-bg:      #E7EFE0;
  --color-bad:          #B04A3A;
  --color-bad-bg:       #F4E2DC;
  --color-warn:         #B8893A;
  --color-warn-bg:      #F5ECDA;

  --radius:             10px;
  --radius-sm:          6px;
  --shadow-sm:          0 1px 2px rgba(31, 42, 48, 0.04),
                        0 2px 6px rgba(31, 42, 48, 0.04);
  --shadow-md:          0 4px 16px rgba(31, 42, 48, 0.06);

  --font-sans:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:         'Source Serif 4', Georgia, serif;
}

/* -------- Reset / base -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; color: var(--color-ink); margin: 0; }
a { color: var(--color-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--color-muted); }
.small { font-size: 13px; }

/* -------- Top bar / header -------- */
.topbar {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; opacity: 0.85; }
.brand:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 4px; border-radius: 4px; }
.brand-logo {
  height: 44px;
  width: auto;
  max-width: 320px;
  display: block;
}
/* On small screens, scale the logo down a touch */
@media (max-width: 720px) {
  .brand-logo { height: 36px; max-width: 220px; }
}

/* Legacy classes (TR circle + text) — kept for any inline references but
   no longer rendered. Pages all use .brand-logo now. */
.brand-mark { display: none; }
.brand-text { display: none; }

.primary-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  margin-left: 24px;
  flex-wrap: wrap;
}
.primary-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  color: var(--color-ink-soft);
  white-space: nowrap;
}
.primary-nav a.active { background: var(--color-bg-subtle); color: var(--color-ink); }
.primary-nav a:hover { background: var(--color-bg-subtle); text-decoration: none; }

/* On narrow screens, allow horizontal scroll if nav overflows */
@media (max-width: 900px) {
  .primary-nav {
    margin-left: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

.meta { font-size: 12px; color: var(--color-muted); }
.freshness::before { content: '●'; color: var(--color-good); margin-right: 6px; font-size: 10px; }
.freshness.is-sample::before { color: var(--color-warn); }

/* =========================================================================
   Data-state visual language
   --------------------------------------------------------------------------
   Three states that any data-rendering element can be in:
     1. LIVE     — real data from a connected source (default styling)
     2. SAMPLE   — placeholder data, source not yet connected but we have demo
                   values to show layout. Dimmed + obviously labeled.
     3. PENDING  — source not connected, no sample data; tile shows phase tag
                   instead of a number so structure is communicated.
   These styles apply across every page so the labeling is consistent.
   ========================================================================= */

/* ---- Top-of-page status banner ---- */
.data-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-line);
  background: var(--color-bg-card);
}
.data-status-banner[hidden] { display: none; }
.data-status-banner .data-status-icon {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-muted);
  flex-shrink: 0;
}
.data-status-banner .data-status-text { flex: 1; color: var(--color-ink-soft); }
.data-status-banner .data-status-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-soft);
  white-space: nowrap;
}
/* Last-updated timestamp on the right side of the banner. Replaces the
   "View channels →" link to free up topbar space and put freshness info
   exactly where people are already reading the status. */
.data-status-banner .data-status-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.data-status-banner.state-live .data-status-time  { color: var(--color-good); opacity: 0.85; }
.data-status-banner.state-mixed .data-status-time { color: var(--color-warn); opacity: 0.85; }

.data-status-banner.state-live {
  background: var(--color-good-bg);
  border-color: var(--color-good);
}
.data-status-banner.state-live .data-status-icon { background: var(--color-good); }
.data-status-banner.state-live .data-status-text { color: var(--color-good); }

.data-status-banner.state-mixed {
  background: var(--color-warn-bg);
  border-color: var(--color-warn);
}
.data-status-banner.state-mixed .data-status-icon { background: var(--color-warn); }
.data-status-banner.state-mixed .data-status-text { color: var(--color-warn); }

.data-status-banner.state-sample {
  background: var(--color-bg-subtle);
  border-color: var(--color-line);
}
.data-status-banner.state-sample .data-status-icon { background: var(--color-muted); }

/* ---- Section-level sample badge (for whole cards) ---- */
.is-sample-data { position: relative; }
.is-sample-data::before {
  content: 'SAMPLE DATA';
  position: absolute;
  top: 0; right: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  background: var(--color-warn-bg);
  padding: 4px 10px;
  border-radius: 0 var(--radius) 0 var(--radius);
  z-index: 3;
  pointer-events: none;
  box-shadow: -1px 1px 0 var(--color-line);
}

/* In-card "showing sample" banner that appears INSIDE the card body, above
   the data. Used by movers and any card where the corner badge isn't loud
   enough. */
.in-card-sample-note {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-warn-bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--color-warn);
  margin-bottom: 12px;
  font-weight: 500;
}
.in-card-sample-note::before {
  content: '⚠';
  font-size: 14px;
}

/* ---- Per-tile state on KPI tiles ---- */
.kpi-tile.state-live { /* default styling */ }

.kpi-tile.state-sample {
  background: repeating-linear-gradient(
    135deg,
    var(--color-bg-card) 0px,
    var(--color-bg-card) 8px,
    var(--color-bg-subtle) 8px,
    var(--color-bg-subtle) 9px
  );
  position: relative;
}
.kpi-tile.state-sample .kpi-value { color: var(--color-ink-soft); }

.kpi-tile.state-pending {
  background: var(--color-bg-subtle);
  border-style: dashed;
  opacity: 0.85;
}
.kpi-tile.state-pending .kpi-value {
  font-size: 14px;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--color-muted);
  line-height: 1.4;
}

/* Tile state pill (top-right corner of each KPI tile) */
.kpi-state-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
}
.kpi-state-pill.state-sample { color: var(--color-muted); background: var(--color-bg-subtle); border: 1px solid var(--color-line); }
.kpi-state-pill.state-pending { color: var(--color-warn); background: var(--color-warn-bg); }

/* Source attribution at the bottom of every KPI tile */
.kpi-source {
  font-size: 10px;
  color: var(--color-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ---- Per-stage state on funnel stages ---- */
.funnel-stage.state-sample {
  background: repeating-linear-gradient(
    135deg,
    transparent 0px,
    transparent 8px,
    var(--color-bg-subtle) 8px,
    var(--color-bg-subtle) 9px
  );
}
.funnel-stage.state-sample .funnel-stage-value { color: var(--color-ink-soft); }

.funnel-stage.state-pending .funnel-stage-value {
  color: var(--color-muted);
  font-size: 14px;
  font-family: var(--font-sans);
  font-weight: 500;
}
.funnel-stage.state-pending {
  background: var(--color-bg-subtle);
}

.funnel-stage-state {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 6px;
}
.funnel-stage-state.state-sample { color: var(--color-muted); background: var(--color-bg-subtle); border: 1px solid var(--color-line); }
.funnel-stage-state.state-pending { color: var(--color-warn); background: var(--color-warn-bg); }

.funnel-stage-source {
  font-size: 10px;
  color: var(--color-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -------- Filter bar (legacy class — still used by main.css references) -------- */
.filterbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px 16px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-line);
}
.filter-group { display: flex; gap: 4px; align-items: center; }
.filter-label { font-size: 12px; color: var(--color-muted); margin-right: 4px; }
.filter-group button {
  background: transparent;
  border: 1px solid var(--color-line);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-group button:hover { background: var(--color-bg-subtle); }
.filter-group button.active {
  background: var(--color-ink);
  color: white;
  border-color: var(--color-ink);
}

/* =========================================================================
   Dashboard filter bar (NEW — injected by filters.js on every page)
   ========================================================================= */

.dashboard-filter-bar {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-line);
  position: sticky;
  /* Stick below the topbar (which is itself sticky at top:0). The topbar's
     rendered height varies slightly with the brand logo, but ~76px covers
     both desktop (44px logo + padding) and most mobile (36px logo + padding). */
  top: 76px;
  z-index: 40;
  box-shadow: 0 2px 4px rgba(31,42,48,0.04);
}
@media (max-width: 720px) {
  .dashboard-filter-bar { top: 64px; }
}
.dfb-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.dfb-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.dfb-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-right: 6px;
}
.dfb-group button {
  background: transparent;
  border: 1px solid var(--color-line);
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dfb-group button:hover:not(:disabled) { background: var(--color-bg-subtle); }
.dfb-group button.active {
  background: var(--color-ink);
  color: white;
  border-color: var(--color-ink);
}
.dfb-group button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dfb-group button.is-current {
  /* Subtle indicator the * marker means "this is the current quarter" */
  font-weight: 600;
}

/* Month picker — button + concealed select layered on top so clicking the
   button opens the native select. */
.dfb-month-wrap {
  position: relative;
  display: inline-block;
}
.dfb-month-wrap select {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-family: inherit;
}
.dfb-month-wrap select:focus + button,
.dfb-month-wrap:hover button {
  background: var(--color-bg-subtle);
}

.dfb-group select {
  background: transparent;
  border: 1px solid var(--color-line);
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  color: var(--color-ink-soft);
  cursor: pointer;
}
.dfb-group select:hover { background: var(--color-bg-subtle); }

.dfb-spacer { flex: 1; min-width: 0; }
.dfb-current {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-soft);
  padding: 4px 10px;
  background: var(--color-bg-subtle);
  border-radius: 999px;
  white-space: nowrap;
}
.dfb-reset {
  background: transparent;
  border: none;
  font-size: 11px;
  font-family: inherit;
  color: var(--color-muted);
  cursor: pointer;
  padding: 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.dfb-reset:hover { color: var(--color-ink); text-decoration: underline; }

/* On mobile, stack groups vertically with a divider */
@media (max-width: 720px) {
  .dfb-inner { gap: 8px; padding: 10px 16px; }
  .dfb-group { width: 100%; }
}

/* -------- Layout -------- */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 20px;
}

/* -------- Pace banner -------- */
.pace-banner {
  background: linear-gradient(135deg, var(--color-bg-subtle), var(--color-bg-card));
  border-radius: var(--radius);
  padding: 20px 24px;
  border-left: 4px solid var(--color-brand);
}
.pace-banner-headline {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.pace-banner-sub {
  margin-top: 6px;
  color: var(--color-ink-soft);
  font-size: 14px;
}
.pace-banner.is-good      { border-left-color: var(--color-good); }
.pace-banner.is-warn      { border-left-color: var(--color-warn); }
.pace-banner.is-bad       { border-left-color: var(--color-bad); }
.pace-banner.state-pending { border-left-color: var(--color-muted); background: var(--color-bg-subtle); }
.pace-banner.state-sample  { border-left-color: var(--color-warn); background: var(--color-warn-bg); }
.pace-banner.state-sample .pace-banner-headline,
.pace-banner.state-pending .pace-banner-headline { color: var(--color-ink-soft); }

/* -------- KPI grid -------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-tile {
  background: var(--color-bg-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-tile.is-dim { opacity: 0.45; }

/* Clickable KPI tiles: the link is the grid item, the article inside
 * fills it. We keep the article visually identical and add a small chevron
 * affordance on hover. The whole tile is the click target. */
.kpi-tile-link,
.kpi-tile-link:hover,
.kpi-tile-link:focus {
  display: flex;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  position: relative;
}
.kpi-tile-link > .kpi-tile { flex: 1; width: 100%; position: relative; cursor: pointer; }
/* Subtle "drill in" affordance — chevron appears on hover */
.kpi-tile-link > .kpi-tile::after {
  content: '›';
  position: absolute;
  top: 14px; right: 16px;
  color: var(--color-muted);
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.kpi-tile-link:hover > .kpi-tile::after { opacity: 0.7; transform: translateX(2px); }
/* Don't conflict with the existing SAMPLE pill in the corner */
.kpi-tile-link > .kpi-tile.state-sample::after { top: 14px; right: 70px; }
/* Keyboard focus visible — important since the whole tile is a link */
.kpi-tile-link:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

/* :target highlight — when a deep-dive page is opened via #anchor (from a
 * tile click), the matching card gets a brief glow so the user knows where
 * they landed. */
@keyframes kpi-target-highlight {
  0%   { box-shadow: 0 0 0 3px var(--color-brand-soft, rgba(139, 46, 31, 0.25)); }
  100% { box-shadow: var(--shadow-sm); }
}
:target { animation: kpi-target-highlight 1.4s ease-out 0.1s; scroll-margin-top: 140px; }
.kpi-label { font-size: 12px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi-period-hint {
  font-size: 9px;
  font-weight: 700;
  color: var(--color-brand);
  background: var(--color-warn-bg);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-value { font-family: var(--font-serif); font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--color-ink); }
.kpi-meta { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.kpi-delta.good { background: var(--color-good-bg); color: var(--color-good); }
.kpi-delta.bad  { background: var(--color-bad-bg);  color: var(--color-bad); }
.kpi-delta.warn { background: var(--color-warn-bg); color: var(--color-warn); }
.kpi-delta.neutral { background: var(--color-bg-subtle); color: var(--color-ink-soft); }
.kpi-compare-label { color: var(--color-muted); font-size: 11px; }
.kpi-spark { height: 36px; margin-top: 4px; }

/* -------- Rows / cards -------- */
.row.two-col {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 16px;
}
@media (max-width: 820px) {
  .row.two-col { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-line);
}
.card-head h2 { font-size: 16px; }
.card-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600; color: var(--color-muted);
  padding: 3px 8px; background: var(--color-bg-subtle); border-radius: 999px;
}
.card-body { padding: 18px 20px; }

/* -------- Weather card -------- */
.weather-now {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px;
}
.weather-temp {
  font-family: var(--font-serif);
  font-size: 38px; font-weight: 700; line-height: 1;
  color: var(--color-ink);
}
.weather-conditions { color: var(--color-ink-soft); font-size: 15px; }
.weather-hilo { font-size: 13px; color: var(--color-muted); margin-bottom: 12px; }
.weather-summary {
  font-style: italic;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-ink-soft);
}

/* -------- Movers card -------- */
.mover {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
}
.mover:last-child { border-bottom: none; }
.mover-arrow {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.mover-arrow.up   { background: var(--color-good-bg); color: var(--color-good); }
.mover-arrow.down { background: var(--color-bad-bg);  color: var(--color-bad); }
.mover-body { line-height: 1.35; }
.mover-channel { font-weight: 600; color: var(--color-ink); }
.mover-metric  { font-size: 13px; color: var(--color-ink-soft); }
.mover-note    { font-size: 12px; color: var(--color-muted); margin-top: 2px; }
.mover-pct     { font-family: var(--font-serif); font-weight: 700; font-size: 18px; }
.mover-pct.up   { color: var(--color-good); }
.mover-pct.down { color: var(--color-bad); }

/* -------- Funnel -------- */
.funnel-card .card-body, .funnel { padding: 0; }
.funnel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.funnel-stage {
  padding: 20px;
  border-right: 1px solid var(--color-line);
  position: relative;
}
.funnel-stage:last-child { border-right: none; }
.funnel-stage-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 600; color: var(--color-muted); margin-bottom: 8px;
}
.funnel-stage-value {
  font-family: var(--font-serif); font-size: 24px; font-weight: 700; line-height: 1.1;
}
.funnel-stage-sub { font-size: 12px; color: var(--color-muted); margin-top: 4px; }

@media (max-width: 720px) {
  .funnel { grid-template-columns: 1fr 1fr; }
  .funnel-stage:nth-child(2n) { border-right: none; }
  .funnel-stage:nth-child(-n+2) { border-bottom: 1px solid var(--color-line); }
}

/* -------- Footer -------- */
.site-foot {
  margin-top: 32px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--color-line);
}
.foot-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 13px;
  color: var(--color-muted);
}
.foot-inner p { margin: 4px 0; }

/* -------- Utility -------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ---- Auth gate (client-side password overlay) ---- */
.auth-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg, #f7f3ed);
  padding: 24px;
}
.auth-gate[hidden] { display: none; }
.auth-gate-card {
  width: 100%; max-width: 380px;
  background: var(--color-bg-card, #fff);
  border: 1px solid var(--color-line, #e2dccf);
  border-radius: var(--radius, 8px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
  padding: 32px 28px;
  text-align: center;
}
.auth-gate-logo { width: 64px; height: auto; margin-bottom: 16px; }
.auth-gate-card h1 {
  font-family: var(--font-serif, "Source Serif 4", Georgia, serif);
  font-size: 22px; font-weight: 700; margin: 0 0 4px;
  color: var(--color-ink, #1f2a30);
}
.auth-gate-sub {
  font-size: 13px; color: var(--color-ink-soft, #4A5460);
  margin: 0 0 20px; line-height: 1.4;
}
.auth-gate input[type="password"] {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--color-line, #e2dccf);
  border-radius: var(--radius-sm, 4px);
  background: white; color: var(--color-ink, #1f2a30);
  margin-bottom: 10px;
}
.auth-gate input[type="password"]:focus {
  outline: 2px solid var(--color-brand, #8b2e1f); outline-offset: 1px;
  border-color: var(--color-brand, #8b2e1f);
}
.auth-gate button[type="submit"] {
  width: 100%; padding: 10px 12px;
  background: var(--color-brand, #8b2e1f); color: white;
  border: none; border-radius: var(--radius-sm, 4px);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.auth-gate button[type="submit"]:hover { filter: brightness(1.08); }
.auth-gate-error {
  margin: 10px 0 0; font-size: 12px;
  color: var(--color-brand, #8b2e1f);
}
