/* The printables hub (lib/printables-hub.js), as design/printables-2026-11/main.html and the Tools
   board's sections A and D draw it. Values come from design.css only (docs/decisions/2026-10-25-
   one-design-system-and-header.md); the board's sizes are kept where it gives them. */
.ph { font-family: var(--font-ui); color: var(--ink); max-width: 1280px; margin: 0 auto; padding: 0 16px; box-sizing: content-box; }
main:has(> .ph), body:has(.ph) { background: radial-gradient(900px 600px at 92% 4%, var(--bloom-mint), transparent 70%), radial-gradient(800px 700px at 0% 30%, var(--bloom-peach), transparent 70%), radial-gradient(1000px 600px at 60% 100%, var(--bloom-mint), transparent 70%), var(--cream); }
.ph [hidden] { display: none !important; }
.ph-eyebrow { font: 700 var(--text-12)/1.3 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); margin: 0; }
.ph-hint { font: 400 var(--text-13)/1.5 var(--font-ui); color: var(--muted); margin: 0; }
.ph-lbl { font: 700 var(--text-12) var(--font-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.ph-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-meta { font: 400 var(--text-13) var(--font-ui); color: var(--muted); margin: 0; }
.ph-kind { font: 700 var(--text-12) var(--font-ui); color: var(--accent-dark); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.ph-h2 { font: 400 var(--text-44)/1.1 var(--font-display); margin: 0; }

/* the hero: the words and the studio card beside the collage */
.ph-hero { display: grid; grid-template-columns: 640px minmax(0, 1fr); gap: 48px; padding: 56px 0 32px; }
.ph-h1 { font: 400 var(--text-hero)/1.02 var(--font-display); margin: 12px 0 16px; letter-spacing: -.01em; }
.ph-h1 i { color: var(--accent-dark); }
.ph-lede { font: 400 var(--text-18)/1.55 var(--font-ui); color: var(--muted); margin: 0 0 24px; max-width: 560px; }
.ph-studio { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-20); box-shadow: var(--shadow-float); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ph-field { display: flex; align-items: center; gap: 10px; background: var(--sunk); border-radius: var(--radius-12); padding: 0 14px; height: 52px; color: var(--muted); }
.ph-field span { font: 700 var(--text-12) var(--font-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; width: 64px; flex-shrink: 0; }
.ph-field input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: 600 var(--text-18) var(--font-ui); color: var(--ink); outline: none; }
.ph-field input::-webkit-search-cancel-button { display: none; }
.ph-field:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.ph-field svg { width: 18px; height: 18px; flex-shrink: 0; }
.ph-collage { position: relative; height: 440px; }
.ph-sheet { position: absolute; background: var(--artwell); border: 1px solid var(--artwell-line); border-radius: var(--radius-8); box-shadow: var(--shadow-book); overflow: hidden; }
.ph-sheet img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ph-sheet-1 { left: 40px; top: 30px; width: 270px; height: 370px; transform: rotate(-6deg); z-index: calc(var(--z-base) + 1); }
.ph-sheet-2 { left: 300px; top: 0; width: 250px; height: 340px; transform: rotate(4deg); }
.ph-sheet-3 { left: 500px; top: 120px; width: 110px; height: 300px; transform: rotate(-3deg); }
.ph-sheet-3 img { object-fit: cover; }

/* Tools board A: the two doors */
.ph-doors { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-bottom: 24px; }
.ph-door { border-radius: var(--radius-20); padding: 32px; display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; align-items: end; border: 1px solid var(--line); }
.ph-door-1 { background: var(--bloom-peach); }
.ph-door-2 { background: var(--bloom-mint); }
.ph-door h2 { font: 400 var(--text-44)/1.05 var(--font-display); margin: 6px 0 10px; }
.ph-door p:not(.ph-eyebrow) { font: 400 var(--text-16)/1.5 var(--font-ui); color: var(--muted); margin: 0 0 18px; }
.ph-door ul { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ph-door li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 6px 12px; font: 600 var(--text-13) var(--font-ui); }
.ph-door-pic { height: 220px; background: var(--artwell); border-radius: var(--radius-12); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-book); }
.ph-door-pic img { max-height: 190px; max-width: 85%; object-fit: contain; }

/* the filters */
.ph-filters { background: color-mix(in srgb, var(--surface) 72%, transparent); border: 1px solid var(--line); border-radius: var(--radius-20); padding: 16px 20px; display: grid; gap: 14px; position: relative; }
.ph-tab, .ph-chip { height: var(--button-h); border-radius: var(--radius-pill); font: 700 var(--text-13) var(--font-ui); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; }
.ph-tab em, .ph-chip em, .ph-fopt em { font: 600 var(--text-12) var(--font-ui); font-style: normal; color: var(--faint); }
.ph-chip { padding: 0 14px 0 4px; font-weight: 600; border-color: var(--line); background: var(--surface); gap: 8px; }
.ph-chip img { width: 28px; height: 28px; border-radius: var(--radius-pill); object-fit: cover; background: var(--sunk); }
.ph-chip em { display: none; }
.ph-tab[aria-pressed="true"], .ph-chip[aria-pressed="true"] { background: var(--surface); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ph-toggles { gap: 28px; }
.ph-toggles > .ph-row { gap: 6px; }
.ph-seg { display: inline-flex; background: var(--sunk); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.ph-seg button { height: 30px; padding: 0 12px; border-radius: var(--radius-pill); border: 0; font: 700 var(--text-12) var(--font-ui); cursor: pointer; color: var(--muted); background: transparent; }
.ph-seg button small { display: none; }
.ph-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-rest); }
.ph-sheet-head, .ph-sheet-foot, .ph-open, .ph-phone, .ph-dim { display: none; }

/* the grid of sheets */
.ph-more { display: flex; justify-content: center; margin-top: 32px; }
.ph-more[hidden] { display: none; }
.ph-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.ph-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-20); overflow: hidden; box-shadow: var(--shadow-rest); display: flex; flex-direction: column; }
.ph-well { height: 300px; background: var(--artwell); border-bottom: 1px solid var(--artwell-line); position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--ink); text-decoration: none; }
/* each kind's well, as the board draws it: the picture large, a maze's outline with its character
   in the corner, a name sheet's three rows of tracing letters; the belonging line at the foot */
.ph-art { max-width: 86%; max-height: 220px; object-fit: contain; margin-bottom: 40px; }
.ph-maze { width: 210px; height: 210px; margin-bottom: 40px; }
.ph-corner { position: absolute; right: 14px; top: 14px; width: 64px; height: 64px; object-fit: contain; }
.ph-traces { display: grid; margin-bottom: 40px; max-width: 100%; }
.ph-trace { font: 400 var(--text-44)/1.5 var(--font-display); color: transparent; -webkit-text-stroke: 1.2px var(--faint); letter-spacing: .06em; text-align: center; white-space: nowrap; overflow: hidden; }
.ph-trace:last-child { -webkit-text-stroke-color: var(--line-strong); }
.ph-belong { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; font: 400 var(--text-13) var(--font-ui); color: var(--muted); text-align: center; }
.ph-belong b { display: block; font: 400 var(--text-22) var(--font-display); color: var(--ink); border-bottom: 1.5px dashed var(--line-strong); margin: 0 24px; padding-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-ct { font: 600 var(--text-16)/1.35 var(--font-ui); margin: 4px 0; }
.ph-cb { padding: 14px 16px 16px; display: grid; gap: 10px; flex: 1; align-content: space-between; }
.ph-cf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* a puzzle card's line for what went wrong with its Download (/download-flow.js), beside it */
/* the result line atop the filters (a world's link lands here); the phone's sheet has its own count */
.ph-flead { margin: 0; }
.ph-say { font: 400 var(--text-13)/1.5 var(--font-ui); color: var(--muted); margin: 0; }
.ph-say.bad { color: var(--warn); }
.ph-say[hidden] { display: none; }
.ph-chars { gap: 4px; }
.ph-chars button { height: 24px; padding: 0 8px; border-radius: var(--radius-pill); border: 1px solid var(--line); font: 700 var(--text-12) var(--font-ui); background: var(--surface); color: var(--muted); cursor: pointer; }
.ph-chars button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.ph-up { background: var(--slab); color: var(--on-slab); border-radius: var(--radius-20); padding: 24px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.ph-up .ph-eyebrow { color: var(--spark); }
.ph-up h3 { font: 400 var(--text-30)/1.1 var(--font-display); margin: 0; }
.ph-up p:not(.ph-eyebrow) { margin: 0; font: 400 var(--text-14)/1.5 var(--font-ui); color: color-mix(in srgb, var(--on-slab) 78%, transparent); }
.ph-up-foot { justify-content: space-between; margin-top: auto; font: 600 var(--text-13) var(--font-ui); }
.ph-fan { position: relative; height: 150px; margin: 4px 0; }
.ph-fan img { position: absolute; width: 104px; height: 140px; object-fit: cover; border-radius: var(--radius-8); box-shadow: var(--shadow-book); border: 2px solid var(--glass-edge); }
.ph-fan img:nth-child(1) { left: 0; top: 6px; transform: rotate(-7deg); }
.ph-fan img:nth-child(2) { left: 72px; top: 0; z-index: calc(var(--z-base) + 1); }
.ph-fan img:nth-child(3) { left: 144px; top: 8px; transform: rotate(6deg); }

/* Tools board D: the search */
.ph-search { padding-top: 8px; }
.ph-qbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); height: 52px; padding: 0 20px; font: 600 var(--text-16) var(--font-ui); margin: 0; }
.ph-qbar svg { width: 18px; height: 18px; }
.ph-qbar .sp { flex: 1; }
.ph-facets { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; margin-top: 20px; }
.ph-facets.none { grid-template-columns: minmax(0, 1fr); }
.ph-facets.none .ph-fcol { display: none; }
.ph-fgrp { display: grid; gap: 4px; margin-bottom: 18px; }
.ph-fgrp.ph-phone { display: none; }
.ph-fopt { display: flex; justify-content: space-between; align-items: center; height: var(--button-h); padding: 0 12px; border-radius: var(--radius-pill); font: 600 var(--text-13) var(--font-ui); border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.ph-fopt em { font-weight: 400; color: var(--muted); }
.ph-fopt[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-dark); }
.ph-rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-content: start; }
.ph-rc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-12); overflow: hidden; text-decoration: none; color: var(--ink); display: block; }
.ph-rc .w { height: 180px; background: var(--artwell); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--artwell-line); }
.ph-rc .w img { max-height: 160px; max-width: 85%; object-fit: contain; }
.ph-rc .t { display: block; padding: 10px 12px; font: 600 var(--text-13) var(--font-ui); }
.ph-rc .t span { display: block; font: 400 var(--text-12) var(--font-ui); color: var(--muted); }
.ph-yours { background: var(--slab); color: var(--on-slab); border-color: var(--slab); display: grid; align-content: center; gap: 10px; padding: 20px; }
.ph-yours .ph-eyebrow { color: var(--spark); }
.ph-yours b { font: 400 var(--text-22)/1.2 var(--font-display); }
.ph-yours .tj-btn { justify-self: start; }
.ph-empty { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-20); padding: 40px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.ph-empty h3 { font: 400 var(--text-30) var(--font-display); margin: 0; }
.ph-try { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-dark); text-decoration: underline; cursor: pointer; }

/* the worlds, the books, the band */
.ph-section { margin-top: 88px; }
.ph-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ph-all { color: var(--ink); font: 600 var(--text-14) var(--font-ui); text-decoration: none; }
.ph-worldgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.ph-world { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-20); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; padding: 14px 10px; gap: 6px; }
.ph-world .pic { width: 112px; height: 112px; border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--tint); }
.ph-world .pic img { width: 100%; height: 100%; object-fit: contain; }
.ph-world b { font: 600 var(--text-14) var(--font-ui); }
.ph-world small { font: 400 var(--text-12) var(--font-ui); color: var(--muted); }
.ph-books { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.ph-book { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-20); padding: 20px; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; text-decoration: none; color: var(--ink); }
.ph-book > img { width: 120px; height: 160px; object-fit: cover; border-radius: var(--radius-8); box-shadow: var(--shadow-book); }
.ph-book h3 { font: 400 var(--text-30)/1.1 var(--font-display); margin: 4px 0; }
.ph-pages { display: flex; gap: 6px; margin-top: 10px; }
.ph-pages img { width: 44px; height: 56px; border: 1px solid var(--artwell-line); background: var(--artwell); border-radius: var(--r-small); object-fit: contain; }
.ph-band { background: var(--slab); color: var(--on-slab); border-radius: var(--radius-20); padding: 40px 48px; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; align-items: center; margin-top: 72px; }
.ph-band .ph-eyebrow { color: var(--spark); }
.ph-band h2 { font: 400 var(--text-44)/1.08 var(--font-display); margin: 8px 0 12px; }
.ph-band p:not(.ph-eyebrow) { font: 400 var(--text-16)/1.55 var(--font-ui); color: color-mix(in srgb, var(--on-slab) 78%, transparent); margin: 0 0 20px; }
.ph-tiers { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.ph-tier { border: 1px solid var(--glass-edge); background: var(--glass); border-radius: var(--radius-12); padding: 10px 14px; font: 400 var(--text-13) var(--font-ui); }
.ph-tier b { display: block; font: 700 var(--text-16) var(--font-ui); }
.ph-bandfan { position: relative; height: 300px; }
.ph-bandfan img { position: absolute; width: 170px; height: 226px; object-fit: cover; border-radius: var(--radius-8); box-shadow: var(--shadow-book); }
.ph-bandfan img:nth-child(1) { left: 10px; top: 40px; transform: rotate(-8deg); }
.ph-bandfan img:nth-child(2) { left: 230px; top: 30px; transform: rotate(7deg); }
.ph-bandfan img:nth-child(3) { left: 120px; top: 0; width: 190px; height: 252px; box-shadow: var(--shadow-float); z-index: calc(var(--z-base) + 1); }

/* the printables footer, in the bar's colour */
.ph-foot { background: var(--bar); color: var(--cream); margin-top: 80px; padding: 48px 16px 40px; }
.ph-foot-cols { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr repeat(5, minmax(0, 1fr)); gap: 24px; }
.ph-foot p { font: 400 var(--text-13)/1.6 var(--font-ui); color: color-mix(in srgb, var(--cream) 72%, transparent); margin: 14px 0 0; max-width: 260px; }
.ph-foot h4 { font: 700 var(--text-13) var(--font-ui); margin: 0 0 12px; color: var(--cream); }
.ph-foot a { display: block; font: 400 var(--text-13)/2 var(--font-ui); color: color-mix(in srgb, var(--cream) 72%, transparent); text-decoration: none; }
.ph-foot a:hover { color: var(--cream); }

/* between a laptop and a phone: the board's columns fold */
@media (max-width: 1279px) {
  .ph-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ph-collage { transform: scale(.8); transform-origin: top left; }
  .ph-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ph-worldgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ph-books { grid-template-columns: minmax(0, 1fr); }
  .ph-band { grid-template-columns: minmax(0, 1fr); }
  .ph-foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* a phone (390): one column; the filters open as a sheet from the bottom (Tools board D) */
@media (max-width: 720px) {
  .ph-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 0 16px; }
  .ph-collage { transform: none; height: 300px; }
  .ph-sheet-1 { left: 8px; top: 16px; width: 180px; height: 248px; }
  .ph-sheet-2 { left: 170px; top: 0; width: 160px; height: 218px; }
  .ph-sheet-3 { display: none; }
  .ph-doors { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ph-door { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .ph-door h2 { font-size: var(--text-30); }
  .ph-door-pic { display: none; }
  .ph-open { display: inline-flex; }
  .ph-filters, .ph-fcol { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet); background: var(--surface); border: 0; border-radius: var(--radius-20) var(--radius-20) 0 0; padding: 16px 16px 20px; display: grid; gap: 14px; max-height: 80vh; overflow: auto; transform: translateY(110%); transition: transform .2s ease; box-shadow: var(--shadow-float); }
  .ph-filters.open, .ph-fcol.open { transform: none; }
  .ph-flead { display: none; }
  .ph-sheet-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; font: 600 var(--text-16) var(--font-ui); }
  .ph-sheet-head i { grid-column: 1 / -1; justify-self: center; width: 44px; height: 4px; border-radius: var(--radius-pill); background: var(--line-strong); margin-bottom: 10px; }
  .ph-clear { border: 0; background: none; font: 600 var(--text-13) var(--font-ui); color: var(--ink); cursor: pointer; }
  .ph-sheet-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--rule); padding-top: 14px; }
  .ph-row.ph-kinds, .ph-row.ph-worlds, .ph-toggles, .ph-toggles > .ph-row { display: flex; flex-wrap: wrap; gap: 8px; }
  .ph-lbl { flex-basis: 100%; }
  .ph-chip em { display: inline; }
  .ph-tab[aria-pressed="true"], .ph-chip[aria-pressed="true"], .ph-sheet-open .ph-fopt[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-dark); color: var(--accent-dark); box-shadow: none; }
  .ph-seg { background: none; padding: 0; gap: 8px; flex-wrap: wrap; }
  .ph-seg button { height: var(--button-h); padding: 0 14px; border: 1px solid var(--line-strong); font-size: var(--text-13); color: var(--ink); }
  .ph-seg button small { display: inline; font-weight: 400; color: var(--muted); margin-left: 4px; }
  .ph-seg button[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-dark); color: var(--accent-dark); box-shadow: none; }
  .ph-free { display: none; }
  .ph-phone { display: grid; }
  .ph-fgrp { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
  .ph-fgrp.ph-phone { display: flex; }
  .ph-fopt { border: 1px solid var(--line-strong); gap: 6px; padding: 0 14px; }
  .ph-sheet-open .ph-dim { display: block; position: fixed; inset: 0; z-index: calc(var(--z-sheet) - 1); background: color-mix(in srgb, var(--bar) 38%, transparent); }
  .ph-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
  .ph-well { height: 240px; }
  .ph-art { max-height: 150px; }
  .ph-maze { width: 150px; height: 150px; }
  .ph-trace { font-size: var(--text-30); }
  .ph-qbar { height: 44px; font-size: var(--text-14); }
  .ph-search .ph-open { margin-top: 12px; }
  .ph-facets { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
  .ph-rgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .ph-rc .w { height: 140px; }
  .ph-yours, .ph-empty { grid-column: 1 / -1; }
  .ph-empty { padding: 24px 16px; }
  .ph-section { margin-top: 56px; }
  .ph-h2 { font-size: var(--text-30); }
  .ph-worldgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .ph-world .pic { width: 80px; height: 80px; }
  .ph-book { grid-template-columns: 90px minmax(0, 1fr); padding: 16px; }
  .ph-book > img { width: 90px; height: 120px; }
  .ph-book h3 { font-size: var(--text-22); }
  .ph-band { padding: 28px 20px; margin-top: 56px; }
  .ph-band h2 { font-size: var(--text-30); }
  .ph-bandfan { display: none; }
  .ph-foot { margin-top: 56px; }
  .ph-foot-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ph-foot-cols > div:first-child { grid-column: 1 / -1; }
}
