/* CleoChristmas - "North Pole Post Office".
   The site is the sorting room on Christmas Eve: night post-office blue, perforated stamp paper printed
   in at most two inks, postmarks for every time and count, one airmail band as the structural border.
   Self-hosted type (Bodoni Moda, Barlow Condensed, Atkinson Hyperlegible) and icons (Lucide). */

@font-face { font-family: "Bodoni Moda"; src: url("fonts/bodoni-moda-400-900-normal.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url("fonts/bodoni-moda-400-900-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* the sorting room at night */
  --bg: #0b1732;
  --bg-raise: #0e1c3c;
  --surface: #12244a;
  --surface-2: #172b56;
  --surface-3: #1e3564;
  --line: #22396a;
  --line-2: #2f4a80;
  --text: #f2f5fc;
  --text-2: #cfd8ec;
  --muted: #a0aecc;
  --dim: #8191b6;
  /* stamp inks - every stamp uses at most two, plus paper */
  --vermilion: #e4472d;
  --vermilion-2: #c8361e;
  --pine: #2f8b60;
  --pine-ink: #17633f;
  --gold: #e9b84a;
  --ice: #9ccaec;
  --paper: #f6f8fc;
  --paper-2: #e8edf6;
  --paper-ink: #13213f;
  --paper-muted: #4a5878;
  --air-red: #d8352b;
  --air-blue: #2552b2;
  /* aliases kept for older components */
  --berry: var(--vermilion);
  --berry-2: var(--vermilion-2);
  --berry-soft: rgba(228, 71, 45, .14);
  --gold-soft: rgba(233, 184, 74, .13);
  --pine-soft: rgba(47, 139, 96, .16);
  --danger: #f0624c;
  --r: 6px;
  --r-sm: 4px;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--display);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  /* perforation */
  --perf: 12px;
  --hole: 3.6px;
  --airmail: repeating-linear-gradient(-45deg, var(--air-red) 0 12px, var(--paper) 12px 18px, var(--air-blue) 18px 30px, var(--paper) 30px 36px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--line-2) var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  font: 400 16px/1.6 var(--sans); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: .5; }
::selection { background: var(--gold); color: var(--paper-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--bg); border-radius: 99px; }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: color .15s, text-decoration-color .15s; }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-color: var(--gold); } }
h1, h2, h3, h4 { margin: 0 0 .45em; color: var(--text); text-wrap: balance; }
h1 { font: 700 clamp(2.1rem, 4vw, 3rem)/1.04 var(--display); letter-spacing: -.015em; font-optical-sizing: auto; }
h2 { font: 600 clamp(1.35rem, 2.2vw, 1.6rem)/1.15 var(--display); letter-spacing: -.01em; font-optical-sizing: auto; }
h3 { font: 700 1.02rem/1.3 var(--sans); }
h4 { font: 700 .92rem/1.3 var(--sans); }
p { margin: 0 0 .9em; text-wrap: pretty; }
em { font-style: italic; }
code, .mono { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); padding: .06em .38em; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
blockquote { margin: .6rem 0; padding: .8rem 1rem; background: var(--surface-2); border-radius: var(--r-sm); white-space: pre-wrap; }
img { max-width: 100%; }

.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: .88rem; } .tiny { font-size: .78rem; }
.right { text-align: right; } .center { text-align: center; } .accent { color: var(--gold); } .ok { color: #7fd0a4; }
.inline { display: inline; } .nowrap { white-space: nowrap; } .grow { flex: 1; min-width: 0; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.num { font-variant-numeric: tabular-nums; }
.m0 { margin: 0; } .mt-1 { margin-top: .8rem; } .mt-2 { margin-top: 1.6rem; } .my-3 { margin: 1.6rem 0; }
/* the postal label voice: tracked condensed caps for stamps, postmarks, tags and table heads */
.label, .kicker, .eyebrow { font: 600 .82rem/1 var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Bodoni's display cut has hairlines too thin for small numerals; face values use a text optical size */
.door-number, .stamp-value, .rank, .stat-value, .pay-price, .hud-count, .figure b { font-variation-settings: "opsz" 6; }

/* icons */
.i { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; stroke-width: 1.75; }
.i.sm { width: 15px; height: 15px; } .i.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: 1.4rem;
  padding: 0 clamp(1rem, 3vw, 2rem) 5px; background: var(--bg);
}
/* the one structural border: the airmail band */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--airmail); }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img, .brand .logo { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--gold); }
.brand .logo { display: grid; place-items: center; background: var(--vermilion); }
.brand .name { font: 700 1.2rem var(--display); letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: .1rem; }
.nav a { white-space: nowrap; color: var(--text-2); padding: .5rem .7rem; font: 600 1rem/1 var(--label); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; border-radius: 3px;
  transition: color .15s, background-color .15s; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--text); background: var(--surface); } }
.nav a.active { color: var(--paper-ink); background: var(--paper); }
.nav a.gold { color: var(--gold); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: .55rem; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .22rem .65rem .22rem .22rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text);
  font-weight: 700; font-size: .9rem; background: var(--surface); transition: border-color .15s; }
@media (hover: hover) and (pointer: fine) { .user-chip:hover { border-color: var(--muted); } }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; margin: 0; }
.menu > summary::-webkit-details-marker { display: none; }
.menu:not([open]) > .menu-pop { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; padding: .4rem; border-radius: var(--r); background: var(--paper); color: var(--paper-ink);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .7); display: flex; flex-direction: column; transform-origin: top right; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.menu-pop .head { display: flex; gap: .65rem; align-items: center; padding: .6rem .65rem .75rem; border-bottom: 1px dashed var(--paper-2); margin-bottom: .3rem; }
.menu-pop .head b { display: block; font-size: .95rem; } .menu-pop .head span { font-size: .8rem; color: var(--paper-muted); }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: .6rem; text-align: left; color: var(--paper-ink); padding: .55rem .65rem; border-radius: 3px;
  font: 400 .93rem var(--sans); background: none; border: 0; cursor: pointer; width: 100%; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .menu-pop a:hover, .menu-pop button:hover { background: var(--paper-2); } }
.menu-pop .sep { height: 1px; background: var(--paper-2); margin: .3rem 0; }
.burger { display: none; color: var(--text); cursor: pointer; }
#nav-toggle { display: none; }

/* ----------------------------------------------------------------- avatars */
.av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-3); display: inline-grid; place-items: center;
  font: 700 .82rem var(--sans); color: var(--text); }
.av.xs { width: 20px; height: 20px; font-size: .62rem; } .av.sm { width: 26px; height: 26px; font-size: .7rem; }
.av.lg { width: 48px; height: 48px; font-size: 1.05rem; } .av.xl { width: 84px; height: 84px; font-size: 1.8rem; }
.av.square { border-radius: 6px; } .av.lg.square { border-radius: 8px; }
.av.ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--gold); }
.av-fallback { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); }
.who { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; text-decoration: none; }
.who .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-av { display: flex; } .stack-av .av { box-shadow: 0 0 0 2px var(--surface); margin-left: -8px; } .stack-av .av:first-child { margin-left: 0; }

/* -------------------------------------------------------------------- shell */
.page { position: relative; z-index: 1; width: min(1160px, 100% - 2.5rem); margin: 2.6rem auto 5rem; flex: 1; }
.app { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); }
.side { position: sticky; top: 64px; height: calc(100vh - 64px); height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem .85rem 1rem; border-right: 1px solid var(--line); background: var(--bg-raise);
  display: flex; flex-direction: column; }
.side-head { display: flex; align-items: center; gap: .75rem; padding: .2rem .5rem 1.1rem; margin-bottom: .4rem; border-bottom: 1px dashed var(--line-2); }
.side-head .t { font: 700 1.05rem/1.2 var(--display); }
.side-head .s { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.side-group { margin: 1.2rem .65rem .45rem; font: 600 .78rem var(--label); text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.side a { display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 3px; color: var(--text-2); font-size: .93rem; text-decoration: none;
  transition: background-color .15s, color .15s; }
@media (hover: hover) and (pointer: fine) { .side a:hover { color: var(--text); background: var(--surface); } }
.side a.active { color: var(--paper-ink); background: var(--paper); }
.side a.active .i { color: var(--vermilion); }
.side a .count { margin-left: auto; font: 700 .72rem var(--sans); background: var(--vermilion); color: #fff; padding: .05rem .45rem; border-radius: 999px; }
.side-foot { margin-top: auto; padding-top: 1rem; }
.side .switcher { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--r); border: 1px solid var(--line); color: var(--text-2); font-size: .88rem; }
.main { padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1.2rem, 3.5vw, 3rem); min-width: 0; max-width: 1180px; }
.main-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; justify-content: space-between; margin-bottom: 1.8rem; }
.main-head h1 { margin: 0; }
.main-head .sub { color: var(--muted); margin-top: .4rem; max-width: 64ch; }
.crumbs { display: flex; gap: .4rem; align-items: center; color: var(--dim); font-size: .85rem; margin-bottom: .5rem; }
.crumbs a { color: var(--muted); text-decoration: none; } @media (hover: hover) and (pointer: fine) { .crumbs a:hover { color: var(--text); } }
.footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.7rem clamp(1rem, 3vw, 2rem); color: var(--muted); font-size: .88rem; border-top: 1px dashed var(--line-2); }
.footer a { color: var(--text-2); text-decoration: none; } @media (hover: hover) and (pointer: fine) { .footer a:hover { color: var(--text); } }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.footer img { width: 24px; height: 24px; border-radius: 50%; }
body.in-app .footer { display: none; }
.snow-toggle { display: inline-flex; align-items: center; gap: .45rem; background: none; border: 1px solid var(--line-2); color: var(--text-2); border-radius: 999px;
  padding: .3rem .75rem; font: 600 .86rem var(--label); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: border-color .15s, color .15s; }
@media (hover: hover) and (pointer: fine) { .snow-toggle:hover { color: var(--text); border-color: var(--muted); } }
.snow-toggle[aria-pressed="false"] { color: var(--dim); }
.snow-toggle[aria-pressed="false"] .i { opacity: .5; }
body:not(.has-snow) .snow-toggle { display: none; }

/* ------------------------------------------------------- stamps & postmarks */
/* perforated stamp paper: semicircle holes along every edge, cut with a mask.
   A mask also clips shadows, so depth comes from a .stamp-lift wrapper (drop-shadow on the wrapper). */
.stamp, .seal {
  --perf-mask: radial-gradient(circle, #0000 var(--hole), #000 calc(var(--hole) + .6px)) calc(var(--perf) / -2) calc(var(--perf) / -2) / var(--perf) var(--perf) round,
    linear-gradient(#000 0 0) center / calc(100% - var(--perf)) calc(100% - var(--perf)) no-repeat;
  -webkit-mask: var(--perf-mask); mask: var(--perf-mask);
  position: relative; background: var(--paper); color: var(--paper-ink);
}
.stamp { padding: calc(var(--perf) * .5 + .5rem); }
.stamp a { color: inherit; text-decoration-color: currentColor; }
.stamp-lift { position: relative; z-index: 0; height: 100%; filter: drop-shadow(0 10px 12px rgba(3, 9, 24, .38)); transition: transform .22s var(--ease); }
/* the printed area inside the white margin - its frame is the stamp's ink */
.stamp-face { position: relative; height: 100%; border: 2px solid var(--ink, var(--vermilion-2)); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.stamp-value { font: 800 2.4rem/1 var(--display); color: var(--ink, var(--vermilion-2)); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.stamp-value small { display: block; font: 700 .58rem/1 var(--label); letter-spacing: .16em; text-transform: uppercase; margin-top: .15rem; }
.stamp-name { font: 700 .9rem/1.1 var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--paper-ink); }
/* inks: a stamp is printed in its ink plus paper ink, never more */
.ink-red { --ink: var(--vermilion-2); } .ink-pine { --ink: var(--pine-ink); } .ink-gold { --ink: #9a6c0c; } .ink-ice { --ink: var(--air-blue); }
.stamp.blank .stamp-face { border-style: dashed; border-color: #b9c3d8; }
.stamp.blank .stamp-value { color: #b9c3d8; }

/* a postmark: double ring, tracked caps, optional wavy cancellation lines running off to the right */
.postmark {
  --pm: var(--text-2); --pm-text: var(--text); position: relative; display: inline-grid; place-content: center; justify-items: center; align-content: center; gap: .15rem;
  width: 6.8rem; aspect-ratio: 1; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--pm); color: var(--pm); text-align: center; line-height: 1.05;
  transform: rotate(var(--tilt, -8deg));
}
.postmark::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--pm); border-radius: 50%; opacity: .75; pointer-events: none; }
.postmark b { display: block; font: 700 1.6rem/1 var(--label); letter-spacing: .01em; font-variant-numeric: tabular-nums; color: var(--pm-text); }
.postmark span { display: block; font: 600 .64rem/1.15 var(--label); letter-spacing: .14em; text-transform: uppercase; max-width: 5.2rem; }
.postmark.sm { width: 4.6rem; } .postmark.sm::before { inset: 4px; } .postmark.sm b { font-size: 1.3rem; } .postmark.sm span { font-size: .56rem; }
.postmark.xs { width: 3.9rem; } .postmark.xs::before { inset: 3px; } .postmark.xs b { font-size: 1rem; } .postmark.xs span { font-size: .5rem; }
.postmark.waves::after, .cancel::after {
  content: ""; position: absolute; pointer-events: none; background: var(--pm, var(--paper-ink));
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='30' viewBox='0 0 96 30' fill='none' stroke='black' stroke-width='2'><path d='M0 4c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 15c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 26c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0'/></svg>") left center / auto 100% repeat-x;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='30' viewBox='0 0 96 30' fill='none' stroke='black' stroke-width='2'><path d='M0 4c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 15c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 26c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0'/></svg>") left center / auto 100% repeat-x;
}
.postmark.waves::after { left: 92%; top: 32%; width: 7.5rem; height: 36%; }

/* registered-mail label: the primary action */
.reg {
  display: inline-flex; align-items: stretch; text-decoration: none; border: 2px solid var(--vermilion-2); border-radius: 3px; background: var(--paper); color: var(--vermilion-2);
  box-shadow: 0 12px 22px -14px rgba(3, 9, 24, .7); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.reg > b { display: grid; place-items: center; min-width: 3.1rem; background: var(--vermilion-2); color: #fff; font: 700 1.8rem/1 var(--display); padding-bottom: .1rem; }
.reg > span { display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: .78rem 1.15rem .7rem; font: 700 1.12rem/1 var(--label); letter-spacing: .1em; text-transform: uppercase; }
.reg small { font: 600 .7rem/1 var(--label); letter-spacing: .16em; color: var(--paper-muted); }
@media (hover: hover) and (pointer: fine) { .reg:hover { box-shadow: 0 18px 28px -14px rgba(3, 9, 24, .75); } }
.reg:active { transform: scale(.97); }
.reg:focus-visible { outline-offset: 4px; }

/* -------------------------------------------------------------------- cards */
/* working panels (dashboard, settings): sorting-room cabinets, square and quiet */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.1rem, 2vw, 1.5rem); margin-bottom: 1.1rem; }
.card.flat { background: transparent; }
a.card { display: block; color: var(--text); text-decoration: none; transition: border-color .18s var(--ease), transform .18s var(--ease), background-color .18s; }
@media (hover: hover) and (pointer: fine) { a.card:hover { border-color: var(--line-2); background: var(--surface-2); } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card .desc { color: var(--muted); font-size: .93rem; margin: -.3rem 0 1.1rem; }
.card-title { display: flex; align-items: center; gap: .55rem; }
.card-title .i { color: var(--gold); }
.danger-zone { border-color: rgba(240, 98, 76, .35); }
.danger-zone .card-title .i { color: var(--danger); }
.grid { display: grid; gap: 1.1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.align-center { align-items: center; }
.narrow { max-width: 760px; margin-inline: auto; }
.prose { font-size: 1rem; max-width: 72ch; } .prose h1 { margin-bottom: .2em; } .prose h2 { margin-top: 2rem; } .prose li { margin-bottom: .4rem; color: var(--text-2); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; white-space: nowrap; text-decoration: none;
  padding: .68rem 1.1rem .62rem; border-radius: var(--r-sm); border: 2px solid var(--vermilion); cursor: pointer;
  background: var(--vermilion); color: #fff; font: 700 1rem/1 var(--label); letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .6); transition: background-color .15s, border-color .15s, color .15s, transform .16s var(--ease), box-shadow .16s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--vermilion-2); border-color: var(--vermilion-2); color: #fff; } }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--text); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: var(--surface-2); border-color: var(--muted); } }
.btn.light { background: var(--paper); border-color: var(--paper); color: var(--paper-ink); }
@media (hover: hover) and (pointer: fine) { .btn.light:hover { background: #fff; border-color: #fff; } }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2a1c03; }
@media (hover: hover) and (pointer: fine) { .btn.gold:hover { background: #f2c766; border-color: #f2c766; } }
.btn.green { background: var(--pine); border-color: var(--pine); }
.btn.danger { background: transparent; border-color: rgba(240, 98, 76, .55); color: #ff9a87; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .btn.danger:hover { background: rgba(240, 98, 76, .12); } }
.btn.big { padding: .9rem 1.4rem .84rem; font-size: 1.12rem; }
.btn.small { padding: .48rem .8rem .44rem; font-size: .9rem; }
.btn.tiny { padding: .34rem .6rem .3rem; font-size: .82rem; }
.btn .i { width: 17px; height: 17px; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .88rem; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { button.link:hover { color: var(--text); } }
button.link.small { font-size: .82rem; margin-left: .4rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.1rem; }

/* -------------------------------------------------------------------- forms */
input, select, textarea {
  width: 100%; padding: .62rem .8rem; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-raise);
  color: var(--text); font: 400 1rem var(--sans); transition: border-color .15s, box-shadow .15s; caret-color: var(--gold);
}
textarea { resize: vertical; min-height: 2.6rem; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--dim); }
@media (hover: hover) and (pointer: fine) { input:hover, select:hover, textarea:hover { border-color: #3d5891; } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233, 184, 74, .18); }
select { appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0aecc' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right .7rem center; }
input[type=checkbox], input[type=range] { width: auto; accent-color: var(--gold); }
label { display: flex; flex-direction: column; gap: .4rem; font-weight: 700; font-size: .9rem; color: var(--text-2); }
label small, .hint { font-weight: 400; color: var(--dim); font-size: .83rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; margin: 0; }
legend { padding: 0 .4rem; color: var(--muted); font-size: .86rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1rem; }
.row-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin: .6rem 0; }
.row-form > input, .row-form > select { width: auto; flex: 1 1 160px; }
.row-form label { flex: 1 1 200px; }
details summary { cursor: pointer; color: var(--muted); margin-top: .9rem; font-size: .9rem; }

/* settings list: label left, control right */
.settings { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 1.4rem; overflow: hidden; }
.settings-head { padding: 1.15rem 1.4rem .35rem; }
.settings-head h2 { margin: 0; display: flex; align-items: center; gap: .55rem; }
.settings-head h2 .i { color: var(--gold); }
.settings-head p { color: var(--muted); font-size: .9rem; margin: .3rem 0 .4rem; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); }
.settings-head + .setting { border-top: 0; }
.card .setting { padding-left: 0; padding-right: 0; }
.card .setting:first-of-type { border-top: 0; }
.setting .s-text { min-width: 0; }
.setting .s-title { font-weight: 700; font-size: .95rem; }
.setting .s-desc { color: var(--muted); font-size: .88rem; margin-top: .15rem; max-width: 60ch; }
.setting .s-control { flex: 0 0 min(320px, 46%); }
.setting .s-control.auto { flex: 0 0 auto; }

.switch { position: relative; display: inline-flex; flex-direction: row; align-items: center; gap: .7rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background-color .2s, border-color .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .22s var(--ease), background-color .2s; }
.switch input:checked + .track { background: var(--pine); border-color: var(--pine); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(233, 184, 74, .3); }
.toggle { flex-direction: row; align-items: center; gap: .6rem; padding: .7rem .85rem; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-raise); font-weight: 700; }
.toggles { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.save-state { display: inline-flex; align-items: center; gap: .45rem; font: 600 .82rem var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
  padding: .4rem .75rem; border: 1px solid var(--line); border-radius: 999px; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.save-state.saving { color: var(--gold); } .save-state.saving::before { background: var(--gold); animation: blink 1s infinite; }
.save-state.saved { color: #7fd0a4; } .save-state.saved::before { background: #7fd0a4; }
.save-state.error { color: var(--danger); } .save-state.error::before { background: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }

/* ------------------------------------------------------------------- notes */
.flash { padding: .85rem 1rem; border-radius: var(--r-sm); margin-bottom: 1.2rem; border: 1px solid var(--line-2); background: var(--surface); font-size: .95rem; }
.flash.success { border-color: rgba(47, 139, 96, .55); background: var(--pine-soft); }
.flash.error { border-color: rgba(240, 98, 76, .55); background: rgba(240, 98, 76, .1); }
.flash.info { border-color: rgba(233, 184, 74, .45); background: var(--gold-soft); }
.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; }
.toast { display: flex; align-items: center; gap: .55rem; padding: .68rem 1rem; border-radius: var(--r-sm); background: var(--paper); color: var(--paper-ink);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .7); font-size: .92rem; font-weight: 700; animation: toast-in .26s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pine); }
.toast.err::before { background: var(--vermilion); }

/* ----------------------------------------------------------- page heads */
.hero.small { display: block; padding: 0 0 1.8rem; }
.hero.small h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); max-width: 22ch; }
.lead { font-size: 1.1rem; color: var(--text-2); max-width: 58ch; line-height: 1.6; }
.big-emoji { font-size: 3.4rem; }
.section { padding: 4rem 0 1rem; margin-top: 1rem; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 2rem; margin-bottom: 2.2rem; align-items: end; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 0; }
.section-head p { color: var(--muted); margin: 0; max-width: 58ch; }
.figures { display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; align-items: center; }
.figure { display: flex; flex-direction: column; }
.figure b { display: block; font: 700 2rem/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.figure span { font: 600 .8rem var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: .35rem; }
.cta { margin-top: 3.5rem; padding: clamp(1.6rem, 4vw, 2.6rem); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .3rem; }
.cta p { color: var(--muted); margin: 0; }

/* stats */
.stats { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.6rem; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.stats-row { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 1.6rem; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.stat { padding: 1.1rem 1.2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.stat-label { color: var(--muted); font: 600 .8rem var(--label); letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; gap: .4rem; }
.stat-label .i { width: 15px; height: 15px; color: var(--dim); }
.stat-value { font: 700 1.7rem/1.15 var(--display); font-variant-numeric: lining-nums tabular-nums; margin-top: .35rem; white-space: nowrap; overflow: hidden; }
.stat { min-width: 0; }
.stats-row > a { color: inherit; text-decoration: none; }

/* tiles (admin overview) */
.tile { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tile .tl { font: 600 .82rem var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); } .tile .tv { font: 700 1.6rem var(--display); margin-top: .2rem; }
.tile .ti { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-3); color: var(--gold); }

/* ------------------------------------------------- advent: one sheet of seals */
/* the 25 doors are one sheet of stamps: no gaps, so the perforations meet */
.door-sheet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.door { position: relative; outline: none; }
.door .stamp { height: 100%; }
.door .stamp-face { min-height: 13.5rem; justify-content: flex-end; gap: .25rem; padding: .85rem .9rem .95rem; }
.door-number { position: absolute; top: .55rem; left: .75rem; font: 800 2.3rem/1 var(--display); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
/* the door's picture is printed in one ink: a monochrome vignette, not a full-colour emoji */
.door-emoji { position: absolute; top: .75rem; right: .8rem; font-size: 1.7rem; line-height: 1; filter: grayscale(1) contrast(1.15); opacity: .8; }
.door h3 { margin: 0; font: 700 1rem/1.15 var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-ink); }
.door p { margin: 0; font-size: .84rem; line-height: 1.4; color: var(--paper-muted); }
.door .badge { align-self: flex-start; margin-top: .3rem; }
.door:focus-visible { z-index: 2; } @media (hover: hover) and (pointer: fine) { .door:hover { z-index: 2; } }
.door:focus-visible .stamp-face { outline: 2px solid var(--gold); outline-offset: 3px; }
.door.today .stamp-face { background: var(--ink); }
.door.today .door-number, .door.today h3, .door.today p { color: #fff; }
.door.today .door-emoji { filter: grayscale(1) brightness(2.2); opacity: 1; }
/* a door that hasn't opened yet is a designed blank seal, never a gap */
.door.locked .stamp-face { border-style: dashed; border-color: #b3bdd3; }
.door.locked .door-number { color: #8593b0; font: 700 2.3rem/1 var(--label); }
.door.locked h3 { color: var(--paper-muted); }
.door.locked .door-emoji { opacity: .35; }
@media (max-width: 1020px) { .door-sheet { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .door-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); } .door .stamp-face { min-height: 11.5rem; } }
@media (max-width: 520px) { .door-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.secret { margin-top: 3rem; color: #22396a; font-size: .8rem; text-align: center; }
.secret-code { letter-spacing: .3em; }
.mini-calendar { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.mini-calendar.big { max-width: 340px; }
.mini-door { aspect-ratio: 1; display: grid; place-items: center; border-radius: 3px; background: var(--bg-raise); border: 1px dashed var(--line-2); font: 700 .95rem var(--label);
  color: var(--dim); text-decoration: none; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { a.mini-door:hover { border-color: var(--muted); color: var(--text); } }
.mini-door.open { border: 1px solid var(--gold); color: var(--gold); }
.mini-door.done { background: var(--paper); border: 1px solid var(--paper); color: var(--pine-ink); }
.mini-door.active { outline: 2px solid var(--gold); outline-offset: 1px; color: var(--text); }

/* ===================================================================== home */
/* the envelope fills the first view: airmail band as its border, address block as the headline */
.post { position: relative; margin-top: -.8rem; }
.envelope { position: relative; z-index: 2; padding: 11px; border-radius: 6px; background: var(--airmail); box-shadow: 0 50px 90px -50px rgba(0, 0, 0, .9); }
.env-inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; grid-template-areas: "from stamp" "addr stamp"; gap: 1.2rem 2rem;
  min-height: min(600px, calc(100svh - 64px - 10rem)); padding: clamp(1.2rem, 3vw, 2.2rem) clamp(1.2rem, 3.6vw, 2.8rem) clamp(1.6rem, 4vw, 3rem);
  background: var(--paper); color: var(--paper-ink); border-radius: 2px;
}
.env-from { grid-area: from; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.env-from p { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--paper-muted); }
.env-from .label { display: block; color: var(--paper-muted); font-size: .7rem; margin-bottom: .3rem; }
.par-avion { display: inline-flex; flex-direction: column; padding: .42rem .7rem .4rem; border-radius: 2px; background: var(--air-blue); color: #fff;
  font: 700 .95rem/1 var(--label); letter-spacing: .18em; text-transform: uppercase; }
.par-avion small { font: 600 .62rem/1 var(--label); letter-spacing: .2em; margin-top: .25rem; opacity: .85; }

.env-stamp { grid-area: stamp; position: relative; justify-self: end; align-self: start; margin: .2rem .2rem 3rem 0; }
.env-stamp .stamp-lift { transform: rotate(2.5deg); }
.cleo-stamp { --perf: 13px; --hole: 3.8px; width: clamp(8.5rem, 15vw, 11.5rem); }
.cleo-stamp .stamp-face { padding: .42rem; gap: .38rem; }
/* Cleo is engraved in one ink: her portrait in navy on stamp paper, the frame and face value in vermilion */
.cleo-pic { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--paper-ink); isolation: isolate; }
.cleo-pic img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: grayscale(1) contrast(1.08) brightness(1.12); mix-blend-mode: screen; }
.cleo-stamp .stamp-value { position: absolute; top: .42rem; left: .42rem; padding: .3rem .45rem .32rem .38rem; background: var(--paper); font-size: 1.75rem; }
.cleo-stamp .stamp-name { text-align: center; font-size: .78rem; padding: .05rem 0 .1rem; }
/* the cancellation over the stamp carries the live countdown to departure */
.postmark.big { --pm: #22407f; --pm-text: var(--paper-ink); position: absolute; left: -5.4rem; bottom: -3rem; width: 9.4rem; --tilt: -10deg; mix-blend-mode: multiply; }
.postmark.big::before { inset: 14%; }
.postmark.big .pm-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.postmark.big .pm-ring text { fill: var(--pm); font: 600 10.5px var(--label); letter-spacing: .1em; text-transform: uppercase; }
.pm-center { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.postmark.big b { font-size: 2.5rem; letter-spacing: -.01em; }
.postmark .pm-unit { font-size: .62rem; margin-top: -.1rem; }
.postmark .pm-clock { font: 700 .86rem/1 var(--label); letter-spacing: .06em; color: var(--pm-text); margin-top: .2rem; }
.postmark .pm-clock i { font-style: normal; }
.postmark .pm-done { display: none; font-size: .78rem; max-width: 4.6rem; color: var(--pm-text); }
.countdown.is-done b, .countdown.is-done .pm-unit, .countdown.is-done .pm-clock { display: none; }
.countdown.is-done .pm-done { display: block; }

.env-address { grid-area: addr; align-self: end; max-width: 54rem; padding-left: clamp(0rem, 5vw, 4.5rem); }
.env-to { margin: 0 0 .6rem; font: italic 400 1.1rem/1.3 var(--sans); color: var(--paper-muted); }
.env-address h1 { color: var(--paper-ink); font-size: clamp(2.5rem, 6.2vw, 5rem); line-height: .98; letter-spacing: -.025em; margin: 0 0 1.2rem; max-width: 18ch; }
.env-address h1 em { display: block; font-style: italic; font-weight: 600; color: var(--vermilion-2); }
.env-body { color: #2c3a5a; font-size: clamp(1rem, 1.3vw, 1.1rem); max-width: 58ch; margin: 0 0 1.6rem; }
.env-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.8rem; }
.env-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--paper-ink); font: 700 1rem/1 var(--label); letter-spacing: .1em; text-transform: uppercase;
  text-decoration-color: rgba(19, 33, 63, .35); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
@media (hover: hover) and (pointer: fine) { .env-link:hover { text-decoration-color: var(--vermilion-2); } }

/* the route slip, pulled out from under the envelope */
.slip { position: relative; z-index: 1; margin: -6px clamp(.6rem, 4vw, 3rem) 0; padding: 1.5rem clamp(1rem, 3vw, 2rem) 1.4rem; background: var(--paper-2); color: var(--paper-ink);
  border-radius: 0 0 4px 4px; box-shadow: inset 0 16px 14px -14px rgba(19, 33, 63, .5), 0 30px 50px -30px rgba(0, 0, 0, .8); }
.slip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; }
.slip-head h2 { margin: 0; font: 700 .92rem/1.2 var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--paper-ink); }
.slip-head a { display: inline-flex; align-items: center; gap: .2rem; flex-shrink: 0; color: var(--paper-ink); font: 700 .88rem var(--label); letter-spacing: .1em; text-transform: uppercase;
  text-decoration-color: rgba(19, 33, 63, .35); }
.slip-stops { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.4rem; }
/* Santa's route is one continuous line; stops are nodes on it */
.slip-stops::before { content: ""; position: absolute; left: 2.3rem; right: 2rem; top: 2.3rem; border-top: 2px dashed #9eabc6; }
.slip-stop { position: relative; display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.slip-stop .postmark { --pm: #2a4683; --pm-text: var(--paper-ink); background: var(--paper-2); }
.slip-stop:nth-child(2) .postmark { --tilt: 6deg; } .slip-stop:nth-child(3) .postmark { --tilt: -3deg; } .slip-stop:nth-child(4) .postmark { --tilt: 9deg; }
.slip-text { min-width: 0; }
.slip-text b { display: block; font-size: .98rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip-text > span { font: 600 .9rem/1.3 var(--label); letter-spacing: .04em; color: var(--paper-muted); font-variant-numeric: tabular-nums; }
.slip-stop.blank .postmark { border-style: dashed; --pm: #8d9bba; }
.slip-stop.blank .postmark::before { border-style: dashed; }
.slip-stop.blank b { color: var(--paper-muted); }

/* live numbers, each one a postmark */
.counts { padding: clamp(3rem, 7vw, 4.6rem) 0 0; text-align: center; }
.counts-title, .sheet-title { margin: 0 0 1.5rem; font: 600 .9rem/1.2 var(--label); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.counts-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem clamp(1rem, 3vw, 2.6rem); }
.counts-row .postmark { --pm: var(--ice); width: 8.2rem; }
.counts-row .postmark b { font-size: 1.95rem; }
.counts-row .postmark span { max-width: 6rem; }
.counts-row li:nth-child(2) { --tilt: 7deg; } .counts-row li:nth-child(3) { --tilt: -3deg; } .counts-row li:nth-child(4) { --tilt: 5deg; } .counts-row li:nth-child(5) { --tilt: -11deg; }

/* chapters of the page */
.band { margin-top: clamp(4.4rem, 10vw, 7.5rem); }
.band-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem 3.5rem; align-items: end; margin-bottom: 2.6rem; }
.band-head h2, .split-text h2, .close h2 { margin: 0; font: 700 clamp(2.1rem, 4.6vw, 3.5rem)/1.02 var(--display); letter-spacing: -.022em; }
.band-head p { margin: 0; color: var(--text-2); font-size: 1.05rem; max-width: 60ch; }
.band-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 2.4rem; }
.band-foot p { margin: 0; color: var(--text-2); max-width: 70ch; }

/* the postage meter: three steps on one strip, torn along dashed lines */
.meter { list-style: none; margin: 0 0 4rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--paper); color: var(--paper-ink); border-radius: 4px; }
.meter li { position: relative; padding: 1.5rem clamp(1.1rem, 2.4vw, 1.8rem) 1.7rem; }
.meter li + li { border-left: 2px dashed #c3cbdc; }
.meter li + li::before, .meter li + li::after { content: ""; position: absolute; left: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); }
.meter li + li::before { top: -9px; } .meter li + li::after { bottom: -9px; }
.meter-n { display: block; margin-bottom: .7rem; font: 800 3.2rem/1 var(--display); color: var(--vermilion-2); font-variant-numeric: lining-nums; }
.meter h3 { margin: 0 0 .4rem; font: 700 1.15rem/1.2 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-ink); }
.meter p { margin: 0; color: var(--paper-muted); font-size: .96rem; }

/* six chapters printed on one sheet, read left to right */
.chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.chapter { position: relative; }
.chapter .stamp { height: 100%; }
.chapter .stamp-face { min-height: 15.5rem; gap: .5rem; padding: .85rem .85rem 1rem; }
.ch-top { display: flex; justify-content: space-between; gap: .4rem; font: 700 .7rem/1.1 var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.ch-top span:last-child { color: var(--paper-muted); text-align: right; }
.chapter .stamp-face > .i { width: 30px; height: 30px; margin: .7rem 0 auto; color: var(--ink); stroke-width: 1.6; }
.ch-title { font: 700 1.16rem/1.1 var(--display); color: var(--paper-ink); letter-spacing: -.01em; }
.ch-text { font-size: .84rem; line-height: 1.45; color: var(--paper-muted); }
/* a chapter that is over carries a cancellation */
.cancel { --pm: rgba(34, 64, 127, .5); }
.cancel::after { left: -12%; right: -12%; top: 40%; height: 16%; }
.chapter.now { z-index: 2; }
.chapter.now .stamp-lift { transform: translateY(-12px) rotate(-1.6deg); filter: drop-shadow(0 18px 18px rgba(3, 9, 24, .5)); }
.ch-now { --pm: var(--gold); --pm-text: var(--gold); position: absolute; right: -.9rem; bottom: -1.5rem; background: var(--bg); --tilt: 12deg; }

/* the seal sheet: 25 doors, torn off one by one */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.8rem clamp(2rem, 6vw, 5rem); align-items: center; }
.split-text h2 { margin-bottom: 1.2rem; }
.split-text p { color: var(--text-2); max-width: 54ch; }
.split-text .btn { margin-top: .6rem; }
.seal-sheet { display: block; color: var(--paper-ink); text-decoration: none; transform: rotate(1.4deg); filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .55)); transition: transform .32s var(--ease); }
.selvage { display: block; padding: .8rem 1rem .55rem; background: var(--paper); font: 600 .72rem/1 var(--label); letter-spacing: .18em; text-transform: uppercase; color: var(--paper-muted); }
.selvage.end { padding: .55rem 1rem .8rem; text-align: right; }
.seals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.seal { --perf: 10px; --hole: 2.9px; aspect-ratio: 1; padding: 7px; display: grid; }
.seal > span { position: relative; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--ink); color: var(--ink);
  font: 700 clamp(1.3rem, 2.6vw, 1.95rem)/1 var(--label); font-variant-numeric: tabular-nums; }
.seal.today > span { background: var(--ink); color: #fff; }
.seal.used > span::after { content: ""; position: absolute; left: -20%; right: -20%; top: 36%; height: 28%; background: var(--paper-ink); opacity: .45;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='30' viewBox='0 0 96 30' fill='none' stroke='black' stroke-width='2.4'><path d='M0 4c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 15c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 26c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0'/></svg>") center / 100% 100%;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='30' viewBox='0 0 96 30' fill='none' stroke='black' stroke-width='2.4'><path d='M0 4c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 15c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0M0 26c8-4 16 4 24 0s16 4 24 0 16 4 24 0 16 4 24 0'/></svg>") center / 100% 100%; }
.seal.blank > span { border-style: dashed; border-color: #b3bdd3; color: #7f8daa; }

/* customs declaration: what's in the parcel */
.customs { max-width: 1000px; margin-inline: auto; padding: clamp(1.2rem, 3vw, 2.1rem); background: var(--paper); color: var(--paper-ink); border-radius: 3px; }
.customs-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; padding-bottom: .8rem; border-bottom: 2.5px solid var(--paper-ink); }
.customs-head h2 { margin: 0; color: var(--paper-ink); font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.customs-head span { font: 600 .8rem var(--label); letter-spacing: .18em; text-transform: uppercase; color: var(--paper-muted); }
.customs-table { width: 100%; border-collapse: collapse; }
.customs-table th, .customs-table td { padding: .9rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid #d3d9e6; }
.customs-table th:first-child { padding-left: 0; }
.customs-table td:last-child { padding-right: 0; }
.customs-table thead th { padding-top: .8rem; padding-bottom: .45rem; font: 600 .72rem var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--paper-muted); }
.customs-table tbody th { width: 14rem; font: 700 1.06rem/1.25 var(--label); letter-spacing: .07em; text-transform: uppercase; color: var(--paper-ink); }
.customs-table td { color: #2c3a5a; font-size: .96rem; }
.customs-table td + td, .customs-table th + td { border-left: 1px solid #d3d9e6; }
.customs-table td.right a { font: 700 .82rem var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--vermilion-2); text-decoration-color: currentColor; white-space: nowrap; }
.customs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.5rem; padding-top: 1.1rem; }
.tick { display: inline-flex; align-items: center; gap: .5rem; font: 600 .82rem var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--paper-muted); }
.tick::before { content: ""; width: 15px; height: 15px; border: 1.5px solid var(--paper-ink); flex-shrink: 0; }
.tick.on { color: var(--paper-ink); }
.tick.on::before { background: no-repeat center / 11px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' stroke='%23c8361e' stroke-width='2.2' stroke-linecap='round'><path d='M2 2l8 8M10 2l-8 8'/></svg>"); }
.customs-note { margin-left: auto; font-size: .92rem; color: var(--paper-ink); }

/* reply-paid postcard */
.postcard { max-width: 1000px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); padding: clamp(1.4rem, 3.2vw, 2.4rem);
  background: var(--paper); color: var(--paper-ink); border-radius: 4px; transform: rotate(-.7deg); box-shadow: 0 30px 60px -32px rgba(0, 0, 0, .85); }
.pc-message { padding-right: clamp(1.2rem, 3vw, 2.4rem); border-right: 1.5px solid #c9d1e1; }
.pc-message h2 { color: var(--paper-ink); font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: .8rem; }
.pc-message p { margin: 0; color: #2c3a5a; font-style: italic; font-size: 1.05rem; }
.pc-address { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; padding-left: clamp(1.2rem, 3vw, 2.4rem); }
.pc-paid { --pm: var(--vermilion-2); --pm-text: var(--vermilion-2); align-self: flex-end; --tilt: 10deg; }
.pc-lines { width: 100%; margin: 0; }
.pc-lines span { display: block; padding: .5rem 0 .25rem; border-bottom: 1px solid #c9d1e1; font: 600 1rem var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-ink); }

/* the close */
.close { max-width: 46rem; margin: clamp(4.4rem, 10vw, 7.5rem) auto 0; text-align: center; }
.close h2 { margin-bottom: .9rem; }
.close p { color: var(--text-2); margin-bottom: 1.8rem; }

.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; }

@media (max-width: 1020px) {
  .chapters { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0; }
  .split { grid-template-columns: 1fr; }
  .seal-sheet { max-width: 520px; }
}
@media (max-width: 760px) {
  .env-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "from stamp" "addr addr"; min-height: 0; }
  .env-from p { font-size: .82rem; }
  .env-stamp { margin-bottom: 3.2rem; }
  .postmark.big { width: 7.6rem; left: -3.4rem; bottom: -3.4rem; }
  .postmark.big b { font-size: 2rem; }
  .postmark.big .pm-ring text { font-size: 11px; }
  .postmark.big.waves::after { display: none; }
  .env-address { padding-left: 0; }
  .slip-stops { grid-template-columns: 1fr; gap: .8rem; }
  .slip-stops::before { left: 2.3rem; right: auto; top: 2.3rem; bottom: 2.3rem; border-top: 0; border-left: 2px dashed #9eabc6; }
  .slip-stop { flex-direction: row; align-items: center; gap: 1rem; }
  .band-head { grid-template-columns: 1fr; }
  .meter { grid-template-columns: 1fr; }
  .meter li + li { border-left: 0; border-top: 2px dashed #c3cbdc; }
  .meter li + li::before { top: -10px; left: -9px; } .meter li + li::after { top: -10px; bottom: auto; left: auto; right: -9px; }
  .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-top { flex-direction: column; gap: .25rem; }
  .ch-top span:last-child { text-align: left; }
  .counts-row { gap: 1rem .7rem; }
  .counts-row .postmark { width: 6.4rem; }
  .counts-row .postmark b { font-size: 1.5rem; }
  .counts-row .postmark span { font-size: .56rem; max-width: 4.8rem; }
  .chapter .stamp-face { min-height: 14rem; }
  .customs-table thead { display: none; }
  .customs-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: .8rem 0; border-bottom: 1px solid #d3d9e6; }
  .customs-table th, .customs-table td { border: 0 !important; padding: 0; }
  .customs-table tbody th { width: auto; }
  .customs-table td:nth-child(2) { grid-row: 2; grid-column: 1 / -1; padding-top: .3rem; }
  .customs-table td.right { grid-row: 1; grid-column: 2; }
  .customs-note { margin-left: 0; }
  .postcard { grid-template-columns: 1fr; transform: none; }
  .pc-message { padding: 0 0 1.4rem; border-right: 0; border-bottom: 1.5px solid #c9d1e1; }
  .pc-address { padding: 1.2rem 0 0; }
  .pc-paid { position: absolute; right: 0; top: .6rem; }
  .pc-lines { padding-right: 5rem; }
}
@media (max-width: 420px) {
  .cleo-stamp { width: 7.4rem; }
  .par-avion { font-size: .8rem; }
  .reg > span { font-size: 1rem; padding: .7rem .9rem .62rem; }
}

/* --------------------------------------------------------------------- tree */
.tree-card { display: block; height: 100%; text-decoration: none; color: var(--paper-ink); }
.tree-card .stamp { height: 100%; }
.tree-card .stamp-face { align-items: center; text-align: center; gap: .3rem; padding: 1rem .9rem .9rem; }
.tree-card .stamp-value { position: absolute; top: .5rem; right: .6rem; font-size: 1.35rem; }
.tree-card .stamp-value small { font-size: .5rem; }
.tree-card h3 { margin: .6rem 0 .1rem; font: 700 .98rem/1.2 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-ink);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-card .meta { font-size: .8rem; color: var(--paper-muted); font-variant-numeric: tabular-nums; }
.tree-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; }
.tree-wrap { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.tree-wrap.mini { max-width: 172px; margin-top: -.4rem; } .tree-wrap.large { max-width: 520px; }
.tree { width: 100%; height: auto; display: block; overflow: visible; }
/* classic pine: two greens per tier, the right side in shadow, snow on the branch tips */
.tree .tier { fill: #2f7d4f; } .tree .tier.alt { fill: #2a7247; }
.tree .tier-shade { fill: #0f3b26; opacity: .34; }
.tree .tier-light { fill: none; stroke: #7fd0a4; stroke-width: 1.6; stroke-linecap: round; opacity: .35; }
.tree .snow { fill: none; stroke: #f6f8fc; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.tree .garland { fill: none; stroke: #e9b84a; stroke-width: 1.7; stroke-dasharray: 0 4.2; stroke-linecap: round; opacity: .95; }
.tree .light { fill: #ffd76a; }
.tree .light.l1 { fill: #ff7a5c; } .tree .light.l2 { fill: #9ccaec; } .tree .light.l3 { fill: #fff1c4; }
.tree .trunk { fill: #6b4226; } .tree .trunk-shade { fill: #4a2c18; }
.tree .skirt { fill: #c8361e; } .tree .skirt-rim { fill: #f6f8fc; opacity: .92; }
.tree .ground { fill: #e8edf6; } .tree .ground-shade { fill: #b9c6dc; opacity: .7; }
.tree .star { fill: #f2c14e; stroke: #fff1c4; stroke-width: .8; stroke-linejoin: round; } .tree .star-shine { fill: #fff6d6; opacity: .7; }
.tree .bauble-hook { stroke: #e9b84a; stroke-width: .8; } .tree .bauble-cap { fill: #e9b84a; } .tree .bauble-shine { fill: #fff; opacity: .6; }
.tree .bauble circle:not(.bauble-shine) { stroke: rgba(0, 0, 0, .22); stroke-width: .6; }
.tree .gift-box { fill: var(--g); } .tree .gift-lid { fill: var(--g); filter: brightness(1.12); }
.tree .gift-ribbon, .tree .gift-bow { fill: var(--r); }
.tree .g-red { --g: #c8361e; --r: #f2c14e; } .tree .g-gold { --g: #e9b84a; --r: #c8361e; } .tree .g-blue { --g: #2552b2; --r: #f6f8fc; }
.tree .g-green { --g: #2f8b60; --r: #f6f8fc; } .tree .g-paper { --g: #f6f8fc; --r: #c8361e; }
/* the big tree on its own page is lit: lights twinkle out of step, the star breathes */
.tree-wrap.large { isolation: isolate; }
.tree-wrap.large::before { content: ""; position: absolute; inset: -6% 0 18%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(233, 184, 74, .16), rgba(156, 202, 236, .06) 60%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .tree-wrap.large .light { animation: light-twinkle 2.6s ease-in-out infinite; }
  .tree-wrap.large .light.l1 { animation-delay: -.65s; } .tree-wrap.large .light.l2 { animation-delay: -1.3s; } .tree-wrap.large .light.l3 { animation-delay: -1.95s; }
  .tree-wrap.large .star-glow { animation: star-breathe 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
}
@keyframes light-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes star-breathe { 0%, 100% { opacity: .8; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
/* premium skins */
.tree.skin-snowy .tier { fill: #3f8462; } .tree.skin-snowy .tier.alt { fill: #377a59; } .tree.skin-snowy .snow { stroke-width: 5; opacity: .97; }
.tree.skin-snowy .tier-light { stroke: #f6f8fc; opacity: .55; }
.tree.skin-pink .tier { fill: #e07ea6; } .tree.skin-pink .tier.alt { fill: #d26f98; } .tree.skin-pink .tier-shade { fill: #7a2149; }
.tree.skin-pink .tier-light { stroke: #ffd6e6; } .tree.skin-pink .light { fill: #fff1c4; } .tree.skin-pink .light.l2 { fill: #ffffff; }
.tree.skin-neon .tier, .tree.skin-neon .tier.alt { fill: #0c2230; stroke: #6fe3c8; stroke-width: 1.6; stroke-linejoin: round; }
.tree.skin-neon .tier.alt { stroke: #e780d6; } .tree.skin-neon .tier-shade, .tree.skin-neon .tier-light { display: none; }
.tree.skin-neon .snow { stroke: #bff7ea; stroke-width: 1; opacity: .8; } .tree.skin-neon .light { fill: #ffffff; } .tree.skin-neon .garland { stroke: #e780d6; }
.tree.skin-gold .tier { fill: #cfa346; } .tree.skin-gold .tier.alt { fill: #bf9338; } .tree.skin-gold .tier-shade { fill: #5c4210; }
.tree.skin-gold .tier-light { stroke: #fff1c4; opacity: .5; } .tree.skin-gold .garland { stroke: #fff6d6; } .tree.skin-gold .light { fill: #ffffff; }
/* on a gallery stamp the tree is printed: pine ink and paper, nothing else */
.tree-card .tree .tier, .tree-card .tree .tier.alt { fill: var(--pine-ink); stroke: none; }
.tree-card .tree .tier-shade { fill: #0a3a24; opacity: .55; display: block; }
.tree-card .tree .tier-light, .tree-card .tree .garland, .tree-card .tree .star-glow, .tree-card .tree .star-shine { display: none; }
.tree-card .tree .snow { stroke: var(--paper); stroke-width: 2.6; opacity: 1; }
.tree-card .tree .light { fill: var(--paper); }
.tree-card .tree .trunk, .tree-card .tree .trunk-shade { fill: var(--pine-ink); }
.tree-card .tree .skirt { fill: var(--pine-ink); } .tree-card .tree .skirt-rim { fill: var(--paper); opacity: 1; }
.tree-card .tree .ground { fill: var(--paper-2); }
.tree-card .tree .ground-shade { display: none; }
.tree-card .tree .star { fill: var(--pine-ink); stroke: none; }
progress, meter { width: 100%; height: 6px; accent-color: var(--pine); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--pine); border-radius: 99px; width: 0; transition: width .6s var(--ease); }
.bar.gold > i { background: var(--gold); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark i { flex: 1; min-width: 5px; background: var(--surface-3); border-radius: 2px; height: 4%; transition: height .5s var(--ease); }
.spark i:last-child { background: var(--gold); }

/* ------------------------------------------------------------------ tracker */
.tracker { position: relative; aspect-ratio: 1200 / 520; min-height: 300px; overflow: hidden; margin-bottom: 1.4rem; border-radius: 6px;
  background: #0b1c2a; border: 8px solid transparent; border-image: var(--airmail) 8; box-shadow: 0 40px 80px -40px rgba(0,0,0,.9); }
.scene, .scene-snow { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-snow { pointer-events: none; }
.scene .twinkle { animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.scene .aurora { animation: aurora 18s ease-in-out infinite alternate; transform-origin: 50% 30%; mix-blend-mode: screen; }
.scene .aurora-2 { animation: aurora 24s ease-in-out infinite alternate-reverse; }
@keyframes aurora { from { transform: translateX(-30px) scaleY(.9); opacity: .65; } to { transform: translateX(40px) scaleY(1.1); opacity: 1; } }
.scene .house { cursor: pointer; outline: none; }
.scene .house .win { transition: fill .3s; }
.scene .house:not(.visited) { opacity: .92; }
.scene .house.hl .win, .scene .house:focus-visible .win { fill: #fff1c4; }
.scene .house.hl, .scene .house:focus-visible { filter: drop-shadow(0 0 6px rgba(255, 214, 130, .9)); }
.scene .house.pulse { filter: drop-shadow(0 0 14px rgba(255, 214, 130, 1)); }
.scene .win-glow { animation: flicker 4s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: .85; } 45% { opacity: 1; } 55% { opacity: .7; } }
.scene .smoke { animation: smoke 3.3s ease-out infinite; opacity: 0; transform-box: fill-box; transform-origin: center; }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: .55; } 100% { opacity: 0; transform: translate(10px, -26px) scale(1.8); } }
.scene .np-text { font: 700 8px var(--label); fill: #f4e6c2; letter-spacing: .1em; text-transform: uppercase; }
.scene .sleigh { will-change: transform; }
.scene .sleigh-body.idle { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.scene .rudolph { animation: rudolph 1.4s ease-in-out infinite; }
@keyframes rudolph { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.scene .trail { animation: trail 1.4s ease-out forwards; }
@keyframes trail { from { opacity: .95; } to { opacity: 0; transform: translateY(6px); } }
.tt { position: absolute; z-index: 3; transform: translate(-50%, -100%); pointer-events: none; padding: .45rem .7rem .5rem; border-radius: 3px; white-space: nowrap;
  background: var(--paper); color: var(--paper-ink); box-shadow: 0 12px 26px rgba(0,0,0,.45); font-size: .82rem; display: flex; flex-direction: column; gap: .1rem; }
.tt b { font: 700 .92rem/1.2 var(--sans); color: var(--paper-ink); } .tt span { color: var(--paper-muted); font-size: .76rem; }
/* the HUD is a postal label stuck on the scene */
.tracker-hud { position: absolute; z-index: 2; left: clamp(.7rem, 2vw, 1.3rem); top: clamp(.7rem, 2vw, 1.3rem); min-width: 250px; max-width: 360px; padding: .85rem 1rem .95rem;
  border-radius: 3px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 16px 34px -14px rgba(0,0,0,.75); }
.hud-state { display: inline-flex; align-items: center; gap: .45rem; font: 700 .76rem var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--air-blue); }
.hud-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--air-blue); }
.tracker.live .hud-state { color: var(--vermilion-2); } .tracker.live .hud-state .dot { background: var(--vermilion-2); animation: live 1.4s ease-in-out infinite; }
@keyframes live { 0%, 100% { box-shadow: 0 0 0 3px rgba(200, 54, 30, .25); } 50% { box-shadow: 0 0 0 7px rgba(200, 54, 30, 0); } }
.hud-count { font: 700 clamp(1.35rem, 2.6vw, 1.85rem)/1.05 var(--display); white-space: nowrap; letter-spacing: -.01em; margin: .4rem 0 .2rem; font-variant-numeric: lining-nums tabular-nums; color: var(--paper-ink); }
.hud-sub { color: var(--paper-muted); font-size: .84rem; }
.hud-bar { height: 5px; border-radius: 99px; background: var(--paper-2); margin-top: .75rem; overflow: hidden; }
.hud-bar > i { display: block; height: 100%; width: 0; background: var(--vermilion-2); border-radius: 99px; transition: width .8s var(--ease); }
.tracker-hud .hud-preview { margin-top: .8rem; width: 100%; justify-content: center; }
.route-head { gap: 1rem; flex-wrap: wrap; }
.route-search { max-width: 260px; margin: 0; }
.stops { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: .35rem .9rem; }
.stop { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 3px; border: 1px solid transparent; transition: background-color .15s, border-color .15s; }
@media (hover: hover) and (pointer: fine) { .stop:hover { background: var(--surface-2); border-color: var(--line); } }
.stop-rank { width: 2.4rem; text-align: right; font: 700 1rem var(--label); letter-spacing: .02em; color: var(--dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.stop.top .stop-rank { color: var(--gold); }
.stop-av { width: 34px; height: 34px; border-radius: 6px; flex-shrink: 0; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; color: var(--text-2); border: 1px solid var(--line-2); }
.stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.stop-main b { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop-bar { height: 3px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.stop-bar > i { display: block; height: 100%; background: var(--pine); border-radius: 99px; }
.stop.visited .stop-bar > i { background: var(--gold); }
.stop-spirit { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.stop-pill { font: 700 .7rem var(--label); letter-spacing: .12em; text-transform: uppercase; padding: .22rem .5rem .2rem; border-radius: 99px; color: var(--dim); border: 1px solid var(--line-2); }
.stop.visited .stop-pill { color: var(--gold); border-color: rgba(233, 184, 74, .4); background: var(--gold-soft); }
.stop-empty { padding: 1rem; }
.scene .drop-gift { animation: drop-gift 1.2s ease-in forwards; }
.scene .drop-gift rect, .scene .drop-gift path { animation: drop-fall 1.2s ease-in forwards; }
@keyframes drop-gift { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes drop-fall { from { transform: translateY(-6px) rotate(0); } to { transform: translateY(14px) rotate(25deg); } }
/* tracker layers: static village below, moving things above (see tracker.js) */
.scene-layer { pointer-events: none; }
.scene .house .win-glow { animation: none; }
.scene-aurora { position: absolute; inset: 0 -8% auto; height: 44%; pointer-events: none; opacity: .75; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.scene-aurora i { position: absolute; inset: 0; filter: blur(22px); will-change: transform; animation: aurora-drift 20s ease-in-out infinite alternate;
  background: radial-gradient(ellipse 34% 26% at 28% 62%, rgba(76, 214, 160, .38), transparent 70%),
              radial-gradient(ellipse 30% 20% at 58% 44%, rgba(90, 168, 224, .3), transparent 70%); }
.scene-aurora i + i { animation-duration: 27s; animation-direction: alternate-reverse;
  background: radial-gradient(ellipse 28% 18% at 78% 52%, rgba(160, 108, 224, .24), transparent 70%),
              radial-gradient(ellipse 22% 16% at 12% 40%, rgba(76, 214, 160, .22), transparent 70%); }
@keyframes aurora-drift { from { transform: translateX(-3%) scaleY(.92); } to { transform: translateX(3%) scaleY(1.08); } }
@media (max-width: 640px) {
  .tracker { aspect-ratio: auto; height: 360px; border-width: 6px; }
  .tracker-hud { left: .5rem; right: .5rem; top: .5rem; min-width: 0; max-width: none; padding: .65rem .8rem .75rem; }
  .stop-pill { display: none; }
}

/* ------------------------------------------------------------------- tables */
/* registers: ruled ledgers with tracked-caps column heads */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 1.2rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .75rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font: 600 .76rem var(--label); text-transform: uppercase; letter-spacing: .14em; background: var(--bg-raise); }
.table tbody tr { transition: background-color .12s; }
@media (hover: hover) and (pointer: fine) { .table tbody tr:hover { background: var(--surface-2); } }
.table tbody tr:last-child td { border-bottom: 0; }
.table.small td, .table.small th { padding: .5rem .75rem; font-size: .84rem; }
.table td.right, .table th.right { text-align: right; }
.table tr.clickable { cursor: pointer; }
.card .table-wrap { border: 0; background: none; margin: 0 calc(-1 * clamp(1.1rem, 2vw, 1.5rem)) calc(-1 * clamp(1.1rem, 2vw, 1.5rem)); border-radius: 0; }
.items-table input:not([type=checkbox]), .items-table select { padding: .35rem .5rem; font-size: .82rem; }
input.xs { width: 5.5rem; }
.rank { font: 700 1.05rem var(--display); color: var(--dim); width: 2.2rem; font-variant-numeric: lining-nums tabular-nums; flex-shrink: 0; }
.rank.top { color: var(--gold); }
.register { list-style: none; margin: 0; padding: 0; }
.register li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); color: var(--text-2); }
.register li:first-child { border-top: 0; }
.register-head { display: flex; justify-content: space-between; gap: 1rem; padding: 0 0 .55rem; margin-bottom: .2rem; border-bottom: 2px solid var(--line-2);
  font: 600 .74rem var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.register .num { font: 700 1.02rem var(--label); letter-spacing: .02em; color: var(--text); }

/* ------------------------------------------------------------- chips/badges */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem; border-radius: 3px; background: var(--bg-raise); border: 1px solid var(--line); font-size: .82rem; color: var(--text-2); }
.chip.rarity-rare { border-color: #3a6aa8; } .chip.rarity-epic { border-color: #7c56b8; } .chip.rarity-legendary { border-color: var(--gold); color: var(--gold); }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .5rem .14rem; border-radius: 3px; font: 700 .72rem/1.2 var(--label); letter-spacing: .1em; text-transform: uppercase;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); }
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(233, 184, 74, .35); }
.badge.green, .badge.state-open, .badge.state-paid { background: var(--pine-soft); color: #8fd1a8; border-color: rgba(47, 139, 96, .45); }
.badge.state-drawn, .badge.state-pending { background: var(--gold-soft); color: var(--gold); border-color: rgba(233, 184, 74, .35); }
.badge.state-revealed { background: rgba(156, 202, 236, .1); color: var(--ice); border-color: rgba(156, 202, 236, .3); }
.badge.red, .badge.state-cancelled, .badge.state-failed, .badge.state-refunded, .badge.state-expired { background: rgba(240, 98, 76, .1); color: #ff9a87; border-color: rgba(240, 98, 76, .38); }
.tabs { display: flex; gap: .2rem; flex-wrap: wrap; margin: 0 0 1.6rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .65rem .9rem .6rem; color: var(--muted); font: 600 .98rem var(--label); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-color: var(--vermilion); } @media (hover: hover) and (pointer: fine) { .tabs a:hover { color: var(--text); } }

/* ------------------------------------------------------------------ premium */
/* each plan carries a stamp whose face value is the price */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 1.4rem; }
.plan { padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem; margin-bottom: .6rem; }
.plan-head h2 { font-size: clamp(1.7rem, 3vw, 2.1rem); margin: 0 0 .3rem; }
.plan-head p { margin: 0; color: var(--muted); font-size: .95rem; }
.plan-stamp { flex-shrink: 0; }
.plus { font: 700 .9em/1 var(--label); vertical-align: .12em; margin-left: .05em; color: var(--gold); }
.plan-stamp .stamp-lift { transform: rotate(3deg); }
.plan-stamp .stamp { --perf: 11px; --hole: 3.2px; width: 7.6rem; }
.plan-stamp .stamp-face { align-items: center; justify-content: center; text-align: center; gap: .3rem; padding: .7rem .4rem .6rem; min-height: 7rem; }
.plan-stamp .i { width: 26px; height: 26px; color: var(--ink); }
.plan-stamp .stamp-value { font-size: 1.7rem; }
.plan .checks { margin: 1.1rem 0 1.4rem; flex: 1; }
.plan form { margin-top: .6rem; }
.pay-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .8rem; }
.pay-option { display: flex; flex-direction: column; gap: .55rem; padding: 1rem 1.05rem 1.1rem; border-radius: var(--r-sm); background: var(--bg-raise); border: 1px dashed var(--line-2); }
.pay-option p { margin: 0; flex: 1; }
.pay-option form { margin: 0; gap: .5rem; }
.pay-option .btn { width: 100%; justify-content: center; }
.pay-via { display: inline-flex; align-items: center; gap: .4rem; font: 700 .8rem var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.pay-via svg { width: 14px; height: 14px; }
.pay-price { font: 700 2rem/1 var(--display); letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.pay-price span { font: 400 .85rem var(--sans); color: var(--muted); letter-spacing: 0; }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; }
.checks li { padding: .5rem 0 .5rem 1.8rem; position: relative; color: var(--text-2); font-size: .94rem; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: .78rem; width: 16px; height: 16px; border-radius: 50%; background: var(--pine-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237fd0a4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");
  background-size: 10px; background-repeat: no-repeat; background-position: center; }
.code-box { font: 600 1.35rem var(--mono); letter-spacing: .08em; padding: 1rem; background: var(--paper); border-radius: var(--r-sm); border: 2px dashed var(--vermilion-2); color: var(--paper-ink); }

/* --------------------------------------------------------------------- misc */
.wishlist { padding-left: 1.3rem; } .wishlist li { margin-bottom: .6rem; color: var(--text-2); }
.wishlist.editable { list-style: none; padding: 0; margin: 0; }
.wishlist.editable li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .8rem 0; border-top: 1px solid var(--line); margin: 0; }
.wishlist.editable li:first-child { border-top: 0; }
.wishlist .actions { margin: 0; flex-shrink: 0; gap: .3rem; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: .65rem 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; color: var(--text-2); }
.plain li:first-child { border-top: 0; }
.chat { display: flex; flex-direction: column; gap: .55rem; max-height: 360px; overflow-y: auto; margin-bottom: .9rem; padding-right: .3rem; }
.msg { padding: .65rem .85rem; border-radius: 10px 10px 10px 3px; background: var(--surface-3); max-width: 88%; white-space: pre-wrap; font-size: .92rem; }
.msg.mine { align-self: flex-end; background: var(--paper); color: var(--paper-ink); border-radius: 10px 10px 3px 10px; }
.msg-label { font: 600 .72rem var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
.msg.mine .msg-label { color: var(--paper-muted); }
.server-card { display: flex !important; align-items: center; gap: .95rem; }
.server-card .meta { min-width: 0; flex: 1; }
.server-card h3 { margin: 0 0 .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 1.05rem var(--display); }
.server-card .chev { color: var(--dim); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .big-emoji, .empty .i.xl { margin-bottom: .6rem; }
.i.xl { width: 40px; height: 40px; color: var(--dim); stroke-width: 1.4; }
.pager { display: flex; gap: .6rem; justify-content: center; margin: 1.2rem 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.2rem; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.search { position: relative; min-width: 260px; }
.search input { padding-left: 2.3rem; }
.search .i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--dim); width: 16px; }
.log { padding: .3rem 1.4rem; }
.log-item { display: grid; grid-template-columns: 34px 1fr auto; gap: .9rem; padding: .95rem 0; border-top: 1px solid var(--line); align-items: start; }
.log-item:first-child { border-top: 0; }
.log-icon { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--gold); }
.log-icon .i { width: 16px; height: 16px; }
.log-title { font-weight: 700; font-size: .92rem; }
.log-meta { color: var(--muted); font-size: .8rem; margin-top: .15rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.log-details { margin-top: .45rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.log-time { color: var(--dim); font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-head { display: flex; align-items: center; gap: 1.3rem; margin-bottom: 1.8rem; }
.profile-head h1 { margin: 0 0 .2rem; }

/* page heads: headline left, the page's live number as a postmark right */
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1.2rem 2.4rem; padding: .4rem 0 2.2rem; margin-bottom: 1.6rem; border-bottom: 1px dashed var(--line-2); }
.page-head h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); max-width: 18ch; margin: 0 0 .7rem; letter-spacing: -.022em; }
.page-head h1 em { font-style: italic; font-weight: 600; color: var(--gold); }
.page-head .lead { margin: 0; }
.page-head .lead + .muted { margin: .8rem 0 0; }
.page-head .postmark { --pm: var(--ice); width: 7.6rem; margin: 0 .6rem .4rem 0; }
.page-head .postmark b { font-size: 1.8rem; }

/* error and thank-you pages: the letter came back with a postmark */
.lost { max-width: 40rem; margin: 2rem auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.lost h1 { margin: 1.6rem 0 .6rem; }
.lost .muted { margin-bottom: 1.6rem; }
.postmark.big-pm { --pm: var(--gold); --pm-text: var(--gold); width: 9rem; --tilt: -12deg; }
.postmark.big-pm b { font-size: 2.6rem; }
.card .postmark.big-pm { margin: .4rem auto 0; }
.tree-title { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.tree-title h1 { margin: 0; }
.counts-row.left { justify-content: flex-start; margin: 1.8rem 0 2rem; }
.counts-row.left .postmark { width: 7rem; }
.counts-row.left .postmark b { font-size: 1.6rem; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; gap: .25rem; overflow-x: auto; padding: .6rem; }
  .side-head, .side-group, .side-foot { display: none; }
  .side a { white-space: nowrap; }
  .section-head { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .burger { display: grid; place-items: center; order: 5; margin-left: -.4rem; width: 40px; height: 40px; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: .8rem; gap: .2rem; background: var(--bg-raise);
    border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px rgba(0,0,0,.8); }
  .nav a { padding: .8rem .9rem; font-size: 1.1rem; }
  #nav-toggle:checked ~ .nav { display: flex; }
}
@media (max-width: 860px) {
  .top-right .label { display: none; }
  .setting { flex-direction: column; align-items: stretch; gap: .7rem; } .setting .s-control { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .topbar { gap: .7rem; }
  .brand .name { font-size: 1.05rem; }
  .brand img, .brand .logo { width: 30px; height: 30px; }
  .brand { gap: .5rem; min-width: 0; }
  .brand .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wide-only { display: none; }
  .top-right { gap: .4rem; }
  .snow-toggle { padding: 0 .6rem; }
  .page { width: calc(100% - 2rem); margin-top: 1.6rem; }
  .page-head { grid-template-columns: 1fr; }
  .page-head .postmark { display: none; }
}
.m0 { margin: 0 !important; }

/* topbar controls: same height, centred */
.top-right > .btn, .user-chip, .snow-toggle { height: 36px; }
.user-chip { padding: 0 .65rem 0 .3rem; }

/* ------------------------------------------------------ countdown name builder */
.setting.cd-setting { flex-direction: column; align-items: stretch; gap: .9rem; }
.cd-builder { display: flex; flex-direction: column; gap: .85rem; }
.cd-preview { display: flex; align-items: center; gap: .55rem; padding: .65rem .85rem; border-radius: 8px; background: #2b2d31; color: #dbdee1; font: 500 .95rem var(--sans); max-width: 420px; }
.cd-preview .cd-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-preview .cd-len { font-size: .72rem; color: #949ba4; font-variant-numeric: tabular-nums; }
.cd-preview .cd-len.bad { color: var(--danger); }
.cd-day, .cd-xmas { flex-direction: row !important; justify-content: flex-start; text-align: left; margin: 0; }
.cd-day { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--muted); }
.cd-day input { width: 160px; margin: 0; accent-color: var(--gold); }
.cd-day b { color: var(--text-2); font-weight: 700; min-width: 7rem; }
.cd-zone { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; min-height: 56px; padding: .6rem; border-radius: var(--r);
  border: 1.5px dashed var(--line-2); background: var(--bg-raise); transition: border-color .15s, background-color .15s; }
.cd-zone.over { border-color: var(--gold); background: var(--gold-soft); }
.cd-builder.no-days .cd-zone { border-color: var(--danger); }
.cd-builder.no-days .cd-zone::after { content: "Add the “21” block - the countdown needs the number of days."; flex-basis: 100%; font-size: .78rem; color: var(--danger); }
.cd-hint { color: var(--dim); font-size: .85rem; padding: 0 .3rem; }
.cd-chip, .cd-pal { display: inline-flex; align-items: center; gap: .35rem; padding: .42rem .7rem; border-radius: 99px; font: 400 .88rem var(--sans); color: var(--text);
  background: var(--surface-3); border: 1px solid var(--line-2); cursor: grab; user-select: none; touch-action: none; transition: transform .12s, border-color .12s, background-color .12s; }
@media (hover: hover) and (pointer: fine) { .cd-chip:hover, .cd-pal:hover { border-color: var(--gold); } }
.cd-chip:focus-visible, .cd-pal:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cd-chip.is-days, .cd-pal.is-days { background: var(--gold-soft); border-color: rgba(233, 184, 74, .45); color: var(--gold); font-weight: 700; }
.cd-chip.dragging { opacity: .3; }
.cd-x { border: 0; background: none; color: var(--dim); font-size: 1rem; line-height: 1; padding: 0 .1rem; margin-right: -.2rem; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .cd-x:hover { color: var(--danger); } }
.cd-marker { width: 3px; height: 30px; border-radius: 3px; background: var(--gold); }
.cd-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg) scale(1.06); box-shadow: 0 12px 28px rgba(0,0,0,.5); cursor: grabbing; }
.is-dragging, .is-dragging * { cursor: grabbing !important; }
.cd-palette { display: flex; flex-direction: column; gap: .55rem; }
.cd-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cd-group-label { width: 6.2rem; flex-shrink: 0; font: 600 .74rem var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.cd-pal { padding: .34rem .6rem; font-size: .84rem; }
.cd-custom input { flex: 1; min-width: 160px; max-width: 260px; margin: 0; }
.cd-xmas { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-size: .84rem; color: var(--muted); }
.cd-xmas input { flex: 1; min-width: 200px; max-width: 320px; margin: 0; }
.cd-actions { display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .cd-group-label { width: 100%; } }

/* ------------------------------------------------------ dressed avatars (cosmetics on the website) */
.dressed { position: relative; display: inline-block; flex-shrink: 0; --d: 40px; width: var(--d); height: var(--d); margin-top: calc(var(--d) * .28); }
.dressed.sm { --d: 30px; } .dressed.md { --d: 44px; } .dressed.lg { --d: 120px; } .dressed.xl { --d: 168px; }
.dressed-av { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 calc(var(--d) * .05) var(--line-2); background: var(--surface-3); }
.dressed-hat { position: absolute; width: calc(var(--d) * 1.1); height: calc(var(--d) * 1.1); left: calc(var(--d) * -.05); top: calc(var(--d) * -.597); pointer-events: none; }
.dressed.fr-elf .dressed-av, .dressed.fr-frame_gold .dressed-av { box-shadow: 0 0 0 calc(var(--d) * .055) #ffd45c, 0 0 calc(var(--d) * .3) rgba(255, 212, 92, .35); }
.dressed.fr-frame_snow .dressed-av { box-shadow: 0 0 0 calc(var(--d) * .055) #dfe9f5, 0 0 calc(var(--d) * .25) rgba(200, 230, 255, .4); }
.dressed.fr-frame_candy::before, .dressed.fr-frame_aurora::before { content: ""; position: absolute; inset: calc(var(--d) * -.06); border-radius: 50%;
  background: repeating-conic-gradient(#e22840 0 15deg, #fff 15deg 30deg); }
.dressed.fr-frame_aurora::before { background: conic-gradient(#4cd6a0, #5aa8e0, #a06ce0, #4cd6a0); }
.dressed.fr-frame_candy .dressed-av, .dressed.fr-frame_aurora .dressed-av { position: relative; box-shadow: none; }
.who .dressed { margin-right: .5rem; }
/* public profile: the nameplate is the user's own cosmetic, so it keeps its colours */
.pp { margin: 1.4rem 0; padding: clamp(1.4rem, 4vw, 2.4rem); border-radius: 6px; border: 1px solid var(--line);
  background: linear-gradient(160deg, #16203f, #4a1a34); }
.pp.np-np_forest { background: linear-gradient(160deg, #08281a, #2e6840); } .pp.np-np_candy { background: linear-gradient(160deg, #6e122e, #ec688c); }
.pp.np-np_aurora { background: linear-gradient(160deg, #06182c, #22807a); } .pp.np-np_midnight { background: linear-gradient(160deg, #04061a, #3a3076); }
.pp.np-np_frost { background: linear-gradient(160deg, #0c2242, #68a2d6); }
.pp-hero { display: flex; align-items: center; gap: clamp(1.2rem, 4vw, 2.4rem); flex-wrap: wrap; }
.pp-name h1 { margin: .2rem 0; font-size: clamp(2rem, 5vw, 3rem); }
.pp-title { font: italic 600 1.1rem var(--display); color: #ffe2a0; margin-bottom: .5rem; }
.pp-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.pp-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 99px; background: rgba(0,0,0,.25); font-size: 1.1rem; }
.pp-badge small { font-size: .78rem; color: var(--text-2); }

/* ------------------------------------------------------- snowfall preference */

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

/* =================================================================== motion */
/* Motion follows the post: a letter is stamped once when you arrive, and a stamp lifts when you reach for it.
   Transform and opacity only, strong ease-out for anything entering, nothing on high-frequency UI. */

/* hover lifts only where there is a real pointer; touch taps would leave them stuck */
@media (hover: hover) and (pointer: fine) {
  .stamp-lift::before { content: ""; position: absolute; inset: 10% 8% 2%; z-index: -1; box-shadow: 0 24px 30px -10px rgba(3, 9, 24, .7); opacity: 0; transition: opacity .22s var(--ease); }
  .door:hover .stamp-lift::before, .chapter:hover .stamp-lift::before, .tree-card:hover .stamp-lift::before, .plan-stamp:hover .stamp-lift::before { opacity: 1; }
  .door:hover .stamp-lift { transform: translateY(-6px) rotate(-1.2deg); }
  .door.today:hover .stamp-lift { transform: translateY(-13px) rotate(-2.2deg); }
  .chapter:hover .stamp-lift { transform: translateY(-6px) rotate(-1deg); }
  .chapter.now:hover .stamp-lift { transform: translateY(-14px) rotate(-2deg); }
  .tree-card:hover .stamp-lift { transform: translateY(-6px) rotate(1deg); }
  .plan-stamp:hover .stamp-lift { transform: translateY(-3px) rotate(5deg); }
  /* reaching for Cleo's stamp lifts it off the envelope, out from under its cancellation */
  .env-stamp:hover .stamp-lift { transform: translate(-3px, -9px) rotate(-.5deg); }
  .env-stamp:hover .stamp-lift::before { opacity: 1; }
  .reg:hover { transform: translateY(-2px); }
  .seal-sheet:hover { transform: rotate(.2deg) translateY(-4px); }
}
.door:focus-visible .stamp-lift { transform: translateY(-6px) rotate(-1.2deg); }

/* today's door and the current chapter are already torn half out of the sheet */
.door.today { z-index: 3; }
.door.today .stamp-lift { transform: translateY(-10px) rotate(-1.8deg); filter: drop-shadow(0 18px 18px rgba(3, 9, 24, .55)); }

/* the mobile menu and the snowfall fade instead of snapping */
#snow, .scene-snow { transition: opacity .45s ease; }
html.no-snow #snow, html.no-snow .scene-snow { display: block; opacity: 0; }
.toast { transition: opacity .2s ease, transform .2s var(--ease); }
.toast.out { opacity: 0; transform: translateY(6px) scale(.98); }

@media (prefers-reduced-motion: no-preference) {
  /* arrival on the home page: the Cleo stamp lands, the cancellation hits it, the route slip slides out from under the flap */
  .env-stamp .stamp-lift { animation: stamp-land .52s var(--ease) .08s backwards; }
  .postmark.big { animation: cancel-hit .26s cubic-bezier(.2, 0, 0, 1) .5s both; }
  .slip { animation: slip-out .6s var(--ease) .28s both; }
  /* Santa's route draws itself, and each stop is postmarked as the line reaches it */
  .slip-stops::before { animation: route-across .9s var(--ease-in-out) .75s both; }
  .slip-stop .postmark { animation: cancel-hit .24s cubic-bezier(.2, 0, 0, 1) both; }
  .slip-stop:nth-child(1) .postmark { animation-delay: .72s; }
  .slip-stop:nth-child(2) .postmark { animation-delay: .94s; }
  .slip-stop:nth-child(3) .postmark { animation-delay: 1.16s; }
  .slip-stop:nth-child(4) .postmark { animation-delay: 1.38s; }
  .door.today .stamp-lift { animation: peel .6s var(--ease) .25s backwards; }
  #nav-toggle:checked ~ .nav { animation: nav-drop .2s var(--ease); }

  /* below the fold: postmarks are stamped when they come into view (app.js adds .in) */
  html.motion [data-reveal]:not(.in) .postmark, html.motion [data-reveal]:not(.in) > .reveal { opacity: 0; }
  html.motion [data-reveal].in .postmark { animation: cancel-hit .26s cubic-bezier(.2, 0, 0, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
  html.motion [data-reveal].in > .reveal { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
  html.motion .chapters[data-reveal]:not(.in) .chapter.now .stamp-lift { transform: none; filter: drop-shadow(0 10px 12px rgba(3, 9, 24, .38)); }
  html.motion .chapters[data-reveal].in .chapter.now .stamp-lift { animation: peel-chapter .6s var(--ease) .35s backwards; }
  html.motion .chapters[data-reveal].in .ch-now { animation: cancel-hit .26s cubic-bezier(.2, 0, 0, 1) .8s both; }
}
@keyframes stamp-land { from { opacity: 0; transform: translate(14px, -18px) rotate(10deg) scale(1.08); } to { opacity: 1; transform: rotate(2.5deg); } }
@keyframes cancel-hit { from { opacity: 0; transform: rotate(var(--tilt, -8deg)) scale(1.28); } to { opacity: 1; transform: rotate(var(--tilt, -8deg)) scale(1); } }
@keyframes slip-out { from { transform: translateY(-40px); } to { transform: none; } }
@keyframes route-across { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes route-down { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes peel { from { transform: none; filter: drop-shadow(0 10px 12px rgba(3, 9, 24, .38)); } to { transform: translateY(-10px) rotate(-1.8deg); filter: drop-shadow(0 18px 18px rgba(3, 9, 24, .55)); } }
@keyframes peel-chapter { from { transform: none; } to { transform: translateY(-12px) rotate(-1.6deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nav-drop { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .slip-stops::before { animation-name: route-down; }
}


/* ==================================================================== touch */
/* Phones and tablets: every control is a 44px target, inputs never trigger the iOS zoom,
   controls neither flash nor select on long-press, and nothing hides under the notch. */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, select, input, textarea, [role="button"], .cd-chip, .cd-pal { touch-action: manipulation; }
button, .btn, .reg, .nav a, .tabs a, .side a, .chip, .badge, .cd-chip, .cd-pal, .snow-toggle, .user-chip, .burger, .menu-pop a, .menu-pop button, .switch, .stop-pill, .postmark, summary {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* safe areas (viewport-fit=cover): pad content away from the notch and the home indicator */
.topbar { padding-left: max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-left)); padding-right: max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-right)); }
.page { width: min(1160px, 100% - 2.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
.footer { padding-bottom: calc(1.7rem + env(safe-area-inset-bottom, 0px)); padding-left: max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-left)); padding-right: max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-right)); }
.toasts { right: calc(1.2rem + env(safe-area-inset-right, 0px)); bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); }
body.in-app .main { padding-bottom: calc(clamp(1.4rem, 3vw, 2.4rem) + env(safe-area-inset-bottom, 0px)); }

/* inner scrollers keep their own bounce and never drag the page with them */
.side, .tabs, .table-wrap, .chat, .menu-pop, .nav { overscroll-behavior: contain; }
.table-wrap { -webkit-overflow-scrolling: touch; }

/* press feedback for things that are not .btn (those already scale on :active) */
.nav a:active, .side a:active, .tabs a:active { background: var(--surface-2); }
.menu-pop a:active, .menu-pop button:active { background: var(--paper-2); }
a.card:active, .tree-card:active .stamp-lift, .reg:active { transform: scale(.98); }
.footer a:active, .crumbs a:active, .env-link:active, .slip-head a:active { opacity: .7; }

@media (pointer: coarse) {
  /* 44px minimum for everything you tap */
  .btn, .btn.small, .btn.tiny { min-height: 44px; }
  .btn.small, .btn.tiny { padding-left: .95rem; padding-right: .95rem; }
  .top-right > .btn, .user-chip, .snow-toggle { height: 44px; min-width: 44px; }
  .burger { width: 44px; height: 44px; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select { min-height: 44px; }
  input[type=range] { height: 44px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .items-table input:not([type=checkbox]), .items-table select { font-size: 16px; min-height: 40px; }
  .switch { min-height: 44px; }
  .toggle { min-height: 48px; }
  .menu-pop a, .menu-pop button { min-height: 48px; }
  .tabs a, .side a { min-height: 44px; display: inline-flex; align-items: center; }
  .cd-chip, .cd-pal { min-height: 44px; min-width: 44px; justify-content: center; padding-left: .8rem; padding-right: .8rem; }
  input.mono { font-size: 16px; }
  .cd-x { position: relative; min-width: 24px; min-height: 24px; }
  .cd-x::after { content: ""; position: absolute; inset: -10px -8px; }
  .stop { min-height: 48px; }
  .register .who, .plain .who { min-height: 44px; }
  .footer-links { gap: 0 .4rem; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4rem; }
  /* small text links grow their hit area without moving the layout */
  .env-link, .slip-head a, .crumbs a, button.link { padding-top: .8rem; padding-bottom: .8rem; margin-top: -.8rem; margin-bottom: -.8rem; }
  .brand { min-height: 44px; }
}

@media (max-width: 1000px) {
  .nav { max-height: calc(100dvh - 64px); overflow-y: auto; padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)); }
  .nav a { min-height: 48px; display: flex; align-items: center; }
}
@media (max-width: 980px) {
  /* the app sidebar becomes one swipeable strip of tabs */
  .side { scroll-snap-type: x proximity; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent); mask: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent); padding-right: 2.5rem; }
  .side::-webkit-scrollbar { display: none; }
  .side a { scroll-snap-align: start; flex-shrink: 0; }
}
@media (max-width: 760px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; margin-right: -1rem; padding-right: 1rem; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex-shrink: 0; scroll-snap-align: start; white-space: nowrap; }
  .table th, .table td { white-space: nowrap; }
  .items-table input:not(.xs):not([type=checkbox]) { min-width: 11rem; }
  .items-table select { min-width: 8rem; }
  .table td.wrap, .table td .wrap { white-space: normal; }
  .cd-day { flex-wrap: wrap; }
  .cd-day input { flex: 1 1 140px; width: auto; }
  .row-form > .btn, .row-form > button { flex: 1 1 auto; }
  .actions > .btn { flex: 1 1 auto; }
  .card-head .btn { flex-shrink: 0; }
}
@media (max-width: 640px) {
  .toasts { left: calc(1rem + env(safe-area-inset-left, 0px)); right: calc(1rem + env(safe-area-inset-right, 0px)); align-items: stretch; }
  .toast { justify-content: center; }
  .main-head { align-items: flex-start; }
  .main-head .save-state { order: -1; }
}
.nav a.nav-small-only { display: none; }
@media (max-width: 520px) {
  /* a crowded topbar sheds Dashboard into the menu and shows the account as an avatar */
  .top-dash { display: none !important; }
  .nav a.nav-small-only { display: flex; gap: .5rem; }
  .user-chip { padding: 0 !important; justify-content: center; width: 44px; border-radius: 50%; }
  .user-chip > .i { display: none; }
  .user-chip .av { width: 34px; height: 34px; }
  /* the main action sits under the thumb, full width */
  .env-actions { flex-direction: column; align-items: stretch; gap: .4rem; }
  .register .dim.small { display: none; }
  .counts-row.left { gap: .6rem; justify-content: space-between; }
  .counts-row.left .postmark { width: 6.1rem; }
  .counts-row.left .postmark b { font-size: 1.4rem; }
  .env-actions .reg, .close .reg { width: 100%; }
  .env-link { justify-content: center; min-height: 44px; margin: 0; padding: 0; }
  .reg > span { flex: 1; }
  .pc-address .btn, .split-text .btn, .band-foot .btn { width: 100%; }
  .plan .pay-option .btn { width: 100%; }
}
