/* ============================================================================
   Siyan ASO — "Gold / Cream Membership" design system
   ----------------------------------------------------------------------------
   A single, tokenised stylesheet that themes the whole dashboard. Everything is
   driven by CSS custom properties declared on :root so colour, type, spacing
   and elevation stay consistent across every screen instead of being
   copy-pasted per page.

   Layers (top → bottom):
     1. Design tokens            — the palette, type scale, spacing, radii, etc.
     2. Legacy token aliases     — old var names kept so inline `var(--slate)`
                                    etc. in the EJS templates keep resolving.
     3. Base / reset             — element defaults.
     4. Components               — the shared classes used across all views
                                    (.card, .btn, .kpi, table, forms, …).
     5. App shell                — top navigation + account menu.
     6. Auth surfaces (auth-*)   — login / reset / 2FA, page-scoped.

   Naming: shared component classes keep their historical names so no template
   markup has to change. NEW, page-specific styling is namespaced with a prefix
   (auth-, acct-, brand-) so it can never silently collide with a global class.
   No web fonts are loaded (the CSP forbids external font hosts) — we use a
   refined system serif for display type and the system UI sans for body copy.
   ========================================================================== */

/* ── 1. Design tokens ─────────────────────────────────────────────────────*/
:root {
  /* Gold ramp — from the palest champagne wash to deep antique bronze. */
  --gold-50:  #FBF6E7;
  --gold-100: #F6ECC9;
  --gold-200: #ECDBA3;
  --gold-300: #DEC474;
  --gold-400: #CBA94C;
  --gold-500: #B4902F;   /* signature gold                                   */
  --gold-600: #8A6A1C;   /* primary action — passes AA (~5:1) with white text*/
  --gold-700: #6F5415;   /* pressed / hover-deep                             */
  --gold-800: #543F0F;

  /* Cream / warm-neutral surfaces */
  --cream:      #F7F1E4;   /* app background                                 */
  --cream-deep: #F1E8D4;   /* recessed wells, inset tiles                    */
  --paper:      #FFFDF9;   /* cards, nav, menus — warm white                 */
  --paper-2:    #FBF6EC;   /* alt surface / table zebra                      */

  /* Ink — warm charcoals rather than pure grey/black */
  --ink:        #2B2417;   /* headings                                       */
  --body:       #493F2E;   /* body copy                                      */
  --muted:      #6F6552;   /* secondary text (AA on cream)                   */
  --faint:      #9A8F79;   /* tertiary / disabled                            */

  /* Lines */
  --border:      #E7DBC1;  /* hairline borders                               */
  --border-soft: #EFE7D5;  /* inner dividers                                 */

  /* Accent (navy-gold is the classic membership pairing) */
  --accent:      #355E7E;  /* deep slate-blue info accent                    */
  --accent-soft: #E7EEF4;

  /* Semantic — warm-tuned */
  --success:      #2F7D4F;  --success-soft: #E4F1E7;  --success-ink: #1E5636;
  --warning:      #9A6B12;  --warning-soft: #FaefD1;  --warning-ink: #7A5310;
  --danger:       #B4463A;  --danger-soft:  #F7E6E2;  --danger-ink:  #8A3128;

  /* Elevation — warm-tinted, never cold grey */
  --shadow-sm: 0 1px 2px rgba(84, 63, 15, 0.06);
  --shadow:    0 6px 18px rgba(84, 63, 15, 0.08), 0 1px 2px rgba(84, 63, 15, 0.05);
  --shadow-lg: 0 18px 44px rgba(84, 63, 15, 0.16);
  --ring:      0 0 0 3px rgba(180, 144, 47, 0.28);   /* gold focus ring       */

  /* Signature gradients (decorative only — text never sits on the mid-tone) */
  --grad-gold:  linear-gradient(135deg, #E4C766 0%, #C6A23F 45%, #9A7620 100%);
  --grad-sheen: linear-gradient(90deg, transparent, var(--gold-400), transparent);

  /* Radii */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;  --r-pill: 999px;

  /* Spacing scale (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;  --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px;  --s-8: 48px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

/* ── 2. Legacy token aliases ──────────────────────────────────────────────*/
/* Old variable names are still referenced by inline styles in several EJS
   templates. Re-point them at the new palette so nothing breaks and everything
   shifts to the gold/cream world in one place. */
:root {
  --green: var(--success);       --green-soft: var(--success-soft);
  --blue: var(--accent);         --blue-soft: var(--accent-soft);   --blue-light: #DCEAF3;
  --navy: var(--ink);
  --slate: var(--muted);         --slate-light: var(--faint);
  --amber: var(--warning);       --amber-soft: var(--warning-soft);
  --red: var(--danger);          --red-soft: var(--danger-soft);
  --bg: var(--cream);
  --panel: var(--cream-deep);
}

/* ── 3. Base / reset ──────────────────────────────────────────────────────*/
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--cream);
  /* soft radial champagne glow so the cream never reads as flat grey */
  background-image:
    radial-gradient(1100px 620px at 82% -8%, rgba(203, 169, 76, 0.16), transparent 60%),
    radial-gradient(900px 520px at -6% 4%, rgba(228, 199, 102, 0.12), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--gold-600); }
a:hover { color: var(--gold-700); }

::selection { background: var(--gold-200); color: var(--ink); }

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

/* ── 5. App shell — top navigation ────────────────────────────────────────*/
.topnav {
  /* Three tracks: brand pinned left, nav cluster dead-centre, account right. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
  padding: 14px 28px;
  background: rgba(255, 253, 249, 0.88);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav .brand { justify-self: start; }
.topnav .links { justify-self: center; }
.topnav .user { justify-self: end; }
/* thin gold hairline glow under the bar */
.topnav::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--grad-sheen);
  opacity: 0.7;
}

.topnav .brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
/* Gold emblem that precedes the wordmark. Uses ::before so no markup change is
   required by templates that only render text, but _layout_open renders an
   explicit .brand-mark span for the monogram — both share the look. */
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--grad-gold);
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), var(--shadow-sm);
  text-shadow: 0 1px 1px rgba(84,63,15,0.35);
}

.topnav .links { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.topnav .links > a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 2px;
  position: relative;
  transition: color 0.15s ease;
}
.topnav .links > a::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--gold-500);
  border-radius: 2px;
  transition: right 0.2s ease;
}
.topnav .links > a:hover { color: var(--gold-700); }
.topnav .links > a:hover::after { right: 0; }

/* Grouped dropdown menus (pure-CSS hover, CSP-safe) */
.navgroup { position: relative; }
.navgroup-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: default;
  user-select: none;
  padding: 6px 2px;
  transition: color 0.15s ease;
}
.navgroup:hover .navgroup-label { color: var(--gold-700); }
.navgroup::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 12px; } /* hover bridge */
.navmenu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px;
  min-width: 190px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
}
.navgroup:hover .navmenu { display: block; animation: menu-in 0.14s ease; }
.navmenu a {
  display: block;
  padding: 8px 12px;
  color: var(--body);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  border-radius: var(--r-sm);
}
.navmenu a:hover { color: var(--gold-700); background: var(--gold-50); }

@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* App switcher (inline markup in _layout_open) */
.appswitch select { padding: 5px 8px; font-size: 13px; }

/* App-switcher rendered as a themed dropdown (a .navgroup) so the whole nav,
   including the current-app control, matches the palette — no native <select>
   popup. The label reads as a subtle pill so it's distinct from section links. */
.appswitch-group .navgroup-label {
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  background: var(--paper);
  color: var(--ink);
}
.appswitch-group:hover .navgroup-label { border-color: var(--gold-300); color: var(--gold-700); }
.navmenu a.active { color: var(--gold-700); background: var(--gold-50); }

/* ── Account menu (scoped: acct-*) ────────────────────────────────────────*/
.topnav .user { display: flex; align-items: center; gap: var(--s-4); }

.acct { position: relative; }
.acct-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--paper);
  cursor: default;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.acct:hover .acct-trigger { border-color: var(--gold-300); box-shadow: var(--shadow-sm); }
.acct-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--grad-gold);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-shadow: 0 1px 1px rgba(84,63,15,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.acct-id { display: flex; flex-direction: column; line-height: 1.15; }
.acct-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.acct-role { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: capitalize; }
.acct-caret { color: var(--faint); font-size: 10px; margin-left: 2px; }

.acct-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 210px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
}
.acct::after { content: ''; position: absolute; top: 100%; right: 0; width: 100%; height: 12px; } /* hover bridge */
.acct:hover .acct-menu { display: block; animation: menu-in 0.14s ease; }
.acct-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.acct-head .acct-name { font-size: 14px; }
.acct-head .acct-email { font-size: 12px; color: var(--muted); }
.acct-item, .acct-item.link-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--body);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.acct-item:hover { background: var(--gold-50); color: var(--gold-700); }
.acct-item.danger { color: var(--danger); }
.acct-item.danger:hover { background: var(--danger-soft); color: var(--danger-ink); }
.acct-sep { height: 1px; background: var(--border-soft); margin: 6px 4px; border: 0; }

.link-btn { background: none; border: none; color: var(--danger); cursor: pointer; font: inherit; font-weight: 600; }

/* ── App-switch "not per-app yet" banner (inline styled in _layout_open) ──*/

/* ── 4. Layout & components ───────────────────────────────────────────────*/
.container { max-width: 1280px; margin: 0 auto; padding: var(--s-7) var(--s-7) var(--s-8); }
.container > h1 { font-size: 30px; margin-bottom: var(--s-6); letter-spacing: -0.02em; }
.container h1 { font-size: 30px; }
.container h2 { font-size: 20px; margin: var(--s-7) 0 var(--s-3); }
.muted { color: var(--muted); font-size: 13px; }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-5);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-700);
  font-weight: 700;
  margin-bottom: var(--s-4);
}

/* Grids */
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); }
.kpi {
  padding: var(--s-4);
  background: var(--cream);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value.good { color: var(--success); }
.kpi-value.warn { color: var(--warning); }
.kpi-value.muted { color: var(--faint); }
.kpi-label { font-size: 11px; text-transform: uppercase; color: var(--muted); margin-top: 7px; font-weight: 700; letter-spacing: 0.06em; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border-soft); }
th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gold-700);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--paper-2);
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--gold-50); }
tr:last-child td { border-bottom: none; }

/* Forms */
label { font-weight: 600; font-size: 13px; color: var(--body); }
input, textarea, select {
  font: inherit;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold-500); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 100px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236F6552' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--gold-600);
  color: #fff;
  text-decoration: none;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.16);
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--gold-700); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-sm); }
.btn:focus-visible { box-shadow: var(--ring); }
.btn.green { background: var(--success); }
.btn.green:hover { background: #256a41; }
.btn.red { background: var(--danger); }
.btn.red:hover { background: #963a30; }
.btn.ghost {
  background: transparent;
  color: var(--gold-700);
  border-color: var(--border);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--gold-50); border-color: var(--gold-300); color: var(--gold-700); }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge.green { background: var(--success-soft); color: var(--success-ink); border-color: #cbe6d3; }
.badge.amber { background: var(--warning-soft); color: var(--warning-ink); border-color: #f0dcae; }
.badge.red   { background: var(--danger-soft);  color: var(--danger-ink);  border-color: #eecdc6; }
.badge.blue  { background: var(--accent-soft);  color: var(--accent);      border-color: #cfe0ec; }
.badge.gold  { background: var(--gold-100);     color: var(--gold-800);    border-color: var(--gold-200); }

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--r-md);
  margin-bottom: var(--s-5);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  border-left-width: 4px;
}
.alert.success { background: var(--success-soft); color: var(--success-ink); border-left-color: var(--success); }
.alert.error   { background: var(--danger-soft);  color: var(--danger-ink);  border-left-color: var(--danger); }
.alert.warn    { background: var(--warning-soft); color: var(--warning-ink); border-left-color: var(--warning); }
.alert.info    { background: var(--accent-soft);  color: var(--accent);      border-left-color: var(--accent); }

/* Misc shared bits */
code { font-family: var(--font-mono); background: var(--cream-deep); padding: 2px 7px; border-radius: 5px; font-size: 12px; color: var(--gold-800); border: 1px solid var(--border-soft); }
.progress { height: 10px; background: var(--cream-deep); border-radius: var(--r-pill); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad-gold); border-radius: var(--r-pill); transition: width 0.3s ease; }
/* Marketing screenshots — small thumbnails, hover to enlarge (pure CSS). */
.ss-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ss-grid img {
  width: 66px; height: auto; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--paper); cursor: zoom-in;
  transform-origin: center bottom;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.ss-grid img:hover {
  transform: scale(3.4); position: relative; z-index: 30;
  box-shadow: var(--shadow-lg); border-color: var(--gold-300);
}

/* Keyword-ranking mini bar chart (dashboard). */
.kwchart { display: flex; flex-direction: column; gap: 9px; }
.kwbar { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; }
.kwbar-label { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kwbar-track { height: 10px; background: var(--cream-deep); border-radius: var(--r-pill); overflow: hidden; }
.kwbar-fill { display: block; height: 100%; background: var(--grad-gold); border-radius: var(--r-pill); }
.kwbar-rank { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; min-width: 64px; justify-content: flex-end; }
@media (max-width: 600px) { .kwbar { grid-template-columns: 104px 1fr auto; } }
.kw { font-weight: 600; color: var(--ink); }
.delta-up   { background: var(--success-soft); color: var(--success-ink); padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.delta-down { background: var(--danger-soft);  color: var(--danger-ink);  padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.delta-new  { background: var(--accent-soft);  color: var(--accent);      padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.scroll { max-height: 600px; overflow-y: auto; border-radius: var(--r-sm); }

/* ── 6. Auth surfaces (page-scoped: auth-*) ───────────────────────────────*/
/* Shared by login.ejs, reset-password.ejs, the account 2fa.ejs verify screen
   and the inline login-time 2FA prompt in routes/auth.js. */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 38px 34px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
/* gold sheen along the top edge of the card */
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-gold);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: var(--s-6); }
.auth-mark {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 16px;
  background: var(--grad-gold);
  color: #fff;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: var(--s-4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), var(--shadow);
  text-shadow: 0 1px 2px rgba(84,63,15,0.4);
}
.auth-title { font-family: var(--font-display); font-size: 26px; color: var(--ink); letter-spacing: 0; }
.auth-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.auth-card form { margin-top: var(--s-2); }
.auth-field { margin-top: var(--s-4); }
.auth-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--body); }
.auth-card .btn { width: 100%; margin-top: var(--s-6); padding: 12px 20px; font-size: 15px; }
.auth-foot { margin-top: var(--s-6); text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { font-weight: 600; }
.auth-note { margin-top: var(--s-4); }
/* big centred one-time-code field */
.auth-code { text-align: center; letter-spacing: 0.5em; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Legacy .login-box kept as an alias of the auth card so any surface still
   using it (and the inline 2FA prompt) inherits the new look automatically. */
.login-box {
  max-width: 440px;
  margin: 8vh auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 38px 34px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.login-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad-gold); }
.login-box h1 { text-align: center; font-family: var(--font-display); margin-bottom: var(--s-6); }
.login-box label { display: block; margin: var(--s-4) 0 6px; font-weight: 600; font-size: 13px; color: var(--body); }
.login-box .btn, .login-box button { width: 100%; margin-top: var(--s-5); }

/* ── Pagination (shared partial: views/_pagination.ejs) ───────────────────*/
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin: var(--s-5) 0 var(--s-2); }
.pagination-info { font-size: 12px; color: var(--muted); }
.pagination-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--paper); color: var(--body);
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.page-link:hover { border-color: var(--gold-300); background: var(--gold-50); color: var(--gold-700); }
.page-link.is-active { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.page-link.is-disabled { color: var(--faint); background: var(--paper-2); pointer-events: none; }
.page-ellipsis { color: var(--faint); padding: 0 4px; user-select: none; }

/* ── Reviews page (tabs + posted-response panels) ─────────────────────────*/
.rvw-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 var(--s-5); }
.rvw-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--paper);
  color: var(--body); font-weight: 700; font-size: 14px; text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rvw-tab:hover { border-color: var(--gold-300); color: var(--gold-700); }
.rvw-tab.active { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.rvw-stars { color: var(--gold-500); letter-spacing: 2px; font-size: 15px; }
.rvw-stars .off { color: var(--border); }
.rvw-response { margin-top: 14px; padding: 14px 16px; background: var(--gold-50); border: 1px solid var(--gold-200); border-radius: var(--r-md); }
.rvw-response.rejected { background: var(--paper-2); border-color: var(--border); }
.rvw-response-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--gold-700); margin-bottom: 6px; }
.rvw-response.rejected .rvw-response-label { color: var(--muted); margin-bottom: 0; }
.rvw-response p { white-space: pre-wrap; margin: 0; color: var(--body); }

/* ── Small-screen shell tweaks ────────────────────────────────────────────*/
@media (max-width: 720px) {
  /* Collapse to brand + account on the top row, nav cluster wrapping below. */
  .topnav { padding: 12px 16px; gap: var(--s-3); grid-template-columns: 1fr auto; }
  .topnav .links { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-start; gap: var(--s-3); }
  .container { padding: var(--s-5) var(--s-4) var(--s-7); }
  .acct-id { display: none; }
}
