/* ───────────────────────────────────────────────────────────────────────────
   Calendar page styles — shared by the web preview and (later) print/PDF.
   Every size is in cqw (container-query width) so a page renders identically
   at thumbnail, preview and A4/A3 print sizes. Theme colours/fonts arrive as
   CSS custom properties from themeStyle() in calendar-render.js.
   ─────────────────────────────────────────────────────────────────────────── */
.cal-wrap { container-type: inline-size; width: 100%; }
.cal-page {
  position: relative; width: 100%; aspect-ratio: 1 / 1.4142;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--ink);
  font-family: var(--body), system-ui, sans-serif;
  container-type: inline-size;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 18px 30px -14px rgba(40,25,10,.35);
  line-height: 1.2;
}
.cal-page * { box-sizing: border-box; }
.cal-page > * { --radius: .6cqw; font-size: 2cqw; }

/* Wire-o binding */
.cal-binding { position: relative; flex: 0 0 5.2cqw; background: var(--paper); z-index: 2; }
.cal-binding::before { /* holes */
  content: ''; position: absolute; left: 4cqw; right: 4cqw; top: 2.9cqw; height: 1.2cqw;
  background: radial-gradient(circle, rgba(0,0,0,.55) 0 .45cqw, transparent .5cqw) 0 0 / 2.4cqw 1.2cqw repeat-x;
}
.cal-binding::after { /* wire loops */
  content: ''; position: absolute; left: 4cqw; right: 4cqw; top: 0; height: 3.6cqw;
  background: linear-gradient(90deg, transparent 0 .75cqw, #8d8d92 .75cqw, #e9e9ee 1.05cqw, #6d6d72 1.45cqw, transparent 1.65cqw) 0 0 / 2.4cqw 100% repeat-x;
  border-radius: 0 0 .6cqw .6cqw;
}
.cal-binding .hanger { position: absolute; left: 50%; top: -1.4cqw; width: 9cqw; height: 5cqw; transform: translateX(-50%);
  background: var(--paper); border-radius: 0 0 50% 50%; z-index: 3; border-bottom: .5cqw solid #77777c; }

/* Art area */
.cal-art { flex: 0 0 62.5cqw; position: relative; overflow: hidden; }
.cal-art > svg, .cover-art > svg { width: 100%; height: 100%; display: block; }
.theme-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame { position: absolute; inset: 0; padding: 2.4cqw 2.4cqw 0; background: var(--soft); }
.cal-photo { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius); }

/* Body */
.cal-body { flex: 1; display: flex; flex-direction: column; padding: 2.4cqw 4cqw 2cqw; min-height: 0; }
.cal-hdr { display: flex; align-items: center; justify-content: center; margin-bottom: 1.6cqw; font-family: var(--display), serif; position: relative; flex: 0 0 auto; }
.cal-hdr .hdr-inner { display: flex; align-items: baseline; gap: 1.6cqw; }
.cal-hdr .m { font-size: 6.4cqw; line-height: 1; }
.cal-hdr .y { font-size: 3.2cqw; line-height: 1; opacity: .85; }
.cal-hdr .k { font-family: var(--body); font-size: 1.5cqw; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }

/* Grid */
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto repeat(var(--weeks), 1fr); min-height: 0; }
.dow { font-size: 1.45cqw; text-transform: uppercase; letter-spacing: .12em; text-align: center; padding: .6cqw 0; color: var(--accent); font-weight: 700; }
.day { position: relative; padding: .5cqw .6cqw; min-width: 0; overflow: hidden; }
.day .num { font-family: var(--display), serif; font-size: 2.3cqw; line-height: 1; display: block; }
.day.weekend { background: var(--weekend); }
.day.holiday .num { color: var(--holiday); font-weight: 700; }
.day.empty { background: transparent; }
.evs { list-style: none; margin: .35cqw 0 0; padding: 0; display: grid; gap: .2cqw; }
.ev { display: flex; align-items: flex-start; gap: .35cqw; font-size: 1.28cqw; line-height: 1.15; overflow: hidden; }
.ev span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: break-word; hyphens: manual; }
.ev i { flex: 0 0 1.55cqw; width: 1.55cqw; height: 1.55cqw; display: inline-flex; }
.ev i svg { width: 100%; height: 100%; }
.ev b { font-weight: 700; color: var(--accent); }
.ev-birthday i { color: var(--accent); }
.ev-anniversary i { color: var(--accent2); }
.ev-holiday { color: var(--holiday); }
.ev-other i, .ev-trip i, .ev-school i, .ev-pet i { color: var(--accent2); }
.ev.more { font-style: italic; opacity: .7; }
.cal-foot { flex: 0 0 auto; display: flex; justify-content: center; font-size: 1.2cqw; padding-top: .9cqw; opacity: .8; min-height: 2.4cqw; }
.legend { display: flex; gap: 2cqw; flex-wrap: wrap; justify-content: center; }
.lg { display: inline-flex; gap: .4cqw; align-items: center; }
.lg i { width: 1.4cqw; height: 1.4cqw; display: inline-flex; }

/* grid styles */
.grid-lines .day { border-top: .18cqw solid var(--line); }
.grid-boxes .cal-grid { border: .2cqw solid var(--line); border-width: 0 0 .2cqw .2cqw; }
.grid-boxes .day, .grid-boxes .dow { border: .2cqw solid var(--line); border-width: .2cqw .2cqw 0 0; }
.grid-boxes .dow { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.grid-rounded .cal-grid { gap: .55cqw; }
.grid-rounded .day:not(.empty) { background: var(--weekend); border-radius: 1cqw; }
.grid-rounded .day.weekend { background: color-mix(in srgb, var(--weekend) 82%, var(--accent3) 18%); }
.grid-minimal .day { text-align: left; }
.grid-minimal .day.weekend { background: transparent; }
.grid-minimal .day.weekend .num { color: var(--accent); }
.grid-minimal .day:not(.empty)::after { content: ''; position: absolute; left: .6cqw; right: .6cqw; bottom: 0; border-bottom: .12cqw dotted var(--line); }
.grid-organiser .cal-grid { border-left: .2cqw solid var(--line); border-bottom: .2cqw solid var(--line); }
.grid-organiser .day { border: .2cqw solid var(--line); border-width: .2cqw .2cqw 0 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 2.3cqw, color-mix(in srgb, var(--line) 55%, transparent) 2.3cqw 2.42cqw); background-position: 0 3.2cqw; }
.grid-organiser .dow { background: var(--ink); color: var(--paper); }

/* ── Cover ─────────────────────────────────────────────────────────────── */
.cover .cover-art { flex: 0 0 95cqw; position: relative; overflow: hidden; }
.cover .cover-text { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1cqw 6cqw 4cqw; gap: 1.2cqw; }
.cover-year { font-family: var(--display), serif; font-size: 15cqw; line-height: .95; color: var(--accent); }
.cover-title { font-family: var(--body); font-size: 4.2cqw; letter-spacing: .02em; }
.cover-title.muted { opacity: .75; font-size: 3.6cqw; letter-spacing: .2em; text-transform: uppercase; }

/* ── Month header styles (one per theme) ───────────────────────────────── */
.hdr-block .cal-hdr { background: var(--accent3); color: var(--paper); padding: 1.2cqw 2.6cqw; justify-content: space-between; text-transform: uppercase; letter-spacing: .05em; }
.hdr-block .hdr-inner { width: 100%; justify-content: space-between; align-items: center; }
.hdr-block .m { font-size: 7.4cqw; order: 1; } .hdr-block .y { font-size: 6cqw; color: var(--accent2); opacity: 1; order: 3; }
.hdr-block .k { order: 2; color: var(--accent); opacity: 1; font-size: 1.6cqw; }
.hdr-block .cover-year, .hdr-block.cover .cover-year { color: var(--accent); }

.hdr-ribbon .cal-hdr .hdr-inner { background: var(--accent); color: var(--paper); padding: 1cqw 9cqw 1.2cqw; clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); }
.hdr-ribbon .y { color: var(--accent2); opacity: 1; }
.hdr-ribbon .k { display: none; }

.hdr-scoreboard .cal-hdr .hdr-inner { gap: 0; align-items: stretch; background: var(--ink); color: #fff; padding: .6cqw; border-radius: .8cqw; text-transform: uppercase; }
.hdr-scoreboard .k { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 1.1cqw; padding: 0 .8cqw; color: var(--accent2); opacity: 1; align-self: center; }
.hdr-scoreboard .m { padding: .6cqw 2.2cqw; font-weight: 700; letter-spacing: .04em; }
.hdr-scoreboard .y { background: var(--accent2); color: #fff; opacity: 1; padding: .6cqw 1.8cqw; font-size: 5cqw; font-variant-numeric: tabular-nums; border-radius: .4cqw; display: flex; align-items: center; }

.hdr-stencil .cal-hdr { justify-content: space-between; border-bottom: 1.3cqw solid; border-image: repeating-linear-gradient(-45deg, var(--accent) 0 1.6cqw, var(--ink) 1.6cqw 3.2cqw) 1; padding-bottom: 1cqw; text-transform: uppercase; }
.hdr-stencil .hdr-inner { width: 100%; justify-content: space-between; }
.hdr-stencil .m { font-size: 7cqw; letter-spacing: .08em; } .hdr-stencil .k { order: 3; font-family: var(--display); }

.hdr-crayon .m { color: var(--accent); text-decoration: underline wavy var(--accent2); text-decoration-thickness: .5cqw; text-underline-offset: 1.4cqw; font-size: 8cqw; }
.hdr-crayon .y { background: var(--accent3); padding: .5cqw 1.6cqw; border-radius: 3cqw; transform: rotate(-5deg); font-size: 3.4cqw; opacity: 1; }
.hdr-crayon .k { display: none; }

.hdr-script .hdr-inner { flex-direction: column; align-items: center; gap: .2cqw; }
.hdr-script .m { font-size: 10cqw; color: var(--accent); line-height: .9; }
.hdr-script .y { font-family: var(--body); font-size: 1.9cqw; letter-spacing: .6em; text-transform: uppercase; display: flex; align-items: center; gap: 1.6cqw; }
.hdr-script .y::before, .hdr-script .y::after { content: ''; width: 8cqw; border-top: .15cqw solid var(--accent2); }
.hdr-script .cal-hdr { margin-top: -1cqw; margin-bottom: .6cqw; }

.hdr-stamp .cal-hdr { justify-content: flex-start; }
.hdr-stamp .hdr-inner { border: 1cqw solid; border-image: repeating-linear-gradient(-45deg, var(--accent) 0 1.6cqw, var(--paper) 1.6cqw 2.4cqw, var(--accent2) 2.4cqw 4cqw, var(--paper) 4cqw 4.8cqw) 12; padding: .8cqw 2.4cqw; transform: rotate(-1.5deg); }
.hdr-stamp .m { color: var(--accent); } .hdr-stamp .k { font-style: italic; color: var(--accent2); opacity: 1; order: 3; }

.hdr-seedpacket .cal-hdr .hdr-inner { background: var(--accent); color: var(--paper); padding: .6cqw 3cqw .6cqw; border-radius: 3cqw 3cqw .6cqw .6cqw; align-items: center; }
.hdr-seedpacket .m { font-size: 7.4cqw; font-weight: 700; letter-spacing: .06em; }
.hdr-seedpacket .y { background: var(--accent2); border-radius: 50%; width: 7cqw; height: 7cqw; display: grid; place-items: center; font-family: var(--body); font-size: 2cqw; font-weight: 700; opacity: 1; }
.hdr-seedpacket .k { order: -1; font-size: 1.3cqw; }

.hdr-topo .cal-hdr { justify-content: flex-start; padding: 1cqw 2cqw; border-radius: 1cqw;
  background: repeating-radial-gradient(ellipse at 80% 60%, transparent 0 1.1cqw, color-mix(in srgb, var(--accent) 22%, transparent) 1.1cqw 1.3cqw), var(--soft); }
.hdr-topo .m { color: var(--accent); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 5.8cqw; }
.hdr-topo .y { border: .25cqw solid var(--accent2); color: var(--accent2); padding: .3cqw 1cqw; opacity: 1; font-weight: 700; }
.hdr-topo .k { order: 3; margin-left: auto; }

.hdr-scorecard .cal-hdr .hdr-inner { gap: 0; border: .3cqw solid var(--accent); align-items: stretch; text-transform: uppercase; }
.hdr-scorecard .hdr-inner > * { padding: .8cqw 2cqw; display: flex; align-items: center; border-right: .3cqw solid var(--accent); }
.hdr-scorecard .hdr-inner > *:last-child { border-right: 0; }
.hdr-scorecard .k { background: var(--accent); color: var(--paper); opacity: 1; font-weight: 700; }
.hdr-scorecard .m { color: var(--accent); font-size: 5.4cqw; letter-spacing: .06em; } .hdr-scorecard .y { color: var(--accent2); opacity: 1; font-weight: 700; }

.hdr-stitched .cal-hdr .hdr-inner { background: var(--soft); padding: 1.4cqw 5cqw; border-radius: 2cqw; outline: .35cqw dashed var(--accent); outline-offset: -1cqw; }
.hdr-stitched .m { font-size: 7.6cqw; color: var(--accent); font-weight: 700; } .hdr-stitched .k { display: none; }

.hdr-scallop .cal-hdr { background: var(--accent); color: var(--paper); padding: 1cqw 2cqw 2.4cqw; margin-left: -4cqw; margin-right: -4cqw; margin-top: -2.4cqw;
  -webkit-mask: radial-gradient(1.4cqw at 50% 100%, transparent 98%, #000) 50% 0 / 2.8cqw 100%; mask: radial-gradient(1.4cqw at 50% 100%, transparent 98%, #000) 50% 0 / 2.8cqw 100%; }
.hdr-scallop .m { font-size: 6.4cqw; } .hdr-scallop .k { font-family: var(--body); order: 3; }

.hdr-speed .cal-hdr { justify-content: flex-start; font-style: italic; text-transform: uppercase; }
.hdr-speed .hdr-inner { transform: skewX(-10deg); padding-left: 12cqw; background: linear-gradient(var(--accent), var(--accent)) 0 30% / 10cqw .5cqw no-repeat, linear-gradient(var(--accent2), var(--accent2)) 3cqw 55% / 7cqw .5cqw no-repeat, linear-gradient(var(--accent3), var(--accent3)) 5cqw 80% / 5cqw .5cqw no-repeat; }
.hdr-speed .m { font-weight: 700; font-size: 7cqw; letter-spacing: -.02em; } .hdr-speed .y { color: var(--accent); opacity: 1; font-weight: 700; }
.hdr-speed .k { order: 3; color: var(--accent2); }

.hdr-sunset .cal-hdr { color: var(--paper); padding: 1.2cqw 0 1.8cqw; margin: -2.4cqw -4cqw 1.2cqw;
  background: linear-gradient(to bottom, transparent 70%, var(--paper) 70% 74%, transparent 74% 82%, var(--paper) 82% 85%, transparent 85%), linear-gradient(90deg, var(--accent3), var(--accent)); }
.hdr-sunset .m { font-size: 7cqw; text-shadow: .4cqw .4cqw 0 var(--ink); } .hdr-sunset .y { opacity: 1; } .hdr-sunset .k { display: none; }

.hdr-pixel .cal-hdr { color: var(--accent2); }
.hdr-pixel .hdr-inner { padding: 1.6cqw 2.4cqw; gap: 2.4cqw; align-items: center;
  box-shadow: 0 -.6cqw 0 0 var(--accent), 0 .6cqw 0 0 var(--accent), -.6cqw 0 0 0 var(--accent), .6cqw 0 0 0 var(--accent); }
.hdr-pixel .m { font-size: 4.2cqw; text-shadow: .5cqw .5cqw 0 var(--accent); text-transform: uppercase; }
.hdr-pixel .y { font-size: 2.6cqw; color: var(--accent3); opacity: 1; } .hdr-pixel .k { font-family: var(--display); font-size: 1.2cqw; color: var(--accent); opacity: 1; }
.hdr-pixel .day .num { font-size: 1.5cqw; }
.hdr-pixel .cover-year { font-size: 11cqw; text-shadow: .8cqw .8cqw 0 var(--accent2); }

.hdr-bookplate .cal-hdr .hdr-inner { flex-direction: column; align-items: center; gap: .4cqw; border: .7cqw double var(--accent3); padding: .8cqw 6cqw; border-radius: .6cqw; }
.hdr-bookplate .k { font-style: italic; text-transform: none; letter-spacing: .06em; color: var(--accent2); opacity: 1; font-size: 1.7cqw; }
.hdr-bookplate .m { color: var(--accent); font-size: 5cqw; } .hdr-bookplate .y { display: none; }

.hdr-tag .cal-hdr .hdr-inner { background: var(--accent); padding: 1cqw 4cqw 1cqw 6cqw; border-radius: 6cqw; position: relative; align-items: center; }
.hdr-tag .hdr-inner::before { content: ''; position: absolute; left: 2cqw; top: 50%; width: 2cqw; height: 2cqw; margin-top: -1cqw; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 .35cqw var(--accent2); }
.hdr-tag .m { font-weight: 700; font-size: 6.6cqw; color: var(--accent2); } .hdr-tag .y { font-weight: 600; } .hdr-tag .k { order: 3; }

.hdr-whiskers .cal-hdr .hdr-inner { flex-direction: column; align-items: center; gap: .3cqw; position: relative; }
.hdr-whiskers .m { font-size: 6.4cqw; font-weight: 700; letter-spacing: .08em; text-transform: lowercase; color: var(--accent); }
.hdr-whiskers .y { font-size: 2cqw; letter-spacing: .5em; }
.hdr-whiskers .cal-hdr::before, .hdr-whiskers .cal-hdr::after { content: ''; width: 12cqw; height: 4cqw; margin: 0 2cqw;
  background: linear-gradient(-8deg, transparent 46%, var(--ink) 46% 54%, transparent 54%) 0 0 / 100% 33% no-repeat, linear-gradient(var(--ink), var(--ink)) 0 50% / 100% .25cqw no-repeat, linear-gradient(8deg, transparent 46%, var(--ink) 46% 54%, transparent 54%) 0 100% / 100% 33% no-repeat; opacity: .5; }

.hdr-tabs .cal-hdr { justify-content: flex-start; border-bottom: .8cqw solid var(--accent); padding-bottom: .8cqw; }
.hdr-tabs .m { font-weight: 800; font-size: 6cqw; letter-spacing: -.03em; } .hdr-tabs .y { font-weight: 300; font-size: 6cqw; }
.hdr-tabs .k { position: absolute; right: 0; top: 50%; transform: translateY(-60%); font-weight: 700; }
.hdr-tabs .cal-hdr::after { content: ''; position: absolute; right: 0; bottom: -.8cqw; width: 18cqw; height: .8cqw; background: linear-gradient(90deg, var(--accent2) 0 33%, var(--accent3) 33% 66%, var(--holiday) 66%); }

.hdr-retro .m { font-size: 7.4cqw; color: var(--accent); text-shadow: .45cqw .45cqw 0 var(--accent2); font-style: italic; }
.hdr-retro .y { background: var(--accent2); color: var(--paper); border-radius: 50%; width: 7.4cqw; height: 7.4cqw; display: grid; place-items: center; font-family: var(--body); font-size: 2.1cqw; font-weight: 700; opacity: 1; transform: rotate(-10deg); align-self: center; }
.hdr-retro .k { order: -1; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 1.2cqw; align-self: center; }

.hdr-postcard .hdr-inner { flex-direction: column; align-items: center; gap: 0; }
.hdr-postcard .k { font-family: 'Pacifico', cursive; text-transform: none; letter-spacing: 0; font-size: 2.2cqw; color: var(--accent3); opacity: 1; margin-bottom: -.6cqw; transform: rotate(-3deg); }
.hdr-postcard .m { font-size: 7.6cqw; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; text-shadow: .35cqw .35cqw 0 var(--accent2), .7cqw .7cqw 0 var(--ink); }
.hdr-postcard .y { display: none; }

.hdr-monogram .cal-hdr .hdr-inner { flex-direction: column; align-items: center; gap: .6cqw; padding: .8cqw 8cqw; border-top: .2cqw solid var(--accent); border-bottom: .2cqw solid var(--accent); }
.hdr-monogram .m { text-transform: uppercase; letter-spacing: .4em; font-size: 4.4cqw; margin-right: -.4em; font-weight: 500; }
.hdr-monogram .y { font-style: italic; color: var(--accent); font-size: 2.4cqw; opacity: 1; }

.hdr-laurel .cal-hdr { gap: 1.5cqw; }
.hdr-laurel .deco { width: 9cqw; height: 9cqw; }
.hdr-laurel .hdr-inner { flex-direction: column; align-items: center; gap: .2cqw; }
.hdr-laurel .m { color: var(--accent); font-size: 6.4cqw; } .hdr-laurel .y { color: var(--accent2); opacity: 1; font-size: 2.2cqw; letter-spacing: .3em; }
.hdr-laurel .k { font-style: italic; text-transform: none; letter-spacing: .1em; font-size: 1.6cqw; }

.hdr-cloud .cal-hdr .hdr-inner { padding: 2cqw 7cqw 1.4cqw; align-items: center;
  background: radial-gradient(circle at 22% 62%, var(--soft) 30%, transparent 31%), radial-gradient(circle at 48% 40%, var(--soft) 38%, transparent 39%), radial-gradient(circle at 76% 60%, var(--soft) 30%, transparent 31%), linear-gradient(var(--soft), var(--soft)) 50% 80% / 70% 40% no-repeat; }
.hdr-cloud .m { color: var(--accent); font-weight: 600; font-size: 6.4cqw; }
.hdr-cloud .k { order: -1; background: var(--accent2); color: #fff; padding: .4cqw 1.2cqw; border-radius: 2cqw; opacity: 1; font-weight: 700; letter-spacing: .08em; }

.hdr-stars .cal-hdr .hdr-inner { align-items: center; gap: 2cqw; }
.hdr-stars .m { color: var(--accent); text-transform: uppercase; letter-spacing: .3em; font-size: 5cqw; font-weight: 300; }
.hdr-stars .y { font-weight: 300; letter-spacing: .2em; }
.hdr-stars .cal-hdr::before, .hdr-stars .cal-hdr::after { content: '✦ · ✧'; color: var(--accent2); font-size: 2cqw; margin: 0 2cqw; letter-spacing: .4em; }
.hdr-stars .cal-binding, .hdr-pixel .cal-binding { filter: brightness(1.1); }

/* dark themes: soften shadows */
.theme-southern-skies .dow { color: var(--accent2); }
.theme-southern-skies .grid-minimal .day:not(.empty)::after { border-color: var(--line); }

/* Raster (AI) artwork integration */
.cal-art.has-img, .cover-art.has-img { border-bottom: .9cqw solid var(--accent); }
.cal-art.has-img::after, .cover-art.has-img::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 .5cqw color-mix(in srgb, var(--paper) 55%, transparent); pointer-events: none; }
.cover .cover-text { position: relative; }
.cover-deco { position: absolute; top: 50%; width: 13cqw; height: 13cqw; transform: translateY(-58%); opacity: .9; }
.cover-deco svg { width: 100%; height: 100%; overflow: visible; }
.cover-deco.l { left: 6cqw; } .cover-deco.r { right: 6cqw; }

/* Gift note on the cover. The element is omitted when there is no note, so this adds no space. */
.cover-note {
  margin: 0 auto; max-width: 72cqw;
  font-family: var(--body), Georgia, serif; font-style: italic; font-weight: 400;
  font-size: 2.2cqw; line-height: 1.32; letter-spacing: .01em; text-align: center;
  color: color-mix(in srgb, var(--ink, #222) 82%, transparent);
  overflow-wrap: anywhere;
}
.cover-note .cover-to {
  display: block; margin: 0 0 .28em;
  font-family: var(--display), Georgia, serif; font-style: normal; font-weight: 400;
  font-size: 1.35cqw; line-height: 1.15; letter-spacing: .02em;
  color: var(--ink, #222); overflow-wrap: anywhere;
}
.cover-note .q { font-family: "Libre Baskerville", Georgia, "Times New Roman", serif; font-style: normal; color: var(--accent); }
.hdr-pixel .cover-note { font-style: normal; font-synthesis: none; }
.hdr-pixel .cover-to { font-size: .9cqw; letter-spacing: 0; }
.theme-grill-master .cover-note { max-width: 54cqw; }
.cover:has(.cover-note) .cover-art { flex: 1 1 auto; min-height: 0; }
.cover .cover-text:has(.cover-note) { flex: 0 0 auto; }

/* Covers scale together at every preview size. */
.cover.cover-size-a4 .cover-art { flex: 1 1 0; min-height: 0; }
.cover.cover-size-a4 .cover-text { flex: 0 0 auto; flex-direction: row; align-items: flex-end; gap: 3cqw; padding: 1.6cqw 18cqw calc(9 * 100cqw / 305); }
.cover-size-a4 .cover-year { font-size: 9cqw; }
.cover-size-a4 .cover-title { font-size: 3.2cqw; margin-bottom: .7cqw; }
.cover-size-a4 .cover-title.muted { font-size: 2.6cqw; }
.cover.cover-size-a4 .cover-text:has(.cover-note) { flex-wrap: wrap; justify-content: center; row-gap: .6cqw; padding-top: 1.2cqw; }
.cover-size-a4 .cover-note { flex: 0 0 100%; max-width: 64cqw; margin: 0 auto; font-size: 1.9cqw; }
.cover-size-a4 .cover-note.long { font-size: 1.65cqw; }
.cover-size-a4 .cover-to { font-size: 1.15cqw; }
.cover-size-a4.theme-grill-master .cover-note { max-width: 50cqw; }
.cover-size-a4.hdr-pixel .cover-to { font-size: .72cqw; }
.cover-size-a3 .cover-note { font-size: 2.2cqw; max-width: 70cqw; }
.cover-size-a3 .cover-to { font-size: 1.45cqw; }
.cover-size-a3.theme-grill-master .cover-note { max-width: 56cqw; }
.cover-size-a3.hdr-pixel .cover-to { font-size: .85cqw; }
.cover.cover-size-a3:has(.cover-note) .cover-art { flex: 1 1 0; min-height: 0; }
.cover.cover-size-a4 .cover-text:has(.cover-note) .cover-deco,
.cover.cover-size-a3 .cover-text:has(.cover-note) .cover-deco { top: .4cqw; transform: none; }

/* One cover composition for the selected size, including the paper edge. */
.cover { text-rendering: geometricPrecision; }
.cover.cover-size-a4 { aspect-ratio: 305 / 218; }
.cover.cover-size-a3 { aspect-ratio: 305 / 428; }
.cover .cal-binding { flex: 0 0 calc(16 * 100cqw / 305); }
.cover .cal-binding::before, .cover .cal-binding::after, .cover .cal-binding .hanger { display: none; }
.cover .photo-frame { padding: calc(8 * 100cqw / 305) calc(8 * 100cqw / 305) 0; }
.cover.cover-size-a3 .cover-text { padding-bottom: calc(12 * 100cqw / 305); }
.cover-size-a4 .cover-deco { width: 9cqw; height: 9cqw; top: 45%; }
.cover-size-a4:has(.cover-note) .cover-deco { top: .4cqw; transform: none; }
/* Fractional sizing keeps the artwork edge and quote line boxes stable in thumbnails. */
.cover-art.has-img { border-bottom: 0; background: var(--accent); }
.cover-art.has-img > .theme-img { height: calc(100% - .9cqw); }
.cover-art.has-img::after { bottom: .9cqw; }
.cover-note .q { line-height: 1; }
.cover-note { padding-bottom: .25cqw; }
.cover-brand {
  flex: 0 0 calc(18 * 100cqw / 305); display: flex; align-items: center; justify-content: center;
  gap: calc(2 * 100cqw / 305); padding: calc(2 * 100cqw / 305) calc(8 * 100cqw / 305) calc(8 * 100cqw / 305);
  background: #fdf8ef; color: #1f2d2b;
  font: 600 calc(2.822222 * 100cqw / 305)/1.2 Inter, sans-serif; letter-spacing: .02em;
}
.cover-brand img { display: block; width: calc(8 * 100cqw / 305); height: calc(8 * 100cqw / 305); flex: 0 0 calc(8 * 100cqw / 305); }
