/* ============================================================
   leave.work — Swiss Precision meets Warm Utility
   ============================================================ */

/* Self-hosted fonts */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens --- */
:root {
  /* Palette */
  --c-teal-50:  #f0fdfa;
  --c-teal-100: #ccfbf1;
  --c-teal-200: #99f6e4;
  --c-teal-300: #5eead4;
  --c-teal-400: #2dd4bf;
  --c-teal-500: #14b8a6;
  --c-teal-600: #0d9488;
  --c-teal-700: #0f766e;
  --c-teal-800: #115e59;
  --c-teal-900: #134e4a;

  --c-amber-50:  #fffbeb;
  --c-amber-100: #fef3c7;
  --c-amber-200: #fde68a;
  --c-amber-300: #fcd34d;
  --c-amber-400: #fbbf24;
  --c-amber-500: #f59e0b;
  --c-amber-600: #d97706;
  --c-amber-700: #b45309;
  --c-amber-800: #92400e;

  --c-red-100: #fee2e2;
  --c-red-500: #ef4444;
  --c-red-600: #dc2626;

  --c-blue-50:  #eff6ff;
  --c-blue-100: #dbeafe;
  --c-blue-400: #60a5fa;
  --c-blue-500: #3b82f6;

  --c-gray-25:  #fcfcfd;
  --c-gray-50:  #f9fafb;
  --c-gray-100: #f3f4f6;
  --c-gray-150: #ecedf0;
  --c-gray-200: #e5e7eb;
  --c-gray-300: #d1d5db;
  --c-gray-400: #9ca3af;
  --c-gray-500: #6b7280;
  --c-gray-600: #4b5563;
  --c-gray-700: #374151;
  --c-gray-800: #1f2937;
  --c-gray-900: #111827;

  /* Semantic */
  --color-bg:         #ffffff;
  --color-bg-subtle:  var(--c-gray-50);
  --color-bg-muted:   var(--c-gray-100);
  --color-surface:    #ffffff;
  --color-border:     var(--c-gray-200);
  --color-border-subtle: var(--c-gray-150);
  --color-text:       var(--c-gray-900);
  --color-text-secondary: var(--c-gray-500);
  /* Used for body copy on white — must clear AA 4.5:1. */
  --color-text-muted: var(--c-gray-500);
  /* Decorative-only — strikethroughs, dividers, dim icons. Do NOT use for body text. */
  --color-text-faint: var(--c-gray-400);
  --color-primary:    var(--c-teal-600);
  --color-primary-hover: var(--c-teal-700);
  --color-primary-bg: var(--c-teal-50);
  --color-accent:     var(--c-amber-600);
  --color-accent-bg:  var(--c-amber-50);

  /* Calendar day types */
  --cal-weekend:    var(--c-gray-100);
  --cal-holiday:    var(--c-teal-100);
  --cal-holiday-text: var(--c-teal-800);
  --cal-bridge:     var(--c-amber-100);
  --cal-bridge-text: var(--c-amber-800);
  --cal-vacation:   var(--c-blue-100);
  --cal-vacation-text: var(--c-blue-500);

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'DM Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;
  --s-24: 6rem;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 0 3px var(--c-teal-100);

  /* Layout */
  --max-w: 1200px;
  --header-h: 64px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle dot-grid background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, var(--c-gray-200) 0.75px, transparent 0.75px);
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--color-primary-hover); }

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }

/* Universal keyboard focus ring — opt-out only where a control supplies its own (header-select, selector-select, vacation-date-input). */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.btn:focus-visible,
.btn-add:focus-visible,
.year-nav a:focus-visible,
.nav-link:focus-visible,
.stat-card:focus-visible,
.feature-card:focus-visible,
.date-chip-remove:focus-visible,
.workday-toggle input:focus-visible + span {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.workday-toggle input:focus-visible + span {
  outline-offset: 0;
}

/* Respect users' motion preferences. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-in { animation: none; }
  .stat-card:hover,
  .feature-card:hover,
  .bridge-card:hover,
  .calendar-day:hover,
  .vacation-slider::-webkit-slider-thumb:hover { transform: none; }
}

/* --- Utility --- */
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: var(--s-6); }
.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; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }

/* Shared page toolbar — country selector + year nav row */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

/* Shared card title — body sans, 600 weight, used inside info cards (vacation plan, best-day-off winner, etc.) */
.card-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--s-6);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.logo:hover { opacity: 0.7; color: var(--color-text); }

.logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  position: relative;
  top: 1px;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  list-style: none;
}

.nav-link {
  display: block;
  padding: var(--s-2) var(--s-3);
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--color-text-secondary);
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-text);
  background: var(--color-bg-muted);
}
.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}

.header-select {
  appearance: none;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-1) var(--s-8) var(--s-1) var(--s-3);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 160px;
}
.header-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--s-2);
  color: var(--color-text);
}
.hamburger svg { width: 22px; height: 22px; }

/* Mobile nav — hidden by default, shown on mobile with .open */
.nav-mobile { display: none; }

/* --- Main --- */
main { flex: 1; padding-block: var(--s-10); }

/* --- Page Header --- */
.page-header {
  margin-bottom: var(--s-10);
}

.page-header h1 {
  margin-bottom: var(--s-3);
}

.page-header .subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 640px;
  line-height: 1.55;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--s-4);
}

.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb-sep { user-select: none; }

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-10);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-5) var(--s-6);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent, var(--color-primary));
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover {
  color: inherit;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card:hover::before { opacity: 1; }

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  margin-bottom: var(--s-1);
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stat-card.stat-wasted { --stat-accent: var(--c-red-500); }
.stat-card.stat-wasted .stat-value { color: var(--c-red-600); }
.stat-card.stat-bridge { --stat-accent: var(--c-amber-500); }
.stat-card.stat-bridge .stat-value { color: var(--c-amber-600); }
.stat-card.stat-holidays .stat-value { color: var(--c-teal-600); }

/* Non-link variant — no hover lift, no border-color shift; signals "data only, no destination". */
.stat-card.stat-passive { cursor: default; }
.stat-card.stat-passive:hover {
  border-color: var(--color-border);
  box-shadow: none;
  transform: none;
}
.stat-card.stat-passive:hover::before { opacity: 0; }

/* --- Holiday Table --- */
.holiday-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.holiday-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.holiday-table thead th {
  text-align: left;
  padding: var(--s-3) var(--s-5);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
}

.holiday-table tbody tr {
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background 0.1s;
}
.holiday-table tbody tr:last-child { border-bottom: none; }
.holiday-table tbody tr:hover { background: var(--c-teal-50); }

.holiday-table td {
  padding: var(--s-3) var(--s-5);
  vertical-align: middle;
}

.holiday-date {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 500;
  font-size: 0.875rem;
}

.holiday-day {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.holiday-name-primary {
  font-weight: 500;
}
.holiday-name-english {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-national {
  background: var(--c-teal-100);
  color: var(--c-teal-800);
}
.badge-regional {
  background: var(--c-amber-100);
  color: var(--c-amber-800);
}
.badge-type {
  background: var(--c-gray-100);
  color: var(--c-gray-600);
}

/* Weekend-wasted row */
.holiday-row-wasted {
  background: var(--c-gray-50);
}
.holiday-row-wasted .holiday-date,
.holiday-row-wasted .holiday-name-primary {
  color: var(--color-text-secondary);
  text-decoration: line-through;
  text-decoration-color: var(--c-red-500);
  text-decoration-thickness: 1.5px;
}
.holiday-row-wasted:hover { background: var(--c-gray-100); }

.wasted-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  color: var(--c-red-600);
  font-weight: 600;
  margin-left: var(--s-2);
}

/* --- Bridge Day Cards --- */
.bridge-list {
  display: grid;
  gap: var(--s-5);
}

.bridge-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.bridge-card:hover {
  border-color: var(--c-amber-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.bridge-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.bridge-headline {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.25;
}
.bridge-headline em {
  font-style: italic;
  color: var(--color-primary);
}

.efficiency-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  background: var(--c-amber-50);
  border: 1px solid var(--c-amber-200);
  color: var(--c-amber-700);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-full);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Bridge day mini-timeline */
.bridge-timeline {
  display: flex;
  gap: 2px;
  margin-bottom: var(--s-5);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.bridge-timeline-day {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 0;
  position: relative;
}

.bridge-timeline-day.day-weekend {
  background: var(--c-gray-150);
  color: var(--c-gray-500);
}
.bridge-timeline-day.day-holiday {
  background: var(--c-teal-200);
  color: var(--c-teal-900);
}
.bridge-timeline-day.day-bridge {
  background: var(--c-amber-300);
  color: var(--c-amber-900);
  animation: pulse-amber 2s ease-in-out infinite;
}

@keyframes pulse-amber {
  0%, 100% { background: var(--c-amber-300); }
  50% { background: var(--c-amber-200); }
}

.bridge-card-dates {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--s-4);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.bridge-card-dates strong {
  color: var(--c-amber-700);
  font-weight: 600;
}
.bridge-day-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--s-2);
  background: var(--c-amber-50);
  border: 1px solid var(--c-amber-200);
  color: var(--c-amber-800);
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-subtitle { margin-top: var(--s-1); }

.row-tile {
  padding: var(--s-3) var(--s-4);
  background: var(--color-bg-subtle);
  border-radius: var(--r-md);
  margin-bottom: var(--s-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}
.row-tile-date { font-weight: 500; }
.row-tile-meta { margin-left: var(--s-3); }

.efficiency-badge-sm { font-size: 0.75rem; }

.vacation-empty { text-align: center; padding: var(--s-8); }

.radio-row {
  display: flex;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
  font-size: 0.875rem;
  flex-wrap: wrap;
}
.radio-option {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
}
.selector-label-meta {
  margin-left: var(--s-2);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.bridge-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--color-border-subtle);
}

.bridge-holidays {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
  border-color: var(--c-gray-300);
}

.btn-sm {
  padding: var(--s-1) var(--s-3);
  font-size: 0.75rem;
}

/* --- Calendar Grid --- */
.calendar-grid-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-xs);
}

.calendar-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  text-align: center;
  margin-bottom: var(--s-4);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-dow {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--s-2) 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: transform 0.1s;
  cursor: default;
  position: relative;
}
.calendar-day.day-empty { cursor: default; }
.calendar-day.day-weekend {
  background: var(--cal-weekend);
  color: var(--c-gray-500);
}
.calendar-day.day-holiday {
  background: var(--cal-holiday);
  color: var(--cal-holiday-text);
  font-weight: 700;
}
.calendar-day.day-bridge {
  background: var(--cal-bridge);
  color: var(--cal-bridge-text);
  font-weight: 700;
}
.calendar-day.day-vacation {
  background: var(--cal-vacation);
  color: var(--cal-vacation-text);
  font-weight: 700;
}
.calendar-day.day-today {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.calendar-legend {
  display: flex;
  gap: var(--s-5);
  justify-content: center;
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--color-border-subtle);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --- Country Selector --- */
.country-selector {
  display: flex;
  gap: var(--s-3);
  align-items: end;
  flex-wrap: wrap;
}

.selector-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.selector-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.selector-select {
  appearance: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-10) var(--s-3) var(--s-4);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  min-width: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.selector-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

/* --- Ad Slots --- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-gray-50);
  border: 1px dashed var(--c-gray-200);
  border-radius: var(--r-md);
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  position: relative;
}

.ad-slot-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin-inline: auto;
  margin-block: var(--s-6);
}

.ad-slot-sidebar {
  width: 300px;
  height: 250px;
}

.ad-slot-in-content {
  width: 100%;
  max-width: 336px;
  height: 280px;
  margin-inline: auto;
  margin-block: var(--s-8);
}

/* --- Footer --- */
.site-footer {
  background: var(--c-gray-900);
  color: var(--c-gray-300);
  padding: var(--s-12) 0 var(--s-8);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-10);
  margin-bottom: var(--s-10);
}

.footer-brand .logo {
  color: white;
  margin-bottom: var(--s-3);
}
.footer-brand .logo:hover { color: white; }

.footer-tagline {
  font-size: 0.875rem;
  color: var(--c-gray-400);
  line-height: 1.6;
  max-width: 300px;
}

.footer-heading {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-gray-400);
  margin-bottom: var(--s-4);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.footer-links a {
  color: var(--c-gray-300);
  font-size: 0.875rem;
  transition: color 0.15s;
}
.footer-links a:hover { color: white; }

.footer-bottom {
  padding-top: var(--s-6);
  border-top: 1px solid var(--c-gray-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--c-gray-500);
}
.footer-github {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--c-gray-500);
  text-decoration: none;
}
.footer-github:hover { color: var(--c-gray-300); }

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: var(--s-16) 0 var(--s-12);
  position: relative;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: var(--s-5);
  max-width: 800px;
  margin-inline: auto;
}
.hero h1 em {
  font-style: italic;
  color: var(--color-primary);
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--s-8);
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.hero-cta .selector-select {
  min-width: 260px;
  font-size: 1rem;
  padding: var(--s-4) var(--s-10) var(--s-4) var(--s-5);
}

.section-centered { margin-top: var(--s-16); }
.section-centered > h2 { text-align: center; margin-bottom: var(--s-8); }

.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-3);
}
.popular-grid .stat-card {
  text-align: center;
  padding: var(--s-5);
}
.popular-grid .stat-card > div {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Feature cards on homepage */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-12);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-8) var(--s-6);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover {
  color: inherit;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin-bottom: var(--s-4);
}
.feature-icon svg { display: block; }
.feature-icon-bridge  { background: var(--c-amber-100); color: var(--c-amber-700); }
.feature-icon-day     { background: var(--c-teal-100);  color: var(--c-teal-700); }
.feature-icon-plan    { background: var(--c-teal-50);   color: var(--c-teal-700); border: 1px solid var(--c-teal-200); }

.feature-card h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--s-2);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* --- Year Navigation --- */
.year-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--r-full);
  padding: 2px;
}

.year-nav a, .year-nav span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-1) var(--s-4);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--r-full);
  transition: all 0.15s;
  text-decoration: none;
  color: var(--color-text-secondary);
  min-width: 56px;
}
.year-nav a:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}
.year-nav .year-current {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
}

/* --- Two-column layout with sidebar ad --- */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--s-8);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

/* --- Best Day Off --- */
.day-off-chart {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.day-off-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  align-items: center;
  gap: var(--s-4);
}

.day-off-label {
  font-weight: 500;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.day-off-label-star { color: var(--c-amber-500); fill: var(--c-amber-300); }

.day-off-bar-track {
  height: 32px;
  background: var(--c-gray-100);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.day-off-bar {
  height: 100%;
  border-radius: var(--r-sm);
  background: var(--color-primary);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  padding-left: var(--s-3);
}

.day-off-bar.best {
  background: linear-gradient(135deg, var(--c-teal-500), var(--c-teal-600));
}

.day-off-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: right;
  color: var(--color-text-secondary);
}

.day-off-winner {
  background: var(--color-primary-bg);
  border: 1px solid var(--c-teal-200);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin-bottom: var(--s-8);
}

.day-off-winner-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-teal-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-teal-800);
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* --- Vacation Planner --- */
.vacation-input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-8);
}

.vacation-slider-row {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

.vacation-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--c-gray-200);
  border-radius: var(--r-full);
  outline: none;
}
.vacation-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s;
}
.vacation-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.vacation-count {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
  min-width: 80px;
  text-align: center;
  color: var(--color-primary);
}

.vacation-unit {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.vacation-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-6);
}
.vacation-controls-grid > .vacation-control-group:first-child {
  grid-column: 1 / -1;
}

.vacation-control-group > .selector-label {
  margin-bottom: var(--s-3);
  display: block;
}

.vacation-date-input {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-gray-200);
  border-radius: var(--r-md);
  background: white;
  color: var(--color-text);
  width: 100%;
  max-width: 220px;
  transition: border-color 0.15s;
}
.vacation-date-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.workday-toggles {
  display: flex;
  gap: var(--s-1);
  flex-wrap: wrap;
}
.workday-toggle {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.workday-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.workday-toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  padding: 0 var(--s-2);
  border: 1px solid var(--c-gray-200);
  border-radius: var(--r-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: white;
  transition: all 0.15s;
}
.workday-toggle input:checked + span {
  background: var(--c-teal-50);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}
.workday-toggle:hover span {
  border-color: var(--c-gray-400);
}

/* --- Date chips & add row --- */
.date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-2);
  background: var(--c-teal-50);
  border: 1px solid var(--c-teal-200);
  border-radius: var(--r-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-teal-700);
}
.date-chip-count {
  font-size: 0.6875rem;
  opacity: 0.7;
}
.date-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--c-teal-600);
  cursor: pointer;
  border-radius: 50%;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}
.date-chip-remove:hover {
  background: var(--c-teal-200);
}
.date-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
.date-add-row .vacation-date-input { flex: 1; min-width: 140px; }
.date-add-row-sep { font-size: 0.8125rem; }
.btn-add {
  padding: var(--s-2) var(--s-4);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-add:hover {
  background: var(--c-teal-700);
}

/* --- Toggle row --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: var(--s-4);
}
.toggle-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--c-gray-200);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.toggle-switch:checked {
  background: var(--color-primary);
}
.toggle-switch:checked::after {
  transform: translateX(20px);
}

/* --- Calendars multi-month grid --- */
.calendars-year {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-6);
}

/* --- Bridge Day Summary --- */
.bridge-summary {
  background: linear-gradient(135deg, var(--c-teal-50), var(--c-amber-50));
  border: 1px solid var(--c-teal-200);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-8);
  margin-bottom: var(--s-8);
  display: flex;
  align-items: center;
  gap: var(--s-6);
}

.bridge-summary-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-amber-100);
  color: var(--c-amber-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bridge-summary-text {
  font-size: 1.125rem;
  line-height: 1.5;
}
.bridge-summary-text strong {
  color: var(--color-primary);
}

/* --- Bridge Explainer --- */
.bridge-explainer {
  margin-top: var(--s-10);
  padding: var(--s-8);
  background: var(--c-gray-50);
  border-radius: var(--r-lg);
  border: 1px solid var(--color-border);
}
.bridge-explainer h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: var(--s-4);
}
.bridge-explainer p {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--s-3);
}
.bridge-explainer p:last-child {
  margin-bottom: 0;
}

/* --- Empty / None State --- */
.empty-state {
  text-align: center;
  padding: var(--s-16) var(--s-6);
  color: var(--color-text-secondary);
}
.empty-state-icon {
  margin: 0 auto var(--s-4);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}
.empty-state p {
  font-size: 1.125rem;
}

/* --- Page entrance animations --- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.animate-in:nth-child(2) { animation-delay: 0.06s; }
.animate-in:nth-child(3) { animation-delay: 0.12s; }
.animate-in:nth-child(4) { animation-delay: 0.18s; }

/* --- Mobile responsive --- */
@media (max-width: 1024px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
  }
  .vacation-controls-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }

  .nav-main { display: none; }
  .hamburger { display: block; }

  .nav-mobile {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    padding: var(--s-6);
    z-index: 99;
    flex-direction: column;
    gap: var(--s-2);
    border-top: 1px solid var(--color-border-subtle);
  }
  .nav-mobile.open { display: flex; }
  .nav-mobile .nav-link {
    font-size: 1.125rem;
    padding: var(--s-4);
  }

  .hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
  .hero .subtitle { font-size: 1.0625rem; }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-3);
  }

  /* Table → card layout on mobile */
  .holiday-table-wrap { border-radius: var(--r-md); }
  .holiday-table thead { display: none; }
  .holiday-table,
  .holiday-table tbody {
    display: block;
  }
  .holiday-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date scope"
      "name name"
      "type type";
    column-gap: var(--s-3);
    row-gap: var(--s-1);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--color-border-subtle);
  }
  .holiday-table td {
    display: block;
    padding: 0;
  }
  .holiday-table td:nth-child(1) { grid-area: date; }
  .holiday-table td:nth-child(2) { display: none; }
  .holiday-table td:nth-child(3) { grid-area: name; }
  .holiday-table td:nth-child(4) { grid-area: type; }
  .holiday-table .td-scope { grid-area: scope; justify-self: end; }

  .bridge-card-header { flex-direction: column; }

  .footer-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .footer-bottom { flex-direction: column; gap: var(--s-3); text-align: center; }

  .bridge-timeline-day { font-size: 0; height: 28px; }

  .day-off-row { grid-template-columns: 80px 1fr 60px; }

  .country-selector { flex-direction: column; }
  .selector-select { min-width: 100%; }

  .calendar-legend { flex-wrap: wrap; gap: var(--s-3); }

  .ad-slot-leaderboard { height: 60px; }

  .vacation-controls-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr; }
  .year-nav a, .year-nav span { padding: var(--s-1) var(--s-3); font-size: 0.8125rem; min-width: 44px; }
}

/* Legal pages */
.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--s-8) 0 var(--s-12);
}
.legal-page h1 { margin-bottom: var(--s-6); }
.legal-page h2 { margin-top: var(--s-6); margin-bottom: var(--s-3); font-size: 1.125rem; }
.legal-page p { margin-bottom: var(--s-4); line-height: 1.7; color: var(--c-gray-700); }
.legal-page ul { margin-bottom: var(--s-4); padding-left: var(--s-6); }
.legal-page li { margin-bottom: var(--s-2); line-height: 1.6; color: var(--c-gray-700); }
.legal-page a { color: var(--color-primary); text-decoration: underline; }
