/* The elf pages (#570). site/styles.css is shared and frozen, so everything the elf pages add
   lives here, on top of the guides' own classes, using the site's colour tokens. */

.elf-page {
  --elf-sheet: #fffdf7;
  --elf-edge: #ded8c9;
  --elf-layer: #eee9dc;
  --elf-shadow: 0 2px 0 var(--elf-layer), 0 4px 8px rgb(27 35 64 / 4%);
  padding-bottom: 8px;
}
/* The planner's controls carry the hidden attribute until the script runs; a class's display must not undo it. */
.elf-page [hidden] { display: none !important; }
.elf-garland { display: block; height: clamp(64px, 10vw, 144px); overflow: hidden; }
.elf-garland img { display: block; width: 100%; height: 100%; object-fit: cover; }
.elf-page .page-head { padding-top: 24px; }

/* Hero on /elf: the words, then the elf. */
.elf-hero { max-width: none; display: grid; gap: 24px; align-items: center; }
.elf-hero-art { display: block; width: 100%; max-width: 240px; height: auto; margin: 0 auto; }
.elf-hero-text { min-width: 0; }
@media (max-width: 640px) {
  .elf-page .elf-hero { padding-top: 20px; gap: 20px; }
  .elf-hero .eyebrow { margin-bottom: 12px; }
  .elf-hero .h1-inner { font-size: 32px; line-height: 1.1; margin-bottom: 14px; }
  .elf-hero .elf-answer { font-size: 16px; line-height: 1.5; }
}
@media (min-width: 841px) { .elf-hero-art { max-width: 420px; } }
@media (min-width: 841px) {
  .elf-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; }
}
.elf-device-note { margin-top: 14px; font: 600 15px/1.5 var(--text); color: var(--green-deep); }
/* Six separate buttons: quiet outlines for quick help, then one clear planner primary (#570). */
.elf-hero .cta-row { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.elf-hero .cta-row .button-primary, .elf-hero .cta-row .elf-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 20px;
  border-radius: 10px; font: 600 15px/1.2 var(--text); text-decoration: none; text-align: center;
  box-shadow: none;
}
.elf-hero .cta-row .elf-link { border: 1px solid var(--indigo); background: transparent; color: var(--indigo-ink); }
.elf-hero .cta-row .elf-link:hover { background: var(--indigo-tint); }
@media (max-width: 640px) {
  .elf-hero .cta-row { align-items: stretch; }
  .elf-hero .cta-row :is(.button-primary, .elf-link) { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
}
.elf-link { display: inline-flex; align-items: center; min-height: 44px; font: 600 15px var(--text); color: var(--indigo); text-underline-offset: 3px; }

/* Quiet sheets of stationery. Pictures and date slips carry the colour, not side bars. */
.elf-card { background: var(--elf-sheet); border: 1px solid var(--elf-edge); border-radius: 12px 16px 14px 10px; padding: 24px; margin-bottom: 40px; }
.elf-card h2 { margin-top: 0; }
.elf-tonight { padding: 24px; box-shadow: 0 4px 0 var(--elf-layer); }
.elf-tonight h2 { font: 700 22px/1.25 var(--display); color: var(--green-deep); margin-bottom: 16px; }
#elf-tonight-text { display: grid; gap: 20px 28px; align-items: center; }
.elf-tonight-copy { min-width: 0; }
.elf-tonight .elf-idea-art { max-width: 280px; margin: 0; border-radius: 8px 10px 6px 4px; }
@media (min-width: 641px) {
  #elf-tonight-text:has(.elf-idea-art) { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); }
}
.elf-tonight-lead { font: 400 16px/1.6 var(--text); color: var(--body); }
.elf-page .elf-tonight-title { font: 700 22px/1.35 var(--display); margin: 8px 0 12px; }
.elf-tonight-title a { display: inline-block; min-height: 44px; padding-block: 6px; color: var(--ink); text-underline-offset: 4px; }
.elf-progress-row { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--elf-edge); }
.elf-progress-row p { font: 600 14px var(--text); color: var(--ink); margin-bottom: 6px; }
#elf-progress { width: 100%; max-width: 420px; height: 8px; accent-color: var(--green-deep); }

/* The card at the very top of /elf (27 Nov 2026): the idea, then one App Store button, then the five
   more. On a 375 by 548 phone screen (an iPhone SE inside Facebook's browser) the button sits wholly on
   the first screen for every idea: the picture shrinks with a short screen (svh) and keeps its width on
   a tall one. tests/e2e/elf-tonight.spec.ts measures it. */
.elf-page > .elf-tonight:first-child { margin-top: 16px; }
.elf-tonight-how { margin: 0 0 16px; font: 400 15px/1.5 var(--text); color: var(--body); }
.elf-tonight-actions { margin: 0 0 12px; }
/* The prompt in the app block's words (content.IDEA_APP, 4 Dec): its heading as the blocks have it, then
   the button with the "Free on iPhone" label beside it, then the line under them. */
.elf-page .elf-tonight-app-title { margin: 0 0 8px; font: 700 16px/1.35 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.elf-tonight-app { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; }
.elf-tonight-app .elf-chip { align-self: center; }
.elf-tonight-app .button-primary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; max-width: 100%;
  padding: 12px 22px; text-align: center; text-wrap: balance;
}
.elf-week { margin-top: 4px; }
.elf-week > summary .elf-more-label { font-size: 15px; }
.elf-week-list { list-style: none; margin: 0 0 4px; padding: 0; }
.elf-week-list a {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 500 15px/1.35 var(--text); color: var(--indigo-ink); text-underline-offset: 3px;
}
.elf-tonight-about { margin: 8px 0 0; font: 400 13px/1.5 var(--text); color: var(--caption); }
.elf-page .elf-tonight-actions > .elf-brand-note { margin-top: 4px; }
/* The page is built before December. In December, or with ?idea=, planner.js draws another idea into
   the card, so until it has (.is-drawn) the idea stays unseen rather than show the wrong one; its
   space is kept, and the button shows. Without the script nothing is hidden, and if the script never
   runs the page's own idea shows after 3 seconds. */
@media (scripting: enabled) {
  .elf-tonight:not(.is-drawn) :is(#tonight-title, #elf-tonight-text > .elf-idea-art, .elf-tonight-title, .elf-tonight-how, .elf-tonight-lead, .elf-need) {
    visibility: hidden; animation: elf-tonight-show 0s 3s forwards;
  }
}
@keyframes elf-tonight-show { to { visibility: visible; } }
@media (min-width: 641px) { #elf-tonight-text { align-items: start; } }
@media (max-width: 640px) {
  .elf-page > .elf-tonight:first-child { margin-top: 4px; margin-bottom: 32px; }
  .elf-page .elf-tonight { padding: 16px 16px 18px; }
  .elf-tonight h2 { font-size: 19px; margin-bottom: 10px; }
  #elf-tonight-text { gap: 12px; }
  /* 34 and 23 (38 and 26 until 4 Dec): the app block's heading above the button took 28px. */
  .elf-tonight .elf-idea-art { max-width: min(280px, 34vh); max-width: min(280px, 34svh); }
  /* One idea's how-to runs to five lines (more than LONG_HOW in planner.js): a smaller picture. */
  .elf-tonight.is-long .elf-idea-art { max-width: min(280px, 23vh); max-width: min(280px, 23svh); }
  .elf-page .elf-tonight-title { font-size: 20px; margin: 0 0 2px; }
  .elf-tonight-how { margin-bottom: 12px; }
  .elf-page .elf-tonight-app-title { margin-bottom: 6px; }
  /* The button fills the row, so the label sits centred under it. */
  .elf-tonight-app { justify-content: center; }
  .elf-tonight-app .button-primary { display: flex; width: 100%; }
}
@media print {
  .elf-tonight-app-title, .elf-tonight-app, .elf-tonight-about, .elf-week { display: none !important; }
}

.elf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 7px 9px 8px 6px;
  max-width: 100%; border: 1px solid #747b90; background: var(--elf-sheet); color: var(--ink);
  font: 600 14px/1.2 var(--text); cursor: pointer; text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.elf-btn:hover { border-color: var(--indigo); background: var(--indigo-tint-2); }
.elf-btn:focus-visible, .elf-input:focus-visible, .elf-select:focus-visible,
.elf-file-input:focus-visible + label, .elf-page a:focus-visible,
.elf-field-check input:focus-visible, .elf-skipped summary:focus-visible {
  outline: 3px solid var(--indigo); outline-offset: 2px;
}
.elf-btn[aria-pressed="true"] { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.elf-btn[aria-pressed="true"]::before { content: "\2713"; }
.elf-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.elf-btn-primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.elf-btn-primary:hover { background: var(--indigo-hover); }
.elf-btn-alert { border-color: var(--red-ink); color: var(--red-ink); background: var(--red-tint); }
.elf-btn-alert:hover { border-color: var(--red-ink); background: #f6e1d9; }

.elf-field { min-width: 0; }
.elf-field label { display: block; font: 600 14px/1.4 var(--text); color: var(--ink); margin-bottom: 6px; }
.elf-input, .elf-select {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: 7px;
  border: 1px solid #747b90; background: #fff; color: var(--ink);
  font: 400 16px/1.3 var(--text);
}
.elf-hint, .elf-count { font: 400 14px/1.5 var(--text); color: var(--caption); }
.elf-nojs { font: 400 15px/1.6 var(--text); color: var(--body); margin-top: 8px; }
.elf-warning { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--red-tint); color: var(--red-ink); font: 500 15px/1.5 var(--text); }
.elf-warning[hidden] { display: none; }

/* The 24 nights */
.elf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 0 20px; }
.elf-nights, .elf-bank { list-style: none; padding: 0 !important; margin: 0; max-width: none !important; }
.elf-nights { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.elf-night, .elf-bank-item, .elf-idea {
  --elf-card-pad: 20px;
  min-width: 0; position: relative; padding: var(--elf-card-pad);
  display: flex; flex-direction: column; gap: 10px;
  background: var(--elf-sheet); border: 1px solid var(--elf-edge);
  border-radius: 12px 16px 10px 14px; box-shadow: var(--elf-shadow);
  overflow-wrap: anywhere;
}
/* Shared guide styles add space between list items; a grid already supplies its own gutters. */
.elf-page .elf-nights > li, .elf-page .elf-bank > li { margin: 0; }
.elf-night.is-kept { border-color: var(--indigo); }
.elf-night.is-done { background: #f0f5ee; border-color: #a6bdae; }
.elf-page .elf-night p, .elf-page .elf-bank-item p, .elf-page .elf-idea p { font-size: 15px; line-height: 1.6; margin: 0; }
.elf-page .elf-night-date { font: 400 13px/1.6 var(--text); color: var(--body); }
.elf-night-date strong {
  display: table; margin: 0 0 7px; padding: 5px 11px 6px 9px;
  background: var(--indigo-tint); color: var(--indigo-ink); font: 700 15px/1.4 var(--display);
  border-radius: 3px 1px 4px 2px;
  clip-path: polygon(0 2%, 94% 0, 100% 16%, 98% 100%, 2% 97%);
  transform: rotate(-1deg);
}
.elf-night[data-kind="weekend"] .elf-night-date strong { background: var(--amber-tint); color: var(--amber-ink); transform: rotate(1deg); }
.elf-night[data-kind="holiday"] .elf-night-date strong,
.elf-night.is-done .elf-night-date strong { background: var(--green-tint); color: var(--green-deep); }
.elf-night[data-kind="arrival"] .elf-night-date strong,
.elf-night[data-kind="goodbye"] .elf-night-date strong { background: var(--red-tint); color: var(--red-ink); }
.elf-page .elf-night-kind { font: 600 13px/1.4 var(--text); color: var(--green-deep); }
.elf-page .elf-night-title, .elf-page .elf-bank-title, .elf-page .elf-idea h3 { font: 700 20px/1.3 var(--display); letter-spacing: -0.02em; color: var(--ink); margin: 0; }
.elf-night-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.elf-night-actions .elf-btn { flex: 1 1 auto; padding: 8px 10px; }
.elf-night-actions .elf-skip { flex-basis: 100%; }
.elf-page .elf-need { color: var(--body); }
.elf-need strong { color: var(--ink); }

/* The app block (Darren, 30 Nov): once near the top of a page, and at the foot of every 4th idea card.
   It sits inside the card, so the card grids keep their columns at every width. */
.elf-idea-app { display: grid; gap: 8px; min-width: 0; }
.elf-page .elf-idea-app-title { margin: 0; font: 700 16px/1.35 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.elf-page .elf-idea-app-line { margin: 0; font: 400 15px/1.6 var(--text); color: var(--body); }
.elf-page .elf-idea-app-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.elf-idea-app-action .elf-btn { text-decoration: none; }
.elf-idea-app-action .elf-chip { align-self: center; }
:is(.elf-night, .elf-idea) > .elf-idea-app { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--elf-edge); }
/* Cards in a row are as tall as the tallest: the block keeps to the foot of its card. */
.elf-idea > .elf-idea-app { margin-top: auto; }
.elf-idea-app-top { margin: 0 0 28px; }
.elf-page .elf-idea-app-top .elf-idea-app-title { font-size: 22px; line-height: 1.25; color: var(--green-deep); }

/* A 4:3 paper-cut scene sits inside a narrow paper mount. Keep HTML dimensions for stable loading. */
.elf-idea-art { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--cream); }
:is(.elf-night, .elf-bank-item, .elf-idea) > .elf-idea-art {
  width: calc(100% + 2 * var(--elf-card-pad) - 16px); max-width: none;
  margin: calc(8px - var(--elf-card-pad)) calc(8px - var(--elf-card-pad)) 6px;
  border-radius: 7px 10px 4px 5px;
}

/* Swipes stay inside the sheet of cards, including at 320px; the clip margin leaves focus visible. */
.elf-nights, .elf-bank { overflow: clip; overflow-clip-margin: 8px; }
.elf-swipeable { touch-action: pan-y; }
.elf-swipeable.is-swiping, .elf-swipeable.is-springing, .elf-swipeable.is-leaving { transform: translateX(var(--elf-swipe-x, 0px)); }
.elf-swipeable.is-swiping { z-index: 1; user-select: none; -webkit-user-select: none; border-color: var(--red-ink); background: #fff5ef; box-shadow: 0 4px 10px rgb(27 35 64 / 9%); }
.elf-swipeable.is-swiping .elf-skip { background: var(--red-tint); color: var(--red-ink); }
.elf-swipeable.is-springing { transition: transform 0.2s ease-out; }
.elf-swipeable.is-leaving { transition: transform 0.16s ease-in, opacity 0.16s ease-in; opacity: 0; }
.elf-skip { background: transparent; border-color: transparent; color: var(--body); text-decoration: underline; text-underline-offset: 3px; }
.elf-skip:hover { background: var(--red-tint); border-color: transparent; color: var(--red-ink); }
.elf-skip-actions { padding-top: 2px; border-top: 1px solid var(--elf-edge); }
.elf-undo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; background: var(--amber-tint); border-radius: 4px 8px 5px 3px; }
.elf-page .elf-undo-text { flex: 1 1 130px; color: var(--ink); font-size: 14px; }
.elf-undo-btn { flex: none; color: var(--indigo-ink); border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.elf-bank-skipped { justify-content: center; background: transparent; border-style: dashed; box-shadow: none; }
.elf-skipped { margin: 0 0 24px; border-block: 1px solid var(--elf-edge); }
.elf-skipped summary { min-height: 44px; padding: 12px 0; font: 600 16px/1.5 var(--text); color: var(--ink); cursor: pointer; }
.elf-page #elf-skipped-list { padding: 0; margin: 0 0 12px; list-style: none; }
.elf-page .elf-skipped-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; padding: 8px 0; border-top: 1px dashed var(--elf-edge); }
.elf-skipped-name { flex: 1 1 180px; min-width: 0; font-size: 15px; color: var(--body); overflow-wrap: anywhere; }
.elf-bring-back { background: transparent; }
.elf-skipped > .elf-btn { margin-bottom: 16px; }
.elf-page .elf-skip-reason, .elf-page .elf-skip-note { font-size: 13px; }

.elf-divider { border: 0; height: 8px; margin: 48px 0; background: url('/elf/art/divider-candy-cane.svg') repeat-x 0 0 / 32px 8px; }

/* Idea bank and idea lists */
.elf-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 16px 0 20px; }
.elf-filters .elf-field { flex: 1 1 180px; max-width: 260px; }
.elf-filters .elf-count { flex-basis: 100%; margin: 0; }
.elf-field-check { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.elf-field-check label { display: flex; align-items: center; min-height: 44px; margin: 0; cursor: pointer; }
.elf-field-check input { appearance: none; display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; margin: 0; cursor: pointer; }
.elf-field-check input::before { content: ''; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #747b90; border-radius: 4px; background: var(--elf-sheet); font: 700 17px/1 var(--text); }
.elf-field-check input:checked::before { content: '\2713'; background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.elf-bank { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.elf-bank-item > a { min-height: 44px; display: flex; align-items: center; font: 700 20px/1.3 var(--display); color: var(--ink); text-underline-offset: 3px; }
.elf-put { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 16px; }
.elf-put label { font: 600 14px var(--text); color: var(--ink); }
.elf-put .elf-select { min-width: 0; width: auto; flex: 1 1 120px; }
.elf-put .elf-btn { flex: 1 1 100%; color: var(--indigo-ink); background: var(--indigo-tint-2); }
.elf-put .elf-btn:hover { background: var(--indigo-tint); }
.elf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.elf-chip { align-self: flex-start; display: inline-block; color: var(--green-deep); font: 600 13px/1.5 var(--text); }
.elf-chip + .elf-chip { color: var(--body); }
.elf-chip-cheeky, .elf-chip + .elf-chip-cheeky { padding: 2px 7px; background: var(--red-tint); color: var(--red-ink); border-radius: 2px 4px 2px 3px; }

.elf-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 24px; margin-top: 20px; }
.elf-idea { scroll-margin-top: 96px; }
.elf-idea:target { box-shadow: 0 0 0 3px var(--indigo); }
.elf-cat-title { display: flex; align-items: center; gap: 12px; }
.elf-cat-icon { width: 44px; height: 44px; flex: none; }
.elf-jump ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 8px 0 24px; }
.elf-jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 6px 8px 5px 7px; border: 1px solid #747b90; background: var(--elf-sheet); color: var(--ink); font: 600 14px var(--text); text-decoration: none; }
.elf-jump a:hover { border-color: var(--indigo); }
.elf-plan-link { font: 400 16px/1.6 var(--text); color: var(--body); margin-bottom: 24px; max-width: 800px; }
.elf-safety { max-width: 800px; margin: 0 0 24px; padding: 14px 18px; border-radius: 14px; background: var(--amber-tint); border: 1px solid var(--amber-border); color: var(--ink); font: 400 15px/1.6 var(--text); }
.elf-steps li { margin-bottom: 8px; }
.elf-page .elf-times-note { font: 400 14px/1.5 var(--text); color: var(--caption); margin: -12px 0 20px; max-width: 800px; }

/* Shopping list, letters, excuses */
.elf-shop { display: grid; gap: 16px 32px; margin-top: 8px; }
@media (min-width: 641px) { .elf-shop { grid-template-columns: 1fr 1fr; } }
.elf-shop h3 { margin-top: 0 !important; }
.elf-shop ul { padding-left: 20px; }
.elf-shop-days { color: var(--caption); font-size: 14px; }
.elf-letter-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.elf-letter-card { background: var(--paper); border: 1px solid var(--border-strong); border-radius: 18px; padding: 18px; }
.elf-letter-card h3 { margin-top: 0 !important; }
.elf-letter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.elf-letter-actions span { display: inline-flex; gap: 8px; }
.elf-letter-art { display: block; width: 100%; max-width: 720px; height: auto; margin-bottom: 8px; }
.elf-letter { max-width: 640px; margin: 16px 0; padding: 24px 28px; background: #fff; border: 1px solid var(--border-strong); border-radius: 18px; }
.elf-page .elf-letter p { font: 400 18px/1.7 var(--text); color: var(--ink); }
.elf-letter p + p { margin-top: 14px; }
.elf-excuse-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.elf-page .elf-excuse { margin: 20px 0 12px; padding: 20px 22px; background: var(--elf-sheet); border: 1px solid var(--elf-edge); border-radius: 3px 10px 6px 3px; box-shadow: 0 3px 0 var(--elf-layer); }
.elf-page .elf-excuse p { margin: 0; }
.elf-page .elf-excuse p, .elf-page .elf-fix { font: 500 18px/1.6 var(--text); color: var(--ink); }
.elf-fix:empty, .elf-excuse p:empty { display: none; }
.elf-excuse:has(p:empty) { display: none; }
.elf-page .elf-excuses { list-style: none; padding: 0; }
.elf-page .elf-excuses li { margin: 0; padding: 16px 0; border-bottom: 1px dashed var(--elf-edge); }
.elf-fixes li { margin-bottom: 8px; }
.elf-backup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.elf-backup-actions p { flex-basis: 100%; margin: 4px 0 0; font: 500 15px var(--text); color: var(--ink); }

/* A larger folded sheet closes the page; the optional email form is a smaller paper insert. */
.elf-app { margin-top: 24px; }
.elf-cta {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px;
  padding: 28px; margin-bottom: 32px; background: #edf2ec; color: var(--ink);
  border: 1px solid #d2dfd6; border-radius: 10px 22px 12px 16px;
  box-shadow: 0 4px 0 #e0e8df;
}
.elf-cta-app, .elf-cta-signup { min-width: 0; }
.elf-cta .panel-title { margin: 0 0 12px; color: var(--ink); font-size: 26px; line-height: 1.25; }
.elf-cta .panel-body { margin: 0; color: var(--green-deep); font-size: 16px; line-height: 1.65; max-width: 560px; }
.elf-app-button { margin-top: 18px; }
.elf-cta .button-light { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; padding: 12px 18px; border: 1px solid var(--indigo); border-radius: 7px 10px 8px 6px; background: var(--indigo); color: #fff; white-space: normal; text-align: center; }
.elf-cta .button-light:hover { background: var(--indigo-hover); border-color: var(--indigo-hover); }
.elf-app-art {
  display: block; width: 100%; max-width: 360px; height: auto; justify-self: center;
  border: 6px solid var(--elf-sheet); border-radius: 8px 14px 7px 11px;
  box-shadow: var(--elf-shadow); transform: rotate(1deg);
}
.elf-cta-signup > .panel-body { padding-top: 20px; border-top: 1px solid #a8bdaf; }
.elf-signup { background: var(--elf-sheet); color: var(--ink); border: 1px solid var(--elf-edge); border-radius: 8px 12px 6px 10px; padding: 22px; box-shadow: var(--elf-shadow); }
.elf-signup-title { margin: 0 0 10px; font: 700 20px/1.3 var(--display); }
.elf-signup-intro { margin: 0; font: 400 15px/1.6 var(--text); color: var(--body); }
.elf-signup .elf-field, .elf-signup-consent { margin-top: 12px; }
.elf-signup-consent, .elf-signup-marketing { align-items: flex-start; }
.elf-signup-consent label, .elf-signup-marketing label { padding-block: 10px; font: 400 14px/1.6 var(--text); color: var(--ink); }
/* Tandlo news (24 Nov 11:28): its hint sits under its own words, in line with them. */
.elf-signup-marketing-hint { margin-top: 0; padding-left: 48px; }
.elf-signup-small { margin: 10px 0 16px; font-size: 13px; line-height: 1.6; color: var(--body); }
.elf-signup a { color: var(--indigo-ink); text-underline-offset: 3px; }
.elf-signup .elf-btn-primary { width: 100%; }
.elf-signup-message { margin: 12px 0 0; font: 600 15px/1.6 var(--text); color: var(--green-deep); overflow-wrap: anywhere; }
.elf-signup-message:empty { display: none; }
.elf-signup [aria-invalid="true"] { border-color: var(--red-ink); outline: 2px solid var(--red-ink); outline-offset: 2px; }
@media (min-width: 761px) {
  .elf-cta { grid-template-columns: minmax(0, 1fr) minmax(240px, 36%); align-items: center; padding: 36px; gap: 32px; }
  .elf-cta:has(.elf-cta-signup) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .elf-cta:has(.elf-cta-signup) .elf-cta-app { grid-column: 1; grid-row: 1; }
  .elf-cta:has(.elf-cta-signup) .elf-app-art { grid-column: 2; grid-row: 1; }
  .elf-cta-signup { grid-column: 1 / -1; }
  .elf-signup { max-width: 640px; margin-inline: auto; }
  .elf-cta-signup > .panel-body { padding: 0 0 0 24px; border: 0; }
}
@media (max-width: 400px) {
  .elf-card, .elf-tonight { padding: 20px; }
  .elf-cta { padding: 22px 18px; }
  .elf-signup { padding: 18px 14px; }
}
.elf-disclaimer { margin: 0 0 48px; font: 400 13px/1.5 var(--text); color: var(--caption); }

/* Open space between individual buttons; no shared surface, dividers or paper shadows. */
.elf-quick { margin-top: 16px; }
.elf-page .elf-quick-buttons, .elf-page .elf-quick-ctas {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 0;
}
.elf-page .elf-quick-ctas { margin-top: 10px; }
.elf-quick-buttons .elf-btn, .elf-quick-buttons a, .elf-quick-ctas a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; max-width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--paper); color: var(--indigo-ink);
  font: 500 14px/1.35 var(--text); text-align: center; text-decoration: none; box-shadow: none;
}
.elf-quick-buttons .elf-btn:hover, .elf-quick-buttons a:hover, .elf-quick-ctas a:hover {
  border-color: var(--indigo); background: var(--indigo-tint); color: var(--indigo-ink);
}
.elf-quick-buttons .elf-btn:active { box-shadow: none; }
@media (max-width: 640px) {
  .elf-quick-buttons .elf-btn { flex: 1 1 auto; padding-inline: 10px; }
  .elf-quick-ctas .elf-quick-remind { flex: 0 0 auto; }
  .elf-quick-ctas .elf-quick-app { flex: 1 1 0; min-width: 0; }
}
.elf-page .elf-quick-nojs { margin: 0; font: 600 15px/1.5 var(--text); color: var(--ink); }
.elf-quick .elf-fix { margin: 16px 0 0; padding: 16px 18px; background: var(--elf-sheet); border: 1px solid var(--elf-edge); border-radius: 5px 10px 6px 3px; box-shadow: var(--elf-shadow); }
.elf-quick .elf-fix:empty { margin: 0; padding: 0; border: 0; box-shadow: none; }
.elf-surprise { margin-top: 16px; }
.elf-surprise-card {
  --elf-card-pad: 20px;
  display: flex; flex-direction: column; gap: 10px; padding: var(--elf-card-pad);
  background: var(--elf-sheet); border: 1px solid var(--elf-edge); border-radius: 12px 16px 10px 14px; box-shadow: var(--elf-shadow);
  overflow-wrap: anywhere;
}
.elf-surprise-card > .elf-idea-art { max-width: 280px; border-radius: 7px 10px 4px 5px; }
.elf-surprise-card.is-fresh { animation: elf-surprise-in 0.2s ease-out; }
@keyframes elf-surprise-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.elf-page .elf-surprise-card p { margin: 0; font-size: 15px; line-height: 1.6; }
.elf-page .elf-surprise-label { font: 600 13px/1.4 var(--text); color: var(--green-deep); }
.elf-page .elf-surprise-title { margin: 0; font: 700 20px/1.3 var(--display); color: var(--ink); }
.elf-surprise-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.elf-surprise-actions .elf-put { flex: 1 1 260px; margin: 0; padding: 0; }
.elf-page .elf-surprise-outcome { font-weight: 600; color: var(--green-deep); }

/* Option 2 placement (Darren, 24 Nov 21:18): hero starts the plan; tools sit under the kinds;
   the app link sits straight after the 24 nights. */
.elf-kinds { margin: 8px 0 12px; }
/* 25 Nov (Darren, 05:50): the tools first, then the question and the kinds. */
.elf-kinds .elf-quick { margin: 0 0 28px; display: grid; grid-template-columns: minmax(0, 1fr); }
/* No jump when the script runs (Darren, 25 Nov 06:22). Until planner.js runs, a one-line fallback shows
   where the tools go, and the tools are taller: on a phone they wrap, two buttons then Browse. So the
   tools' row is laid out from the first paint, unseen (visibility: hidden, so nothing in it can be
   clicked, tabbed to or read out), in the same grid cell as the fallback line. The cell is as tall as
   the real row at every width, and the question and the kinds stay put when the script swaps one for
   the other. The 60-second fix and the surprise card take the rows after it, as before. */
.elf-kinds .elf-quick-buttons, .elf-kinds .elf-quick-nojs { grid-area: 1 / 1; }
.elf-page .elf-kinds .elf-quick-buttons[hidden] { display: flex !important; visibility: hidden; }
/* Without the script nothing swaps, so nothing is kept: no gap under the fallback line. */
@media (scripting: none) {
  .elf-page .elf-kinds .elf-quick-buttons[hidden] { display: none !important; }
}
.elf-kinds .elf-kind-chips { margin-bottom: 40px; }
.elf-page #nights { margin-bottom: 16px; }
.elf-after-nights { margin: 0 0 40px; }
.elf-after-nights .elf-quick-app {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; max-width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--paper); color: var(--indigo-ink);
  font: 500 14px/1.35 var(--text); text-align: center; text-decoration: none; box-shadow: none;
}
.elf-after-nights .elf-quick-app:hover { border-color: var(--indigo); background: var(--indigo-tint); color: var(--indigo-ink); }
@media (max-width: 640px) {
  .elf-kinds .elf-quick-buttons .elf-btn, .elf-kinds .elf-quick-buttons .elf-link { flex: 1 1 auto; }
}

/* Ideas by kind, under the hero: real buttons with aria-pressed, which filter the idea bank. */
.elf-page .elf-kinds-title { margin: 0 0 12px; font: 700 20px/1.3 var(--display); }
.elf-kind-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.elf-kind-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 9px 13px;
  border: 1px solid #aba998; border-radius: 5px 9px 6px 8px; background: var(--elf-sheet); color: var(--ink);
  box-shadow: 0 2px 0 var(--elf-layer);
  font: 600 14px/1.2 var(--text); cursor: pointer;
}
.elf-kind-chip:hover { border-color: var(--indigo); background: var(--indigo-tint-2); }
.elf-kind-chip:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.elf-kind-chip[aria-pressed="true"] { background: var(--green-deep); border-color: var(--green-deep); color: #fff; box-shadow: 0 2px 0 #b5c9bb, inset 0 0 0 1px #fff8; }
.elf-kind-count { display: inline-grid; place-items: center; min-width: 24px; min-height: 24px; padding-inline: 4px; border-radius: 3px 5px 2px 4px; background: #eeeade; font-size: 13px; font-weight: 600; }
.elf-kind-chip[aria-pressed="true"] .elf-kind-count { background: #fff; color: var(--green-deep); }
.elf-page .elf-kind-pages { margin: 12px 0 0; font: 400 14px/1.6 var(--text); color: var(--body); }
/* The kinds on one line (Darren, 25 Nov 05:50). In the HTML the row is collapsed: one chip high (the
   chips' min-height, 44px) with the rest clipped, so nothing jumps before planner.js runs. planner.js
   then hides the chips that don't fit beside the button (is-over) and lets the row size itself
   (is-fitted). Without the script, every chip shows, wrapping as before, and the button goes. */
.elf-kind-chips.is-collapsed { max-height: 44px; overflow: hidden; }
.elf-kind-chips.is-fitted { max-height: none; overflow: visible; }
.elf-kind-chips.is-collapsed .elf-kind-chip.is-over { display: none; }
.elf-kind-more {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 13px;
  border: 1px solid var(--indigo); border-radius: 5px 9px 6px 8px; background: transparent; color: var(--indigo-ink);
  font: 600 14px/1.2 var(--text); white-space: nowrap; cursor: pointer;
}
.elf-kind-more:hover { background: var(--indigo-tint); }
.elf-kind-more:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
@media (scripting: none) {
  .elf-kind-chips.is-collapsed { max-height: none; overflow: visible; }
  .elf-kind-more { display: none; }
}
/* The brand line under the H1 (25 Nov), in the same small type as the one above the footer. */
.elf-page .elf-brand-note { margin: 8px 0 0; font: 400 13px/1.5 var(--text); color: var(--caption); }

/* The sign-up section on /elf, in place of the keepsake: the app and (when on) the email. */
.elf-capture { margin-top: 0; }
.elf-signup-check:empty { display: none; }

/* /elf/confirm, the double opt-in link's page. site/email-link.js shows one state at a time with the
   hidden class. Basic styles, in the shape of /confirm-offers. */
.elf-confirm { max-width: 560px; margin: 0 auto; padding: 32px 16px 96px; }
.elf-confirm .hidden { display: none !important; }
.elf-confirm-title { margin: 0 0 16px; font: 800 1.75rem/1.15 var(--display); letter-spacing: -0.02em; color: var(--ink); overflow-wrap: anywhere; }
.elf-confirm-state p { margin: 0 0 16px; font: 400 1rem/1.55 var(--text); color: var(--body); }
.elf-confirm-done { margin: 0 0 8px; font: 800 1.375rem/1.25 var(--display); color: var(--ink); }
.elf-confirm-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 8px; font-size: 1.0625rem; }
.elf-confirm-button:disabled { opacity: 0.7; cursor: progress; }
.elf-confirm-error { margin: 16px 0 0; font: 500 1rem/1.4 var(--text); color: var(--red-ink); }
.elf-confirm-error:empty { display: none; }
.elf-confirm a:focus-visible, .elf-confirm button:focus-visible, .elf-confirm-done:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.elf-confirm-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 40px; font: 500 0.8125rem var(--text); color: var(--body); }

/* The humaniser pass (24 Nov 10:44): structure only, in Codex's classes. Short paragraphs sit close
   together; More toggles are native <details>; the kinds are links until planner.js makes them buttons. */
.elf-page .elf-answer + .elf-answer, .elf-cta .panel-body + .panel-body { margin-top: 10px; }
.elf-page .faq p + p { margin-top: 8px; }
.elf-page .guide-section > p + p { margin-top: 8px; }
.elf-more > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.elf-more > summary::-webkit-details-marker { display: none; }
.elf-more > summary:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.elf-more-label { font: 600 14px var(--text); color: var(--indigo-ink); text-decoration: underline; text-underline-offset: 3px; }
.elf-more[open] .elf-more-label { text-decoration: none; }
details.elf-safety ul { margin: 8px 0 0; padding-left: 20px; }
details.elf-safety li + li { margin-top: 4px; }
.elf-how ul { margin: 6px 0 0; padding-left: 20px; }
.elf-toolbar .elf-how { flex-basis: 100%; }
.elf-page .elf-rules { margin: 0 0 12px; padding-left: 20px; max-width: 760px; }
.elf-page .elf-rules li + li { margin-top: 4px; }
a.elf-kind-chip { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .elf-btn { transition: none; }
  .elf-surprise-card.is-fresh { animation: none; }
  .elf-swipeable.is-swiping, .elf-swipeable.is-springing, .elf-swipeable.is-leaving { transform: none; transition: none; opacity: 1; }
  html { scroll-behavior: auto; }
}

/* Printing. A Print button puts one letter or the shopping list in #elf-print and
   prints only that. Printing the page itself leaves out the menu, the buttons and the footer. */
#elf-print { display: none; }
@media print {
  @page { margin: 18mm; }
  body { background: #fff; }
  html.elf-printing body > *:not(#elf-print) { display: none !important; }
  html.elf-printing #elf-print { display: block; font: 400 14pt/1.6 Georgia, 'Times New Roman', serif; color: #000; }
  #elf-print p { margin: 0 0 12pt; }
  #elf-print h1 { font: 700 20pt/1.2 var(--display); margin: 0 0 12pt; }
  #elf-print h2 { font: 700 14pt/1.3 var(--display); margin: 16pt 0 6pt; }
  #elf-print ul, #elf-print ol { padding-left: 18pt; }
  .elf-print-art { width: 100%; height: auto; margin-bottom: 16pt; }
  header.container, .footer, .elf-app, .elf-idea-app, .elf-garland, .elf-hero-art, .elf-cat-icon, .elf-divider, .elf-filters, .elf-toolbar,
  .elf-night-actions, .elf-put, .elf-skip-actions, .elf-undo, .elf-skipped, .elf-skip-reason, .elf-skip-note, .elf-letter-actions, .elf-backup-actions, .elf-jump,
  .elf-page button, .elf-excuse-buttons, .elf-hero .cta-row,
  .skip-link, .elf-related, #more { display: none !important; }
  .elf-hero { display: block; }
  .elf-letter-section + .elf-letter-section { break-before: page; }
  .elf-letter { border: 0; padding: 0; }
  .elf-nights, .elf-bank, .elf-ideas { display: block; overflow: visible; }
  .elf-page :is(.elf-night, .elf-bank-item, .elf-idea, .elf-tonight, .elf-excuse) { break-inside: avoid; background: #fff; border: 1px solid #bbb; box-shadow: none; border-radius: 0; }
  .elf-page .elf-nights > li, .elf-page .elf-bank > li, .elf-idea { margin-bottom: 16pt; }
  .elf-nights .elf-idea-art, .elf-bank .elf-idea-art, .elf-ideas .elf-idea-art, .elf-tonight .elf-idea-art { display: none; }
  .elf-page .elf-night .elf-night-date strong { display: inline; padding: 0; background: none; color: #000; clip-path: none; transform: none; }
  .elf-swipeable { transform: none !important; opacity: 1 !important; transition: none !important; }
  .elf-chip, .elf-chip + .elf-chip, .elf-chip-cheeky { color: #000; background: none; }
  #elf-tonight-text:has(.elf-idea-art) { display: block; }
  .elf-progress-row, .elf-quick, .elf-kinds { display: none !important; }
}
