@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --paper: #f6f0e4;
  --paper-2: #faf6ee;
  --ink: #241f1a;
  --muted: #8c8175;
  --rule: #e3d9c6;
  --accent: #c2673b;
  --max: 60rem;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 2rem 1.5rem 5rem; }

header.site { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; text-decoration: none; color: inherit; }
.brand:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.brand .dot { color: var(--accent); }

nav.views { display: flex; flex-wrap: wrap; gap: 0.25rem; }
nav.views a {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); text-decoration: none; padding: 0.4rem 0.7rem; border-radius: 999px;
}
nav.views a[aria-current="page"] { color: var(--ink); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); }

/* Hamburger — only with JS, only on narrow screens. No-JS / desktop = wrapped pill row. */
.nav-toggle {
  display: none; font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer;
  align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; padding: 0;
  color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.5rem;
}
@media (max-width: 47.999rem) {
  header.site { position: sticky; top: 0; z-index: 50; background: var(--paper); transition: transform .2s ease, box-shadow .2s ease; }
  header.site.is-scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
  header.site.is-hidden { transform: translateY(-100%); }
  .js .nav-toggle { display: inline-flex; }
  .js header.site.nav-open .nav-toggle { background: var(--accent); color: var(--paper-2); border-color: var(--accent); }
  .js nav.views {
    display: none; position: absolute; top: 100%; right: 0; z-index: 70;
    flex-direction: column; gap: 0.15rem; min-width: 12rem; margin-top: 0.5rem; padding: 0.4rem;
    background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.6rem; box-shadow: 0 8px 30px rgba(36,31,26,0.14);
  }
  .js header.site.nav-open nav.views { display: flex; }
  .js nav.views a { padding: 0.6rem 0.8rem; }
}

.eyebrow { text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.72rem; color: var(--accent); margin: 0 0 0.5rem; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 6vw, 2.75rem); line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 0.6rem; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.lead { color: var(--muted); max-width: 38rem; }

.controls { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
select, input[type="date"] {
  font: inherit; color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 0.5rem; padding: 0.5rem 0.7rem;
}

.cards { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.75rem; padding: 0.9rem 1rem; }
.card .flag { font-size: 1.4rem; }
.card .name { font-weight: 600; }
.card .sub { color: var(--muted); font-size: 0.85rem; }
.card.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.hol-list { list-style: none; padding: 0; margin: 1rem 0; }
.hol-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.hol-list .when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty, .error { color: var(--muted); font-style: italic; padding: 1.5rem 0; }
.error { color: var(--accent); font-style: normal; }

footer.site { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.8rem; }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) { a, .card { transition: background 0.15s ease, box-shadow 0.15s ease; } }

/* ===== Calendar (home) ===== */
.cal-hero { margin-bottom: 1rem; }
#cal-count { margin-top: 0.75rem; }
.cal-bignum {
  font-family: var(--serif); font-weight: 600; color: var(--accent);
  font-size: clamp(3rem, 9vw, 4.5rem); line-height: 0.95; letter-spacing: -0.03em;
}
.cal-sub { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }
.cal-allgone { color: var(--accent); font-style: italic; font-family: var(--serif); }
.cal-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.cal-chip {
  display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1;
  font: inherit; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.6rem;
  padding: 0.4rem 0.6rem; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.cal-chip b { font-family: var(--serif); font-size: 1.15rem; color: var(--accent); letter-spacing: 0; }
button.cal-chip:hover { border-color: var(--ink); color: var(--ink); }
button.cal-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.cal-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; margin: 1rem 0 0.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); }
.cal-yearwrap { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); display: inline-flex; align-items: center; gap: 0.5rem; }
.cal-yearwrap select { text-transform: none; letter-spacing: normal; }
.cal-flabel { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
.cal-typewrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.cal-mini {
  font: inherit; font-size: 0.72rem; cursor: pointer; color: var(--muted);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px; padding: 0.3rem 0.7rem;
}
.cal-mini:hover { color: var(--ink); }
.cal-types { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cal-type {
  font: inherit; font-size: 0.78rem; cursor: pointer; color: var(--muted);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.7rem;
}
.cal-type .n { color: var(--muted); font-variant-numeric: tabular-nums; opacity: 0.7; margin-left: 0.15rem; }
.cal-type.is-on { color: var(--paper-2); background: var(--accent); border-color: var(--accent); }
.cal-type.is-on .n { color: var(--paper-2); opacity: 0.85; }

/* "i" button that opens the holiday-type glossary tooltip. */
.cal-info {
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 0.78rem; line-height: 1;
  flex: 0 0 auto; width: 1.2rem; height: 1.2rem; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 50%;
}
.cal-info:hover { color: var(--accent); border-color: var(--accent); }
.cal-info:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Tap-to-reveal tooltip, positioned by JS (assets/js/calendar.js). Works without hover. */
.cal-tip {
  position: fixed; z-index: 130; max-width: min(22rem, calc(100vw - 1rem));
  background: var(--ink); color: var(--paper);
  border-radius: 0.55rem; padding: 0.65rem 0.8rem;
  font-size: 0.82rem; line-height: 1.45;
  box-shadow: 0 10px 34px rgba(36,31,26,0.4);
}
.cal-tip strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 0.92rem; margin-bottom: 0.3rem; }
.cal-tip p { margin: 0; color: rgba(246,240,228,0.88); }
.cal-gloss { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.7rem; }
.cal-gloss dt { font-weight: 700; }
.cal-gloss dd { margin: 0; color: rgba(246,240,228,0.82); }

.cal-guided { margin-top: .75rem; }
.cal-guidedlead { color: #6b5d4f; margin: 0 0 .5rem; }
.cal-presets { display: flex; flex-wrap: wrap; gap: .5rem; }
.cal-preset { font: inherit; cursor: pointer; padding: .5rem .8rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper-2); color: inherit; }
.cal-preset:hover { background: rgba(194,103,59,.12); }
.cal-guidedprompt { color: #8a7c6b; text-align: center; padding: 1.5rem 0; }

.cal-places { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem 0.75rem; margin: 0.6rem 0 0; }

.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 1.1rem; padding: 0; margin: 0.75rem 0 1rem; font-size: 0.78rem; color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.sw { width: 0.95rem; height: 0.95rem; border-radius: 0.3rem; display: inline-block; flex: 0 0 auto; }
.sw-work { background: transparent; border: 1px solid var(--rule); }
.sw-off { background: linear-gradient(120deg, rgba(194,103,59,0.32), rgba(194,103,59,0.85)); }
.sw-weekend { background: var(--paper); border: 1px solid var(--rule); opacity: 0.45; }
.sw-today { background: var(--paper-2); box-shadow: inset 0 0 0 1.6px var(--ink); }
.sw-sel { background: var(--paper-2); box-shadow: 0 0 0 1px var(--paper-2), 0 0 0 2.5px var(--accent); }
/* Heat ramp: explains that a darker tile = more places off on that day. */
.cal-legramp { gap: 0.4rem; }
.cal-ramp {
  width: 3rem; height: 0.72rem; border-radius: 0.25rem; display: inline-block; flex: 0 0 auto;
  background: linear-gradient(90deg, rgba(194,103,59,0.22), rgba(194,103,59,0.85));
  border: 1px solid rgba(120,60,30,0.18);
}
.cal-rk { color: var(--muted); }

.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.85rem; }
.cal-month { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.7rem; padding: 0.7rem; }
.cal-mhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.45rem; }
.cal-mhead span:first-child { font-family: var(--serif); font-weight: 600; font-size: 1rem; }
.cal-mwork { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 2px; }
.cal-dow span { text-align: center; font-size: 0.6rem; color: var(--muted); opacity: 0.6; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cd {
  font: inherit; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; border-radius: 0.35rem; border: 1px solid transparent; color: var(--ink);
  font-variant-numeric: tabular-nums; padding: 0; background: transparent; cursor: pointer;
  position: relative;
}
@media (prefers-reduced-motion: no-preference) {
  button.cd { transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease; }
}
/* hover: lift the tile out of the grid with a ring + shadow */
button.cd:hover { transform: scale(1.14); border-color: var(--ink); box-shadow: 0 3px 10px rgba(36,31,26,0.22); z-index: 2; }
/* press: tactile squash */
button.cd:active { transform: scale(0.95); box-shadow: 0 1px 3px rgba(36,31,26,0.25); }
/* keyboard focus */
button.cd:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 2; }
.cd-empty { background: transparent; cursor: default; pointer-events: none; }
/* three distinct states: off = orange fill (via inline heat), work = quiet outline, weekend = ghost */
.cd-off { color: var(--ink); font-weight: 600; border-color: rgba(120,60,30,0.18); }
.cd-work { border-color: var(--rule); color: var(--ink); }
.cd-weekend { color: var(--muted); opacity: 0.4; }
/* today = ink frame inside the cell; selected = accent ring outside it. Different
   colour and placement, so the two never read as the same marker. */
.cd-today { box-shadow: inset 0 0 0 1.6px var(--ink); font-weight: 700; }
.cd.is-sel, .cd-sel { outline: 2.5px solid var(--accent); outline-offset: 2px; z-index: 3; }

.cal-detail {
  --pad-x: 1.5rem;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 32vh; overflow-y: auto;
  background: var(--paper-2); border-top: 1px solid var(--rule); box-shadow: 0 -8px 30px rgba(36,31,26,0.12);
  padding: 0 var(--pad-x) 1.1rem;
  padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
}
/* Header bar sticks to the top of the scroll area so the ✕ is reachable without scrolling up.
   Negative side margins bleed its background to the panel edges; top:0 leaves no gap above. */
.cal-dhead {
  position: sticky; top: 0; z-index: 2;
  margin: 0 calc(-1 * var(--pad-x)) 0.5rem;
  padding: 0.7rem var(--pad-x) 0.55rem;
  background: var(--paper-2); border-bottom: 1px solid var(--rule);
}
.cal-dhead-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: var(--max); margin: 0 auto; }
.cal-dhead b { font-family: var(--serif); font-size: 1rem; }
#cal-close { font: inherit; cursor: pointer; background: var(--paper); border: 1px solid var(--rule); border-radius: 0.4rem; padding: 0.3rem 0.6rem; color: var(--ink); }
.cal-dlist { list-style: none; padding: 0; margin: 0 auto; max-width: var(--max); display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.1rem 1.25rem; }
.cal-drow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 0.4rem; padding: 0.22rem 0; border-bottom: 1px solid var(--rule); font-size: 0.82rem; }
.cal-rowopen { display: flex; align-items: baseline; gap: 0.4rem; min-width: 0; font: inherit; text-align: left; background: transparent; border: 0; padding: 0.15rem 0; color: inherit; cursor: pointer; }
.cal-rowopen .flag { font-size: 1rem; }
.cal-rowopen:hover .nm,
.cal-rowopen:focus-visible .nm { color: var(--accent); }
.cal-rowopen:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 0.2rem; }
/* flex-wrap lets a long country or holiday name drop to its own line instead of forcing
   the row past its grid column and overlapping the type badge (min-width:0 alone isn't
   enough: nowrap text still refuses to shrink below its full content width). */
.cal-rowmain { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.4rem; row-gap: 0.05rem; min-width: 0; }
.cal-rowmain .nm { font-weight: 600; min-width: 0; overflow-wrap: break-word; }
.cal-rowmain .hn { color: var(--muted); font-size: 0.78rem; min-width: 0; overflow-wrap: break-word; }
.cal-rowmain .nm sup { color: var(--accent); font-weight: 700; }
.cal-drow .ty {
  color: var(--accent); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
  font-family: inherit; background: transparent; border: 0; padding: 0; cursor: help;
  border-bottom: 1px dotted rgba(194,103,59,0.45);
}
button.ty:hover { color: var(--ink); border-bottom-color: var(--ink); }
button.ty:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 0.15rem; }
.cal-more { color: var(--muted); font-style: italic; padding: 0.5rem 0; }
.cal-foot { grid-column: 1 / -1; color: var(--muted); font-style: italic; font-size: 0.75rem; padding-top: 0.6rem; list-style: none; }
.cal-caret-btn { font: inherit; background: transparent; border: 0; padding: 0 0.15rem; cursor: pointer; line-height: 1; }
.cal-caret-btn:hover .cal-caret,
.cal-caret-btn:focus-visible .cal-caret { color: var(--accent); }
.cal-caret { color: var(--muted); font-size: 0.7rem; }
.cal-states { grid-column: 1 / -1; color: var(--muted); font-size: 0.76rem; line-height: 1.35; padding: 0.05rem 0 0.35rem 1.4rem; }

/* ---- Compare facts panel (compare mode only) ---- */
.cal-facts {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.7rem;
  padding: 0.95rem 1.15rem; margin: 1rem 0 0.85rem;
}
.cal-fvs { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin: 0 0 0.45rem; }
.cal-fvs b { color: var(--accent); font-size: 1.5rem; letter-spacing: -0.02em; }
.cal-frows { list-style: none; margin: 0; padding: 0; }
.cal-frow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.45rem; padding: 0.18rem 0; font-size: 0.88rem; }
.cal-frow .flag { font-size: 1rem; }
.cal-fname { font-weight: 600; }
.cal-fdays { color: var(--muted); }
.cal-fdays b { font-family: var(--serif); color: var(--accent); font-size: 1.05rem; }
.cal-fsplit { color: var(--muted); font-size: 0.78rem; }
.cal-flead, .cal-fnone, .cal-fnote { margin: 0.75rem 0 0; padding-top: 0.65rem; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.cal-flead b { font-family: var(--serif); color: var(--accent); font-size: 1.2rem; }
.cal-fnone, .cal-fnote { color: var(--muted); }
.cal-fnone b { color: var(--ink); font-family: var(--serif); }
.cal-fshared-list {
  list-style: none; margin: 0.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.35rem 0.6rem;
}
/* Echoes the "all your places off" cell: accent fill + dark ring. Click = select the day. */
.cal-fshared {
  font: inherit; font-size: 0.82rem; cursor: pointer; text-align: left; width: 100%; color: inherit;
  display: flex; flex-direction: column; gap: 0.06rem;
  background: rgba(194,103,59,0.1); border: 1px solid rgba(120,60,30,0.22); border-radius: 0.5rem;
  padding: 0.42rem 0.6rem;
}
.cal-fshared b { font-family: var(--serif); }
.cal-fshared:hover { border-color: var(--accent); background: rgba(194,103,59,0.16); }
.cal-fshared:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cal-fnames { color: var(--muted); font-size: 0.76rem; line-height: 1.4; }

/* ---- Year heatmap ---- */
.cal-heatmap { margin: 0.25rem 0 1.25rem; }
.hm-caption { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.hm-caption b { font-family: var(--serif); color: var(--accent); font-size: 1.1rem; }
.hm-months { display: grid; gap: 2px; margin-bottom: 3px; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.hm-mlabel { overflow: hidden; white-space: nowrap; }
.hm-grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 2px; }
.hm-cell { aspect-ratio: 1; min-width: 0; border-radius: 2px; border: 1px solid transparent; padding: 0; background: transparent; cursor: pointer; }
.hm-empty { visibility: hidden; cursor: default; }
.hm-off { border-color: rgba(120,60,30,0.10); }
.hm-work { background: transparent; border: 1.5px solid var(--accent); }   /* days you'd work — light up */
.hm-weekend { background: var(--paper-2); border: 1px solid var(--rule); opacity: 0.5; }
.hm-today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.hm-cell.is-sel { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 2; }
/* On the calendar page, selected = accent (today stays ink). The country popup keeps the
   ink ring above, where off-cells are solid accent and ink reads better. */
#cal-heatmap .hm-cell.is-sel { outline: 2.5px solid var(--accent); outline-offset: 1.5px; z-index: 3; }
button.hm-cell:hover { border-color: var(--ink); }
button.hm-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 2; }

/* ---- Mobile filter collapse ---- */
.cal-filter-toggle { display: none; }   /* desktop / no-JS: panel is always shown */
@media (max-width: 47.999rem) {
  .js .cal-filter-toggle {
    display: inline-flex; align-items: baseline; gap: 0.4rem; cursor: pointer;
    font: inherit; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--muted); background: var(--paper-2); border: 1px solid var(--rule);
    border-radius: 999px; padding: 0.5rem 1rem; margin: 0.5rem 0;
  }
  .js .cal-filter-toggle .cal-filter-sum { text-transform: none; letter-spacing: 0; color: var(--ink); }
  .js .cal-filter-panel { display: none; }
  .js .cal-filter-panel.is-open { display: block; }
}

.sw-alloff { background: rgba(194,103,59,.95); box-shadow: 0 0 0 2px #2f2a24 inset; }
.cd-alloff { outline: 2px solid #2f2a24; outline-offset: -2px; }
.hm-alloff { outline: 1.5px solid #2f2a24; outline-offset: -1.5px; }

@media (max-width: 32rem) {
  .wrap { padding: 1.5rem 1.1rem 4rem; }
  .lead { font-size: 0.95rem; }
  .cal-hero { margin-bottom: 0.75rem; }
  #cal-count { margin-top: 0.5rem; }
  /* Density pass: calm the above-the-fold count + filters on a phone. */
  .cal-bignum { font-size: clamp(2.6rem, 13vw, 3.5rem); }
  .cal-controls { gap: 0.5rem 0.9rem; }
  .cal-chips { gap: 0.3rem; }
  .cal-chip { padding: 0.35rem 0.5rem; }
  .cal-grid { gap: 0.6rem; }
  .cal-detail { --pad-x: 1.1rem; max-height: 45vh; }
}

/* --- Country popup (country.js) --- */
@keyframes cm-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
body.cm-open { overflow: hidden; }
.country-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(36, 31, 26, 0.42); padding: 1.5rem;
}
.country-overlay[hidden] { display: none; } /* beats the flex display above */
.cm-card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(36, 31, 26, 0.3); width: 100%; max-width: 30rem;
  max-height: 85vh; overflow-y: auto; padding: 1.1rem 1.2rem 1.3rem;
}
.cm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.cm-title { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.cm-title b { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.cm-flag { font-size: 1.5rem; }
.cm-close { font: inherit; cursor: pointer; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.4rem; padding: 0.25rem 0.55rem; color: var(--ink); line-height: 1; }
.cm-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 0.2rem; }
.cm-count { color: var(--muted); font-size: 0.85rem; }
.cm-yearwrap { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
.cm-yearwrap select { padding: 0.3rem 0.5rem; }
.cm-trig { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.cm-loading { color: var(--muted); font-style: italic; padding: 1.5rem 0; }

/* Compact year heatmap — reuses the calendar page's .hm-* layout, recoloured for a
   single country: accent = public day off, plain square = working day, muted = weekend. */
.cm-heat { margin: 0.9rem 0 0.4rem; }
.cm-heat .hm-months { font-size: 0.55rem; }
.cm-heat .hm-cell { cursor: default; background: var(--paper-2); border: 1px solid var(--rule); }
.cm-heat .hm-off { background: rgba(194, 103, 59, 0.72); border-color: rgba(194, 103, 59, 0.72); }
.cm-heat-legend { display: flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--muted); font-size: 0.72rem; }
.cm-heat-sw { width: 0.7rem; height: 0.7rem; border-radius: 2px; background: rgba(194, 103, 59, 0.72); display: inline-block; }

.cm-list { list-style: none; padding: 0; margin: 0; max-height: 12rem; overflow-y: auto; border-top: 1px solid var(--rule); }
.cm-row { display: flex; gap: 0.8rem; padding: 0.4rem 0.2rem; border-bottom: 1px solid var(--rule); font-size: 0.85rem; }
.cm-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 3.2rem; }
.cm-hname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-row.is-trig { background: rgba(194, 103, 59, 0.12); }
.cm-row.is-trig .cm-when { color: var(--accent); font-weight: 700; }
.cm-empty { color: var(--muted); font-style: italic; padding: 1rem 0.2rem; }

.cm-foot { padding-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.cm-cta { display: inline-block; font: inherit; text-decoration: none; background: var(--accent); color: var(--paper); border-radius: 0.5rem; padding: 0.5rem 0.9rem; font-size: 0.9rem; }
.cm-cta:hover { filter: brightness(1.06); }
.cm-compare { display: inline-block; font: inherit; text-decoration: none; background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); border-radius: 0.5rem; padding: 0.5rem 0.9rem; font-size: 0.9rem; cursor: pointer; }
.cm-compare:hover { border-color: var(--accent); color: var(--accent); }
.cm-compare:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 47.999rem) {
  .country-overlay { align-items: flex-end; }            /* dock the sheet to the bottom */
  .cm-card { width: 100%; max-width: none; max-height: 88vh; border-radius: 16px 16px 0 0; overflow-y: auto; animation: cm-slide-up .18s ease-out; }
}
@media (max-width: 30rem) {
  .country-overlay { padding: 0; align-items: flex-end; }
  .cm-card { max-width: none; max-height: 92vh; border-radius: 1rem 1rem 0 0; }
}

.cards li { list-style: none; }
.card-btn { width: 100%; display: block; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.card-btn:hover { border-color: var(--accent); }
.card-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ov-flag { font: inherit; background: transparent; border: 1px solid transparent; border-radius: 0.3rem; padding: 0.05rem 0.14rem; cursor: pointer; line-height: 1.5; }
.ov-flag:hover { border-color: var(--accent); background: var(--paper-2); }
.ov-flag:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---- Places picker ---- */
.pp-combo { position: relative; display: inline-block; }
.pp-field { position: relative; display: flex; align-items: center; }
.pp-ico { position: absolute; left: 0.6rem; width: 1.05rem; height: 1.05rem; color: var(--muted); pointer-events: none; }
.pp-input { font: inherit; background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); border-radius: 0.6rem; padding: 0.5rem 0.7rem 0.5rem 2.1rem; min-width: 18rem; width: 100%; }
.pp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194, 103, 59, 0.18); }
.pp-input::placeholder { color: var(--muted); }

.pp-listbox {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0;
  width: 24rem; max-width: 100%; max-height: min(60vh, 22rem); overflow-y: auto;
  box-sizing: border-box;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.7rem;
  box-shadow: 0 10px 30px rgba(36, 31, 26, 0.16); padding: 0.3rem;
}

.pp-opt { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.55rem; border-radius: 0.45rem; cursor: pointer; }
.pp-opt:hover { background: var(--paper); }
.pp-opt.is-active { background: rgba(194, 103, 59, 0.12); }
.pp-opt.is-active .pp-name { color: var(--accent); }
.pp-flag { flex: 0 0 1.4rem; text-align: center; }
.pp-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; flex: 1 1 auto; }
.pp-name { color: var(--ink); }
.pp-region .pp-name { font-size: 0.9rem; }
.pp-meta { color: var(--muted); font-size: 0.72rem; }
.pp-regmeta { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.pp-tag { font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; padding: 0 .35em; border-radius: 4px; background: rgba(0,0,0,.06); color: #6b5d4f; margin-left: .35em; vertical-align: middle; }
.pp-opt.pp-region { padding-left: 1.6rem; } /* visually subordinate to its country */
.pp-chip-region .pp-tag { margin-left: .25em; }
.pp-caret { color: var(--muted); width: 1rem; text-align: center; }

.pp-group { margin: 0.1rem 0 0.3rem 1rem; padding-left: 0.7rem; border-left: 1px solid var(--rule); }
.pp-sub { display: flex; align-items: center; gap: 0.55rem; padding: 0.38rem 0.5rem; border-radius: 0.4rem; cursor: pointer; }
.pp-sub:hover { background: var(--paper); }
.pp-sub.is-active { background: rgba(194, 103, 59, 0.12); }
.pp-subname { color: var(--ink); font-size: 0.9rem; }
.pp-whole .pp-subname { font-weight: 600; }

.pp-check { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; border: 1px solid var(--rule); border-radius: 0.3rem; background: var(--paper-2); display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; line-height: 1; color: transparent; }
.pp-check.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pp-country .pp-check, .pp-region .pp-check { margin-left: auto; }

.pp-none { padding: 0.55rem; color: var(--muted); font-style: italic; font-size: 0.9rem; }

.pp-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.pp-chip { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--accent); color: var(--paper-2); border-radius: 999px; padding: 0.3rem 0.4rem 0.3rem 0.7rem; font-size: 0.8rem; }
.pp-chiprm { font: inherit; cursor: pointer; background: rgba(255, 255, 255, 0.25); color: var(--paper-2); border: 0; border-radius: 999px; width: 1.15rem; height: 1.15rem; line-height: 1; padding: 0; }
.pp-chiprm:hover { background: rgba(255, 255, 255, 0.5); }
.pp-clear { margin-top: 0.5rem; }

/* Visually-hidden live region for screen readers. */
.pp-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 30rem) {
  /* Drop the picker onto its own full-width row below the "Places" label so the
     absolutely-positioned dropdown anchors to the container's left edge and its
     90vw width can't overflow the viewport. */
  #cal-places-mount { flex-basis: 100%; }
  .pp-combo { display: block; }
  .pp-input { min-width: 0; }
}

/* Mobile-only floating "back to top" button. Sits below the country-modal overlay (z-index 100). */
.to-top { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper-2); color: inherit; font-size: 1.1rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.to-top { display: none; }
.to-top.is-visible { display: flex; align-items: center; justify-content: center; }
@media (min-width: 48rem) { .to-top, .to-top.is-visible { display: none; } } /* desktop: never */

/* Cookie-consent banner (assets/js/consent.js). Shown only to EEA/UK/CH visitors. */
.consent {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 120;
  max-width: 34rem; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 0.75rem;
  padding: 0.9rem 1.1rem; box-shadow: 0 8px 30px rgba(36,31,26,0.18);
}
.consent-text { margin: 0; flex: 1 1 16rem; font-size: 0.92rem; line-height: 1.45; color: var(--ink); }
.consent-text a { color: var(--accent); }
.consent-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }
.consent-btn {
  font: inherit; font-size: 0.9rem; cursor: pointer; padding: 0.45rem 1rem;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--paper);
  color: var(--ink);
}
.consent-btn:hover { border-color: var(--ink); }
.consent-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.consent-accept { background: var(--accent); border-color: var(--accent); color: var(--paper-2); }
.consent-accept:hover { border-color: var(--accent); filter: brightness(0.95); }
