  :root { --ink:#1c1a17; --red:#b3312d; --green:#176442; --paper:#fffdf7; --cream:#f6f1e3; --serif: Gelasio, Georgia, "Times New Roman", "Liberation Serif", "Nimbus Roman", "DejaVu Serif", serif; }
/* Gelasio (SIL Open Font License) - a Georgia-metric-compatible serif so the edition looks like a newspaper everywhere, including the server-rendered PDF. */
@font-face { font-family: "Gelasio"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/gelasio-regular.woff2") format("woff2"); }
@font-face { font-family: "Gelasio"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("fonts/gelasio-italic.woff2") format("woff2"); }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body { background: linear-gradient(180deg, #14532d 0%, #0d3b24 55%, #0a2f1c 100%); background-attachment: fixed; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif; }
  a { color: var(--green); }
  .wrap { max-width: 920px; margin: 0 auto; padding: 26px 16px 60px; }
  .intro { background: var(--paper); border: 1px solid #ddd2ba; border-radius: 14px; padding: 22px clamp(16px,4vw,34px); margin-bottom: 22px; }
  .eyebrow { margin: 0 0 6px; color: var(--red); font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
  h1.pagetitle { margin: 0; font-family: var(--serif); font-size: clamp(30px,5vw,46px); letter-spacing: -.02em; }
  .intro p { color: #4a443a; line-height: 1.55; margin: 10px 0 0; }
  .privacy { font-size: 13px; background: #f1ead6; border: 1px dashed #c9b98f; border-radius: 8px; padding: 8px 12px; margin-top: 14px !important; }
  fieldset { border: 1px solid #ddd2ba; border-radius: 12px; background: var(--paper); padding: 16px clamp(14px,3vw,24px); margin: 0 0 16px; }
  legend { font-weight: 900; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--green); padding: 2px 8px; background: var(--paper); border-radius: 6px; }
  label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 4px; }
  label .hint { display: block; font-weight: 400; color: #6b6353; font-size: 12px; margin-top: 2px; }
  input[type=text], input[type=url], textarea { width: 100%; border: 1px solid #cfc4a8; border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; }
  .fileinfo { font-size: 12.5px; margin: 6px 0 0; }
  .fileinfo.ok { color: var(--green); font-weight: 700; }
  .fileinfo.err { color: var(--red); font-weight: 700; }
  textarea { min-height: 110px; resize: vertical; }
  .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; }
  .check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 10px 0 0; }
  .check input { width: 18px; height: 18px; }
  .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 26px; }
  .btn { border: 1px solid var(--green); border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 900; cursor: pointer; background: var(--green); color: #fff; }
  .btn.alt { background: #fff; color: var(--green); }
  .btn.red { background: var(--red); border-color: var(--red); }
  /* ---- newspaper sheets ---- */
  .sheet { background: var(--paper); width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto 26px; padding: 0 14mm 13mm; box-shadow: 0 3px 18px rgba(0,0,0,.18); display: flex; flex-direction: column; border: 2px solid var(--red); outline: 1px solid var(--green); outline-offset: 4px; }
  .masthead { text-align: center; background: linear-gradient(180deg, #14532d 0%, #0d3b24 60%, #0a2f1c 100%); margin: 0 -14mm 10px; padding: 6px 14mm 10px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .masthead .kicker { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: #e8b64c; font-weight: 800; margin-top: 4px; }
  .masthead h2 { font-family: var(--serif); font-size: clamp(19px,5.5vw,52px); white-space: nowrap; margin: 2px 0; letter-spacing: .01em; color: #e8b64c; text-shadow: 0 1px 0 rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; gap: clamp(4px,1vw,14px); }
  .masthead h2 .mtree { height: .85em; width: auto; flex: 0 0 auto; }
  .masthead .dateline { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; border-top: 1px solid rgba(255,253,247,.5); margin-top: 6px; padding-top: 4px; color: #d9ead9; }
  .headline { font-family: var(--serif); font-size: clamp(26px,5vw,40px); line-height: 1.08; margin: 14px 0 2px; }
  .byline { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #6b6353; margin-bottom: 10px; }
  .story { font-family: var(--serif); font-size: 14.5px; line-height: 1.5; column-count: 2; column-gap: 22px; column-rule: 1px solid #d8cfb8; }
  .story p { margin: 0 0 10px; break-inside: avoid; }
  .figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 8px; margin: 12px 0; }
  .fig { border: 1px solid var(--ink); padding: 8px 10px; text-align: center; }
  .fig b { display: block; font-family: var(--serif); font-size: 20px; }
  .fig span { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #6b6353; }
  .routebox { border: 1px solid var(--ink); padding: 10px; margin: 12px 0; text-align: center; }
  .routebox svg { max-width: 100%; height: auto; }
  .routebox figcaption { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #6b6353; margin-top: 6px; }
  .section-title { font-family: var(--serif); font-size: 20px; border-bottom: 2px solid var(--green); margin: 16px 0 8px; padding-bottom: 3px; color: var(--green); }
  .section-title .tag { color: var(--red); }
  ul.news { list-style: none; margin: 0; padding: 0; }
  ul.news li { padding: 7px 0; border-bottom: 1px dotted #c9bfa5; font-size: 13.5px; line-height: 1.4; }
  ul.news a { font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--green); }
  ul.news .src { color: #6b6353; font-size: 11.5px; }
  .pagefoot { margin-top: auto; border-top: 3px double var(--red); padding-top: 6px; font-size: 11px; display: flex; justify-content: space-between; letter-spacing: .06em; text-transform: uppercase; color: var(--green); }
  .pagefoot b { color: var(--red); }

  /* ---- crossword ---- */
  .cw { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 16px; align-items: start; }
  .cw-grid { display: grid; gap: 0; border: 2px solid var(--ink); background: var(--ink); aspect-ratio: 1; }
  .cw-cell { position: relative; background: var(--paper); box-shadow: inset 0 0 0 0.5px #b9ad8f; }
  .cw-cell.block { background: var(--ink); }
  .cw-cell .num { position: absolute; top: 1px; left: 2px; font-size: 8px; font-weight: 700; }
  .cw-cell .sol { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--red); }
  .show-answers .cw-cell .sol { display: flex; }
  .cw-clues { font-size: 12px; line-height: 1.5; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: start; }
  .cw-clues h4 { font-family: var(--serif); margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
  .cw-clues .cw-col { break-inside: avoid; }
  .cw-clues ol { margin: 0 0 10px; padding-left: 18px; }
  .cw-clues li { margin-bottom: 2px; }
  .cw-note { text-align: center; font-size: 12px; color: #6b6353; font-style: italic; margin: 8px 0 0; }
  /* ---- photos ---- */
  .photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; margin: 10px 0; }
  .photos figure { margin: 0 auto; width: fit-content; max-width: 100%; border: 1px solid var(--ink); padding: 6px; background: #fff; display: flex; flex-direction: column; align-items: center; }
  .photos img { width: auto; max-width: 100%; height: auto; max-height: 430px; object-fit: contain; display: block; }
  .photos figcaption { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b6353; margin-top: 5px; text-align: center; }
  /* ---- poster ---- */
  .sheet.poster { background: linear-gradient(180deg, #176442 0%, #0f4a2f 60%, #0c3a25 100%); text-align: center; justify-content: flex-start; border: 4px double var(--red); outline: 1px solid #e8b64c; outline-offset: -10px; color: #fffdf7; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .poster .p-kicker { margin-top: 8mm; font-size: 12px; letter-spacing: .34em; text-transform: uppercase; color: #e8b64c; font-weight: 800; }
  .poster h2 { font-family: var(--serif); font-size: clamp(34px,7vw,56px); margin: 6px 0 2px; color: #fffdf7; }
  .poster .p-sub { font-family: var(--serif); font-style: italic; font-size: 16px; color: #dcead9; }
  .poster .p-art { margin: 8mm auto 4mm; width: 78%; border: 1px solid var(--ink); background: var(--paper); padding: 8px; }
  .poster .p-art img, .poster .p-art svg { width: 100%; height: auto; display: block; max-height: 110mm; object-fit: contain; }
  @media print { .poster .p-art img, .poster .p-art svg, .photos img, .photos svg { max-height: 92mm; } }
  .poster .p-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-family: var(--serif); font-size: 15px; margin: 4mm 0; color: #fffdf7; }
  .poster .p-stats b { color: #e8b64c; }
  .poster .p-foot { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #d9ead9; }
  .poster .p-date { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #bcd4bd; margin-top: 2mm; }
  .poster .p-noart { margin: 8mm auto 4mm; width: 78%; padding: 14mm 0; border-top: 3px double #e8b64c; border-bottom: 3px double #e8b64c; }
  .poster .p-noart .flake { color: #fffdf7; font-size: 40px; letter-spacing: 20px; }
  .poster .p-wordmark { font-family: var(--serif); font-size: clamp(26px,5vw,40px); letter-spacing: .14em; color: #e8b64c; margin: 7mm 0; }
  .poster .p-foot b { color: #e8b64c; }
  .poster .p-trees { display: block; width: 96%; margin: auto auto 2mm; height: 60px; }
  .snow { color: #fffdf7; }
  .sheet.poster .snowdot { color: rgba(255,253,247,.8); }
  .sheet.poster .snowdot:empty { background: rgba(255,253,247,.8); }
  /* tree lights + snow */
  .lights { display: block; width: 100%; height: 22px; }
  .sheet { position: relative; }
  .snowdot { position: absolute; color: #b9c2cc; pointer-events: none; z-index: 0; line-height: 1; }
  .snowdot:empty { background: #b9c2cc; border-radius: 50%; }
  .sheet > *:not(.snowdot) { position: relative; z-index: 1; }
  /* Keep the shared snowfall behind this page's reading and form surfaces. */
  .xmas-snow { z-index: 0; }
  #snow-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
  .wrap, #edition { position: relative; z-index: 1; }
  /* ---- gate ---- */
  .gate { background: var(--paper); border: 1px solid #ddd2ba; border-radius: 14px; padding: 30px clamp(16px,4vw,40px); text-align: center; }
  .gate h2 { font-family: var(--serif); margin: 0 0 8px; font-size: 26px; }
  .gate p { color: #4a443a; max-width: 520px; margin: 0 auto 18px; line-height: 1.5; }
  .gate .gbtn { display: flex; justify-content: center; min-height: 44px; }
  .gate .err { color: var(--red); font-size: 13px; margin-top: 10px; }
  [hidden] { display: none !important; }
  /* ---- print ---- */
  @page { size: A4; margin: 0; }
  @media print {
    body { background: #fff; }
    .no-print, .site-nav, #snow-canvas, .sheet.poster { display: none !important; }
    .sheet { box-shadow: none; margin: 0; width: auto; max-width: none; min-height: 270mm; page-break-after: always; padding-top: 0; padding-bottom: 12mm; border: none; outline: none; }
    .sheet::before { content: ""; position: absolute; inset: 5mm; border: 2px solid var(--red); outline: 1px solid var(--green); outline-offset: 3px; pointer-events: none; z-index: 2; }
    .sheet:last-child { page-break-after: auto; }
    .masthead { margin-bottom: 4mm; padding-bottom: 6px; padding-top: 3px; }
    .masthead h2 { font-size: 30px; }
    .masthead .kicker { font-size: 10px; margin-top: 3px; }
    .masthead .dateline { font-size: 9.5px; margin-top: 5px; padding-top: 4px; }
    .headline { font-size: 26px; margin: 1.5mm 0 0.5mm; }
    .byline { margin-bottom: 3mm; }
    .story { font-size: 12.5px; line-height: 1.48; text-align: justify; hyphens: auto; }
    .story > p:first-of-type::first-letter { font-family: var(--serif); font-size: 300%; line-height: .85; font-weight: 700; float: left; padding: 1mm 1.5mm 0 0; color: var(--red); }
    .figures { margin: 3mm 0; gap: 3mm; }
    .fig { padding: 6px 10px; }
    .fig b { font-size: 18px; }
    .routebox { margin: 4mm 0; padding: 8px; }
    .routebox svg { max-height: 50mm; }
    .section-title { margin: 4mm 0 2.5mm; font-size: 19px; }
    ul.news { margin: 2mm 0; }
    ul.news li { padding: 1.8mm 0; font-size: 12px; }
    .pagefoot { padding-top: 2mm; font-size: 10.5px; }
    /* crossword page: grid on top, Across and Down blocks side by side below */
    .cw { display: block; }
    .cw-grid { width: 96mm; margin: 1.5mm auto 2.5mm; }
    .cw-clues { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6mm; font-size: 11px; align-items: start; }
    .cw-clues ol { break-inside: avoid; }
    .cw-note { margin-top: 3mm; font-size: 11px; }
    .photos { gap: 4mm; margin: 3mm 0; }
    .photos img { height: auto; max-height: 60mm; }
    .photos figcaption { font-size: 10px; }
  }
  @media (max-width: 720px) {
    .cw { grid-template-columns: 1fr; }
    .story { column-count: 1; }
    .sheet { padding: 8mm 6mm; min-height: 0; }
    .masthead { margin-left: -6mm; margin-right: -6mm; padding-left: 6mm; padding-right: 6mm; }
  }

/* Native disclosure: keyboard, touch and screen-reader accessible help bubble. */
.privacy-help { padding: 0; }
.privacy-help summary { cursor: pointer; padding: 10px 12px; min-height:44px; font-weight:700; }
.privacy-help summary:focus-visible { outline: 3px solid #176442; outline-offset:3px; }
.help-icon { display:inline-flex; justify-content:center; align-items:center; border:1px solid currentColor; border-radius:50%; width:22px; height:22px; margin-right:5px; }
.privacy-help-body { padding:0 12px 12px; overflow-wrap:anywhere; }
.privacy-help-body p { font-size:13px; line-height:1.5; margin:8px 0 !important; }
.privacy-help-body a { color:#176442; text-decoration:underline; }

/* Generated-story editing is separate from the printed edition. */
#story-edit-panel{background:#fffdf5;color:#222;border:1px solid #d6cbb4;border-radius:12px;padding:16px;margin:24px 16px;max-width:920px;box-sizing:border-box}
#story-edit-panel label{color:#222}
#story-edit-panel .hint{color:#625a4c}
#story-edit-panel textarea{width:100%;box-sizing:border-box}

/* Compact natural-height photo columns. Do not stretch a short image card to a tall neighbour. */
.photos{display:block;columns:2 150px;column-gap:10px}
.photos figure{display:inline-flex;vertical-align:top;break-inside:avoid;page-break-inside:avoid;width:100%;height:auto;min-height:0;margin:0 0 10px;padding:6px}
.photos img{width:100%;height:auto;max-height:none;object-fit:contain}
@media print{.photos img{max-height:60mm;width:auto;max-width:100%}.photos figure{break-inside:avoid;page-break-inside:avoid}}

.sheet.poster-cover{padding:0;background:#0a2f1c;justify-content:center;align-items:center;overflow:hidden}
.poster-cover img{display:block;width:100%;height:auto;max-height:none;object-fit:contain}
@media print{.sheet.poster-cover{display:flex!important;min-height:270mm;padding:0;page-break-after:always;break-after:page}.poster-cover img{width:100%;max-height:268mm;object-fit:contain}.sheet.poster-cover::before{display:none}}

/* Portrait cover preview follows exported image, without A4 spacer height. */
.sheet.poster-cover{min-height:0;aspect-ratio:auto;display:block}
.poster-cover img{width:100%;height:auto;aspect-ratio:9/16}

/* Brand colours remain readable against the festive dark masthead. */
.masthead .brand-tagline { display:inline-block; padding:4px 9px; border-radius:3px; background:#fffdf7; letter-spacing:.18em; }
.masthead .brand-run { color:#b3312d; }
.masthead .brand-recover { color:#176442; }
.masthead .brand-repeat { color:#1c1a17; }

/* Shared picture-desk album layout for the builder and saved editions. */
.photos.photo-album { display: block !important; columns: auto !important; grid-template-columns: 1fr !important; column-span: all; }
.photo-album .album-track { display: flex !important; justify-content: center; width: 100%; columns: auto !important; }
.photo-album .album-track > figure { margin: 0 auto !important; width: fit-content !important; max-width: 100% !important; break-inside: avoid; box-sizing: border-box; }
.photo-album .album-track > figure[hidden] { display: none !important; }
.photo-album .album-track > figure > img { display: block; width: auto !important; max-width: 100% !important; height: auto !important; max-height: 70vh !important; object-fit: contain !important; background: #123d2d; }
.photo-album .album-track > figure.route-photo-panel { width: 100% !important; }
.photo-album .album-track > figure.route-photo-panel > img { width: 100% !important; }
.photo-album .album-nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; margin: 16px 0 20px; font: 600 15px system-ui; columns: auto; }
.photo-album .album-nav button { background: #176442; color: white; border: 0; border-radius: 22px; padding: 12px 18px; font: inherit; cursor: pointer; }
.photo-album .album-nav button:disabled { opacity: .4; cursor: default; }
.photo-album .album-count { white-space: nowrap; color: #176442; }
