/* =========================================================
   friendsadventcalendar.best — Nordic Letterpress & Wax-Seal Stationery
   4 Heirloom Themes (WCAG AA >= 4.96:1) | 3-Viewport Responsive
   ========================================================= */
:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: var(--font-sans);

  --text-h1: clamp(1.85rem, 3.1vw, 2.65rem);
  --text-h2: clamp(1.375rem, 2.2vw, 1.875rem);
  --text-h3: clamp(1.0625rem, 1.4vw, 1.25rem);
  --text-body: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;
  --container-max: 1180px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-card: 0 18px 44px -14px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  --shadow-door: 0 6px 14px -4px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 28px 64px -12px rgba(0, 0, 0, 0.6);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-door: 520ms;

  --semantic-success: #1E6B47;
  --semantic-success-bg: color-mix(in srgb, #1E6B47 12%, #FFFFFF);
  --semantic-warning: #8A5300;
  --semantic-warning-bg: color-mix(in srgb, #8A5300 12%, #FFFFFF);
  --semantic-danger: #B83B2E;
  --semantic-danger-bg: color-mix(in srgb, #B83B2E 12%, #FFFFFF);
  --semantic-info: #1E5689;
  --semantic-info-bg: color-mix(in srgb, #1E5689 12%, #FFFFFF);
}

/* Theme 1: Pine Night (Default) */
:root, [data-theme="pine"] {
  --bg-canvas: #0F241D;
  --bg-canvas-elevated: color-mix(in srgb, var(--bg-canvas) 88%, #FFFFFF);
  --bg-surface: #FAF5EC;
  --bg-surface-muted: color-mix(in srgb, var(--bg-surface) 92%, var(--text-primary));
  --door-closed-bg: color-mix(in srgb, var(--bg-canvas) 82%, #FFFFFF);
  --door-opened-bg: color-mix(in srgb, var(--bg-surface) 95%, var(--text-primary));
  --brand-primary: #B83B2E;
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary) 82%, #000000);
  --brand-accent: #E6BE6C;
  --text-on-canvas: var(--bg-surface);
  --text-on-canvas-muted: color-mix(in srgb, var(--bg-surface) 78%, var(--bg-canvas));
  --text-primary: #1A241F;
  --text-secondary: color-mix(in srgb, var(--text-primary) 76%, var(--bg-surface));
  --text-muted: color-mix(in srgb, var(--text-primary) 68%, var(--bg-surface));
  --border-subtle: color-mix(in srgb, var(--text-primary) 14%, transparent);
  --border-strong: color-mix(in srgb, var(--text-primary) 30%, transparent);
  --border-foil: color-mix(in srgb, var(--brand-accent) 48%, transparent);
}

/* Theme 2: Warm Cocoa */
[data-theme="cocoa"] {
  --bg-canvas: #241611;
  --bg-canvas-elevated: color-mix(in srgb, var(--bg-canvas) 88%, #FFFFFF);
  --bg-surface: #FAF5EC;
  --bg-surface-muted: color-mix(in srgb, var(--bg-surface) 92%, var(--text-primary));
  --door-closed-bg: color-mix(in srgb, var(--bg-canvas) 82%, #FFFFFF);
  --door-opened-bg: color-mix(in srgb, var(--bg-surface) 95%, var(--text-primary));
  --brand-primary: #B83B2E;
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary) 82%, #000000);
  --brand-accent: #E6BE6C;
  --text-on-canvas: var(--bg-surface);
  --text-on-canvas-muted: color-mix(in srgb, var(--bg-surface) 78%, var(--bg-canvas));
  --text-primary: #1A241F;
  --text-secondary: color-mix(in srgb, var(--text-primary) 76%, var(--bg-surface));
  --text-muted: color-mix(in srgb, var(--text-primary) 68%, var(--bg-surface));
  --border-subtle: color-mix(in srgb, var(--text-primary) 14%, transparent);
  --border-strong: color-mix(in srgb, var(--text-primary) 30%, transparent);
  --border-foil: color-mix(in srgb, var(--brand-accent) 50%, transparent);
}

/* Theme 3: Winter Frost */
[data-theme="frost"] {
  --bg-canvas: #132234;
  --bg-canvas-elevated: color-mix(in srgb, var(--bg-canvas) 88%, #FFFFFF);
  --bg-surface: color-mix(in srgb, #FFFFFF 92%, #DCE7F3);
  --bg-surface-muted: color-mix(in srgb, var(--bg-surface) 92%, var(--text-primary));
  --door-closed-bg: color-mix(in srgb, var(--bg-canvas) 82%, #FFFFFF);
  --door-opened-bg: color-mix(in srgb, var(--bg-surface) 95%, var(--text-primary));
  --brand-primary: #1E5689;
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary) 82%, #000000);
  --brand-accent: #DCE7F3;
  --text-on-canvas: var(--bg-surface);
  --text-on-canvas-muted: color-mix(in srgb, var(--bg-surface) 78%, var(--bg-canvas));
  --text-primary: #1A241F;
  --text-secondary: color-mix(in srgb, var(--text-primary) 76%, var(--bg-surface));
  --text-muted: color-mix(in srgb, var(--text-primary) 68%, var(--bg-surface));
  --border-subtle: color-mix(in srgb, var(--text-primary) 14%, transparent);
  --border-strong: color-mix(in srgb, var(--text-primary) 30%, transparent);
  --border-foil: color-mix(in srgb, var(--brand-accent) 45%, transparent);
}

/* Theme 4: Festive Crimson */
[data-theme="crimson"] {
  --bg-canvas: #361017;
  --bg-canvas-elevated: color-mix(in srgb, var(--bg-canvas) 88%, #FFFFFF);
  --bg-surface: #FAF5EC;
  --bg-surface-muted: color-mix(in srgb, var(--bg-surface) 92%, var(--text-primary));
  --door-closed-bg: color-mix(in srgb, var(--bg-canvas) 82%, #FFFFFF);
  --door-opened-bg: color-mix(in srgb, var(--bg-surface) 95%, var(--text-primary));
  --brand-primary: #9E2133;
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary) 82%, #000000);
  --brand-accent: #E6BE6C;
  --text-on-canvas: var(--bg-surface);
  --text-on-canvas-muted: color-mix(in srgb, var(--bg-surface) 78%, var(--bg-canvas));
  --text-primary: #1A241F;
  --text-secondary: color-mix(in srgb, var(--text-primary) 76%, var(--bg-surface));
  --text-muted: color-mix(in srgb, var(--text-primary) 68%, var(--bg-surface));
  --border-subtle: color-mix(in srgb, var(--text-primary) 14%, transparent);
  --border-strong: color-mix(in srgb, var(--text-primary) 30%, transparent);
  --border-foil: color-mix(in srgb, var(--brand-accent) 50%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--text-on-canvas);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  transition: background-color 280ms var(--ease-out);
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 1; flex: 1; }
a { color: var(--brand-accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header (Strict Single-Row Desktop) ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 64px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg-canvas) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-foil);
}

.nav-wrap {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-on-canvas);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.04rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand .gf-site-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  flex-shrink: 1;
}

.primary-nav a {
  color: var(--text-on-canvas-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 2px;
  transition: color var(--dur-fast);
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--brand-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.my-cals-btn {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-foil);
  background: color-mix(in srgb, var(--bg-canvas-elevated) 90%, transparent);
  color: var(--brand-accent);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.my-cals-btn.visible { display: inline-flex; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--brand-primary);
  color: #FFFFFF;
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.nav-cta:hover { background: var(--brand-primary-hover); transform: translateY(-1px); color: #FFFFFF; }

.mobile-code-link {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-foil);
  color: var(--brand-accent);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-foil);
  background: color-mix(in srgb, var(--bg-canvas-elevated) 85%, transparent);
  color: var(--text-on-canvas);
  cursor: pointer;
  padding: 0;
}

/* Mobile Nav Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in srgb, #000000 72%, transparent);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: flex-end;
}
.mobile-drawer.open { display: flex; }
.mobile-drawer-panel {
  width: min(320px, 86vw);
  height: 100%;
  background: var(--bg-canvas-elevated);
  border-left: 1px solid var(--border-foil);
  padding: 18px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-foil);
}
.mobile-drawer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-on-canvas);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.mobile-drawer a:hover { background: rgba(255, 255, 255, 0.08); color: var(--brand-accent); }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  padding: 14px 0 4px;
  font-size: var(--text-xs);
  color: var(--text-on-canvas-muted);
}
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.breadcrumbs a { color: var(--text-on-canvas-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-accent); text-decoration: underline; }
.breadcrumbs .sep { opacity: 0.55; }

/* ===== Hero Base ===== */
.hero-section { padding: 18px 0 36px; }
.hero-head {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 20px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-foil);
  background: color-mix(in srgb, var(--bg-canvas-elevated) 85%, transparent);
  color: var(--brand-accent);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
  color: var(--text-on-canvas);
}
.hero-sub {
  margin: 0 auto;
  max-width: 68ch;
  font-size: 0.98rem;
  color: var(--text-on-canvas-muted);
  line-height: 1.55;
}

/* ===== Home Bento Studio ===== */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.creator-card, .parchment-card {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.modal-box a:not(.btn-primary):not(.btn-secondary):not(.recent-cal-item),
.parchment-card a:not(.btn-primary):not(.btn-secondary):not(.recent-cal-item),
.creator-card a:not(.btn-primary):not(.btn-secondary):not(.recent-cal-item) {
  color: var(--brand-primary);
  font-weight: 600;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface-muted);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 12px;
  gap: 4px;
}
.mode-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 9px;
  cursor: pointer;
  min-height: 44px;
  transition: all 180ms var(--ease-out);
}
.mode-btn[aria-pressed="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
.mode-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 14px;
  line-height: 1.45;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.field-input, .field-textarea, .field-select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field-input:focus, .field-textarea:focus, .field-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.field-input.mono-code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  padding: 14px 16px;
}
.field-error {
  color: var(--semantic-danger);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 6px;
}

/* Compact Schedule Picker (Zero Bloat, Nordic Letterpress) */
.schedule-picker { margin: 2px 0 4px; }
.schedule-range-pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.sched-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface-muted);
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
  min-width: 0;
}
.sched-btn[hidden] { display: none; }
.sched-btn:hover { border-color: var(--brand-primary); background: var(--bg-surface); }
.sched-btn[aria-pressed="true"] {
  border-color: var(--brand-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.sched-btn-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sched-btn[aria-pressed="true"] .sched-btn-title { color: var(--brand-primary); }
.sched-btn-sub {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.schedule-custom-panel {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
}
.schedule-custom-panel[hidden] { display: none; }
.schedule-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.95fr);
  gap: 8px;
  align-items: end;
}
.sched-mini-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 0;
}
.sched-date-input, .sched-num-input {
  padding: 7px 9px;
  font-size: 14px;
  min-height: 40px;
}
.sched-quick-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.sched-chip {
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.sched-chip[aria-pressed="true"] {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
}
.schedule-hint {
  margin: 6px 0 2px;
  font-size: 0.77rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}
.theme-btn {
  border: 2px solid transparent;
  border-radius: 11px;
  padding: 9px 4px;
  min-height: 54px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
  transition: transform var(--dur-fast), border-color var(--dur-fast);
}
.theme-btn:hover { transform: translateY(-1px); }
.theme-btn[aria-pressed="true"] {
  border-color: #E6BE6C;
  box-shadow: 0 0 0 2px #FFFFFF inset;
}
.t-pine { background: color-mix(in srgb, #0F241D 84%, #FFFFFF); }
.t-cocoa { background: color-mix(in srgb, #241611 84%, #FFFFFF); }
.t-frost { background: color-mix(in srgb, #132234 84%, #FFFFFF); }
.t-crimson { background: color-mix(in srgb, #361017 84%, #FFFFFF); }
.swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
}

.pin-details {
  margin: 0 0 14px;
  background: var(--bg-surface-muted);
  border-radius: 10px;
  padding: 8px 12px;
}
.pin-details summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pin-details summary::-webkit-details-marker { display: none; }
.pin-details[open] summary { margin-bottom: 8px; color: var(--text-primary); }

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast), transform var(--dur-fast), border-color var(--dur-fast);
}
.btn-full { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: var(--text-sm); border-radius: 10px; }

.btn-primary {
  border: 0;
  background: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.btn-primary:hover { background: var(--brand-primary-hover); transform: translateY(-1px); color: #FFFFFF; }

.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-secondary {
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface-muted);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--text-primary); background: var(--bg-surface); }

.btn-ghost {
  border: 1.5px solid var(--border-foil);
  background: color-mix(in srgb, var(--bg-canvas-elevated) 85%, transparent);
  color: var(--text-on-canvas);
}
.btn-ghost:hover { border-color: var(--brand-accent); color: var(--brand-accent); }

.btn-danger {
  border: 1.5px solid var(--semantic-danger);
  background: var(--semantic-danger-bg);
  color: var(--semantic-danger);
}
.btn-danger:hover { background: var(--semantic-danger); color: #FFFFFF; }

:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

.creator-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}
.creator-foot a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }
.creator-foot a:hover { text-decoration: underline; }

/* ===== 24-Door Calendar Board & 3D Flip ===== */
.board-frame {
  background: var(--bg-canvas-elevated);
  border: 1.5px solid var(--border-foil);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.board-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-on-canvas);
  display: flex;
  align-items: center;
  gap: 8px;
}
.board-pill {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-foil);
  color: var(--brand-accent);
}

.doors-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  perspective: 900px;
}
.doors-grid[data-cols="4"] {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.doors-grid[data-cols="3"] {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.door {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  perspective: 750px;
  font-family: var(--font-sans);
  text-align: center;
}
.door-inner {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--door-opened-bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  overflow: hidden;
}
.door-inner-emoji { font-size: 1.25rem; line-height: 1.1; }
.door-inner-author {
  font-weight: 700;
  font-size: var(--text-xs);
  max-width: 96%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.door-inner-meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.door-leaf {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--door-closed-bg);
  border: 1.5px solid var(--border-foil);
  box-shadow: var(--shadow-door);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform var(--dur-door) var(--ease-out), box-shadow var(--dur-base), border-color var(--dur-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  color: var(--brand-accent);
  backface-visibility: hidden;
}
.door:hover .door-leaf {
  transform: translateY(-2px);
  border-color: var(--brand-accent);
}
.door.empty .door-inner { display: none; }
.door.empty .door-leaf {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px dashed var(--border-foil);
  box-shadow: none;
  color: var(--text-on-canvas-muted);
}
.door.empty:hover .door-leaf {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}
.door.unlockable .door-leaf {
  box-shadow: 0 0 0 2px var(--brand-accent), 0 0 18px color-mix(in srgb, var(--brand-accent) 45%, transparent);
  animation: pulseGlow 2.4s ease-in-out infinite;
}
.door.opened .door-leaf {
  transform: rotateY(-112deg);
  pointer-events: none;
}
.door.shake { animation: shakeDoor 320ms ease-in-out; }

.door-seal {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 0.72rem;
  line-height: 1;
}
.door-day-pill {
  position: absolute;
  top: 5px;
  right: 6px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.64rem;
  font-weight: 600;
  opacity: 0.78;
  line-height: 1;
}
.door-num {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.door-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  opacity: 0.94;
  max-width: 94%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}
.door-thank-badge {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 0.8rem;
  background: #FFFFFF;
  border-radius: var(--radius-full);
  padding: 1px 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 2px var(--brand-accent), 0 0 12px color-mix(in srgb, var(--brand-accent) 30%, transparent); }
  50% { box-shadow: 0 0 0 2.5px var(--brand-accent), 0 0 22px color-mix(in srgb, var(--brand-accent) 65%, transparent); }
}
@keyframes shakeDoor {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Confetti Particles */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 150;
  animation: confettiFall 880ms var(--ease-out) forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.4); }
}

/* Skeleton Loader */
.door-skeleton {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Differentiated SEO Hero Widgets ===== */
/* 1. Online Countdown Hero */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.countdown-box {
  background: var(--bg-canvas);
  border: 1.5px solid var(--border-foil);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
}
.countdown-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  color: var(--brand-accent);
  line-height: 1.1;
}
.countdown-lbl {
  font-size: var(--text-xs);
  color: var(--text-on-canvas-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.today-door-stage {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  background: color-mix(in srgb, var(--bg-canvas) 65%, transparent);
  border: 1px solid var(--border-foil);
  border-radius: 16px;
  padding: 16px;
}
.today-door-btn {
  width: 150px;
  height: 150px;
  margin: 0 auto;
}

/* 2. Maker Template Gallery */
.maker-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.maker-tpl-card {
  border: 2px solid var(--border-foil);
  border-radius: 16px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: #FFFFFF;
  transition: transform var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.maker-tpl-card:hover { transform: translateY(-3px); }
.maker-tpl-card[aria-pressed="true"] {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 35%, transparent);
}
.maker-mini-doors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.maker-mini-doors span {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}
.maker-tpl-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.maker-tpl-desc { font-size: var(--text-xs); opacity: 0.88; line-height: 1.4; }

.maker-bar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}
.story-mini-preview {
  background: var(--bg-canvas);
  border: 1.5px solid var(--border-foil);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  color: var(--text-on-canvas);
}

/* 3. Digital Stats & Lock Simulator */
.metrics-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.metric-tile {
  background: var(--bg-canvas);
  border: 1px solid var(--border-foil);
  border-radius: 14px;
  padding: 14px;
}
.metric-val {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-accent);
}
.metric-lbl { font-size: var(--text-xs); color: var(--text-on-canvas-muted); margin-top: 2px; }
.sim-box {
  background: var(--bg-canvas);
  border: 1.5px solid var(--border-foil);
  border-radius: 14px;
  padding: 16px;
}
.sim-json {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--brand-accent);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 4. Virtual Teams Calculator */
.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.pill-tab {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-foil);
  background: transparent;
  color: var(--text-on-canvas-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.pill-tab[aria-pressed="true"] {
  background: var(--brand-accent);
  color: var(--text-primary);
  border-color: var(--brand-accent);
}
.calc-range {
  width: 100%;
  accent-color: var(--brand-accent);
  margin: 10px 0;
  height: 28px;
}
.invite-script-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-foil);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: var(--text-sm);
  color: var(--text-on-canvas);
  line-height: 1.5;
  margin: 10px 0 12px;
}

/* 5. Couples 3-Door Preview */
.couples-doors-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.couples-doors-3 .door { aspect-ratio: 4 / 5; }

/* 6. Messages Bank (80+ Filterable & Printable) */
.messages-toolbar {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-canvas-elevated) 95%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-foil);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.messages-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.messages-search {
  flex: 1;
  min-width: 200px;
}
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.note-card {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.note-card.hidden-note { display: none; }
.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.note-cat-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
}
.note-char-badge {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--semantic-success);
  background: var(--semantic-success-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.note-card-text {
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text-primary);
}
.note-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 7. DIY Budget Hero */
.diy-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}
.diy-cocoa-cta {
  background: var(--bg-canvas-elevated);
  border: 1.5px solid var(--brand-accent);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--text-on-canvas);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

/* 8. /code Dual-State Workbench */
.code-entry-wrap {
  max-width: 560px;
  margin: 0 auto 28px;
}
.offline-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--semantic-warning-bg);
  color: var(--semantic-warning);
  border: 1px solid color-mix(in srgb, var(--semantic-warning) 25%, transparent);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 16px;
}
.offline-banner.visible { display: flex; }

.live-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-canvas-elevated);
  border: 1px solid var(--border-foil);
  border-radius: 16px;
}
.live-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recent-cals-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.recent-cal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-surface-muted);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
}
.recent-cal-item:hover { background: #FFFFFF; }
.code-chip {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xs);

  background: var(--bg-canvas);
  color: var(--brand-accent);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ===== Content Sections (Below the Fold) ===== */
.content-band {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.prose-card {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 36px 38px;
  box-shadow: var(--shadow-card);
}
.prose-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  line-height: 1.25;
  color: var(--text-primary);
  margin: 36px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}
.prose-card h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: 1.35;
  color: var(--text-primary);
  margin: 22px 0 8px;
}
.prose-card p, .prose-card li {
  color: var(--text-secondary);
  max-width: 72ch;
}
.prose-card strong { color: var(--text-primary); }
.prose-card a { color: var(--brand-primary); font-weight: 600; }
.prose-card ul, .prose-card ol { padding-left: 22px; }
.prose-card li { margin-bottom: 6px; }

/* Responsive Tables inside Prose */
.table-wrap, .prose-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: var(--text-sm);
}
.prose-card .table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.prose-card .table-scroll table { margin: 0; }
.prose-card th {
  background: var(--bg-surface-muted);
  color: var(--text-primary);
  text-align: left;
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1.5px solid var(--border-strong);
}
.prose-card td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}
.prose-card tr:last-child td { border-bottom: 0; }

/* Related Matrix Grid */
.matrix-section { padding: 36px 0; }
.section-heading {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  color: var(--text-on-canvas);
  margin: 0 0 18px;
}
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.matrix-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 18px;
  border-radius: 16px;
  background: var(--bg-canvas-elevated);
  border: 1px solid var(--border-foil);
  text-decoration: none;
  color: var(--text-on-canvas);
  transition: transform var(--dur-fast), border-color var(--dur-fast);
}
.matrix-card:hover { transform: translateY(-2px); border-color: var(--brand-accent); }
.matrix-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-accent);
}
.matrix-card-desc { font-size: var(--text-sm); color: var(--text-on-canvas-muted); margin: 0; }

/* FAQ Accordion */
.faq-section { padding: 36px 0 48px; }
.faq-list { display: grid; gap: 12px; max-width: 900px; }
.faq-item {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--text-primary);
}
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brand-primary);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer {
  padding: 0 20px 18px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}
.faq-answer a { color: var(--brand-primary); font-weight: 600; }

/* Legal Reader Layout */
.legal-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 28px;
  align-items: start;
  padding: 18px 0 56px;
}
.legal-toc {
  position: sticky;
  top: 84px;
  background: var(--bg-canvas-elevated);
  border: 1px solid var(--border-foil);
  border-radius: 14px;
  padding: 16px;
}
.legal-toc-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent);
  margin: 0 0 10px;
}
.legal-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legal-toc a {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-on-canvas-muted);
  text-decoration: none;
  padding: 4px 0;
}
.legal-toc a:hover { color: var(--brand-accent); }
.trust-strip {
  margin-top: 28px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

/* Report Form on /contact */
.report-card {
  margin-top: 24px;
  background: var(--bg-surface-muted);
  border: 1.5px solid var(--border-strong);
  border-radius: 16px;
  padding: 22px;
}

/* ===== Footer (3 Columns + Brand Info) ===== */
.site-footer {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--bg-canvas) 75%, #000000);
  border-top: 1px solid var(--border-foil);
  padding: 44px 0 28px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}
.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--brand-accent);
  margin: 0 0 12px;
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.footer-links a {
  color: var(--text-on-canvas-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.footer-links a:hover { color: var(--brand-accent); text-decoration: underline; }
.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--text-xs);
  color: var(--text-on-canvas-muted);
}

/* ===== Modals & Drawers ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: color-mix(in srgb, #000000 74%, transparent);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
}
.modal-close {
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-muted);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.sticker-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.sticker-tab {
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
}
.sticker-tab.active { background: var(--brand-primary); color: #FFFFFF; border-color: var(--brand-primary); }
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.sticker-btn {
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--bg-surface-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sticker-btn[aria-pressed="true"] {
  border-color: var(--brand-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 20%, transparent);
}

.idea-drawer {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0 12px;
  display: none;
}
.idea-drawer.open { display: block; }
.idea-item {
  width: 100%;
  text-align: left;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 11px;
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text-primary);
  cursor: pointer;
}
.idea-item:hover { border-color: var(--brand-primary); }

.note-letter-box {
  background: #FFFFFF;
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  margin: 12px 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.thank-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thank-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface-muted);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}
.thank-btn.active { background: var(--brand-primary); color: #FFFFFF; border-color: var(--brand-primary); }

.alert-box {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: var(--text-sm);
  margin-bottom: 12px;
  font-weight: 600;
}
.alert-warn { background: var(--semantic-warning-bg); color: var(--semantic-warning); border: 1px solid color-mix(in srgb, var(--semantic-warning) 25%, transparent); }
.alert-danger { background: var(--semantic-danger-bg); color: var(--semantic-danger); border: 1px solid color-mix(in srgb, var(--semantic-danger) 25%, transparent); }
.alert-info { background: var(--semantic-info-bg); color: var(--semantic-info); border: 1px solid color-mix(in srgb, var(--semantic-info) 25%, transparent); }
.alert-success { background: var(--semantic-success-bg); color: var(--semantic-success); border: 1px solid color-mix(in srgb, var(--semantic-success) 25%, transparent); }

.story-canvas-preview {
  width: 100%;
  max-width: 260px;
  margin: 0 auto 14px;
  display: block;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  z-index: 140;
  background: var(--bg-canvas);
  color: var(--text-on-canvas);
  border: 1px solid var(--brand-accent);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 220ms var(--ease-out);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive Breakpoints ===== */
@media (max-width: 1024px) {
  .primary-nav { gap: 12px; }
  .maker-gallery { grid-template-columns: repeat(2, 1fr); }
  .matrix-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
}

@media (max-width: 900px) {
  .primary-nav, .nav-cta { display: none; }
  .mobile-code-link, .mobile-menu-btn { display: inline-flex; }
  .site-header { height: 56px; }
  .messages-toolbar { top: 56px; }
  .studio-grid, .maker-bar-grid, .diy-hero-grid { grid-template-columns: 1fr; }
  .doors-grid,
  .doors-grid[data-cols="4"],
  .doors-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .today-door-stage { grid-template-columns: 1fr; text-align: center; }
  .notes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .brand span { font-size: 0.94rem; }
  .creator-card, .parchment-card { padding: 18px 16px; }
  .prose-card { padding: 24px 18px; }
  .maker-gallery, .matrix-grid, .footer-grid, .couples-doors-3 { grid-template-columns: 1fr; }
  .countdown-grid { grid-template-columns: repeat(2, 1fr); }
  .themes-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .btn-primary, .btn-secondary { width: 100%; }
  .live-toolbar-actions .btn-sm { flex: 1 1 auto; }
}

/* Mobile Landscape (844x390 hard spec: Header <= 44px, 6x4 doors, scrollable modal) */
@media (max-height: 460px) and (orientation: landscape) {
  .site-header { height: 44px; }
  .messages-toolbar { top: 44px; }
  .mobile-code-link, .mobile-menu-btn { min-height: 36px; height: 36px; }
  .hero-section { padding: 10px 0 20px; }
  .hero-head { margin-bottom: 10px; }
  .hero-badge, .hero-sub { display: none; }
  h1 { font-size: 1.35rem; margin-bottom: 4px; }
  .studio-grid { grid-template-columns: 44% 56%; gap: 14px; }
  .creator-card { padding: 12px; }
  .board-frame { padding: 10px; }
  .doors-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .doors-grid[data-cols="4"] { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .doors-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .door { aspect-ratio: 4 / 3; min-height: 44px; }
  .door-num { font-size: 0.88rem; }
  .door-day-pill, .door-tag { display: none; }
  .sched-btn { min-height: 36px; padding: 4px 8px; }
  .schedule-hint { display: none; }
  .modal-backdrop { align-items: center; padding: 8px; }
  .modal-box { max-width: 680px; max-height: 92dvh; border-radius: 14px; }
  .modal-head { padding: 10px 16px; }
  .modal-body { padding: 12px 16px; }
  .modal-footer { padding: 10px 16px; }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .door.unlockable .door-leaf { animation: none; }
  .door-leaf { transition: opacity 150ms linear; }
  .door.opened .door-leaf { transform: none; opacity: 0; }
  .confetti-piece { display: none; }
}

/* Print Stylesheet for /advent-calendar-messages (24-Card Cutout Sheet) */
@media print {
  body { background: #FFFFFF !important; color: #000000 !important; }
  body::before, .site-header, .site-footer, .breadcrumbs, .messages-toolbar,
  .note-card-actions, .content-band, .matrix-section, .faq-section, .modal-backdrop, .toast {
    display: none !important;
  }
  .hero-head { text-align: left; margin-bottom: 12px; }
  h1 { color: #000000 !important; font-size: 18pt !important; }
  .hero-badge, .hero-sub { display: none !important; }
  .notes-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
  .note-card {
    break-inside: avoid;
    border: 1.5px dashed #000000 !important;
    border-radius: 6px !important;
    padding: 10px !important;
    box-shadow: none !important;
  }
  .note-card:nth-child(n+25) { display: none !important; }
}

/* Phase v2.0 Experience Upgrade (0 New Hex Colors — Pure Tokens + color-mix) */
:root { --font-hand: 'Kalam', Georgia, cursive; }

.fac-snow { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.fac-snow i {
  position: absolute; top: -12px; left: var(--sx, 10%);
  width: var(--ss, 4px); height: var(--ss, 4px); border-radius: 50%;
  background: color-mix(in srgb, #FFFFFF 78%, var(--brand-accent));
  opacity: var(--so, 0.42); will-change: transform;
  animation: snowfall var(--sd, 14s) linear var(--sdl, 0s) infinite;
}
@keyframes snowfall {
  0% { transform: translate3d(0, -10px, 0); }
  50% { transform: translate3d(var(--sw, 18px), 52vh, 0); }
  100% { transform: translate3d(calc(var(--sw, 18px) * -0.5), 104vh, 0); }
}

.music-ctrl { position: relative; display: inline-flex; align-items: center; }
.music-btn {
  width: 44px; height: 44px; padding: 0; border-radius: var(--radius-full);
  border: 1.5px solid var(--border-foil);
  background: color-mix(in srgb, var(--bg-canvas-elevated) 86%, transparent);
  color: var(--text-on-canvas); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.music-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.music-btn .music-icon-on { display: none; }
.music-btn[aria-pressed="true"] {
  border-color: var(--brand-accent); color: var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 16%, var(--bg-canvas));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent) 22%, transparent);
}
.music-btn[aria-pressed="true"] .music-icon-off { display: none; }
.music-btn[aria-pressed="true"] .music-icon-on { display: block; }
.music-track-pill {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 75;
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 10px;
  border-radius: var(--radius-full); border: 1px solid var(--border-foil);
  background: var(--bg-canvas); color: var(--brand-accent);
  font-family: var(--font-sans); font-size: 0.72rem; font-weight: 600;
  white-space: nowrap; cursor: pointer; box-shadow: var(--shadow-door);
}
.music-track-pill[hidden] { display: none; }
.music-track-pill:hover { border-color: var(--brand-accent); color: #FFFFFF; }

.theme-btn { padding: 7px 5px 6px; min-height: 68px; gap: 5px; position: relative; overflow: hidden; }
.theme-btn-name { font-size: 0.72rem; line-height: 1.15; white-space: nowrap; }
.mini-board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
  width: 100%; max-width: 58px; padding: 4px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.16);
}
.mini-board i { display: block; height: 14px; border-radius: 3px; border: 1px dashed rgba(255, 255, 255, 0.45); }
.t-pine .mini-board i:nth-child(1) { background: color-mix(in srgb, #0F241D 60%, #1E6B47); }
.t-pine .mini-board i:nth-child(2) { background: #B83B2E; border-color: #E6BE6C; }
.t-pine .mini-board i:nth-child(3) { background: color-mix(in srgb, #0F241D 70%, #E6BE6C); }
.t-cocoa .mini-board i:nth-child(1) { background: color-mix(in srgb, #241611 65%, #8A5300); }
.t-cocoa .mini-board i:nth-child(2) { background: #B83B2E; border-color: #E6BE6C; }
.t-cocoa .mini-board i:nth-child(3) { background: color-mix(in srgb, #241611 55%, #E6BE6C); }
.t-frost .mini-board i:nth-child(1) { background: color-mix(in srgb, #132234 55%, #1E5689); }
.t-frost .mini-board i:nth-child(2) { background: #1E5689; border-color: #DCE7F3; }
.t-frost .mini-board i:nth-child(3) { background: color-mix(in srgb, #132234 65%, #DCE7F3); }
.t-crimson .mini-board i:nth-child(1) { background: color-mix(in srgb, #361017 55%, #9E2133); }
.t-crimson .mini-board i:nth-child(2) { background: #9E2133; border-color: #E6BE6C; }
.t-crimson .mini-board i:nth-child(3) { background: color-mix(in srgb, #361017 65%, #E6BE6C); }
.maker-mini-doors span { border: 1px dashed rgba(255, 255, 255, 0.35); }

.board-header-right, .live-toolbar-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view-switch {
  display: inline-flex; align-items: center; padding: 3px; border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border-foil); gap: 2px;
}
.view-switch-btn {
  min-height: 32px; padding: 0 11px; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--text-on-canvas-muted);
  font-family: var(--font-sans); font-size: 0.76rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast);
}
.view-switch-btn:hover { color: var(--text-on-canvas); }
.view-switch-btn[aria-pressed="true"] {
  background: var(--bg-surface); color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.door.felt-filled .door-leaf {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--door-closed-bg) 92%, #FFFFFF) 0%, var(--door-closed-bg) 100%);
  border: 1.5px solid color-mix(in srgb, var(--brand-accent) 55%, transparent);
  justify-content: flex-end; padding: 6px 4px 5px; gap: 2px; overflow: visible;
}
.door.felt-filled .door-leaf::after {
  content: ""; position: absolute; inset: 4px; border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--brand-accent) 44%, transparent); pointer-events: none;
}
.door.empty .door-leaf::after {
  content: ""; position: absolute; inset: 5px; border-radius: 7px;
  border: 1px dotted color-mix(in srgb, var(--text-on-canvas) 22%, transparent); pointer-events: none;
}
.door-gift-peek {
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  width: 68%; height: 22%; min-height: 12px; max-height: 24px;
  border-radius: 4px 4px 2px 2px; overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.24);
  pointer-events: none;
}
.door-gift-peek svg { width: 100%; height: 100%; display: block; }
.door-bow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 18%; min-width: 6px; height: 100%; background: var(--brand-accent);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);
}
.door-bow::before, .door-bow::after {
  content: ""; position: absolute; top: -1px; width: 7px; height: 5px; border-radius: 50%;
  border: 1.5px solid var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 40%, transparent);
}
.door-bow::before { right: 50%; transform: rotate(-18deg); }
.door-bow::after { left: 50%; transform: rotate(18deg); }
.door-open-pill {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 4;
  background: var(--brand-primary); color: #FFFFFF; font-family: var(--font-sans);
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.06em; padding: 2px 7px;
  border-radius: var(--radius-full); white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); border: 1px solid color-mix(in srgb, #FFFFFF 32%, transparent);
  animation: badgepulse 2.1s ease-in-out infinite; pointer-events: none;
}
@keyframes badgepulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.07); }
}
.door-charm-badge {
  position: absolute; top: 4px; left: 5px; font-size: 0.82rem; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); pointer-events: none; z-index: 2;
}
.door-name-tag {
  display: inline-block; max-width: 92%; padding: 1px 6px; border-radius: 4px;
  background: color-mix(in srgb, #FAF5EC 94%, transparent); color: #1A241F;
  font-size: 0.65rem; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28); position: relative; z-index: 2;
}
.door-teaser-pill {
  display: block; max-width: 94%; font-size: 0.58rem; font-weight: 600;
  color: var(--brand-accent); opacity: 0.92; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; line-height: 1.15; position: relative; z-index: 2;
}
.door.felt-filled .door-num { margin-top: 14px; font-size: 1.02rem; position: relative; z-index: 2; }
.door.opened .door-open-pill { display: none; }

.tree-stage[hidden] { display: none; }
.tree-stage { position: relative; width: 100%; padding: 8px 4px 6px; }
.tree-canvas {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 560 / 450;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--brand-accent) 14%, var(--bg-canvas)) 0%, var(--bg-canvas) 74%);
  border: 1px solid color-mix(in srgb, var(--brand-accent) 26%, transparent); overflow: hidden;
}
.tree-svg { width: 100%; height: 100%; display: block; }
.tree-bulb { animation: twinkle 2.4s ease-in-out infinite; }
.tree-bulb:nth-child(2n) { animation-delay: 0.6s; }
.tree-bulb:nth-child(3n) { animation-delay: 1.2s; }
.tree-bulb:nth-child(5n) { animation-delay: 1.8s; }
@keyframes twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.tree-ornaments { position: absolute; inset: 0; }
.tree-node {
  position: absolute; left: var(--tx); top: var(--ty); transform: translate(-50%, -50%);
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--border-foil);
  background: color-mix(in srgb, var(--bg-canvas) 82%, transparent); color: var(--text-on-canvas);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; font-family: var(--font-sans); z-index: 2;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.tree-node::before { content: ""; position: absolute; inset: -6px; }
.tree-node:hover, .tree-node:focus-visible { transform: translate(-50%, -50%) scale(1.16); z-index: 8; border-color: var(--brand-accent); }
.tree-node.is-empty { border-style: dashed; background: rgba(255, 255, 255, 0.08); color: var(--text-on-canvas-muted); }
.tree-node.is-filled {
  background: color-mix(in srgb, var(--brand-primary) 78%, var(--bg-canvas));
  border-color: var(--brand-accent); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.tree-node.is-unlockable {
  background: var(--brand-primary); border-color: #FFFFFF;
  box-shadow: 0 0 0 2px var(--brand-accent), 0 0 14px color-mix(in srgb, var(--brand-accent) 70%, transparent);
  animation: pickring 2.2s ease-in-out infinite;
}
.tree-node.is-opened { background: var(--bg-surface); color: var(--text-primary); border-color: var(--brand-accent); }
@keyframes pickring {
  0%, 100% { box-shadow: 0 0 0 2px var(--brand-accent), 0 0 10px color-mix(in srgb, var(--brand-accent) 45%, transparent); }
  50% { box-shadow: 0 0 0 4px var(--brand-accent), 0 0 18px color-mix(in srgb, var(--brand-accent) 82%, transparent); }
}
.tree-node-icon { font-size: 0.92rem; line-height: 1; }
.tree-node-num {
  position: absolute; bottom: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: var(--radius-full); background: var(--bg-canvas); color: var(--brand-accent);
  border: 1px solid var(--border-foil); font-family: var(--font-mono); font-size: 0.56rem;
  font-weight: 700; line-height: 13px; text-align: center;
}
.tree-node.is-empty .tree-node-num { position: static; border: 0; background: transparent; color: var(--text-on-canvas-muted); font-size: 0.68rem; }
.tree-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 4px 8px; font-size: 0.7rem; font-weight: 700; white-space: nowrap;
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow-door); pointer-events: none;
}
.tree-node:hover .tree-tip, .tree-node:focus-visible .tree-tip { display: block; }
.tree-legend { margin: 10px 0 0; text-align: center; font-size: 0.78rem; color: var(--text-on-canvas-muted); }

.unwrap-stage[hidden] { display: none; }
.unwrap-stage {
  position: fixed; inset: 0; z-index: 135; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--bg-canvas) 78%, rgba(0, 0, 0, 0.72)) 0%, rgba(0, 0, 0, 0.86) 100%);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.unwrap-stage-inner {
  position: relative; width: 100%; max-width: 400px; text-align: center; padding: 28px 20px 24px;
  border-radius: 22px; background: color-mix(in srgb, var(--bg-canvas-elevated) 92%, transparent);
  border: 1.5px solid var(--border-foil); box-shadow: var(--shadow-modal); color: var(--text-on-canvas);
  animation: land 280ms var(--ease-out);
}
@keyframes land { 0% { opacity: 0; transform: translateY(14px) scale(0.95); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.unwrap-close-btn {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border-foil); background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-canvas); font-size: 1rem; cursor: pointer;
}
.unwrap-eyebrow { margin: 0 0 4px; font-size: 0.85rem; font-weight: 600; color: var(--brand-accent); }
.unwrap-title { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.45rem; color: var(--text-on-canvas); }
.unwrap-meta-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; margin-bottom: 14px;
  border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-foil); color: var(--text-on-canvas); font-size: 0.8rem; font-weight: 600;
}
.unwrap-meta-pill[hidden] { display: none; }
.unwrap-gift-btn {
  position: relative; width: 100%; background: transparent; border: 0; padding: 18px 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 18px; cursor: pointer; color: var(--text-on-canvas);
}
.unwrap-glow {
  position: absolute; top: 32%; left: 50%; width: 170px; height: 170px;
  transform: translate(-50%, -50%) scale(0.7); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-accent) 75%, #FFFFFF) 0%, transparent 70%);
  opacity: 0.25; pointer-events: none;
}
.unwrap-box { position: relative; width: 164px; height: 136px; display: block; }
.unwrap-lid {
  position: absolute; top: 0; left: -6px; width: 176px; height: 36px; border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary) 92%, #FFFFFF), var(--brand-primary));
  border: 1.5px solid var(--brand-accent); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); z-index: 3;
}
.unwrap-bow {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 18px; border-radius: 50% 50% 6px 6px;
  border: 4px solid var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 28%, transparent);
}
.unwrap-tag-chip {
  position: absolute; right: 10px; bottom: -11px; padding: 2px 8px; border-radius: 5px;
  background: #FAF5EC; color: #1A241F; font-size: 0.68rem; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unwrap-body {
  position: absolute; top: 32px; left: 0; width: 164px; height: 104px; border-radius: 0 0 12px 12px;
  overflow: hidden; border: 1.5px solid var(--brand-accent); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}
.unwrap-wrap-svg { width: 100%; height: 100%; display: block; }
.unwrap-ribbon-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 18px; transform: translateX(-50%); background: var(--brand-accent); }
.unwrap-ribbon-h { position: absolute; left: 0; right: 0; top: 50%; height: 14px; transform: translateY(-50%); background: color-mix(in srgb, var(--brand-accent) 88%, #FFFFFF); }
.unwrap-day-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%; background: #FAF5EC; color: #1A241F;
  border: 2px solid var(--brand-accent); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.unwrap-cta-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border-radius: var(--radius-full); background: var(--brand-primary); color: #FFFFFF;
  font-weight: 700; font-size: 0.94rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.unwrap-sparks { position: absolute; top: 36%; left: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.unwrap-spark { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: var(--brand-accent); opacity: 0; }
.unwrap-stage.unwrapping .unwrap-bow { animation: bowoff 260ms var(--ease-out) forwards; }
.unwrap-stage.unwrapping .unwrap-tag-chip { animation: tagoff 240ms var(--ease-out) forwards; }
.unwrap-stage.unwrapping .unwrap-lid { animation: lidoff 380ms 140ms var(--ease-out) forwards; }
.unwrap-stage.unwrapping .unwrap-glow { animation: glowup 460ms 180ms var(--ease-out) forwards; }
.unwrap-stage.unwrapping .unwrap-spark { animation: spark 520ms 180ms var(--ease-out) forwards; }
.unwrap-stage.unwrapping .unwrap-cta-pill { opacity: 0.4; }
@keyframes bowoff { to { opacity: 0; transform: translateX(-50%) translateY(-34px) rotate(-18deg) scale(1.2); } }
@keyframes tagoff { to { opacity: 0; transform: translate(26px, -18px) rotate(22deg); } }
@keyframes lidoff { to { opacity: 0; transform: translateY(-56px) rotate(-14deg) scale(1.06); } }
@keyframes glowup {
  0% { opacity: 0.25; transform: translate(-50%, -50%) scale(0.7); }
  65% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.45); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
}
@keyframes spark {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--sx, 40px), var(--sy, -60px)) scale(0.3) rotate(140deg); }
}

.lined-paper {
  position: relative; border-radius: 14px; background-color: #FAF5EC;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 27px, color-mix(in srgb, #1A241F 10%, transparent) 27px, color-mix(in srgb, #1A241F 10%, transparent) 28px);
  background-position: 0 14px; border: 1px solid var(--border-subtle);
  padding: 16px 16px 14px 36px; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.16);
  animation: unfold 260ms var(--ease-out);
}
.lined-paper::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 24px; width: 1.5px;
  background: color-mix(in srgb, #B83B2E 30%, transparent); pointer-events: none;
}
@keyframes unfold { 0% { opacity: 0; transform: translateY(8px) scale(0.98); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.lined-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.lined-salutation { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.lined-note-body { font-family: var(--font-hand); font-size: 1.22rem; line-height: 28px; color: #1A241F; margin: 4px 0 10px; white-space: pre-wrap; word-break: break-word; }
.lined-textarea { width: 100%; min-height: 112px; border: 0; background: transparent; font-family: var(--font-hand); font-size: 1.15rem; line-height: 28px; color: #1A241F; padding: 0; resize: vertical; }
.lined-textarea:focus { outline: none; }
.lined-sig-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border-subtle); }
.lined-sig-label { font-family: var(--font-hand); font-size: 1.05rem; color: var(--text-secondary); white-space: nowrap; }
.lined-sig-input { flex: 1; min-width: 0; border: 0; border-bottom: 1.5px dashed var(--border-strong); background: transparent; font-family: var(--font-hand); font-size: 1.08rem; color: #1A241F; padding: 2px 4px; }
.lined-sig-input:focus { outline: none; border-bottom-color: var(--brand-primary); }
.lined-signature { font-family: var(--font-hand); font-size: 1.08rem; font-weight: 700; color: var(--brand-primary); text-align: right; margin: 4px 0 0; }

.icebreaker-bar[hidden], .rescue-banner[hidden] { display: none; }
.icebreaker-bar {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg-canvas-elevated) 92%, #FFFFFF);
  border: 1px solid var(--border-foil); color: var(--text-on-canvas);
}
.icebreaker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.icebreaker-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin: 0; color: var(--brand-accent); }
.icebreaker-sub { font-size: 0.78rem; color: var(--text-on-canvas-muted); margin: 0; }
.charm-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.charm-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 10px;
  border-radius: var(--radius-full); border: 1px solid var(--border-foil);
  background: rgba(255, 255, 255, 0.06); color: var(--text-on-canvas);
  font-family: var(--font-sans); font-size: 0.76rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.charm-pill:hover { border-color: var(--brand-accent); transform: translateY(-1px); }
.charm-pill[aria-pressed="true"] { background: var(--bg-surface); color: var(--text-primary); border-color: var(--brand-accent); }

.charm-header-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle); margin-bottom: 12px;
}
.charm-header-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.charm-big-icon { font-size: 1.65rem; line-height: 1; flex-shrink: 0; }
.charm-grid-modal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.charm-opt-btn {
  display: flex; align-items: center; gap: 5px; padding: 6px 8px; min-height: 36px; border-radius: 9px;
  border: 1px solid var(--border-subtle); background: #FFFFFF; color: var(--text-primary);
  font-family: var(--font-sans); font-size: 0.74rem; font-weight: 600; cursor: pointer; text-align: left; min-width: 0;
}
.charm-opt-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charm-opt-btn[aria-pressed="true"] { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 10%, #FFFFFF); color: var(--brand-primary); }

.teaser-box { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-surface-muted); border: 1px solid var(--border-subtle); }
.teaser-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.teaser-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.teaser-shuffle-btn { border: 1px solid var(--border-strong); background: #FFFFFF; color: var(--text-primary); border-radius: var(--radius-full); padding: 3px 10px; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.teaser-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.teaser-chip { min-height: 32px; padding: 4px 10px; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: #FFFFFF; color: var(--text-primary); font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.teaser-chip[aria-pressed="true"] { background: var(--brand-primary); border-color: var(--brand-primary); color: #FFFFFF; }

.reciprocal-box {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, #E6BE6C 18%, #FAF5EC);
  border: 1.5px solid color-mix(in srgb, #8A5300 32%, transparent);
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
}
.reciprocal-box input[type="checkbox"] { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand-primary); flex-shrink: 0; cursor: pointer; }
.reciprocal-copy { font-size: 0.84rem; line-height: 1.38; color: var(--text-primary); }
.reciprocal-copy strong { display: block; font-size: 0.86rem; }

.rescue-banner {
  margin-bottom: 12px; padding: 11px 14px; border-radius: 14px;
  background: color-mix(in srgb, #E6BE6C 20%, #FAF5EC); border: 1.5px solid #E6BE6C; color: #1A241F;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 0.88rem; font-weight: 600;
}

.share-hero-emblem {
  width: 78px; height: 68px; margin: 0 auto 10px; border-radius: 10px;
  background: var(--bg-canvas); color: var(--brand-accent); border: 2px solid var(--brand-accent);
  position: relative; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; box-shadow: var(--shadow-door);
}
.share-hero-emblem::after { content: ""; position: absolute; inset: 5px; border-radius: 6px; border: 1.5px dashed color-mix(in srgb, var(--brand-accent) 65%, transparent); }
.share-script-card {
  padding: 12px 14px; border-radius: 12px; background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle); font-size: 0.86rem; line-height: 1.5;
  color: var(--text-primary); margin: 12px 0 14px; text-align: left; word-break: break-word;
}
.share-channels-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.share-ch-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 64px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid var(--border-subtle);
  background: #FFFFFF; color: var(--text-primary); font-family: var(--font-sans);
  font-size: 0.72rem; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform var(--dur-fast), border-color var(--dur-fast);
}
.share-ch-btn:hover { transform: translateY(-1px); border-color: var(--brand-primary); }
.share-ch-icon {
  width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.02rem; color: #FFFFFF; background: var(--brand-primary);
}
.share-ch-btn.ch-wa .share-ch-icon { background: #1E6B47; }
.share-ch-btn.ch-sms .share-ch-icon { background: #1E5689; }
.share-ch-btn.ch-story .share-ch-icon { background: #9E2133; }
.share-ch-btn.ch-copy .share-ch-icon { background: #1A241F; }
.share-ch-btn.ch-tg .share-ch-icon { background: #1E5689; }
.share-owner-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 0.8rem;
}

.m-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 0.84rem; color: var(--text-secondary); }
.m-note-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-full); background: var(--bg-surface-muted); border: 1px solid var(--border-subtle); font-size: 0.76rem; font-weight: 700; color: var(--text-primary); }
.m-link-card { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #FFFFFF; border: 1px solid var(--border-strong); font-size: 0.84rem; font-weight: 600; word-break: break-all; }
.m-thank-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.m-thank-btn { min-height: 36px; padding: 0 11px; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: #FFFFFF; color: var(--text-primary); font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.m-thank-btn[aria-pressed="true"] { background: var(--brand-primary); border-color: var(--brand-primary); color: #FFFFFF; }
.m-ideas-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-surface-muted); border: 1px solid var(--border-subtle); }
.m-ideas-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.m-idea-pick { text-align: left; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-subtle); background: #FFFFFF; color: var(--text-primary); font-family: var(--font-sans); font-size: 0.8rem; cursor: pointer; }
.m-idea-pick:hover { border-color: var(--brand-primary); }

@media (max-width: 760px) {
  .nav-wrap { padding: 0 12px; gap: 8px; }
  .brand { flex-shrink: 1; min-width: 0; gap: 7px; font-size: 0.9rem; }
  .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-actions { gap: 6px; flex-shrink: 0; }
  .mobile-code-link { padding: 0 10px; min-width: 44px; font-size: 0.78rem; flex-shrink: 0; }
  .mobile-menu-btn { flex-shrink: 0; }
}
@media (max-width: 520px) {
  .brand .gf-site-icon { width: 26px; height: 26px; }
  .brand span { font-size: 0.86rem; }
  .my-cals-btn.visible { display: none; }
}
@media (max-width: 640px) {
  .share-channels-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .charm-grid-modal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door-teaser-pill { display: none; }
  .tree-node { width: 30px; height: 30px; }
  .tree-node-icon { font-size: 0.8rem; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .music-btn { width: 36px; height: 36px; }
  .door-gift-peek, .door-teaser-pill, .door-open-pill { display: none; }
  .door.felt-filled .door-num { margin-top: 0; }
  .door-name-tag { font-size: 0.56rem; padding: 0 4px; }
  .tree-canvas { max-width: 310px; }
  .tree-node { width: 26px; height: 26px; }
  .tree-node-icon { font-size: 0.72rem; }
  .icebreaker-bar { padding: 8px 10px; margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .fac-snow, .unwrap-sparks { display: none !important; }
  .tree-bulb, .door-open-pill, .tree-node.is-unlockable, .unwrap-stage-inner, .lined-paper { animation: none !important; }
  .unwrap-stage.unwrapping .unwrap-bow, .unwrap-stage.unwrapping .unwrap-tag-chip, .unwrap-stage.unwrapping .unwrap-lid, .unwrap-stage.unwrapping .unwrap-glow { animation: none !important; transition: opacity 150ms linear; opacity: 0; }
}
@media print {
  .fac-snow, .unwrap-stage, .music-ctrl, .icebreaker-bar, .rescue-banner { display: none !important; }
}