/* Dane Grey Christmas — styles.
   Colors are CSS variables injected per season from src/theme (see README).
   Type: Schibsted Grotesk for reading; IBM Plex Mono for labels & data. */

@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  --sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 2px 4px rgba(0, 0, 0, .06), 0 30px 60px -28px rgba(0, 0, 0, .55);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
  /* Space to keep clear at the top of the screen (see "Safe areas" below). */
  --top-clear: env(safe-area-inset-top);
  --airmail: repeating-linear-gradient(135deg, var(--accent) 0 14px, var(--paper) 14px 24px, var(--pine) 24px 38px, var(--paper) 38px 48px);
}

/* ---- Safe areas ----------------------------------------------------------
   In an iPhone/iPad Home Screen web app, iOS 26 blurs roughly the top 40pt
   just below the status bar, and CSS can't turn that off. So everything at
   the top of the screen starts below --top-clear. The extra 2.5rem only
   applies to an installed app on iOS/iPadOS; browser tabs, desktop and
   Android just use the safe-area inset (usually 0). */
@media (display-mode: standalone) {
  @supports (-webkit-touch-callout: none) {
    :root { --top-clear: calc(env(safe-area-inset-top) + 2.5rem); }
  }
}
.pt-safe { padding-top: var(--top-clear); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom); }
.safe-x { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }
html:has(body.is-admin) { background: var(--admin-bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; position: relative; overflow-x: hidden;
  font-family: var(--sans); font-size: 16px; line-height: 1.55; font-weight: 400;
  color: var(--on-night); background-color: var(--night);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* Background glow on its own fixed layer (iOS ignores background-attachment: fixed). */
body.is-public::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 680px at 12% -8%, var(--night-soft), transparent 62%),
    radial-gradient(900px 620px at 108% 108%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: .88em; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: .1em .4em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--paper-edge); margin: 8px 0; width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 80%, transparent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---- Type --------------------------------------------------------------- */

.label {
  font-family: var(--mono); font-size: 12px; font-weight: 400; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .12em;
}
.data { font-family: var(--mono); letter-spacing: .02em; }
.display {
  margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.02;
  font-size: clamp(2.6rem, 5.6vw, 4.6rem); text-wrap: balance;
}
.display-sm { font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.06; }
.title { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.lede { margin: 0; font-size: 1.125rem; line-height: 1.55; text-wrap: pretty; }
.muted { margin: 0; color: var(--ink-soft); }
.is-public .hero-copy .lede, .is-public .account-head .lede { color: var(--on-night-soft); }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.error { margin: 6px 0 0; font-size: 14px; color: var(--danger); font-weight: 500; }
.fineprint { margin: 0; font-size: 13px; color: var(--ink-soft); text-align: center; }
.optional { color: var(--ink-soft); opacity: .75; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; }

/* ---- Layout ------------------------------------------------------------- */

.page { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page-wide { max-width: 1280px; }
main { flex: 1; padding: clamp(12px, 3vw, 28px) 0 72px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; align-items: center; }
.narrow { max-width: 520px; margin: clamp(8px, 5vh, 48px) auto 0; }
.narrow.wide-ish { max-width: 760px; }
.inline-actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.center .inline-actions { justify-content: center; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.row-3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.row-3 .field-city { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-3 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .9fr); }
  .row-3 .field-city { grid-column: auto; }
}

/* ---- Header / footer ---------------------------------------------------- */

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(22px + var(--top-clear)) 0 22px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-family { font-weight: 700; letter-spacing: -0.025em; font-size: 17px; line-height: 1.1; }
.brand .label { color: var(--on-night-soft); }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding: 22px 0 calc(30px + env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in srgb, var(--on-night) 14%, transparent); color: var(--on-night-soft); }

/* Postage stamp: perforated paper edge around a colored block */
.stamp, .envelope-stamp {
  display: inline-block; padding: 4px; flex: none;
  background: radial-gradient(circle at 4px 4px, transparent 2.2px, var(--paper) 2.7px) -4px -4px / 8px 8px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25));
  transform: rotate(-4deg);
}
.stamp-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 40px; height: 48px; border-radius: 2px;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--paper) 55%, transparent);
  color: var(--paper);
}
.stamp-inner .tree { width: 18px; height: 22px; fill: var(--paper); }
.stamp-year { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; line-height: 1; }

/* ---- Decorations -------------------------------------------------------- */

.snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.decor .motif { position: absolute; width: clamp(150px, 22vw, 290px); opacity: .95; }
.decor-tl { top: -46px; left: -54px; transform: rotate(8deg); }
.decor-br { right: -60px; bottom: -40px; transform: rotate(188deg); }
@media (max-width: 720px) {
  .decor .motif { width: 130px; opacity: .55; }
  .decor-br { display: none; }
}
.motif-pine .n1 { stroke: var(--pine); stroke-width: 3.4; }
.motif-pine .n2 { stroke: var(--pine-deep); stroke-width: 3.4; }
.motif-pine .stem { stroke: #6e4b2c; stroke-width: 4.5; fill: none; }
.motif-pine .berry, .motif-ornament .ball { fill: var(--accent); }
.motif-pine .shine, .motif-ornament .shine { fill: rgba(255, 255, 255, .55); }
.motif-ornament .band, .motif-ornament .cap { fill: var(--gold); }
.motif-ornament .string { stroke: var(--gold); stroke-width: 2; }
.motif-star .star { fill: var(--gold); }

/* ---- Panels -------------------------------------------------------------- */

.panel {
  position: relative; background: var(--paper); color: var(--ink);
  border-radius: var(--radius); padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow);
}
.panel-tight { padding: clamp(18px, 3vw, 24px); }
.panel-flush { padding: 0; overflow: hidden; }
.panel-airmail { overflow: hidden; padding-top: calc(clamp(22px, 4vw, 36px) + 8px); }
.panel-airmail::before { content: ''; position: absolute; inset: 0 0 auto; height: 8px; background: var(--airmail); }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---- Flash --------------------------------------------------------------- */

.flash { margin: 0 0 20px; padding: 12px 16px; border-radius: 12px; font-weight: 500; font-size: 15px; background: var(--paper); color: var(--ink); border-left: 4px solid var(--gold); box-shadow: var(--shadow); }
.flash-success { border-left-color: var(--success); }
.flash-error { border-left-color: var(--danger); }
.panel .flash { box-shadow: none; background: color-mix(in srgb, var(--success) 10%, var(--paper)); margin: 0; }

/* ---- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent;
  font: 700 15px/1 var(--sans); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: color-mix(in srgb, currentColor 9%, transparent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--accent-deep); }
.btn-lg { min-height: 54px; font-size: 17px; padding: 0 26px; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.is-public .site-header .btn-ghost { color: var(--on-night); border-color: color-mix(in srgb, var(--on-night) 30%, transparent); }

.key-icon { width: 18px; height: 18px; flex: none; background: currentColor; display: inline-block;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.5'/%3E%3Cpath d='M10.7 12.3 20 3M16 7l3 3M14 9l2 2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.5'/%3E%3Cpath d='M10.7 12.3 20 3M16 7l3 3M14 9l2 2'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---- Forms --------------------------------------------------------------- */

fieldset.group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
fieldset.group > legend { padding: 0; margin: 0 0 14px; color: var(--accent); display: flex; align-items: center; gap: 10px; width: 100%; }
fieldset.group > legend::after { content: ''; flex: 1; height: 1px; background: var(--paper-edge); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.field > .label { color: var(--ink-soft); }
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--paper-edge); background: #fff; color: var(--ink);
  font: 400 16px/1.3 var(--sans); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { padding: 12px 14px; min-height: 90px; resize: vertical; line-height: 1.5; }
select {
  padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23555' stroke-width='1.6'/%3E%3C/svg%3E") right 12px center / 12px no-repeat;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--paper-edge)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.has-error input, .has-error select, input.has-error { border-color: var(--danger); }
input[type="datetime-local"] { font-family: var(--mono); font-size: 14px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { text-align: center; }

.code-input {
  width: 220px !important; height: 76px; text-align: center; margin: 0 auto;
  font: 500 34px/1 var(--mono) !important; letter-spacing: .5em; padding-left: .5em !important;
}
.code-input-sm { width: 120px !important; height: 44px; min-height: 44px !important; font-size: 18px !important; letter-spacing: .3em; margin: 0; }
.code-form { width: 100%; align-items: center; }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input { flex: 1 1 200px; width: auto; }

/* Segmented radio control */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); align-self: flex-start; }
.segment { position: relative; cursor: pointer; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment span { display: block; padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--ink-soft); transition: background .15s, color .15s; }
.segment input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.segment input:focus-visible + span { box-shadow: var(--ring); }
.segment input:disabled + span { opacity: .45; cursor: not-allowed; }

/* Address suggestions */
.address-search { position: relative; }
.suggestions { position: absolute; z-index: 20; top: calc(100% - 24px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 12px; border: 1px solid var(--paper-edge); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .35); }
.suggestions li { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: color-mix(in srgb, var(--accent) 8%, #fff); }
.suggestions .main { font-weight: 500; }
.suggestions .secondary { font-size: 13px; color: var(--ink-soft); }
.suggestions .powered { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 12px 2px; cursor: default; }

/* ---- Pills --------------------------------------------------------------- */

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; line-height: 1;
  background: var(--paper-edge); color: var(--ink); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill-success { background: color-mix(in srgb, var(--success) 16%, var(--paper)); color: var(--pine-deep); }
.pill-muted { background: color-mix(in srgb, var(--ink) 8%, var(--paper)); color: var(--ink-soft); }
.pill-warn { background: color-mix(in srgb, var(--gold) 28%, var(--paper)); color: #6b5212; }
.pill-danger { background: color-mix(in srgb, var(--danger) 14%, var(--paper)); color: var(--accent-deep); }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow-pill { display: inline-flex; align-self: flex-start; margin: 0; padding: 7px 12px; border-radius: 999px; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.panel .eyebrow-pill { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ---- Home --------------------------------------------------------------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-top: clamp(8px, 3vw, 32px); }
@media (min-width: 980px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(440px, 520px); } .hero-copy { position: sticky; top: calc(40px + var(--top-clear)); } }
.hero-copy { display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.hero-copy .display { max-width: 12ch; }
.hero-copy .lede { max-width: 46ch; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; max-width: 460px; }
.steps li { display: flex; align-items: baseline; gap: 16px; padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--on-night) 14%, transparent); font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.steps li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--on-night) 14%, transparent); }
.steps .label { color: var(--gold); }
.closes { color: var(--on-night-soft); margin: 0; }
.panel .closes { color: var(--ink-soft); }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 26px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.tabs a { flex: 1; text-align: center; padding: 11px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-soft); transition: background .15s, color .15s; }
.tabs a[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 1px var(--paper-edge); }
.tab-panel form.stack { gap: 26px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 2px; color: var(--ink-soft); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--paper-edge); }

/* Closed / sealed */
.sealed { max-width: 620px; margin: clamp(32px, 9vh, 96px) auto 0; }
.sealed-card { text-align: center; align-items: center; display: flex; flex-direction: column; gap: 18px; padding-top: 70px; overflow: visible; }
.sealed-card::before { border-radius: var(--radius) var(--radius) 0 0; }
.sealed-card .eyebrow-pill { align-self: center; }
.seal {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%) rotate(-8deg);
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent) 45%, var(--accent-deep));
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .55), inset 0 0 0 5px color-mix(in srgb, var(--accent-deep) 70%, transparent);
}
.seal span { font-weight: 700; font-size: 28px; letter-spacing: -0.025em; color: color-mix(in srgb, var(--paper) 88%, var(--accent)); }

.mail-icon { width: 76px; height: 56px; background: var(--accent); border-radius: 8px; position: relative; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .5); }
.mail-icon::before { content: ''; position: absolute; inset: 0; border-radius: 8px;
  background: linear-gradient(to bottom right, transparent 49%, var(--accent-deep) 50%, transparent 52%), linear-gradient(to bottom left, transparent 49%, var(--accent-deep) 50%, transparent 52%);
  background-size: 50% 100%; background-repeat: no-repeat; background-position: left top, right top; clip-path: polygon(0 0, 100% 0, 50% 62%); }

.choice-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) { .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choice { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 14px; border: 1.5px solid var(--paper-edge); background: #fff; }
.choice .label { color: var(--accent); }
.choice > :last-child { margin-top: auto; }

/* ---- Envelope (label preview) ----------------------------------------- */

.envelope {
  position: relative; margin: 0; aspect-ratio: 1.62; min-height: 220px; display: grid; place-items: center; padding: 28px;
  border: 9px solid transparent; border-radius: 14px; color: var(--ink);
  background: linear-gradient(170deg, #fffdf8, var(--paper)) padding-box, var(--airmail) border-box;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.envelope-stamp { position: absolute; top: 14px; right: 14px; transform: rotate(5deg); }
.envelope-stamp .stamp-inner { width: 50px; height: 60px; }
.envelope-stamp .tree { width: 24px; height: 28px; }
.postmark { position: absolute; top: 26px; right: 82px; padding: 10px 12px; border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 999px; color: color-mix(in srgb, var(--accent) 75%, transparent); transform: rotate(-12deg); font-size: 10px; }
.mailing-label { display: flex; flex-direction: column; font-size: clamp(16px, 2.2vw, 19px); line-height: 1.45; padding-top: 18px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
/* Narrow screens: no fixed shape; text starts below the stamp, postmark moves to the bottom. */
@media (max-width: 559px) {
  .envelope { aspect-ratio: auto; min-height: 0; place-items: start; padding: 84px 20px 22px; }
  .envelope:has(.postmark) { padding-bottom: 64px; }
  .mailing-label { padding-top: 0; font-size: 17px; }
  .postmark { top: auto; right: auto; bottom: 16px; left: 18px; transform: rotate(-6deg); }
}
.mailing-label strong { font-weight: 700; letter-spacing: -0.025em; font-size: 1.1em; }

/* In-page jump targets clear the top strip. */
[id] { scroll-margin-top: calc(16px + var(--top-clear)); }

.bell-icon { width: 18px; height: 18px; flex: none; display: inline-block; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E") center / contain no-repeat; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.btn-danger-text { color: var(--danger); }

/* ---- Account ------------------------------------------------------------- */

.account-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 920px) { .account-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } }
.kv { display: grid; gap: 10px; margin-bottom: 18px; }
.kv > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.kv .label { color: var(--ink-soft); }
.kv > div > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.passkey-list { list-style: none; margin: 0; padding: 0; }
.passkey-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--paper-edge); }
.passkey-list .key-icon { color: var(--accent); }
.passkey-name { flex: 1; display: flex; flex-direction: column; gap: 2px; font-weight: 500; }
.passkey-name .label { color: var(--ink-soft); font-size: 11px; }
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; color: var(--on-night-soft); }
.is-admin .back { color: var(--ink-soft); }

/* ---- Admin ---------------------------------------------------------------- */

body.is-admin { background: var(--admin-bg); color: var(--ink); }
.is-admin .site-header { border-bottom: 1px solid var(--paper-edge); }
.is-admin .brand .label { color: var(--ink-soft); }
.is-admin .site-footer { color: var(--ink-soft); border-top-color: var(--paper-edge); }
.is-admin .panel { box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 0 0 1px var(--paper-edge); }
.is-admin .lede { color: var(--ink-soft); }
.is-admin .narrow { margin-top: clamp(24px, 8vh, 80px); }
.admin-nav { display: flex; gap: 4px; margin: 0 0 28px; overflow-x: auto; border-bottom: 1px solid var(--paper-edge); scrollbar-width: none; }
.admin-nav a { padding: 12px 16px; text-decoration: none; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.admin-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.admin-nav a:hover { color: var(--ink); }
.year-select { display: flex; align-items: center; gap: 8px; }
.year-select select { min-height: 36px; width: auto; font-family: var(--mono); font-size: 14px; }
.admin-section { gap: 24px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-head .label { color: var(--accent); margin: 0 0 6px; }

.start-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: var(--night); color: var(--on-night); overflow: hidden; }
.start-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: var(--airmail); }
.start-card .muted { color: var(--on-night-soft); max-width: 56ch; margin-top: 8px; }
.start-card .label { color: var(--gold); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--paper); border-radius: 14px; padding: 18px 20px; box-shadow: 0 0 0 1px var(--paper-edge); display: flex; flex-direction: column; gap: 10px; }
.stat .label { color: var(--ink-soft); }
.stat-value { font-weight: 700; font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-success .stat-value { color: var(--pine); }
.substats { color: var(--ink-soft); margin: -8px 0 0; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.timeline { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; padding: 0 0 22px; position: relative; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--paper-edge); }
.step:last-child::before { display: none; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--paper-edge); background: #fff; margin-top: 1px; }
.step.done .step-dot { background: var(--pine); border-color: var(--pine); box-shadow: inset 0 0 0 4px #fff; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--paper-edge); }
.activity li a { font-weight: 500; text-decoration: none; }
.activity li .label { color: var(--ink-soft); margin-left: auto; }

.search { display: flex; gap: 8px; }
.search input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--paper); box-shadow: 0 0 0 1px var(--paper-edge); text-decoration: none; font-size: 14px; font-weight: 500; }
.chip .label { color: var(--ink-soft); font-size: 11px; }
.chip[aria-current="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip[aria-current="true"] .label { color: color-mix(in srgb, var(--paper) 70%, transparent); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); padding: 14px 16px; border-bottom: 1px solid var(--paper-edge); background: color-mix(in srgb, var(--paper-edge) 35%, var(--paper)); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--paper-edge); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 3%, var(--paper)); }
.table .sub { display: block; font-size: 13px; color: var(--ink-soft); }
.table .right { text-align: right; }
.row-link { text-decoration: none; }
.empty { padding: 32px; text-align: center; }

.member-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1040px) { .member-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); } }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 12px 0; border-top: 1px solid var(--paper-edge); }
.history-label { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }
.danger-zone .title { color: var(--danger); }
.recovery summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; }
.recovery summary::-webkit-details-marker { display: none; }
.recovery summary .label { color: var(--ink-soft); }

.label-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.mini-label { aspect-ratio: 2.625; display: flex; flex-direction: column; justify-content: center; padding: 8px 14px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--paper-edge); font-size: 12.5px; line-height: 1.35; overflow: hidden; }
.mini-label strong { font-weight: 700; letter-spacing: -0.02em; }
.mini-label span, .mini-label strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 560px) {
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .search { flex-direction: column; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .snow { display: none; }
}
.center .envelope { align-self: stretch; }
@media (max-width: 559px) {
  .admin-nav { gap: 0; }
  .admin-nav a { flex: 1 1 auto; text-align: center; padding: 12px 4px; font-size: 14.5px; }
}
@media (max-width: 359px) {
  .admin-nav a { font-size: 13.5px; padding: 12px 2px; }
}

.activity-log { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.activity-log li { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-top: 1px solid var(--paper-edge); font-size: 14px; }
.activity-log li:first-child { border-top: 0; }
.activity-log .label { color: var(--ink-soft); font-size: 11px; }
.activity-log .panel-row .label { white-space: nowrap; }
.narrow-panel { max-width: 640px; }
input[type="file"] { padding: 10px 12px; min-height: 48px; font-size: 14px; }
.self-start { align-self: flex-start; }
/* Phones: admin tabs become wrapping pills so all five always fit. */
@media (max-width: 479px) {
  .admin-nav { flex-wrap: wrap; gap: 6px; overflow: visible; border-bottom: 0; }
  .admin-nav a, .admin-nav a[aria-current="page"] {
    flex: 1 1 auto; margin: 0; padding: 9px 12px; font-size: 14px; border-radius: 999px;
    background: var(--paper); border: 1px solid var(--paper-edge); font-weight: 500;
  }
  .admin-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
}
