/* dragonlock.app v3: the free tools (/tools/, /tools/chore-chart, /tools/reward-chart). Loaded after site.css.
   The forge painting (assets/world/forge-band.svg) is the band at the top; everything a parent works with sits on
   paper below it: a plain form panel beside the sheet it makes, shown on a night stage like a product shot. The sheet
   (.chart) is the one thing that prints, so its look is tuned for paper first: a quiet cream page (white with Save
   ink), ink type, warm hairlines and octagon stones to colour in, with the child's pet as the only picture.
   Lamplight still means "chosen": a lit day, a picked idea, a chosen pet. Design notes: docs/site-v3/README.md. No
   inline styles (the CSP forbids them). */

/* ------------------------------------------------------------------ the band: the forge at night */
.forge-top { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }
.forge-top .band { object-position: 72% 100%; filter: saturate(.82) brightness(.92); }
/* the night falls over the wall from the left, so the words sit on dark and the hearth stays lit */
.forge-top::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(11,14,26,.94) 0%, rgba(11,14,26,.78) 34%, rgba(11,14,26,.28) 62%, rgba(11,14,26,.05) 82%),
    linear-gradient(0deg, rgba(11,14,26,.55), rgba(11,14,26,0) 45%); }
.forge-top.maker-top { padding-bottom: clamp(7.5rem, 12vw, 10.5rem); }
.forge-title { padding: clamp(1.75rem, 4vw, 3rem) 0 0; }
.forge-title .crumbs-bar { padding: 0; margin: 0 0 clamp(.75rem, 2vw, 1.5rem); }
.forge-title .crumbs-bar li, .forge-title .crumbs-bar a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.forge-title .crumbs-bar a:focus-visible { outline-color: var(--lamp); }
.forge-title .crumbs-bar [aria-current] { color: rgba(244,237,226,.6); }
.forge-title h1 { max-width: 15ch; }
.forge-title .lede { max-width: 36rem; }
/* small facts under the title, on night glass */
.stamps { list-style: none; margin: 1.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.stamps li { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem .42rem .75rem; border-radius: 999px; font: 600 .92rem/1.2 var(--body); color: var(--bone);
  background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(214,208,255,.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.stamps li::before { content: ""; width: .55rem; height: .3rem; margin-top: -.15rem; border-left: 1.75px solid var(--lamp); border-bottom: 1.75px solid var(--lamp); transform: rotate(-45deg); }
@media (width < 47.5625em) {
  .forge-top .band { object-position: 82% 100%; }
  .forge-top::after { background: linear-gradient(180deg, rgba(11,14,26,.82) 0%, rgba(11,14,26,.72) 55%, rgba(11,14,26,.3) 100%); }
}

/* ------------------------------------------------------------------ the page under the band */
.forge-main { position: relative; display: flow-root; color-scheme: light; padding-bottom: clamp(4.5rem, 9vw, 8rem); }

/* what rises onto the band: the makers' workshop and the quiz's card */
.workshop, .quiz-stage { position: relative; z-index: 3; margin-top: calc(-1 * clamp(5.5rem, 9vw, 8rem)); }
/* the workshop: the form panel beside the stage. The editor needs 24.5rem (seven 44px day keys and the pets in a row of
   four), the sheet stays legible from about 24rem, so the two sit side by side down to 860px */
.workshop { display: grid; grid-template-columns: minmax(24.5rem, 25.5rem) minmax(0, 1fr); grid-template-areas: "bench anvil"; gap: clamp(1.25rem, 2.8vw, 2.5rem); align-items: start; }

/* ------------------------------------------------------------------ the form panel */
.bench { --field-edge: #8C7E6B; --chip-edge: var(--edge); container: bench / inline-size; grid-area: bench; padding: .35rem clamp(1.2rem, 2.4vw, 1.75rem) 1.1rem; border-radius: var(--r-l); background: var(--card-paper);
  box-shadow: inset 0 0 0 1px var(--hair), 0 1px 2px rgba(27,24,34,.05), 0 32px 64px -32px rgba(11,14,26,.45); }
/* each step: the rule is a shadow on its top edge, so it runs above the legend rather than through it */
.bench .bench-step { min-width: 0; margin: 0; padding: 1.35rem 0 1.45rem; border: 0; box-shadow: 0 -1px 0 var(--hair); }
.bench .bench-step:first-of-type { box-shadow: none; }
.bench legend { float: left; width: 100%; display: flex; align-items: center; gap: .7rem; padding: 0; margin: 0 0 1rem; font: 700 1.2rem/1.2 var(--display); letter-spacing: -.01em; color: var(--fg); }
.bench legend + * { clear: both; }
.bench .bench-step::after { content: ""; display: block; clear: both; }

.num { display: grid; place-items: center; flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; font: 700 .88rem/1 var(--body); font-variant-numeric: lining-nums tabular-nums;
  color: var(--ember-ink); background: #FCEBD8; box-shadow: inset 0 0 0 1px rgba(200,100,42,.3); }
.sub-label, .field-line label { display: block; margin: 0 0 .5rem; font: 600 .96rem/1.35 var(--body); color: var(--fg-2); }
.field-line { margin: 0; }
.field-line label { margin-bottom: .4rem; }
.hint { margin: .55rem 0 0; font-size: .9rem; line-height: 1.45; color: var(--fg-3); }
.hint.split { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.hint output { flex: none; padding: .1rem .55rem; border-radius: 999px; font: 700 .82rem/1.4 var(--body); font-variant-numeric: lining-nums; color: var(--ember-ink); background: #FCEBD8; white-space: nowrap; }
.kid-row + .field-line { margin-top: 1rem; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 8.75rem; gap: .75rem; margin-top: 1rem; }

/* text fields: white wells with a warm hairline; focus brings the ember edge and a soft lamp halo */
.bench input[type="text"], .bench textarea, .bench select { display: block; width: 100%; min-height: 3rem; margin: 0; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--field-edge);
  background: #fff; color: var(--ink); font: 400 1.05rem/1.4 var(--body); box-shadow: inset 0 1px 2px rgba(27,24,34,.05); transition: border-color .15s, box-shadow .15s; }
.bench textarea { resize: vertical; min-height: 6.2rem; }
.bench input[type="text"]:hover, .bench textarea:hover, .bench select:hover { border-color: #6F6352; }
.bench input[type="text"]:focus-visible, .bench textarea:focus-visible, .bench select:focus-visible { outline: 2px solid var(--ember-ink); outline-offset: 2px; border-color: var(--ember-ink); box-shadow: 0 0 0 4px rgba(244,169,97,.25); }
.bench input::placeholder, .bench textarea::placeholder { color: #6E6777; opacity: 1; }
.bench select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2348434F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right .95rem center / .7rem no-repeat, #fff; }

/* chips: ideas and quick picks. An idea lights (with a tick) when it's on the list. */
.chips, .presets { display: flex; flex-wrap: wrap; gap: .45rem; }
.presets { margin-top: .75rem; }
.ideas { margin-top: 1.15rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .45rem .95rem; border: 0; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink); font: 600 .95rem/1.2 var(--body); text-align: left; box-shadow: inset 0 0 0 1px var(--chip-edge);
  transition: background-color .15s, box-shadow .15s, color .15s; }
.chip:hover { background: var(--paper); box-shadow: inset 0 0 0 1px #7A6E5E; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.idea::before, .chip.add::before { content: "+"; font: 400 1.2em/1 var(--body); color: var(--ember-ink); }
.chip.idea[aria-pressed="true"] { background: #FDEAD3; color: #5E2A0C; box-shadow: inset 0 0 0 1.5px var(--ember); }
.chip.idea[aria-pressed="true"]::before { content: ""; width: .6em; height: .32em; margin: -.2em .1em 0 .05em; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.chip:disabled { opacity: .45; cursor: not-allowed; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }

/* the children: one tab each; the chart you're editing is filled in ink */
.kid-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.kid-list { display: contents; }
.kid { position: relative; cursor: pointer; border-radius: 999px; }
.kid input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.kid span { display: block; min-height: 2.75rem; max-width: 11rem; padding: .45rem 1.1rem; line-height: 1.85rem; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700; font-size: 1rem; color: var(--ink-2); background: #fff; box-shadow: inset 0 0 0 1px var(--chip-edge); transition: background-color .15s, color .15s; }
.kid:hover span { box-shadow: inset 0 0 0 1px #7A6E5E; }
.kid input:checked + span { background: var(--ink); color: var(--bone); box-shadow: none; }
.kid:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.text-button { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: .35rem; padding: .3rem 0; border: 0; background: none; color: var(--ember-ink); cursor: pointer;
  font: 700 .95rem/1.3 var(--body); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: rgba(154,67,20,.4); }
.text-button:hover { color: #6B2F0E; text-decoration-color: currentColor; }
.text-button[hidden] { display: none; }

/* the days: seven keys that light when chosen */
.daypick { display: grid; grid-template-columns: repeat(7, minmax(2.75rem, 1fr)); gap: .25rem; }
@container bench (max-width: 24rem) { .daypick { grid-template-columns: repeat(4, minmax(2.75rem, 1fr)); gap: .4rem; } }
/* too narrow even for four (enlarged text on a phone): as many 44 px keys a row as fit */
@container bench (max-width: 12.5rem) { .daypick { grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); } }
.daypick label { position: relative; cursor: pointer; border-radius: 12px; }
.daypick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.daypick span { display: grid; place-items: center; min-height: 3rem; border-radius: 12px; font: 700 .92rem/1 var(--body); color: var(--ink-3); background: #fff;
  box-shadow: inset 0 0 0 1px var(--chip-edge); transition: background-color .15s, color .15s, box-shadow .15s; }
.daypick label:hover span { box-shadow: inset 0 0 0 1px #7A6E5E; }
/* a chosen day: lit, with a firm ember edge (3.9:1 against the panel), not just a tint */
.daypick input:checked + span { color: #5E2A0C; background: linear-gradient(180deg, #FFF1DE, #FCD9B0); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 0 0 1.5px var(--ember); }
.daypick label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* and a small tick, so the choice reads without colour */
.daypick span { position: relative; }
.daypick input:checked + span::after { content: ""; position: absolute; top: .3rem; right: .3rem; width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--ember-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8.4l2.4 2.4 5-5.4' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; }
@media print { .daypick input:checked + span::after { display: none; } }

/* the guardians: the pets, and a plain chart */
.pet-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.pet-pick label { position: relative; display: grid; justify-items: center; align-content: end; gap: .25rem; min-height: 5.9rem; padding: .5rem .25rem .55rem; border-radius: 14px; cursor: pointer;
  font: 600 .86rem/1.1 var(--body); color: var(--ink-2); background: #fff; box-shadow: inset 0 0 0 1px var(--chip-edge); transition: background-color .15s, box-shadow .15s; }
.pet-pick img { width: 3.7rem; height: 3.3rem; object-fit: contain; transition: transform .25s var(--settle); }
.pet-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pet-pick label:hover { box-shadow: inset 0 0 0 1px #7A6E5E; }
.pet-pick label:hover img { transform: translateY(-2px) scale(1.04); }
.pet-pick label:has(:checked) { color: var(--ink); background: #FFF4E6; box-shadow: inset 0 0 0 2px var(--ember), 0 8px 18px -10px rgba(200,100,42,.55); }
.pet-pick label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pet-pick label.none { grid-column: span 2; }
.no-pet { width: 2.5rem; height: 2.5rem; margin: .35rem 0 .5rem; border-radius: 50%; border: 1.5px dashed #A8977F; }

/* settings: segmented controls; the chosen side is filled in ink */
.opt-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.seg { display: inline-flex; flex-wrap: wrap; padding: 4px; border-radius: 999px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--chip-edge); }
.seg label { position: relative; cursor: pointer; border-radius: 999px; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .4rem 1rem; border-radius: 999px;
  font: 600 .95rem/1.1 var(--body); font-variant-numeric: lining-nums; color: var(--ink-2); white-space: nowrap; transition: background-color .15s, color .15s; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--ink); color: var(--bone); font-weight: 700; box-shadow: 0 2px 6px -2px rgba(27,24,34,.4); }
.seg label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a checkbox drawn to match */
.check { display: flex; gap: .75rem; align-items: center; min-height: 2.75rem; margin-top: .85rem; font-size: .98rem; line-height: 1.35; color: var(--ink-2); cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-items: center; width: 1.4rem; height: 1.4rem; margin: 0; border-radius: 6px; cursor: pointer;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink-3); transition: background-color .15s; }
.check input::after { content: ""; width: .68rem; height: .36rem; margin-top: -.18rem; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); opacity: 0; }
.check input:checked { background: var(--ink); box-shadow: none; }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ the stage: the sheet under the lamp, as it will print */
.anvil-col { grid-area: anvil; position: sticky; top: calc(var(--head-h) + 1.25rem); display: grid; gap: 1.1rem; }
.anvil { position: relative; isolation: isolate; padding: clamp(1.1rem, 3vw, 2.5rem) clamp(1.1rem, 3.4vw, 2.75rem) clamp(1rem, 2vw, 1.5rem); border-radius: var(--r-l); color: var(--bone);
  background: radial-gradient(70% 60% at 50% 0%, rgba(255,217,166,.17), rgba(255,217,166,0) 70%), radial-gradient(90% 50% at 50% 100%, rgba(157,148,224,.1), rgba(157,148,224,0) 70%), linear-gradient(180deg, #171C36, var(--night) 85%);
  box-shadow: inset 0 0 0 1px rgba(214,208,255,.12), 0 1px 2px rgba(11,14,26,.2), 0 32px 64px -30px rgba(11,14,26,.6); }
.anvil .chart { box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 4px 10px -4px rgba(0,0,0,.35), 0 34px 60px -24px rgba(0,0,0,.75); }
.anvil-note { display: flex; align-items: center; justify-content: center; gap: .55rem; margin: clamp(1rem, 2vw, 1.4rem) 0 0; text-align: center; font: 600 .9rem/1.35 var(--body); color: var(--bone-3); }
.anvil-note::before { content: ""; flex: none; width: .95rem; height: .72rem; border-radius: 2px; box-shadow: inset 0 0 0 1.5px currentColor; }
.forge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.forge-actions .button { min-height: 3.1rem; padding-inline: 1.5rem; }
.forge-actions .text-button { margin: 0 0 0 .25rem; }
.status { min-height: 1.45em; margin-top: .7rem; overflow-wrap: anywhere; color: var(--fg-3); }
@media (scripting: none) { :root .forge-actions, :root .ideas { display: none; } }   /* not .no-js: that waits for the deferred script and shifts the page */

/* ------------------------------------------------------------------ the sheet: a Letter (or A4) page in landscape.
   Sizes are in cqw (hundredths of the sheet's width), so the preview, the gallery and the printed page match. */
.chart { --sheet: #FCF7EE; --zebra: #F6EFE2; --s-ink: #1E1A24; --s-ink-2: #4A4452; --s-ink-3: #6F6878; --s-accent: #9A4314;
  --rule: #E3D9C8; --rule-2: #B3A38B; --stone: #9C8A70; --stone-2: #BDAE97; --num: #6A5E4E; --frame: #E0D4C0;
  position: relative; aspect-ratio: 11 / 8.5; container-type: inline-size; display: flex; flex-direction: column; padding: 4.6cqw 5.2cqw 3.6cqw; border-radius: .45cqw;
  color: var(--s-ink); background: var(--sheet); font-family: var(--body); text-align: left; }
/* a fine frame inside the edge, so the page reads as finished on the fridge */
.chart::before { content: ""; position: absolute; inset: 2cqw; border: .14cqw solid var(--frame); border-radius: 1.1cqw; pointer-events: none; }
.paper-a4 .chart { aspect-ratio: 297 / 210; }
.chart.print-only { display: none; }
.chart-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 3cqw; margin-bottom: 1.9cqw; }
.chart-head > div { min-width: 0; }
.chart-name { margin: 0; font: 700 5.6cqw/1 var(--display); letter-spacing: -.022em; overflow-wrap: anywhere; color: var(--s-ink); text-wrap: balance; }
.chart-week { display: flex; align-items: flex-end; gap: 1cqw; margin: 1.5cqw 0 0; font: 600 1.75cqw/1 var(--display); font-variant-caps: all-small-caps; letter-spacing: .08em; color: var(--s-accent); }
.chart-week .blank { width: 18cqw; height: 1.1em; border-bottom: .14cqw solid var(--rule-2); }
.chart-week strong { font-variant-caps: normal; letter-spacing: 0; color: var(--s-ink); }
.chart-reward { margin: 1.2cqw 0 0; font-size: 2cqw; line-height: 1.3; color: var(--s-ink-2); }
.chart-reward strong { color: var(--s-ink); }
.chart-pet { flex: none; width: 13cqw; height: auto; margin: -2.6cqw -.4cqw -1cqw 0; }
.chart-grid { position: relative; width: 100%; flex: 1; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 2.15cqw; }
.chart-grid th, .chart-grid td { padding: .5cqw .7cqw; border-bottom: .12cqw solid var(--rule); text-align: center; vertical-align: middle; }
.chart-grid thead th { padding-bottom: 1cqw; font: 600 1.75cqw/1 var(--display); font-variant-caps: all-small-caps; letter-spacing: .08em; color: var(--s-ink-3); border-bottom: .2cqw solid var(--rule-2); }
.chart-grid thead th:first-child { width: 36%; }
.chart-grid tbody tr:nth-child(even) > * { background-color: var(--zebra); }
.chart-grid tbody th, .chart-grid tfoot th { padding-left: 1.2cqw; text-align: left; font: 700 1.12em/1.15 var(--display); letter-spacing: -.005em; color: var(--s-ink); overflow-wrap: anywhere; }
.chart-grid tfoot th { font: 600 .86em/1.15 var(--display); font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--s-accent); }
.chart-grid tfoot th, .chart-grid tfoot td { border-bottom: 0; border-top: .2cqw solid var(--rule-2); }
.chart-grid .cell { display: block; width: min(5cqw, 100%); height: auto; margin: auto; color: var(--stone); }
.chart-grid tfoot .cell { color: var(--stone-2); }
.chart-grid td.off { background-image: repeating-linear-gradient(135deg, rgba(111,104,120,.09) 0 .3cqw, transparent .3cqw .9cqw); }
.chart[data-rows="7"] .chart-grid, .chart[data-rows="8"] .chart-grid { font-size: 1.9cqw; }
.chart[data-rows="7"] .cell, .chart[data-rows="8"] .cell { width: min(4.3cqw, 100%); }
.chart[data-rows="9"] .chart-grid, .chart[data-rows="10"] .chart-grid { font-size: 1.72cqw; }
.chart[data-rows="9"] .cell, .chart[data-rows="10"] .cell { width: min(3.6cqw, 100%); }
.chart[data-rows="9"] .chart-pet, .chart[data-rows="10"] .chart-pet { width: 10.5cqw; }
.chart-foot { position: relative; display: flex; justify-content: space-between; gap: 2cqw; margin: 1.5cqw 0 0; font-size: 1.4cqw; color: var(--s-ink-3); }
.chart-foot span:last-child { font-variant-caps: all-small-caps; letter-spacing: .06em; font-size: 1.12em; }
/* save ink: white paper, no tint behind the rows, the lines and stones lighter */
.save-ink .chart { --sheet: #FFFFFF; --zebra: #FFFFFF; --rule: #E8E1D6; --rule-2: #CBBFAD; --stone: #BDAF9B; --stone-2: #D3C8B7; --num: #6A5E4E; --frame: #ECE5DA; }
.save-ink .chart-grid td.off { background-image: repeating-linear-gradient(135deg, rgba(111,104,120,.06) 0 .3cqw, transparent .3cqw .9cqw); }

/* the reward chart: one goal, a trail of numbered stones that winds across the page (every other row runs back), and
   the prize at the end. Sizes come from the stones per row */
.reward-goal { margin: 1.4cqw 0 0; font-size: 2.45cqw; line-height: 1.3; color: var(--s-ink-2); }
.reward-goal strong { color: var(--s-ink); }
.trail { --stone-w: 10.5cqw; --rowgap: 5cqw; position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--rowgap); padding: 1.5cqw 1.5cqw; }
.trail[data-rows="1"] { --stone-w: 13cqw; }
.trail[data-per="5"][data-rows="3"] { --stone-w: 9cqw; --rowgap: 4cqw; }
.trail[data-per="10"] { --stone-w: 7.2cqw; --rowgap: 5cqw; }
.trail[data-per="10"][data-rows="3"] { --stone-w: 6.6cqw; --rowgap: 3.8cqw; }
.trail-row { position: relative; display: flex; justify-content: space-between; }
.trail-row.back { flex-direction: row-reverse; }
/* the path: dotted along each row, and down at the turn to the next */
.trail-row::before { content: ""; position: absolute; left: calc(var(--stone-w) / 2); right: calc(var(--stone-w) / 2); top: 50%; border-top: .3cqw dotted var(--rule-2); }
.trail-row:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: calc(var(--stone-w) / 2 - .15cqw); height: calc(100% + var(--rowgap)); border-left: .3cqw dotted var(--rule-2); }
.trail-row.back:not(:last-child)::after { right: auto; left: calc(var(--stone-w) / 2 - .15cqw); }
.waystone { position: relative; z-index: 1; flex: none; width: var(--stone-w); aspect-ratio: 1; }
.waystone::before { content: ""; position: absolute; inset: 7.5%; background: var(--sheet); clip-path: polygon(39.5% 0, 60.5% 0, 100% 39.5%, 100% 60.5%, 60.5% 100%, 39.5% 100%, 0 60.5%, 0 39.5%); }
.waystone svg { position: relative; display: block; width: 100%; height: 100%; color: var(--stone); }
.waystone .n { position: absolute; inset: 0; display: grid; place-items: center; font: 700 calc(var(--stone-w) * .28)/1 var(--display); font-variant-numeric: lining-nums; color: var(--num); }
.waystone.last svg { color: var(--s-accent); }
.waystone.last .n { color: var(--s-accent); }
.prize { position: relative; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: .5cqw 1.6cqw; margin: 1.8cqw auto 0; padding: 1.5cqw 4cqw 1.7cqw;
  border-radius: 99cqw; line-height: 1.25; text-align: center; color: var(--s-ink-2); background: var(--zebra); box-shadow: inset 0 0 0 .16cqw var(--rule-2); }
.prize .label { font: 600 2cqw/1 var(--display); font-variant-caps: all-small-caps; letter-spacing: .08em; color: var(--s-accent); }
.prize strong { font: 700 3.3cqw/1.1 var(--display); letter-spacing: -.012em; color: var(--s-ink); overflow-wrap: anywhere; }
.save-ink .prize { background: #fff; }

/* ------------------------------------------------------------------ below the workshop: how-to, ideas, questions */
.notes-grid-forge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "how ideas" "faq ideas"; gap: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 4.5rem);
  align-items: start; margin-top: clamp(5rem, 9vw, 8rem); }
.notes-grid-forge > :nth-child(1) { grid-area: how; }
.notes-grid-forge > .ideas-section { grid-area: ideas; }
.notes-grid-forge > .faq-forge { grid-area: faq; }
.forge-notes { font-size: 1.08rem; line-height: 1.65; color: var(--fg-2); }
.forge-notes h2 { margin: 0 0 1.4rem; font-size: clamp(1.75rem, 2.8vw, 2.3rem); line-height: 1.08; letter-spacing: -.02em; color: var(--fg); }
.forge-notes h3 { margin: 0 0 .35rem; font-size: 1.15rem; line-height: 1.3; color: var(--fg); }
.forge-notes p { margin: 0 0 1rem; }
.forge-notes strong { color: var(--fg); }
.forge-notes a { color: var(--link); }
.forge-steps { list-style: none; margin: 0 0 1.6rem; padding: 0; counter-reset: fs; display: grid; gap: 1.1rem; }
.forge-steps li { counter-increment: fs; display: grid; grid-template-columns: 2rem 1fr; column-gap: 1rem; }
.forge-steps li::before { content: counter(fs); grid-row: span 2; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-top: .1rem; border-radius: 50%;
  font: 700 .9rem/1 var(--body); font-variant-numeric: lining-nums; color: var(--ember-ink); background: #FCEBD8; box-shadow: inset 0 0 0 1px rgba(200,100,42,.3); }
.forge-steps strong { display: block; margin-bottom: .1rem; font: 700 1.12rem/1.35 var(--display); }
.faq-forge { padding-top: clamp(2rem, 4vw, 2.75rem); border-top: 1px solid var(--hair); }
.qa { padding: 1.1rem 0; border-bottom: 1px solid var(--hair); }
.qa:last-child { border-bottom: 0; padding-bottom: 0; }
.qa h3 + p { margin: 0; }
.qa p { margin: 0; font-size: 1.02rem; }
/* the ideas: a card, the table inside it */
.ideas-section { padding: clamp(1.5rem, 3vw, 2.25rem); border-radius: var(--r-l); background: var(--card-paper); box-shadow: inset 0 0 0 1px var(--hair), var(--shadow); }
.ideas-section > p { font-size: 1.02rem; }
.ideas-table table { width: 100%; border-collapse: collapse; margin-top: .4rem; }
.ideas-table th, .ideas-table td { text-align: left; vertical-align: top; padding: .9rem 0; border-bottom: 1px solid var(--hair); }
.ideas-table thead th { padding: 0 0 .6rem; font: 600 .98rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .08em; color: var(--fg-3); border-bottom: 1px solid var(--hair-2); }
.ideas-table tbody th { width: 6.6rem; padding-right: 1rem; font: 700 1.05rem/1.9rem var(--display); color: var(--fg); white-space: nowrap; }
.ideas-table tr:last-child > * { border-bottom: 0; padding-bottom: 0; }
.ideas-table ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ideas-table li { padding: .25rem .7rem .28rem; border-radius: 999px; font: 400 .95rem/1.35 var(--body); color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }

/* ------------------------------------------------------------------ the tools index: a gallery, one tool to a row */
.forge-wall { padding-top: clamp(4.5rem, 8vw, 7rem); }
.plaque { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); grid-template-areas: "copy shot"; gap: clamp(2rem, 5.5vw, 5.5rem); align-items: center; }
.plaque > div:first-child { grid-area: copy; }
.plaque > .anvil { grid-area: shot; }
.plaque.flip { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); grid-template-areas: "shot copy"; }
.plaque + .plaque { margin-top: clamp(5rem, 10vw, 8.5rem); }
.nameplate { display: block; margin: 0 0 .9rem; font: 600 1rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--ember-ink); }
.plaque h2 { font-size: clamp(2.2rem, 3.8vw, 3.2rem); line-height: 1.02; letter-spacing: -.022em; max-width: 17ch; hyphens: manual; }
.plaque h2 a { color: inherit; text-decoration: none; transition: color .15s; }
.plaque h2 a:hover { color: var(--ember-ink); }
.plaque > div > p { margin: 1.1rem 0 0; font-size: 1.15rem; line-height: 1.6; color: var(--fg-2); max-width: 33rem; }
.features { list-style: none; margin: 1.6rem 0 0; padding: 1.25rem 0 0; display: grid; gap: .6rem; max-width: 33rem; border-top: 1px solid var(--hair); }
.features li { display: grid; grid-template-columns: 1.35rem 1fr; gap: .7rem; align-items: start; font-size: 1.02rem; line-height: 1.45; color: var(--fg); }
.features li::before { content: ""; width: .62rem; height: .34rem; margin: .42rem 0 0 .28rem; border-left: 2px solid var(--ember); border-bottom: 2px solid var(--ember); transform: rotate(-45deg); }
.plaque .actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
/* the product shot: the sheet laid on the stage, a second sheet under it */
.plaque .anvil { padding: clamp(1.5rem, 3.6vw, 3rem); }
.plaque .clamps { position: relative; transform: rotate(-1.4deg); }
.plaque.flip .clamps { transform: rotate(1.2deg); }
.plaque .clamps::before { content: ""; position: absolute; inset: 0; border-radius: .45cqw; background: #E9E1D3; transform: rotate(3deg) translate(1.5%, 1%); box-shadow: 0 30px 50px -24px rgba(0,0,0,.7); }
.plaque.flip .clamps::before { transform: rotate(-3.2deg) translate(-1.5%, 1%); }
.plaque .chart { pointer-events: none; }
.plaque .chart-grid td { font: 600 1em/1.2 var(--body); color: var(--s-ink-2); }
/* the quiz's sheet: three starter quests, each with how it's checked */
.chart.quiz-sheet .chart-grid { font-size: 2.6cqw; }
.chart.quiz-sheet .chart-grid thead th:first-child { width: 70%; }
.chart.quiz-sheet .chart-grid td span { display: inline-block; padding: .5cqw 1.6cqw .6cqw; border-radius: 99cqw; font: 600 1.7cqw/1.2 var(--body); color: var(--s-accent); box-shadow: inset 0 0 0 .14cqw var(--rule-2); }

/* three promises */
.truths { list-style: none; margin: clamp(5.5rem, 10vw, 8.5rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); }
.truths li { padding-top: 1.4rem; border-top: 1px solid var(--hair-2); }
.truths h3 { display: flex; align-items: center; gap: .7rem; font-size: 1.35rem; letter-spacing: -.01em; }
.truths p { margin: .6rem 0 0; font-size: 1.02rem; line-height: 1.55; color: var(--fg-2); }

/* the guides shelf */
.tool-guides { margin-top: clamp(5rem, 9vw, 7.5rem); }
.guides-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 2rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.guides-head .link-arrow { min-height: 2.75rem; }
.guides-head h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); letter-spacing: -.02em; }
.guides-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.4vw, 1.75rem); }
.guide-card { position: relative; display: flex; flex-direction: column; padding: clamp(1.4rem, 2.6vw, 2rem); border-radius: var(--r-l); background: var(--card-paper);
  box-shadow: inset 0 0 0 1px var(--hair), var(--shadow); transition: transform .25s var(--settle), box-shadow .25s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--hair-2), 0 2px 4px rgba(27,24,34,.05), 0 24px 44px -20px rgba(27,24,34,.3); }
.guide-card:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.guide-card .kind { margin: 0 0 .8rem; font: 600 .98rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--ember-ink); }
.guide-card h3 { font-size: clamp(1.3rem, 2vw, 1.55rem); line-height: 1.2; letter-spacing: -.012em; }
.guide-card h3 a { color: var(--fg); text-decoration: none; }
/* the whole card is the link */
.guide-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.guide-card h3 a:focus-visible { outline: none; }
.guide-card p { margin: .7rem 0 0; font-size: 1.02rem; line-height: 1.55; color: var(--fg-2); }
.guide-card .meta { margin-top: auto; padding-top: 1.2rem; font: 600 .9rem/1.3 var(--body); color: var(--fg-3); }

/* ------------------------------------------------------------------ narrower screens */
@media (max-width: 53.75em) {
  .workshop { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bench" "anvil" "actions"; row-gap: 1.25rem; }
  .anvil { margin-top: .75rem; }
  .anvil-col { position: static; display: contents; }
  .anvil { grid-area: anvil; }
  .forge-actions-wrap { grid-area: actions; }
  /* one column: the editor first, then the sheet with Print right under it, all at one readable width */
  .anvil, .bench, .forge-actions-wrap { justify-self: center; width: 100%; max-width: 44rem; }
  .plaque, .plaque.flip { grid-template-columns: minmax(0, 1fr); grid-template-areas: "shot" "copy"; gap: clamp(1.75rem, 4vw, 2.5rem); }
  .plaque h2 { max-width: 20ch; }
  .notes-grid-forge { grid-template-columns: minmax(0, 1fr); grid-template-areas: "how" "ideas" "faq"; }
  .truths, .guides-shelf { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 35em) {
  .workshop, .quiz-stage { margin-top: calc(-1 * clamp(4.5rem, 16vw, 5.5rem)); }
  .forge-top.maker-top { padding-bottom: 6.5rem; }
  .bench { padding-inline: 1.1rem; }
  .pair { grid-template-columns: minmax(0, 1fr) 7.75rem; }
  .pet-pick { gap: .4rem; }
  .pet-pick img { width: 3.1rem; height: 2.8rem; }
  .pet-pick label { min-height: 5.25rem; font-size: .8rem; }
  .anvil { padding: 1rem .9rem .9rem; border-radius: var(--r); }
  .ideas-table tbody th { width: 4.9rem; font-size: .98rem; }
  .ideas-section { padding: 1.25rem 1.1rem; }
  .plaque .anvil { padding: 1.5rem 1.25rem; }
  .forge-actions .button { flex: 1 1 auto; }
}

/* ------------------------------------------------------------------ motion and print */
@media (prefers-reduced-motion: reduce) { .chip, .daypick span, .pet-pick label, .pet-pick img, .guide-card { transition: none; } }
@media print {
  @page { size: letter landscape; margin: 9mm; }
  @page a4 { size: A4 landscape; margin: 9mm; }
  body.forge-page > *:not(main), .forge-main > *:not(.workshop), .bench, .forge-actions-wrap, .anvil-note, .forge-top { display: none !important; }
  /* the pages say color-scheme: dark (for the night chrome); Chrome would paint the paper's margins dark with it */
  :root { color-scheme: light !important; }
  html, body, .forge-main { background: #fff !important; }
  .forge-main, .workshop, .anvil-col, .anvil, .clamps, .charts { display: block !important; position: static !important; margin: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; width: auto !important; max-width: none !important;
    justify-self: stretch !important; /* Letter's printable width falls under the one-column layout, whose centring would shrink the sheet */ }
  .chart, .chart.print-only { display: flex !important; width: 100%; height: 196mm; aspect-ratio: auto; border-radius: 0; box-shadow: none !important; break-after: page;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chart:last-child { break-after: auto; }
  .paper-a4 .chart { page: a4; height: 190mm; }
}

/* forced colours: the tools' toggles keep an edge, and what's chosen is outlined in Highlight */
@media (forced-colors: active) {
  .chip, .kid span, .daypick span, .seg span, .pet-pick label, .check input { border: 1px solid ButtonText; }
  /* chosen: a thick Highlight border; focus: a Highlight outline set off from it, so the two never look alike */
  .chip.idea[aria-pressed="true"], .kid input:checked + span, .daypick input:checked + span, .seg input:checked + span, .pet-pick label:has(:checked) { border: 3px solid Highlight; }
  .chip:focus-visible, .kid:has(:focus-visible), .daypick label:has(:focus-visible), .seg label:has(:focus-visible), .pet-pick label:has(:focus-visible), .check input:focus-visible { outline: 2px solid Highlight; outline-offset: 4px; }
  .check input:checked { background: Highlight; }
}
