/*
 * THE POLICY NEST — Shared Design System
 * style.css
 *
 * Art direction: Healthcare policy platform → authoritative, structured, trustworthy
 * Palette: Cobalt + Aubergine gradient header, Bone body, Clay CTAs, Sage accents
 * Typography: Bricolage Grotesque (display/headings) + Source Sans 3 (body)
 * Density: Balanced — spacious hero moments, structured tool panels
 *
 * Usage: <link rel="stylesheet" href="./style.css">
 * All page-specific layout stays in each page's own <style> block.
 */

/* ============================================================
   FONT IMPORTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Source+Sans+3:ital,wght@0,300..900;1,300..900&display=swap');


/* ============================================================
   DESIGN TOKENS — LIGHT MODE
   ============================================================ */
:root, [data-theme="light"] {

  /* --- Brand Colors --- */
  --aubergine:        #4a2e4f;   /* Primary brand, main headings */
  --aubergine-deep:   #3a2240;   /* Darker variant for pressed states */
  --aubergine-light:  #6b4a72;   /* Lighter variant for hover */
  --cobalt:           #1b3a6b;   /* Header background, structural dark */
  --cobalt-deep:      #122951;   /* Deeper cobalt for gradient end */
  --azure:            #1f4e79;   /* Secondary, badge backgrounds, links */
  --clay:             #c96a4a;   /* Primary CTA, accent lines, highlights */
  --clay-hover:       #b05a3c;   /* CTA hover state */
  --clay-active:      #943f26;   /* CTA active/pressed */
  --clay-highlight:   #f2e0d8;   /* Clay tint for backgrounds */
  --sage:             #8fa88f;   /* Dividers, icon details, secondary accents */
  --sage-deep:        #6b8a6b;   /* Darker sage for text */
  --sage-light:       #c2d4c2;   /* Light sage for backgrounds */
  --bone:             #f3eee6;   /* Body background, document surfaces */
  --bone-warm:        #ede7dc;   /* Slightly deeper bone for offset surfaces */

  /* --- Semantic Surface Tokens --- */
  --color-bg:             var(--bone);
  --color-surface:        #f9f6f0;
  --color-surface-soft:   #ffffff;
  --color-surface-accent: #eef2f7;   /* Azure-tinted surface for info panels */
  --color-surface-offset: var(--bone-warm);
  --color-divider:        #ddd8ce;
  --color-border:         rgba(74, 46, 79, 0.15);   /* Aubergine-tinted border */
  --color-border-subtle:  rgba(74, 46, 79, 0.08);

  /* --- Text --- */
  --color-text:           #2a1f2e;   /* Near-black with aubergine warmth */
  --color-text-muted:     #5c4d63;   /* Secondary text */
  --color-text-faint:     #9b8fa3;   /* Tertiary / placeholder */
  --color-text-inverse:   #f3eee6;   /* Text on dark backgrounds */
  --color-text-on-clay:   #ffffff;   /* Text on clay buttons */

  /* --- Header Gradient (matches brand JPG exactly) --- */
  --header-gradient: linear-gradient(135deg, var(--cobalt) 0%, #2a3a7a 30%, #4a2e5a 70%, var(--aubergine) 100%);
  --header-gradient-subtle: linear-gradient(135deg, var(--cobalt) 0%, var(--aubergine) 100%);

  /* --- Status Colors --- */
  --color-success:        #437a22;
  --color-success-bg:     #d4dfcc;
  --color-warning:        #c96a4a;   /* Reuses clay for brand consistency */
  --color-warning-bg:     #f2e0d8;
  --color-danger:         #a12c4a;
  --color-danger-bg:      #f0d0d8;
  --color-info:           var(--azure);
  --color-info-bg:        var(--color-surface-accent);

  /* --- Shadows --- */
  --shadow-sm:   0 1px 3px rgba(42, 31, 46, 0.08);
  --shadow-md:   0 4px 12px rgba(42, 31, 46, 0.10);
  --shadow-lg:   0 12px 32px rgba(42, 31, 46, 0.14);
  --shadow-card: 0 2px 8px rgba(42, 31, 46, 0.08), 0 1px 2px rgba(42, 31, 46, 0.05);

  /* --- Border Radius --- */
  --radius-sm:   0.25rem;   /*  4px */
  --radius-md:   0.5rem;    /*  8px */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-2xl:  1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-fast:        120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:        320ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Typography --- */
  --font-display: 'Bricolage Grotesque', 'Georgia', serif;
  --font-body:    'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  /* --- Fluid Type Scale --- */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);  /* 12–14px */
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);       /* 14–16px */
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);   /* 16–18px */
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);     /* 18–24px */
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);    /* 24–36px */
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);     /* 32–56px */
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);        /* 40–80px */
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);        /* 48–128px */

  /* --- Spacing Scale (4px base) --- */
  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */

  /* --- Content Widths --- */
  --content-narrow:  640px;
  --content-default: 960px;
  --content-wide:    1200px;
  --content-full:    100%;
}


/* ============================================================
   DARK MODE TOKENS
   ============================================================ */
[data-theme="dark"],
@media (prefers-color-scheme: dark) { :root:not([data-theme]) {
  --color-bg:             #1a1520;
  --color-surface:        #201a27;
  --color-surface-soft:   #261f2e;
  --color-surface-accent: #1e2a3a;
  --color-surface-offset: #1d1824;
  --color-divider:        #352c3e;
  --color-border:         rgba(199, 170, 210, 0.12);
  --color-border-subtle:  rgba(199, 170, 210, 0.06);
  --color-text:           #ede7f4;
  --color-text-muted:     #a897b5;
  --color-text-faint:     #6d5e7a;
  --color-text-inverse:   #1a1520;
  --color-text-on-clay:   #ffffff;
  --cobalt:               #2a4f8f;
  --aubergine:            #7a5285;
  --clay:                 #d4795a;
  --clay-hover:           #c06848;
  --clay-highlight:       #3a2520;
  --sage:                 #7a9a7a;
  --sage-light:           #2a3a2a;
  --bone:                 #1a1520;
  --header-gradient: linear-gradient(135deg, #0f2347 0%, #1e2a5a 30%, #321e40 70%, #2a1a30 100%);
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg:   0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --color-success:    #6daa45;
  --color-success-bg: #1e2e18;
  --color-warning:    #d4795a;
  --color-warning-bg: #2e1e18;
  --color-danger:     #d4607a;
  --color-danger-bg:  #2e1820;
  --color-info:       #4f7fbb;
  --color-info-bg:    #182030;
}}


/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role="list"], ol[role="list"] { list-style: none; }

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.2;
  color: var(--aubergine);
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

a {
  color: var(--azure);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

a:hover { color: var(--clay); }

button {
  cursor: pointer;
  background: none;
  border: none;
}

table { border-collapse: collapse; width: 100%; }

::selection {
  background: rgba(201, 106, 74, 0.22);   /* Clay tint */
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

/* Interactive transitions */
a, button, [role="button"], [role="link"], input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    opacity var(--transition-interactive);
}


/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-muted  { color: var(--color-text-muted); }
.text-faint  { color: var(--color-text-faint); }
.text-clay   { color: var(--clay); }
.text-sage   { color: var(--sage-deep); }
.text-azure  { color: var(--azure); }

.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--wide {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--content-narrow);
  margin-inline: auto;
  padding-inline: var(--space-6);
}


/* ============================================================
   APP HEADER — Shared gradient header (homepage + planners)
   ============================================================ */
.app-header {
  background: var(--header-gradient);
  padding: var(--space-6) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: relative;
}

/* Subtle clay accent line at bottom of header */
.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clay) 0%, transparent 100%);
  opacity: 0.6;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
}

.app-header__logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.app-header__titles {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.app-header__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.app-header__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--sage-light);
  letter-spacing: 0.01em;
}

.app-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Back nav link (used in planners: "← All Models") */
.app-header__back {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}

.app-header__back:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}


/* ============================================================
   DARK MODE TOGGLE
   ============================================================ */
.toggle-dark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-interactive), color var(--transition-interactive);
  flex-shrink: 0;
}

.toggle-dark:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}


/* ============================================================
   BUTTONS
   ============================================================ */

/* Primary — Clay CTA */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: background var(--transition-interactive), color var(--transition-interactive), box-shadow var(--transition-interactive), transform var(--transition-fast);
  min-height: 44px;
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--clay);
  color: var(--color-text-on-clay);
  box-shadow: 0 2px 8px rgba(201, 106, 74, 0.3);
}

.btn-primary:hover {
  background: var(--clay-hover);
  box-shadow: 0 4px 16px rgba(201, 106, 74, 0.4);
  color: var(--color-text-on-clay);
}

.btn-primary:active { background: var(--clay-active); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--aubergine);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--color-surface-offset);
  border-color: var(--aubergine);
  color: var(--aubergine-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
}

.btn-ghost:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

/* Disabled state */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icon-only button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: unset;
}

.btn-icon:hover {
  background: var(--color-surface-offset);
  color: var(--aubergine);
}


/* ============================================================
   BADGES / STATUS PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.badge--active {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(67, 122, 34, 0.2);
}

.badge--coming-soon {
  background: var(--clay-highlight);
  color: var(--clay);
  border: 1px solid rgba(201, 106, 74, 0.2);
}

.badge--development {
  background: var(--color-surface-accent);
  color: var(--azure);
  border: 1px solid rgba(31, 78, 121, 0.2);
}

.badge--sage {
  background: rgba(143, 168, 143, 0.15);
  color: var(--sage-deep);
  border: 1px solid rgba(143, 168, 143, 0.3);
}

.badge--aubergine {
  background: rgba(74, 46, 79, 0.1);
  color: var(--aubergine);
  border: 1px solid rgba(74, 46, 79, 0.2);
}


/* ============================================================
   CARDS — Generic surface card
   ============================================================ */
.card {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}

.card--accent {
  border-left: 3px solid var(--clay);
}

.card--info {
  background: var(--color-surface-accent);
  border-color: rgba(31, 78, 121, 0.15);
}


/* ============================================================
   RESOURCE / REFERENCE LINK CARDS
   ============================================================ */
.resource-link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: background var(--transition-interactive), border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}

.resource-link:hover {
  background: var(--color-surface-accent);
  border-color: var(--azure);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.resource-link__icon {
  width: 20px;
  height: 20px;
  color: var(--clay);
  flex-shrink: 0;
  margin-top: 2px;
}

.resource-link__body { flex: 1; min-width: 0; }

.resource-link__title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--azure);
  margin-bottom: var(--space-1);
}

.resource-link__url {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: monospace;
  word-break: break-all;
}


/* ============================================================
   FR REFERENCE CARDS (Federal Register / CMS links)
   ============================================================ */
.fr-ref-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-surface-accent);
  border: 1px solid rgba(31, 78, 121, 0.15);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: background var(--transition-interactive), border-color var(--transition-interactive);
}

.fr-ref-card:hover {
  background: rgba(31, 78, 121, 0.08);
  border-color: var(--azure);
  color: var(--color-text);
}

.fr-ref-card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--azure);
}

.fr-ref-card__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--aubergine);
  line-height: 1.3;
}

.fr-ref-card__url {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: monospace;
  word-break: break-all;
}


/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
  min-height: 44px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(201, 106, 74, 0.15);
}

.form-input::placeholder { color: var(--color-text-faint); }


/* ============================================================
   CHECKBOXES — Custom styled
   ============================================================ */
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 44px;
}

.checkbox-item:hover { background: var(--color-surface-offset); }

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--clay);
  cursor: pointer;
}

.checkbox-item__label {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}

.checkbox-item--done .checkbox-item__label {
  text-decoration: line-through;
  color: var(--color-text-faint);
}


/* ============================================================
   DIVIDERS
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--color-divider);
  margin-block: var(--space-6);
}

.divider--sage {
  border-top-color: var(--sage-light);
}

.divider--clay {
  border-top-color: rgba(201, 106, 74, 0.3);
}


/* ============================================================
   SECTION LABELS / OVERLINE TEXT
   ============================================================ */
.overline {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clay);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--aubergine);
  margin-bottom: var(--space-2);
}

.section-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 60ch;
}


/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  color: var(--color-text-faint);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: 36ch;
  margin-bottom: var(--space-6);
}


/* ============================================================
   SKELETON LOADERS
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-offset) 25%,
    var(--color-surface-soft)   50%,
    var(--color-surface-offset) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text    { height: 1em;   margin-bottom: var(--space-2); }
.skeleton-heading { height: 1.5em; width: 40%; margin-bottom: var(--space-4); }
.skeleton-image   { aspect-ratio: 16/9; width: 100%; }


/* ============================================================
   APP FOOTER
   ============================================================ */
.app-footer {
  background: var(--aubergine);
  color: rgba(255, 255, 255, 0.65);
  padding: var(--space-8) var(--space-8);
  margin-top: auto;
}

.app-footer__inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.app-footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.app-footer__note {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
  max-width: 48ch;
  text-align: center;
}

.app-footer__link {
  font-size: var(--text-xs);
  color: var(--sage-light);
  text-decoration: none;
}

.app-footer__link:hover {
  color: #ffffff;
}


/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
@media (max-width: 768px) {
  .app-header {
    padding: var(--space-4) var(--space-5);
    flex-wrap: wrap;
  }

  .app-header__logo { width: 44px; height: 44px; }

  .app-header__title { font-size: var(--text-lg); }

  .container,
  .container--wide { padding-inline: var(--space-4); }

  .app-footer__inner { flex-direction: column; text-align: center; }
  .app-footer__note  { text-align: center; }
}

@media (max-width: 480px) {
  .app-header__subtitle { display: none; }
  .btn { min-height: 48px; padding: var(--space-3) var(--space-5); }
}


/* ============================================================
   DARK MODE TOGGLE — JS Snippet (copy into each page's <script>)
   ============================================================
   (function(){
     const t = document.querySelector('[data-theme-toggle]');
     const r = document.documentElement;
     let d = matchMedia('(prefers-color-scheme:dark)').matches ? 'dark' : 'light';
     r.setAttribute('data-theme', d);
     t && t.addEventListener('click', () => {
       d = d === 'dark' ? 'light' : 'dark';
       r.setAttribute('data-theme', d);
       t.setAttribute('aria-label', 'Switch to ' + (d === 'dark' ? 'light' : 'dark') + ' mode');
       t.innerHTML = d === 'dark'
         ? '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg>'
         : '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>';
     });
   })();
   ============================================================ */
