/* main.css — Global design system, CSS variables, reset, and layout.
   Brown × White — rich brown ink on clean white canvas; transparent liquid-glass buttons. */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Pure white canvas — every surface is white; brown ink is the dominant colour */
  --color-bg:              #FFFFFF;
  --color-surface:         #FFFFFF;
  --color-surface-2:       #F2F2F7;
  --color-border:          #7A4818;
  --color-border-light:    #B07A40;

  /* Brown ink palette — Brown > White hierarchy */
  --color-text-primary:    #1C1C1C;
  --color-text-secondary:  #4A4A52;
  --color-text-muted:      #6E6E76;

  /* Transparent Liquid Glass — clear white glass with brown borders */
  --glass-bg:              rgba(255, 255, 255, 0.20);
  --glass-bg-strong:       rgba(255, 255, 255, 0.45);
  --glass-border:          rgba(107, 56, 18, 0.42);
  --glass-border-dark:     rgba(80, 38, 10, 0.60);
  --glass-shadow:          0 4px 28px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.90);
  --glass-shadow-sm:       0 2px 14px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,0.85);
  --glass-blur:            blur(40px) saturate(180%);
  --glass-blur-sm:         blur(28px) saturate(170%);

  /* Accent — signature rich brown */
  --color-accent:          #6B3812;
  --color-accent-dark:     #3D1E06;
  --color-accent-light:    #F0F0F5;

  --color-gold:            #9C6018;
  --color-gold-light:      #E8E8EC;
  --color-highlight:       #C87C10;

  --color-success:         #2D6A3F;
  --color-info:            #1A4E7A;
  --color-warning:         #B8700B;
  --color-error:           #8B1A1A;

  
  --dm-bg:                 #160E06;
  --dm-surface:            #201408;
  --dm-surface-2:          #2A1A0C;
  --dm-border:             #4A2E14;
  --dm-text-primary:       #F5EAD8;
  --dm-text-secondary:     #C8A87A;
  --dm-text-muted:         #8A6844;

  /* Typography */
  --font-body:             'Lora', Georgia, 'Times New Roman', serif;
  --font-ui:               'Inter', system-ui, -apple-system, sans-serif;
  --font-dyslexic:         'OpenDyslexic', 'Comic Sans MS', cursive;

  /* Sizing */
  --radius-xs:             4px;
  --radius-sm:             8px;
  --radius-md:             12px;
  --radius-lg:             18px;
  --radius-xl:             24px;
  --radius-full:           9999px;

  /* Shadows */
  --shadow-xs:             0 1px 3px rgba(0,0,0,0.07);
  --shadow-sm:             0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:             0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg:             0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:             0 16px 48px rgba(0,0,0,0.15);

  /* Layout */
  --max-width:             1100px;
  --nav-height:            68px;

  /* Transitions */
  --transition:            200ms ease;

  /* ── Unified Liquid Glass tokens — Apple-style frosted glass ─────────────
     Two tiers: surface (cards/panels) and interactive (buttons/chips).
     High-opacity warm-white base + heavy blur + multi-layer specular shimmer.  */

  /* Tier 1 — Surface glass: panels, cards, containers */
  --lg-surface-bg:        rgba(255, 255, 255, 0.42);
  --lg-surface-bg-hover:  rgba(255, 255, 255, 0.60);
  --lg-surface-blur:      blur(72px) saturate(220%) brightness(1.03);
  --lg-surface-border:    rgba(107, 56, 18, 0.22);
  --lg-surface-shadow:
    0 8px 40px rgba(0,0,0,0.09),
    0 2px 8px  rgba(0,0,0,0.05),
    inset 0 1.5px 0 rgba(255,255,255,0.98),
    inset 1px 0 0   rgba(255,255,255,0.40),
    inset 0 -0.5px 0 rgba(0,0,0,0.06);
  --lg-surface-shadow-sm:
    0 4px 20px rgba(0,0,0,0.07),
    inset 0 1px 0 rgba(255,255,255,0.95),
    inset 0 -0.5px 0 rgba(0,0,0,0.05);

  /* Tier 2 — Interactive glass: buttons, chips, small interactive elements */
  --lg-btn-bg:            rgba(255, 255, 255, 0.48);
  --lg-btn-bg-hover:      rgba(255, 255, 255, 0.68);
  --lg-btn-blur:          blur(60px) saturate(210%) brightness(1.04);
  --lg-btn-border:        rgba(200, 200, 210, 0.50);
  --lg-btn-shadow:
    0 4px 24px rgba(0,0,0,0.07),
    0 1px 4px  rgba(0,0,0,0.04),
    inset 0 1.5px 0 rgba(255,255,255,0.96),
    inset 1px 0 0   rgba(255,255,255,0.30),
    inset 0 -1px 0  rgba(0,0,0,0.05);
}html.high-contrast {
  --color-bg:              #000000;
  --color-surface:         #000000;
  --color-border:          #FFFFFF;
  --color-text-primary:    #FFFFFF;
  --color-text-secondary:  #FFFFFF;
  --color-text-muted:      #CCCCCC;
  --color-accent:          #FFFF00;
  --color-gold:            #FFFF00;
}
/* Force all text visible in high-contrast mode */
html.high-contrast body,
html.high-contrast p,
html.high-contrast span,
html.high-contrast li,
html.high-contrast td,
html.high-contrast th,
html.high-contrast label,
html.high-contrast .nav-logo,
html.high-contrast .navbar-link,
html.high-contrast .era-card-title,
html.high-contrast .era-card-desc,
html.high-contrast .era-card-range,
html.high-contrast .today-text,
html.high-contrast .today-label,
html.high-contrast .word-term,
html.high-contrast .word-def,
html.high-contrast .card,
html.high-contrast .card *,
html.high-contrast .settings-section-title,
html.high-contrast .settings-a11y-label,
html.high-contrast .settings-a11y-hint,
html.high-contrast .settings-field-label,
html.high-contrast .sp-plan-name,
html.high-contrast .sp-plan-price,
html.high-contrast .sp-plan-per,
html.high-contrast .sp-plan-tier,
html.high-contrast .plan-name,
html.high-contrast .plan-price,
html.high-contrast .plan-per,
html.high-contrast .plan-tier,
html.high-contrast .feature-item span,
html.high-contrast .sp-feature-item span,
html.high-contrast .splan-features li,
html.high-contrast .results-title,
html.high-contrast .article-content,
html.high-contrast .article-content * { color: #FFFFFF !important; }
html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast h4 { color: #FFFF00 !important; }
html.high-contrast a { color: #00FFFF !important; text-decoration: underline !important; }
html.high-contrast .btn,
html.high-contrast button { color: #000000 !important; background: #FFFFFF !important; border-color: #FFFFFF !important; }
html.high-contrast .card,
html.high-contrast .plan-card,
html.high-contrast .sp-plan-card,
html.high-contrast .splan-card { background: #000000 !important; border: 2px solid #FFFFFF !important; }

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;           /* restored to original — landing page has its own overrides */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.font-sm { font-size: 14px; }
html.font-lg { font-size: 20px; }

/* Prevent text overflow at any font size — critical for font-lg on mobile */
.article-content,
.article-content p,
.article-content li,
.article-content h2,
.article-content h3,
.essay-section,
.card,
.today-text,
.word-def,
.results-title {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
html.font-lg .main-content { padding-left: 14px; padding-right: 14px; }
html.font-lg .article-content { font-size: 1rem; }
html.font-lg .navbar-inner,
html.font-lg .landing-nav-inner { gap: 10px; }

body {
  font-family: var(--font-ui);
  font-style: normal;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.75;
  min-height: 100vh;
  /* Pure white — no tint, no gradient; brown text and borders carry all the character */
  /* Pure white — no tint, no gradient; brown text and borders carry all the character */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.dyslexic body,
html.dyslexic .article-content,
html.dyslexic p {
  font-family: var(--font-dyslexic) !important;
  font-style: normal !important;
  letter-spacing: 0.05em;
  word-spacing: 0.1em;
  line-height: 1.9;
}

/* ── Global Heading & Paragraph Typography ──────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-style: normal;
  color: var(--color-text-primary);
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.12;
}
h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
}
h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.28;
}
h4 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

p {
  line-height: 1.78;
  margin-bottom: 0.9em;
}
p:last-child { margin-bottom: 0; }

/* ── Skip Link ─────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  padding: 12px 20px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  z-index: 10000;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 8px;
  left: 8px;
}

/* ── Focus Indicators ──────────────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-info);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-border-light); }
::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

/* ── Navigation Bar ─────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1.5px solid rgba(107, 56, 18, 0.20);
  backdrop-filter: blur(44px) saturate(200%);
  -webkit-backdrop-filter: blur(44px) saturate(200%);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06), inset 0 -1px 0 rgba(255,255,255,1.0);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 500px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}
.navbar-inner > * { align-self: center; }

.nav-logo {
  font-family: var(--font-body);
  font-size: 1.45rem;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.022em;
  flex-shrink: 0;
  line-height: 1;
}
.nav-logo span {
  color: var(--color-gold);
}

.nav-search-wrap {
  width: 100%;
  position: relative;
  justify-self: center;
}

.nav-search {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  background: rgba(255, 253, 250, 0.60);
  backdrop-filter: blur(56px) saturate(200%) brightness(1.02);
  -webkit-backdrop-filter: blur(56px) saturate(200%) brightness(1.02);
  border: 1.5px solid rgba(107, 56, 18, 0.28);
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05), inset 0 1.5px 0 rgba(255,255,255,1.0), inset 0 -0.5px 0 rgba(0,0,0,0.05);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.15s ease;
}
.nav-search:focus {
  border-color: rgba(150, 150, 158, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07), 0 2px 14px rgba(0,0,0,0.06), inset 0 1.5px 0 rgba(255,255,255,1.0);
  outline: none;
  background: rgba(255, 255, 255, 0.82);
}
.nav-search::placeholder { color: var(--color-text-muted); }

.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  display: none;
}
.nav-search-results.show { display: block; }
.nav-search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.875rem;
  color: var(--color-text-primary);
  transition: background var(--transition);
}
.nav-search-result-item:hover,
.nav-search-result-item:focus {
  background: var(--color-accent-light);
}
.nav-search-result-item:last-child { border-bottom: none; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  justify-self: end;
}

.nav-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(107, 56, 18, 0.30);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(56px) saturate(200%) brightness(1.03);
  -webkit-backdrop-filter: blur(56px) saturate(200%) brightness(1.03);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), inset 0 1.5px 0 rgba(255,255,255,1.0), inset 0 -0.5px 0 rgba(0,0,0,0.06);
}
.nav-icon-btn:hover,
.nav-icon-btn:focus {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(150, 150, 158, 0.55);
  box-shadow: 0 8px 28px rgba(0,0,0,0.10), inset 0 1.5px 0 rgba(255,255,255,1.0), inset 0 -0.5px 0 rgba(0,0,0,0.08);
  transform: translateY(-3px) scale(1.05);
}
.nav-icon-btn:active { transform: scale(0.92) translateY(1px); transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── Subscriptions nav button (logged-in users only) ───────────────────── */
.nav-subscriptions-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(150, 150, 158, 0.45);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  align-self: center;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.90);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.nav-subscriptions-btn:hover,
.nav-subscriptions-btn:focus {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(150, 150, 158, 0.70);
  box-shadow: 0 6px 22px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.98);
  transform: translateY(-3px) scale(1.03);
}
.nav-subscriptions-btn:active { transform: scale(0.93) translateY(1px); transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Shrink to emoji-only on smaller screens — never hide entirely */
@media (max-width: 720px) {
  .nav-sub-label { display: none; }
  .nav-subscriptions-btn { padding: 7px 10px; }
}
@media (max-width: 480px) {
  .nav-sub-label { display: none; }
  .nav-subscriptions-btn { padding: 6px 9px; height: 34px; font-size: 0.82rem; }
}

/* Gear icon wrap — relative so tooltip can anchor below it */
.nav-a11y-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* Remove flex-direction:column — tooltip is absolute, no column needed */
  align-self: center;
}

/* Accessibility tooltip — hidden by default, appears on hover or .a11y-tip-show */
.nav-a11y-label {
  position: absolute;
  top: calc(100% + 8px);  /* sits just below the button */
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: #FFF8F0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.3;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  pointer-events: none;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 1100;
}
/* Small caret pointing upward */
.nav-a11y-label::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--color-text-primary);
}

/* Show on desktop hover */
.nav-a11y-wrap:hover .nav-a11y-label {
  opacity: 1;
  visibility: visible;
}

/* Show via JS on mobile tap or keyboard focus */
.nav-a11y-label.a11y-tip-show {
  opacity: 1;
  visibility: visible;
}

/* ── Accessibility Panel ────────────────────────────────────────────────── */
.a11y-panel {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  right: 20px;
  width: 300px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  padding: 20px;
  display: none;
}
.a11y-panel.show { display: block; }
.a11y-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.a11y-panel-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.a11y-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.a11y-section {
  margin-bottom: 14px;
}
.a11y-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  display: block;
}
.a11y-btn-group {
  display: flex;
  gap: 6px;
}
.a11y-btn {
  flex: 1;
  padding: 7px 4px;
  font-size: 0.8rem;
  font-style: normal;
  border: 1.5px solid rgba(150, 150, 158, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: center;
  min-height: 36px;
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.95), 0 2px 8px rgba(0,0,0,0.04);
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.a11y-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(107, 56, 18, 0.72);
  color: var(--color-accent);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07), inset 0 1.5px 0 rgba(255,255,255,0.98);
}
.a11y-btn:hover, .a11y-btn:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(150, 150, 158, 0.58);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05), inset 0 1.5px 0 rgba(255,255,255,0.96);
}
.a11y-btn.active:hover, .a11y-btn.active:focus, .a11y-btn.active:active {
  background: rgba(255, 255, 255, 0.30);
  border-color: rgba(107, 56, 18, 0.88);
  color: var(--color-accent);
}
.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.a11y-toggle-row:last-child { border-bottom: none; }
.a11y-toggle-label {
  font-size: 0.85rem;
  color: var(--color-text-primary);
  font-style: normal;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Main Content Wrapper ───────────────────────────────────────────────── */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb {
  margin-bottom: 24px;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb ol li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: normal;
}
.breadcrumb ol li a {
  color: var(--color-accent);
  text-decoration: none;
  font-style: normal;
}
.breadcrumb ol li a:hover { text-decoration: underline; }
.breadcrumb ol li::after {
  content: '›';
  color: var(--color-border);
  font-size: 0.9rem;
}
.breadcrumb ol li:last-child::after { display: none; }
.breadcrumb ol li:last-child { color: var(--color-text-secondary); }

/* ── Page Nav Bar (Back + Skip) ─────────────────────────────────────────── */
.page-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(107,56,18,0.10);
}.page-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--color-text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  line-height: 1;
}
.page-back-btn:hover { color: var(--color-accent); }
.page-back-btn svg { flex-shrink: 0; }
.page-skip-link {
  font-style: normal;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--font-body);
  color: var(--color-accent);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s;
  line-height: 1;
}
.page-skip-link:hover { opacity: 0.7; }

/* ── Cards — unified liquid glass ────────────────────────────────────────── */
.card {
  background: var(--lg-surface-bg);
  backdrop-filter: var(--lg-surface-blur);
  -webkit-backdrop-filter: var(--lg-surface-blur);
  border: 1.5px solid var(--lg-surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--lg-surface-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--lg-surface-shadow);
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.47) 0%,
    rgba(255,255,255,0.13) 35%,
    rgba(255,255,255,0.0) 100%);
  pointer-events: none;
}

.card-sm {
  background: var(--lg-surface-bg);
  backdrop-filter: var(--lg-surface-blur);
  -webkit-backdrop-filter: var(--lg-surface-blur);
  border: 1.5px solid var(--lg-surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--lg-surface-shadow-sm);
}

/* ── iOS 26/27 Liquid Glass: Keyframe Animations ────────────────────────────── */
@keyframes glass-shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}

@keyframes glass-ripple {
  from { transform: scale(0); opacity: 0.38; }
  to   { transform: scale(1); opacity: 0; }
}

/* Glass ripple element — injected by JS on click */
.glass-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.38);
  transform: scale(0);
  animation: glass-ripple 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
  z-index: 10;
}/* Disable animations when reduced-motion is active */
html.reduced-motion .glass-ripple,
html.reduced-motion .btn:hover::before,
html.reduced-motion .btn:focus::before,
html.reduced-motion .chip:hover::before,
html.reduced-motion .chip:focus::before { animation: none !important; }

/* ── Buttons — unified liquid glass ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  min-width: 44px;
  padding: 10px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  border: 1.5px solid var(--lg-btn-border);
  box-shadow: var(--lg-btn-shadow);
  color: var(--color-text-secondary);
}
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(120deg,
    rgba(255,255,255,0.00) 0%,
    rgba(255,255,255,0.55) 40%,
    rgba(255,255,255,0.00) 70%);
  background-size: 200% 100%;
  background-position: -200% center;
  pointer-events: none;
  z-index: 0;
  transition: background-position 0s;
}
/* Bottom reflection — subtle lower shimmer */
.btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 30%;
  border-radius: 0 0 inherit inherit;
  background: linear-gradient(0deg,
    rgba(255,255,255,0.20) 0%,
    rgba(255,255,255,0.0) 100%);
  pointer-events: none;
  z-index: 0;
}
.btn:hover, .btn:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(180, 180, 190, 0.60);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.10),
    0 2px 8px  rgba(0,0,0,0.06),
    inset 0 1.5px 0 rgba(255,255,255,0.95),
    inset 1px 0 0   rgba(255,255,255,0.35),
    inset 0 -0.5px 0 rgba(0,0,0,0.06);
  transform: translateY(-4px) scale(1.02);
}
.btn:hover::before, .btn:focus::before {
  animation: glass-shimmer 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.btn:active {
  transform: scale(0.93) translateY(2px);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.07),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Primary — accent text, slightly stronger border */
.btn-primary {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-accent);
  font-weight: 700;
  border: 1.5px solid rgba(150, 150, 158, 0.45);
  box-shadow: var(--lg-btn-shadow);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.70);
  box-shadow: 0 10px 36px rgba(0,0,0,0.10), inset 0 1.5px 0 rgba(255,255,255,0.96);
  transform: translateY(-4px) scale(1.02);
}
.btn-primary:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Secondary */
.btn-secondary {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-accent);
  border: 1.5px solid rgba(150, 150, 158, 0.35);
  box-shadow: var(--lg-btn-shadow);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.60);
  box-shadow: 0 8px 28px rgba(0,0,0,0.09), inset 0 1.5px 0 rgba(255,255,255,0.95);
  transform: translateY(-4px) scale(1.02);
}
.btn-secondary:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Ghost */
.btn-ghost {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-text-secondary);
  border: 1.5px solid rgba(150, 150, 158, 0.28);
  box-shadow: var(--lg-btn-shadow);
}
.btn-ghost:hover, .btn-ghost:focus {
  background: var(--lg-btn-bg-hover);
  color: var(--color-accent);
  border-color: rgba(150, 150, 158, 0.55);
  transform: translateY(-3px) scale(1.02);
}
.btn-ghost:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Gold */
.btn-gold {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-gold);
  font-weight: 600;
  border: 1.5px solid rgba(150, 150, 158, 0.40);
  box-shadow: var(--lg-btn-shadow);
}
.btn-gold:hover, .btn-gold:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.65);
  box-shadow: 0 8px 28px rgba(0,0,0,0.09), inset 0 1.5px 0 rgba(255,255,255,0.96);
  transform: translateY(-4px) scale(1.02);
}
.btn-gold:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

.btn-sm  { min-height: 38px; padding: 7px 20px; font-size: 0.92rem; border-radius: var(--radius-full); }
.btn-lg  { min-height: 54px; padding: 14px 42px; font-size: 1.08rem; border-radius: var(--radius-full); }

/* ── Chips / Pills — unified liquid glass ────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 500;
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  border: 1.5px solid var(--lg-btn-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: none;
  min-height: 36px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--lg-btn-shadow);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.chip::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 55%;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.16) 40%,
    rgba(255,255,255,0.0) 100%);
  pointer-events: none;
}
.chip:hover, .chip:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.58);
  box-shadow: 0 4px 18px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.95);
  transform: translateY(-3px) scale(1.02);
}
.chip:active { transform: scale(0.92) translateY(1px); transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1); }
.chip-accent {
  background: var(--lg-btn-bg);
  border-color: rgba(150, 150, 158, 0.45);
  color: var(--color-accent);
  box-shadow: var(--lg-btn-shadow);
}
.chip-accent:hover, .chip-accent:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.65);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.95);
}

/* ── Dropdowns ───────────────────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;       /* align to the RIGHT edge of the trigger button — prevents off-screen on right-side nav */
  left: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(44px) saturate(200%);
  -webkit-backdrop-filter: blur(44px) saturate(200%);
  border: 1.5px solid rgba(107, 56, 18, 0.30);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,0.98);
  z-index: 500;
  min-width: 200px;  /* wide enough to show "Settings" label comfortably */
  overflow: hidden;
  display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  width: 100%;
  transition: none;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item:focus, .dropdown-item:active {
  background: var(--color-accent-light);
  color: var(--color-text-primary);
}

/* Settings item in dropdown — slightly more prominent */
.dropdown-item-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
}
.dropdown-item-settings:hover, .dropdown-item-settings:focus {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

/* Fixed user-menu panel items */
.umenu-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 10px;
}
.umenu-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid rgba(0,0,0,0.12); flex-shrink: 0;
}
.umenu-name {
  font-weight: 700; font-size: 0.88rem; color: var(--color-text-primary);
  font-style: normal; line-height: 1.2;
}
.umenu-email { font-size: 0.72rem; color: var(--color-text-muted); font-style: normal; }.umenu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 0.88rem; font-style: normal;
  color: var(--color-text-primary); text-decoration: none; background: none;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: background 0.14s;
  cursor: pointer;
}
.umenu-btn {
  width: 100%; border: none; border-bottom: 1px solid rgba(0,0,0,0.07);
  text-align: left; font-family: var(--font-ui);
}
.umenu-danger { color: #8B1A1A !important; border-bottom: none !important; }
.umenu-item:last-child { border-bottom: none; }
.umenu-item:hover { background: rgba(0,0,0,0.04); }
.umenu-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.65; }/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-primary);
  max-width: 320px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
}
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-error { border-left: 4px solid var(--color-error); }
.toast-success { border-left: 4px solid var(--color-success); }
.toast-info { border-left: 4px solid var(--color-info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Loading Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 32px auto;
}
.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-style: normal;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid rgba(107,56,18,0.12);
  padding: 28px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-style: normal;
  letter-spacing: 0.01em;
  line-height: 1.7;
  background: var(--color-surface);
  margin-top: 56px;
}
footer a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.15s;
}
footer a:hover { opacity: 0.7; }

/* ── Session Timeout Banner ──────────────────────────────────────────────── */
.session-banner {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-warning);
  color: #fff;
  padding: 10px 24px;
  text-align: center;
  font-size: 0.9rem;
  font-style: normal;
  z-index: 900;
  display: none;
}
.session-banner.show { display: block; }

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

/* ── Colour Blind Mode ────────────────────────────────────────────────────── */
html.colorblind .status-badge,
html.colorblind .chip-accent,
html.colorblind .btn-primary,
html.colorblind .btn-gold {
  background-image: repeating-linear-gradient(
    45deg,
    transparent, transparent 3px,
    rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 6px
  ) !important;
}

/* ── Guest Search Limit Popup ─────────────────────────────────────────────── */
.guest-limit-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 26, 14, 0.50);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.30s ease, visibility 0.30s ease;
  padding: 20px;
}
.guest-limit-overlay.show {
  opacity: 1;
  visibility: visible;
}
.guest-limit-modal {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1.5px solid rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-xl);
  padding: 44px 36px 36px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(44, 26, 14, 0.28),
    0 8px 24px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.65);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.guest-limit-overlay.show .guest-limit-modal {
  transform: scale(1) translateY(0);
}
/* Top specular shine */
.guest-limit-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.0) 100%);
  pointer-events: none;
}
.guest-limit-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(139,69,19,0.20));
}
.guest-limit-title {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  margin-bottom: 10px;
  line-height: 1.1;
}
.guest-limit-msg {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-style: normal;
  color: var(--color-text-primary);
  line-height: 1.5;
  margin-bottom: 10px;
  font-weight: 600;
}
.guest-limit-sub {
  font-size: 0.92rem;
  font-style: normal;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}
.guest-limit-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.guest-limit-cta {
  width: 100%;
  max-width: 240px;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.guest-limit-dismiss {
  background: rgba(255,255,255,0.47);
  color: var(--color-text-muted);
  font-size: 0.88rem;
  min-height: 40px;
  padding: 8px 20px;
}
.guest-limit-dismiss:hover {
  color: var(--color-text-secondary);
}
@media (max-width: 480px) {
  .guest-limit-modal { padding: 36px 24px 28px; }
  .guest-limit-title { font-size: 1.7rem; }
  .guest-limit-msg   { font-size: 1rem; }
}

/* ── Milestone shimmer ────────────────────────────────────────────────────── */
@keyframes milestone-shimmer {
  0%   { box-shadow: 0 0 0 0 rgba(201,146,42,0.8); }
  50%  { box-shadow: 0 0 0 10px rgba(201,146,42,0.0); }
  100% { box-shadow: 0 0 0 0 rgba(201,146,42,0); }
}
.milestone-glow {
  animation: milestone-shimmer 2s ease 2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE & RESPONSIVE STYLES
   Breakpoints: 900px (tablet), 600px (mobile), 480px (small), 360px (tiny)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Prevent horizontal overflow on all screens */
html, body { overflow-x: hidden; }

/* Minimum readable font size — raise all tiny labels site-wide */
.breadcrumb ol li,
.nav-a11y-label,
.today-label, .word-era,
footer, .loading-state,
.a11y-label { font-size: 0.82rem; }

.dropdown-item,
.nav-search,
.toast,
.session-banner { font-size: 0.95rem; }

/* ── Tablet (≤ 900px) ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --nav-height: 60px; }

  .navbar-inner { padding: 0 16px; gap: 10px; grid-template-columns: 1fr minmax(200px, 420px) 1fr; }
  .nav-logo { font-size: 1.2rem; }
  .nav-search { font-size: 0.95rem; height: 40px; }

  .main-content { padding: 20px 16px 40px; }

  .btn { min-height: 48px; font-size: 0.95rem; }
  .btn-lg { min-height: 54px; font-size: 1rem; }
  .chip { font-size: 0.9rem; padding: 6px 16px; }

  .card { padding: 20px; }

  .a11y-panel { right: 10px; left: 10px; width: auto; }

  .toast-container { bottom: 16px; right: 14px; left: 14px; align-items: stretch; }
  .toast { max-width: 100%; width: 100%; font-size: 0.95rem; }

  /* Page nav bar */
  .page-back-btn { font-size: 1rem; }
  .page-skip-link { font-size: 1.05rem; }
}

/* ── Mobile (≤ 600px) ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --nav-height: 52px; }

  /* Mobile: two-row navbar — logo+icons on row 1, full-width search on row 2 */
  .navbar { height: auto; }
  .navbar-inner {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    padding: 0 14px;
    gap: 6px;
    align-items: center;
  }
  .nav-logo {
    flex: 1 1 auto;
    font-size: 1.15rem;
    letter-spacing: 0;
    padding: 12px 0;
  }
  .nav-right {
    flex-shrink: 0;
    margin-left: 0;
    gap: 10px;
    align-self: center;
    justify-self: unset;
  }
  .nav-search-wrap {
    order: 10;
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 10px;
    justify-self: unset;
    width: 100%;
  }
  .nav-search {
    font-size: 1rem;
    height: 44px;
    padding: 0 16px 0 44px;
    width: 100%;
  }
  .nav-icon-btn { width: 42px; height: 42px; font-size: 1rem; }

  /* Breadcrumb */
  .breadcrumb ol li { font-size: 0.88rem; }

  /* Main content — more breathing room */
  .main-content { padding: 16px 14px 32px; }

  /* Buttons — large tap targets */
  .btn { min-height: 50px; padding: 12px 20px; font-size: 1rem; }
  .btn-sm { min-height: 42px; padding: 8px 14px; font-size: 0.9rem; }
  .btn-lg { min-height: 54px; font-size: 1rem; }
  .btn-block-mobile { width: 100%; text-align: center; justify-content: center; }

  /* Cards */
  .card { padding: 18px; }

  /* Page nav */
  .page-back-btn { font-size: 1rem; }
  .page-skip-link { font-size: 1.05rem; }

  /* Chips */
  .chip { font-size: 0.9rem; padding: 7px 16px; min-height: 38px; }

  /* Dropdown */
  .dropdown-item { font-size: 1rem; padding: 12px 16px; }

  /* Footer */
  footer { font-size: 0.9rem; padding: 20px 16px; }
}

/* ── Small phone (≤ 480px) ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .nav-logo { font-size: 1.05rem; }
  .main-content { padding: 12px 12px 28px; }

  .btn { min-height: 50px; font-size: 0.95rem; }
  .chip { font-size: 0.85rem; }

  /* Accessibility panel — slides up from bottom on small screens */
  .a11y-panel {
    right: 0; left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    bottom: 0; top: auto;
    position: fixed;
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* ── Very small (≤ 360px) ──────────────────────────────────────────────── */
@media (max-width: 360px) {
  .nav-logo { font-size: 0.95rem; }
  .main-content { padding: 10px 10px 24px; }
  .btn { font-size: 0.9rem; padding: 10px 14px; }
}

/* ── Page Loader ─────────────────────────────────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FDFAF6;
  background-image:
    radial-gradient(ellipse at 35% 30%, rgba(240,215,175,0.55) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(220,190,140,0.30) 0%, transparent 50%);
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.4,0,0.2,1), visibility 0.5s ease;
  visibility: visible;
}
.page-loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
  animation: loader-float 3.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
@keyframes loader-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-9px) scale(1.005); }
}

.loader-logo {
  font-family: var(--font-body);
  font-size: clamp(2.1rem, 5.5vw, 3.2rem);
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  letter-spacing: -0.028em;
  line-height: 1;
  animation: loader-glow 2.6s ease-in-out infinite;
}
.loader-logo span { color: var(--color-gold); }
@keyframes loader-glow {
  0%, 100% { opacity: 0.78; filter: drop-shadow(0 0 0px rgba(107,56,18,0)); }
  50%       { opacity: 1;    filter: drop-shadow(0 0 18px rgba(107,56,18,0.22)); }
}

/* ── Orbit loader system ─────────────────────────────────────────────────── */
.loader-spinner {
  position: relative;
  width: 86px;
  height: 86px;
}
.loader-orbit {
  position: absolute;
  border-radius: 50%;
}
/* Outer orbit — slow clockwise */
.loader-orbit-1 {
  inset: 0;
  border: 1.5px solid rgba(107,56,18,0.14);
  animation: orbit-spin 2.9s linear infinite;
}
/* Middle orbit — medium, counterclockwise */
.loader-orbit-2 {
  inset: 14px;
  border: 1.5px solid rgba(156,96,24,0.11);
  animation: orbit-spin 2.1s linear infinite reverse;
}
/* Inner orbit — fast clockwise */
.loader-orbit-3 {
  inset: 29px;
  border: 1px solid rgba(107,56,18,0.08);
  animation: orbit-spin 1.35s linear infinite;
}

/* Orbiting planets */
.loader-planet {
  position: absolute;
  border-radius: 50%;
}
.loader-planet-1 {
  width: 11px;
  height: 11px;
  top: -5.5px;
  left: calc(50% - 5.5px);
  background: radial-gradient(circle at 32% 28%, #C9922A 0%, #8B4513 100%);
  box-shadow: 0 0 10px rgba(107,56,18,0.60), 0 0 22px rgba(107,56,18,0.28);
}
.loader-planet-2 {
  width: 8px;
  height: 8px;
  top: -4px;
  left: calc(50% - 4px);
  background: radial-gradient(circle at 32% 28%, #F0C84A 0%, #C9922A 100%);
  box-shadow: 0 0 8px rgba(201,146,42,0.60);
}
.loader-planet-3 {
  width: 5px;
  height: 5px;
  top: -2.5px;
  left: calc(50% - 2.5px);
  background: rgba(107,56,18,0.42);
  box-shadow: 0 0 4px rgba(107,56,18,0.32);
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}
/* Orb core — liquid glass pearl */
.loader-orb {
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%,
    rgba(255,255,255,1.0)   0%,
    rgba(255,240,210,0.92) 30%,
    rgba(230,190,120,0.58) 68%,
    rgba(200,155,70,0.18)  100%);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    0 4px 18px rgba(107,56,18,0.28),
    inset 0 2px 0 rgba(255,255,255,1.0),
    inset 0 -1px 0 rgba(107,56,18,0.12),
    inset 2px 0 0 rgba(255,255,255,0.60);
  animation: loader-orb-pulse 2.0s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
/* Orb shimmer sweep */
.loader-orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255,255,255,0) 0deg,
    rgba(255,255,255,0.55) 40deg,
    rgba(255,255,255,0) 80deg,
    rgba(255,255,255,0) 360deg
  );
  animation: loader-orb-sweep 1.8s linear infinite;
}
@keyframes loader-orb-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.88; }
  50%       { transform: scale(1.18); opacity: 1; }
}
@keyframes loader-orb-sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Nav logo orbit icon ─────────────────────────────────────────────────── */
.nav-logo-orbit-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.nav-orbit-dot {
  animation: nav-orbit-spin 3.6s linear infinite;
  transform-origin: 11px 11px;
}
@keyframes nav-orbit-spin {
  to { transform: rotate(360deg); }
}

.loader-tagline {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  opacity: 0;
  animation: loader-fade 0.8s ease 0.6s forwards;
}
@keyframes loader-fade { to { opacity: 1; } }/* ── Spell-alert shake animation (Did You Mean?) ───────────────────────── */
@keyframes spell-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ── Page Loader — reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .loader-inner      { animation: none; }
  .loader-logo       { animation: none; opacity: 1; }
  .loader-orbit-1    { animation: none; }
  .loader-orbit-2    { animation: none; }
  .loader-orbit-3    { animation: none; }
  .loader-planet-1   { background: var(--color-accent); box-shadow: none; }
  .loader-planet-2   { background: var(--color-gold); box-shadow: none; }
  .loader-planet-3   { background: rgba(107,56,18,0.42); box-shadow: none; }
  .loader-orb        { animation: none; opacity: 1; }
  .loader-orb::after { animation: none; }
  .loader-tagline    { animation: none; opacity: 1; }
  .nav-orbit-dot     { animation: none; }
  /* Compass loader reduced motion */
  .ring-outer, .ring-mid, .rose-group, .needle,
  .planet, .comet-group, .tick-group { animation: none !important; }
  .center-gem  { animation: none !important; opacity: 1; }
  .compass-title-history { animation: none; background-position: 0% 50%; }
  .compass-divider       { animation: none; width: 200px; }
  .compass-title-orbit   { animation: none; opacity: 0.9; }
  .compass-tagline-box   { animation: none; opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   History Orbit — Compass Logo Animations
   ═══════════════════════════════════════════════════════════════════════════ */

/* SVG animated groups — transform-origin assumes SVG rendered at 220×220px */
.ring-outer  { animation: compass-ringOuter    28s linear       infinite;         transform-origin: 110px 110px; }
.ring-mid    { animation: compass-ringMid      18s linear       infinite reverse; transform-origin: 110px 110px; }
.rose-group  { animation: compass-roseSpin     60s linear       infinite;         transform-origin: 110px 110px; }
.needle      { animation: compass-needleWobble  4s ease-in-out  infinite;         transform-origin: 110px 110px; }
.planet      { animation: compass-planetOrbit  12s linear       infinite;         transform-origin: 110px 110px; }
.comet-group { animation: compass-cometOrbit    8s linear       infinite reverse; transform-origin: 110px 110px; }
.center-gem  { animation: compass-gemPulse      3s ease-in-out  infinite; }
.tick-group  { animation: compass-tickDrift    40s linear       infinite;         transform-origin: 110px 110px; }

@keyframes compass-ringOuter    { to { transform: rotate(360deg); } }
@keyframes compass-ringMid      { to { transform: rotate(360deg); } }
@keyframes compass-roseSpin     { to { transform: rotate(360deg); } }
@keyframes compass-cometOrbit   { to { transform: rotate(360deg); } }
@keyframes compass-planetOrbit  { to { transform: rotate(360deg); } }
@keyframes compass-tickDrift    { to { transform: rotate(-360deg); } }
@keyframes compass-needleWobble {
  0%   { transform: rotate(-6deg); }
  25%  { transform: rotate(3deg);  }
  50%  { transform: rotate(-2deg); }
  75%  { transform: rotate(5deg);  }
  100% { transform: rotate(-6deg); }
}
@keyframes compass-gemPulse {
  0%, 100% { opacity: 0.80; }
  50%       { opacity: 1.00; }
}
@keyframes compass-shimmerBrown {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
@keyframes compass-fadeLetters {
  0%   { opacity: 0;   letter-spacing: 0.95em; transform: translateY(4px); }
  100% { opacity: 0.9; letter-spacing: 0.55em; transform: translateY(0); }
}
@keyframes compass-subtleFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-2px); }
}
@keyframes compass-expandLine    { to { width: 230px; } }
@keyframes compass-expandLine-sm { to { width: 170px; } }
@keyframes compass-fadeUp {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Compass text block ───────────────────────────────────────────────────── */
.compass-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.compass-title-history {
  font-family: 'Cinzel Decorative', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  background: linear-gradient(135deg, #7B4A1E 0%, #3D1F05 35%, #A0622A 60%, #5C320E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 250% 250%;
  animation: compass-shimmerBrown 5s ease-in-out infinite;
}

.compass-divider {
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #7B4A1E, #A0622A, #7B4A1E, transparent);
  border-radius: 2px;
  animation: compass-expandLine 1.4s ease-out 0.6s forwards;
}

.compass-title-orbit {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.55em;
  color: #7B4A1E;
  text-transform: uppercase;
  opacity: 0;
  animation: compass-fadeLetters 2s ease-out 0.4s forwards,
             compass-subtleFloat 6s ease-in-out 2.4s infinite;
}

.compass-tagline-box {
  opacity: 0;
  animation: compass-fadeUp 1.4s ease-out 2.8s forwards;
  text-align: center;
  max-width: 340px;
  margin-top: 4px;
  padding: 10px 18px;
  border: 1px solid rgba(160,98,42,0.33);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(250,243,230,0.44), rgba(240,224,192,0.22));
}

.compass-tagline {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #4A2208;
  letter-spacing: 0.025em;
}

/* ── Loader compass — smaller text ────────────────────────────────────────── */
.loader-compass-text .compass-title-history {
  font-size: 1.55rem;
  letter-spacing: 0.10em;
}
.loader-compass-text .compass-title-orbit {
  font-size: 0.80rem;
}
.loader-compass-text .compass-divider {
  animation: compass-expandLine-sm 1.4s ease-out 0.6s forwards;
}

html.high-contrast {
  --color-bg:              #000000;
  --color-surface:         #000000;
  --color-border:          #FFFFFF;
  --color-text-primary:    #FFFFFF;
  --color-text-secondary:  #FFFFFF;
  --color-text-muted:      #CCCCCC;
  --color-accent:          #FFFF00;
  --color-gold:            #FFFF00;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;           /* restored to original — landing page has its own overrides */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.font-sm { font-size: 14px; }
html.font-lg { font-size: 20px; }

/* Prevent text overflow at any font size — critical for font-lg on mobile */
.article-content,
.article-content p,
.article-content li,
.article-content h2,
.article-content h3,
.essay-section,
.card,
.today-text,
.word-def,
.results-title {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
html.font-lg .main-content { padding-left: 14px; padding-right: 14px; }
html.font-lg .article-content { font-size: 1rem; }
html.font-lg .navbar-inner,
html.font-lg .landing-nav-inner { gap: 10px; }

body {
  font-family: var(--font-ui);
  font-style: normal;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.7;
  min-height: 100vh;
  /* Pure white — no tint, no gradient; brown text and borders carry all the character */
  background-image: none;
}

html.dyslexic body,
html.dyslexic .article-content,
html.dyslexic p {
  font-family: var(--font-dyslexic) !important;
  font-style: normal !important;
  letter-spacing: 0.05em;
  word-spacing: 0.1em;
  line-height: 1.9;
}

/* ── Skip Link ─────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  padding: 12px 20px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  z-index: 10000;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 8px;
  left: 8px;
}

/* ── Focus Indicators ──────────────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-info);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-border-light); }
::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

/* ── Navigation Bar ─────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1.5px solid rgba(107, 56, 18, 0.20);
  backdrop-filter: blur(44px) saturate(200%);
  -webkit-backdrop-filter: blur(44px) saturate(200%);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06), inset 0 -1px 0 rgba(255,255,255,1.0);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 500px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}
.navbar-inner > * { align-self: center; }

.nav-logo {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.nav-logo span {
  color: var(--color-gold);
}

.nav-search-wrap {
  width: 100%;
  position: relative;
  justify-self: center;
}

.nav-search {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  background: rgba(255, 253, 250, 0.60);
  backdrop-filter: blur(56px) saturate(200%) brightness(1.02);
  -webkit-backdrop-filter: blur(56px) saturate(200%) brightness(1.02);
  border: 1.5px solid rgba(107, 56, 18, 0.28);
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05), inset 0 1.5px 0 rgba(255,255,255,1.0), inset 0 -0.5px 0 rgba(0,0,0,0.05);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.15s ease;
}
.nav-search:focus {
  border-color: rgba(150, 150, 158, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07), 0 2px 14px rgba(0,0,0,0.06), inset 0 1.5px 0 rgba(255,255,255,1.0);
  outline: none;
  background: rgba(255, 255, 255, 0.82);
}
.nav-search::placeholder { color: var(--color-text-muted); }

.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  display: none;
}
.nav-search-results.show { display: block; }
.nav-search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.875rem;
  color: var(--color-text-primary);
  transition: background var(--transition);
}
.nav-search-result-item:hover,
.nav-search-result-item:focus {
  background: var(--color-accent-light);
}
.nav-search-result-item:last-child { border-bottom: none; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  justify-self: end;
}

.nav-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(107, 56, 18, 0.30);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(56px) saturate(200%) brightness(1.03);
  -webkit-backdrop-filter: blur(56px) saturate(200%) brightness(1.03);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), inset 0 1.5px 0 rgba(255,255,255,1.0), inset 0 -0.5px 0 rgba(0,0,0,0.06);
}
.nav-icon-btn:hover,
.nav-icon-btn:focus {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(150, 150, 158, 0.55);
  box-shadow: 0 8px 28px rgba(0,0,0,0.10), inset 0 1.5px 0 rgba(255,255,255,1.0), inset 0 -0.5px 0 rgba(0,0,0,0.08);
  transform: translateY(-3px) scale(1.05);
}
.nav-icon-btn:active { transform: scale(0.92) translateY(1px); transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── Subscriptions nav button (logged-in users only) ───────────────────── */
.nav-subscriptions-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(150, 150, 158, 0.45);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  align-self: center;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.90);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.nav-subscriptions-btn:hover,
.nav-subscriptions-btn:focus {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(150, 150, 158, 0.70);
  box-shadow: 0 6px 22px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.98);
  transform: translateY(-3px) scale(1.03);
}
.nav-subscriptions-btn:active { transform: scale(0.93) translateY(1px); transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Shrink to emoji-only on smaller screens — never hide entirely */
@media (max-width: 720px) {
  .nav-sub-label { display: none; }
  .nav-subscriptions-btn { padding: 7px 10px; }
}
@media (max-width: 480px) {
  .nav-sub-label { display: none; }
  .nav-subscriptions-btn { padding: 6px 9px; height: 34px; font-size: 0.82rem; }
}

/* Gear icon wrap — relative so tooltip can anchor below it */
.nav-a11y-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* Remove flex-direction:column — tooltip is absolute, no column needed */
  align-self: center;
}

/* Accessibility tooltip — hidden by default, appears on hover or .a11y-tip-show */
.nav-a11y-label {
  position: absolute;
  top: calc(100% + 8px);  /* sits just below the button */
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: #FFF8F0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.3;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  pointer-events: none;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 1100;
}
/* Small caret pointing upward */
.nav-a11y-label::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--color-text-primary);
}

/* Show on desktop hover */
.nav-a11y-wrap:hover .nav-a11y-label {
  opacity: 1;
  visibility: visible;
}

/* Show via JS on mobile tap or keyboard focus */
.nav-a11y-label.a11y-tip-show {
  opacity: 1;
  visibility: visible;
}

/* ── Accessibility Panel ────────────────────────────────────────────────── */
.a11y-panel {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  right: 20px;
  width: 300px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  padding: 20px;
  display: none;
}
.a11y-panel.show { display: block; }
.a11y-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.a11y-panel-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.a11y-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.a11y-section {
  margin-bottom: 14px;
}
.a11y-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  display: block;
}
.a11y-btn-group {
  display: flex;
  gap: 6px;
}
.a11y-btn {
  flex: 1;
  padding: 7px 4px;
  font-size: 0.8rem;
  font-style: normal;
  border: 1.5px solid rgba(150, 150, 158, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: center;
  min-height: 36px;
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.95), 0 2px 8px rgba(0,0,0,0.04);
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.a11y-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(107, 56, 18, 0.72);
  color: var(--color-accent);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07), inset 0 1.5px 0 rgba(255,255,255,0.98);
}
.a11y-btn:hover, .a11y-btn:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(150, 150, 158, 0.58);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05), inset 0 1.5px 0 rgba(255,255,255,0.96);
}
.a11y-btn.active:hover, .a11y-btn.active:focus, .a11y-btn.active:active {
  background: rgba(255, 255, 255, 0.30);
  border-color: rgba(107, 56, 18, 0.88);
  color: var(--color-accent);
}
.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.a11y-toggle-row:last-child { border-bottom: none; }
.a11y-toggle-label {
  font-size: 0.85rem;
  color: var(--color-text-primary);
  font-style: normal;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Main Content Wrapper ───────────────────────────────────────────────── */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb {
  margin-bottom: 24px;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb ol li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: normal;
}
.breadcrumb ol li a {
  color: var(--color-accent);
  text-decoration: none;
  font-style: normal;
}
.breadcrumb ol li a:hover { text-decoration: underline; }
.breadcrumb ol li::after {
  content: '›';
  color: var(--color-border);
  font-size: 0.9rem;
}
.breadcrumb ol li:last-child::after { display: none; }
.breadcrumb ol li:last-child { color: var(--color-text-secondary); }

/* ── Page Nav Bar (Back + Skip) ─────────────────────────────────────────── */
.page-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(107,56,18,0.10);
}.page-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--color-text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  line-height: 1;
}
.page-back-btn:hover { color: var(--color-accent); }
.page-back-btn svg { flex-shrink: 0; }
.page-skip-link {
  font-style: normal;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--font-body);
  color: var(--color-accent);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s;
  line-height: 1;
}
.page-skip-link:hover { opacity: 0.7; }

/* ── Cards — unified liquid glass ────────────────────────────────────────── */
.card {
  background: var(--lg-surface-bg);
  backdrop-filter: var(--lg-surface-blur);
  -webkit-backdrop-filter: var(--lg-surface-blur);
  border: 1.5px solid var(--lg-surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--lg-surface-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--lg-surface-shadow);
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.47) 0%,
    rgba(255,255,255,0.13) 35%,
    rgba(255,255,255,0.0) 100%);
  pointer-events: none;
}

.card-sm {
  background: var(--lg-surface-bg);
  backdrop-filter: var(--lg-surface-blur);
  -webkit-backdrop-filter: var(--lg-surface-blur);
  border: 1.5px solid var(--lg-surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--lg-surface-shadow-sm);
}

/* ── iOS 26/27 Liquid Glass: Keyframe Animations ────────────────────────────── */
@keyframes glass-shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}

@keyframes glass-ripple {
  from { transform: scale(0); opacity: 0.38; }
  to   { transform: scale(1); opacity: 0; }
}

/* Glass ripple element — injected by JS on click */
.glass-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.38);
  transform: scale(0);
  animation: glass-ripple 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
  z-index: 10;
}/* Disable animations when reduced-motion is active */
html.reduced-motion .glass-ripple,
html.reduced-motion .btn:hover::before,
html.reduced-motion .btn:focus::before,
html.reduced-motion .chip:hover::before,
html.reduced-motion .chip:focus::before { animation: none !important; }

/* ── Buttons — unified liquid glass ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  min-width: 44px;
  padding: 10px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  border: 1.5px solid var(--lg-btn-border);
  box-shadow: var(--lg-btn-shadow);
  color: var(--color-text-secondary);
}
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(120deg,
    rgba(255,255,255,0.00) 0%,
    rgba(255,255,255,0.55) 40%,
    rgba(255,255,255,0.00) 70%);
  background-size: 200% 100%;
  background-position: -200% center;
  pointer-events: none;
  z-index: 0;
  transition: background-position 0s;
}
/* Bottom reflection — subtle lower shimmer */
.btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 30%;
  border-radius: 0 0 inherit inherit;
  background: linear-gradient(0deg,
    rgba(255,255,255,0.20) 0%,
    rgba(255,255,255,0.0) 100%);
  pointer-events: none;
  z-index: 0;
}
.btn:hover, .btn:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(180, 180, 190, 0.60);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.10),
    0 2px 8px  rgba(0,0,0,0.06),
    inset 0 1.5px 0 rgba(255,255,255,0.95),
    inset 1px 0 0   rgba(255,255,255,0.35),
    inset 0 -0.5px 0 rgba(0,0,0,0.06);
  transform: translateY(-4px) scale(1.02);
}
.btn:hover::before, .btn:focus::before {
  animation: glass-shimmer 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.btn:active {
  transform: scale(0.93) translateY(2px);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.07),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Primary — accent text, slightly stronger border */
.btn-primary {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-accent);
  font-weight: 700;
  border: 1.5px solid rgba(150, 150, 158, 0.45);
  box-shadow: var(--lg-btn-shadow);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.70);
  box-shadow: 0 10px 36px rgba(0,0,0,0.10), inset 0 1.5px 0 rgba(255,255,255,0.96);
  transform: translateY(-4px) scale(1.02);
}
.btn-primary:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Secondary */
.btn-secondary {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-accent);
  border: 1.5px solid rgba(150, 150, 158, 0.35);
  box-shadow: var(--lg-btn-shadow);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.60);
  box-shadow: 0 8px 28px rgba(0,0,0,0.09), inset 0 1.5px 0 rgba(255,255,255,0.95);
  transform: translateY(-4px) scale(1.02);
}
.btn-secondary:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Ghost */
.btn-ghost {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-text-secondary);
  border: 1.5px solid rgba(150, 150, 158, 0.28);
  box-shadow: var(--lg-btn-shadow);
}
.btn-ghost:hover, .btn-ghost:focus {
  background: var(--lg-btn-bg-hover);
  color: var(--color-accent);
  border-color: rgba(150, 150, 158, 0.55);
  transform: translateY(-3px) scale(1.02);
}
.btn-ghost:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Gold */
.btn-gold {
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  color: var(--color-gold);
  font-weight: 600;
  border: 1.5px solid rgba(150, 150, 158, 0.40);
  box-shadow: var(--lg-btn-shadow);
}
.btn-gold:hover, .btn-gold:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.65);
  box-shadow: 0 8px 28px rgba(0,0,0,0.09), inset 0 1.5px 0 rgba(255,255,255,0.96);
  transform: translateY(-4px) scale(1.02);
}
.btn-gold:active { transform: scale(0.93) translateY(2px); transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }

.btn-sm  { min-height: 38px; padding: 7px 20px; font-size: 0.92rem; border-radius: var(--radius-full); }
.btn-lg  { min-height: 54px; padding: 14px 42px; font-size: 1.08rem; border-radius: var(--radius-full); }

/* ── Chips / Pills — unified liquid glass ────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 500;
  background: var(--lg-btn-bg);
  backdrop-filter: var(--lg-btn-blur);
  -webkit-backdrop-filter: var(--lg-btn-blur);
  border: 1.5px solid var(--lg-btn-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: none;
  min-height: 36px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--lg-btn-shadow);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.chip::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 55%;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.16) 40%,
    rgba(255,255,255,0.0) 100%);
  pointer-events: none;
}
.chip:hover, .chip:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.58);
  box-shadow: 0 4px 18px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.95);
  transform: translateY(-3px) scale(1.02);
}
.chip:active { transform: scale(0.92) translateY(1px); transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1); }
.chip-accent {
  background: var(--lg-btn-bg);
  border-color: rgba(150, 150, 158, 0.45);
  color: var(--color-accent);
  box-shadow: var(--lg-btn-shadow);
}
.chip-accent:hover, .chip-accent:focus {
  background: var(--lg-btn-bg-hover);
  border-color: rgba(150, 150, 158, 0.65);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.95);
}

/* ── Dropdowns ───────────────────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;       /* align to the RIGHT edge of the trigger button — prevents off-screen on right-side nav */
  left: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(44px) saturate(200%);
  -webkit-backdrop-filter: blur(44px) saturate(200%);
  border: 1.5px solid rgba(107, 56, 18, 0.30);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,0.98);
  z-index: 500;
  min-width: 200px;  /* wide enough to show "Settings" label comfortably */
  overflow: hidden;
  display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  width: 100%;
  transition: none;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item:focus, .dropdown-item:active {
  background: var(--color-accent-light);
  color: var(--color-text-primary);
}

/* Settings item in dropdown — slightly more prominent */
.dropdown-item-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
}
.dropdown-item-settings:hover, .dropdown-item-settings:focus {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

/* Fixed user-menu panel items */
.umenu-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 10px;
}
.umenu-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid rgba(0,0,0,0.12); flex-shrink: 0;
}
.umenu-name {
  font-weight: 700; font-size: 0.88rem; color: var(--color-text-primary);
  font-style: normal; line-height: 1.2;
}
.umenu-email { font-size: 0.72rem; color: var(--color-text-muted); font-style: normal; }.umenu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 0.88rem; font-style: normal;
  color: var(--color-text-primary); text-decoration: none; background: none;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: background 0.14s;
  cursor: pointer;
}
.umenu-btn {
  width: 100%; border: none; border-bottom: 1px solid rgba(0,0,0,0.07);
  text-align: left; font-family: var(--font-ui);
}
.umenu-danger { color: #8B1A1A !important; border-bottom: none !important; }
.umenu-item:last-child { border-bottom: none; }
.umenu-item:hover { background: rgba(0,0,0,0.04); }
.umenu-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.65; }/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-primary);
  max-width: 320px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
}
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-error { border-left: 4px solid var(--color-error); }
.toast-success { border-left: 4px solid var(--color-success); }
.toast-info { border-left: 4px solid var(--color-info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Loading Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 32px auto;
}
.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-style: normal;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--color-border);
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-style: normal;
  background: var(--color-surface);
  margin-top: 48px;
}
footer a {
  color: var(--color-accent);
  text-decoration: none;
}

/* ── Session Timeout Banner ──────────────────────────────────────────────── */
.session-banner {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-warning);
  color: #fff;
  padding: 10px 24px;
  text-align: center;
  font-size: 0.9rem;
  font-style: normal;
  z-index: 900;
  display: none;
}
.session-banner.show { display: block; }

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

/* ── Colour Blind Mode ────────────────────────────────────────────────────── */
html.colorblind .status-badge,
html.colorblind .chip-accent,
html.colorblind .btn-primary,
html.colorblind .btn-gold {
  background-image: repeating-linear-gradient(
    45deg,
    transparent, transparent 3px,
    rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 6px
  ) !important;
}

/* ── Guest Search Limit Popup ─────────────────────────────────────────────── */
.guest-limit-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 26, 14, 0.50);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.30s ease, visibility 0.30s ease;
  padding: 20px;
}
.guest-limit-overlay.show {
  opacity: 1;
  visibility: visible;
}
.guest-limit-modal {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1.5px solid rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-xl);
  padding: 44px 36px 36px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(44, 26, 14, 0.28),
    0 8px 24px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.65);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.guest-limit-overlay.show .guest-limit-modal {
  transform: scale(1) translateY(0);
}
/* Top specular shine */
.guest-limit-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.0) 100%);
  pointer-events: none;
}
.guest-limit-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(139,69,19,0.20));
}
.guest-limit-title {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  margin-bottom: 10px;
  line-height: 1.1;
}
.guest-limit-msg {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-style: normal;
  color: var(--color-text-primary);
  line-height: 1.5;
  margin-bottom: 10px;
  font-weight: 600;
}
.guest-limit-sub {
  font-size: 0.92rem;
  font-style: normal;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}
.guest-limit-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.guest-limit-cta {
  width: 100%;
  max-width: 240px;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.guest-limit-dismiss {
  background: rgba(255,255,255,0.47);
  color: var(--color-text-muted);
  font-size: 0.88rem;
  min-height: 40px;
  padding: 8px 20px;
}
.guest-limit-dismiss:hover {
  color: var(--color-text-secondary);
}
@media (max-width: 480px) {
  .guest-limit-modal { padding: 36px 24px 28px; }
  .guest-limit-title { font-size: 1.7rem; }
  .guest-limit-msg   { font-size: 1rem; }
}

/* ── Milestone shimmer ────────────────────────────────────────────────────── */
@keyframes milestone-shimmer {
  0%   { box-shadow: 0 0 0 0 rgba(201,146,42,0.8); }
  50%  { box-shadow: 0 0 0 10px rgba(201,146,42,0.0); }
  100% { box-shadow: 0 0 0 0 rgba(201,146,42,0); }
}
.milestone-glow {
  animation: milestone-shimmer 2s ease 2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE & RESPONSIVE STYLES
   Breakpoints: 900px (tablet), 600px (mobile), 480px (small), 360px (tiny)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Prevent horizontal overflow on all screens */
html, body { overflow-x: hidden; }

/* Minimum readable font size — raise all tiny labels site-wide */
.breadcrumb ol li,
.nav-a11y-label,
.today-label, .word-era,
footer, .loading-state,
.a11y-label { font-size: 0.82rem; }

.dropdown-item,
.nav-search,
.toast,
.session-banner { font-size: 0.95rem; }

/* ── Tablet (≤ 900px) ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --nav-height: 60px; }

  .navbar-inner { padding: 0 16px; gap: 10px; grid-template-columns: 1fr minmax(200px, 420px) 1fr; }
  .nav-logo { font-size: 1.2rem; }
  .nav-search { font-size: 0.95rem; height: 40px; }

  .main-content { padding: 20px 16px 40px; }

  .btn { min-height: 48px; font-size: 0.95rem; }
  .btn-lg { min-height: 54px; font-size: 1rem; }
  .chip { font-size: 0.9rem; padding: 6px 16px; }

  .card { padding: 20px; }

  .a11y-panel { right: 10px; left: 10px; width: auto; }

  .toast-container { bottom: 16px; right: 14px; left: 14px; align-items: stretch; }
  .toast { max-width: 100%; width: 100%; font-size: 0.95rem; }

  /* Page nav bar */
  .page-back-btn { font-size: 1rem; }
  .page-skip-link { font-size: 1.05rem; }
}

/* ── Mobile (≤ 600px) ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --nav-height: 52px; }

  /* Mobile: two-row navbar — logo+icons on row 1, full-width search on row 2 */
  .navbar { height: auto; }
  .navbar-inner {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    padding: 0 14px;
    gap: 6px;
    align-items: center;
  }
  .nav-logo {
    flex: 1 1 auto;
    font-size: 1.15rem;
    letter-spacing: 0;
    padding: 12px 0;
  }
  .nav-right {
    flex-shrink: 0;
    margin-left: 0;
    gap: 10px;
    align-self: center;
    justify-self: unset;
  }
  .nav-search-wrap {
    order: 10;
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 10px;
    justify-self: unset;
    width: 100%;
  }
  .nav-search {
    font-size: 1rem;
    height: 44px;
    padding: 0 16px 0 44px;
    width: 100%;
  }
  .nav-icon-btn { width: 42px; height: 42px; font-size: 1rem; }

  /* Breadcrumb */
  .breadcrumb ol li { font-size: 0.88rem; }

  /* Main content — more breathing room */
  .main-content { padding: 16px 14px 32px; }

  /* Buttons — large tap targets */
  .btn { min-height: 50px; padding: 12px 20px; font-size: 1rem; }
  .btn-sm { min-height: 42px; padding: 8px 14px; font-size: 0.9rem; }
  .btn-lg { min-height: 54px; font-size: 1rem; }
  .btn-block-mobile { width: 100%; text-align: center; justify-content: center; }

  /* Cards */
  .card { padding: 18px; }

  /* Page nav */
  .page-back-btn { font-size: 1rem; }
  .page-skip-link { font-size: 1.05rem; }

  /* Chips */
  .chip { font-size: 0.9rem; padding: 7px 16px; min-height: 38px; }

  /* Dropdown */
  .dropdown-item { font-size: 1rem; padding: 12px 16px; }

  /* Footer */
  footer { font-size: 0.9rem; padding: 20px 16px; }
}

/* ── Small phone (≤ 480px) ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .nav-logo { font-size: 1.05rem; }
  .main-content { padding: 12px 12px 28px; }

  .btn { min-height: 50px; font-size: 0.95rem; }
  .chip { font-size: 0.85rem; }

  /* Accessibility panel — slides up from bottom on small screens */
  .a11y-panel {
    right: 0; left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    bottom: 0; top: auto;
    position: fixed;
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* ── Very small (≤ 360px) ──────────────────────────────────────────────── */
@media (max-width: 360px) {
  .nav-logo { font-size: 0.95rem; }
  .main-content { padding: 10px 10px 24px; }
  .btn { font-size: 0.9rem; padding: 10px 14px; }
}

/* Loader styles defined earlier in this file — no duplicate needed */
