/* Coloring Pup — a coloring-book look: paper, black ink outlines, crayon colors. */
:root {
  --bg: #fffdf7;          /* paper */
  --surface: #ffffff;
  --paper: #fff;
  --ink: #1f1d1a;         /* the same near-black as the line art */
  --muted: #5d584f;
  --line: #e9e4d8;        /* soft dividers */
  --sage: #f4f0e6;        /* quiet fills (segmented controls, chips) */
  --accent: #e2463a;      /* crayon red, for links and small accents */
  --accent-dark: #b93227;
  --yellow: #ffc53d;      /* primary buttons */
  --stroke: 2px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --radius: 16px;
  --max: 1240px;
  --display: "Fredoka", "Avenir Next Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--accent-dark); text-underline-offset: .22em; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
button, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #4d9fff; outline-offset: 3px; }
::selection { background: #ffe08a; color: var(--ink); }
.wrap { width: min(100% - 48px, var(--max)); margin-inline: auto; }
main.wrap { padding-block: 0 96px; min-height: 60vh; }
main.full { max-width: none; padding: 0; }
h1, h2, h3, p { margin-block: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -.01em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); text-wrap: balance; }
h3 { font-size: 1.15rem; }
p { text-wrap: pretty; }
p + p { margin-top: 1em; }
p.lead { max-width: 60ch; font-size: clamp(1.02rem, 1.4vw, 1.15rem); color: var(--muted); line-height: 1.6; }

/* Buttons: ink outline with a hard offset shadow, like a sticker on paper */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 20px; border: var(--stroke); border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); font-family: var(--display); font-size: 1rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--yellow); }
.btn-primary:hover { background: #ffd35f; }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-secondary:hover { background: #3a3631; color: #fff; }
.btn-ghost { background: var(--surface); }
.btn-ghost:hover { background: #fff8e6; }
.text-link, .section-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.text-link:hover, .section-link:hover { color: var(--accent-dark); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.chip-easy { background: #d9f5e3; }
.chip-medium { background: #fff1c7; }
.chip-detailed { background: #ffe0dc; }

/* Site chrome */
.site-header { position: relative; z-index: 2; background: var(--surface); border-bottom: var(--stroke); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--ink); font-family: var(--display); font-size: 1.45rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.site-header nav { display: flex; align-items: center; gap: 4px; margin-inline: auto; }
.site-header nav a { padding: 7px 13px; border-radius: 999px; color: var(--ink); font-size: .92rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-header nav a:hover { background: var(--sage); color: var(--ink); }
.site-header nav a.active { background: var(--ink); color: #fff; }
.header-cta { min-height: 40px; padding: 7px 16px; font-size: .92rem; }
.site-footer { margin-top: 40px; border-top: var(--stroke); background: var(--surface); padding: 52px 0 28px; }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 36px; }
.site-footer p { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; gap: 22px; align-items: start; flex-wrap: wrap; }
.footer-links a { color: var(--ink); font-weight: 800; text-decoration: none; }
.footer-links a:hover { color: var(--accent-dark); }
.footer-themes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.footer-themes a { color: var(--muted); font-size: .84rem; text-decoration: none; white-space: nowrap; }
.footer-themes a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .footer-bottom { grid-column: 1 / -1; margin: 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .82rem; }
.site-footer .footer-disclaimer { grid-column: 1 / -1; margin: 0; font-size: .76rem; opacity: .8; }
.licensed-note { font-size: .84rem; color: var(--muted); margin-top: 10px; }

/* Home: hero with a page you can color right away */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 56px; padding-block: 40px 56px; }
.hero-copy h1 { font-size: clamp(2.7rem, 5.4vw, 4.9rem); }
.hero-copy h1 .mark { position: relative; white-space: nowrap; }
.hero-copy h1 .mark::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .32em; z-index: -1; background: var(--yellow); border-radius: 4px; transform: rotate(-1.2deg); }
.hero-copy h1 { position: relative; z-index: 0; }
.hero-copy .lead { margin-top: 22px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 32px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; padding: 0; list-style: none; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--surface); font-size: .86rem; font-weight: 700; }
.hero-facts b { font-family: var(--display); font-size: 1.05rem; font-weight: 600; }
.try-card { justify-self: center; width: min(100%, 400px); padding: 14px; border: var(--stroke); border-radius: 22px; background: var(--surface); box-shadow: 8px 8px 0 var(--ink); }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 12px; }
.try-head strong { font-family: var(--display); font-size: 1.1rem; font-weight: 600; }
.try-head .chip { background: #d9f5e3; }
.try-stage { position: relative; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 12px; background: #fff; aspect-ratio: var(--w) / var(--h); cursor: pointer; touch-action: manipulation; }
.try-stage > img, .try-stage > svg, .try-stage .try-lines svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.try-stage .try-lines { position: absolute; inset: 0; pointer-events: none; }
.try-stage path[data-i] { transition: fill .25s ease; }
.try-crayons { display: flex; justify-content: space-between; gap: 6px; padding: 14px 2px 4px; }
.try-crayons button { position: relative; flex: 1; height: 44px; border: 0; background: none; padding: 0; }
.try-crayons button::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 26px; height: 34px; margin-left: -13px; border: 1.5px solid var(--ink); border-radius: 4px 4px 6px 6px; background: var(--c); transition: transform .15s ease; }
.try-crayons button::after { content: ""; position: absolute; left: 50%; bottom: 33px; margin-left: -8px; border-inline: 8px solid transparent; border-bottom: 10px solid var(--ink); transition: transform .15s ease; }
.try-crayons button[aria-pressed="true"]::before, .try-crayons button[aria-pressed="true"]::after { transform: translateY(-7px); }
.try-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px 2px; color: var(--muted); font-size: .86rem; }
.try-foot a { font-weight: 800; color: var(--ink); }

/* Home sections */
.home-section { padding-block: 34px 44px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading p { margin-top: 6px; color: var(--muted); }
.season { padding: 30px; border: var(--stroke); border-radius: 24px; background: var(--tone, #ffe2c7); box-shadow: 6px 6px 0 var(--ink); }
.season .section-heading h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 16px; overflow-x: auto; padding: 4px 6px 12px 2px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.scroller > * { scroll-snap-align: start; }
.facts-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-block: 26px 10px; }
.fact { padding: 20px 22px; border: var(--stroke); border-radius: var(--radius); background: var(--surface); }
.fact h3 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.fact h3::before { content: ""; width: 14px; height: 14px; flex: none; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--c); }
.fact p { margin-top: 8px; color: var(--muted); font-size: .94rem; }

/* Theme cards: the first page of the theme, colored in, on the theme's crayon color */
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.theme-card { display: flex; flex-direction: column; overflow: hidden; border: var(--stroke); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.theme-card:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.theme-art { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: var(--stroke); background: var(--tone); }
.theme-art img { position: absolute; left: 9%; right: 9%; top: 10%; width: 82%; height: auto; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; transition: transform .25s ease; }
.theme-card:hover .theme-art img { transform: translateY(-4%); }
.theme-monogram { display: grid; place-items: center; height: 100%; font-family: var(--display); font-size: 5rem; font-weight: 700; }
.theme-card-content { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px 14px; }
.theme-card-title { font-family: var(--display); font-size: 1.12rem; font-weight: 600; line-height: 1.2; }
.theme-card-count { flex: none; padding: 2px 9px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--tone); font-size: .76rem; font-weight: 800; white-space: nowrap; }

/* Page cards: line art; the colored preview fades in on hover */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-block: 26px; }
.card { display: flex; flex-direction: column; overflow: hidden; border: var(--stroke); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.card-art { position: relative; aspect-ratio: 480 / 621; border-bottom: var(--stroke); background: #fff; }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-art .card-color { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity .3s ease; }
.card:hover .card-color, .card:focus-visible .card-color { background-image: var(--color); opacity: 1; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 11px 13px 13px; }
.card .t { font-size: .92rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .chip { align-self: flex-start; font-size: .72rem; padding: 1px 9px; }

/* Catalogs and page details */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 22px 0; color: var(--muted); font-size: .84rem; font-weight: 700; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.catalog-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 30px; margin-block: 22px 8px; padding: 34px 36px; border: var(--stroke); border-radius: 24px; background: var(--tone, #fff1c7); box-shadow: 6px 6px 0 var(--ink); }
.catalog-intro h1 { font-size: clamp(2.2rem, 4.4vw, 3.8rem); }
.catalog-intro .lead { margin-top: 14px; color: var(--ink); opacity: .85; }
.catalog-intro .licensed-note { color: var(--ink); opacity: .75; }
.catalog-intro .intro-count { display: grid; place-items: center; width: 130px; aspect-ratio: 1; border: var(--stroke); border-radius: 50%; background: var(--surface); text-align: center; line-height: 1.1; font-weight: 800; transform: rotate(-6deg); }
.catalog-intro .intro-count b { display: block; font-family: var(--display); font-size: 2.6rem; font-weight: 700; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.filter-bar span { margin-right: 4px; color: var(--muted); font-size: .88rem; font-weight: 800; }
.filter-bar button { padding: 6px 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--surface); font-weight: 800; font-size: .86rem; }
.filter-bar button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.catalog-grid { padding-bottom: 20px; }
.prose-page { max-width: 760px; padding-block: 64px 30px; }
.prose-page h1 { margin: 14px 0 26px; font-size: clamp(2.4rem, 4.5vw, 3.8rem); }
.prose-page h2 { margin: 42px 0 14px; font-size: 1.6rem; }
.prose-page p, .prose-page li { color: var(--muted); line-height: 1.8; }
.prose-page .lead { margin-bottom: 28px; }
.prose-page ul { padding-left: 1.3em; }
.prose-page li + li { margin-top: 9px; }
.collection-info { max-width: 760px; margin-top: 64px; color: var(--muted); }
.collection-info h2 { margin: 44px 0 16px; color: var(--ink); font-size: 1.7rem; }
.collection-info p { line-height: 1.75; }
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-list a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .88rem; font-weight: 800; text-decoration: none; }
.tag-list a::before { content: ""; width: 10px; height: 10px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--c, #fff); }
.tag-list a:hover { background: #fff8e6; }

/* Page detail: the sheet on the left, everything you can do with it on the right */
.page-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: start; gap: 48px; margin-top: 22px; }
.sheet { padding: 14px; border: var(--stroke); border-radius: 20px; background: #fff; box-shadow: 6px 6px 0 var(--ink); }
.sheet img { width: 100%; }
.detail-panel { position: sticky; top: 20px; display: grid; gap: 18px; }
.detail-panel h1 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.12; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-meta .chip-theme { background: var(--tone); text-decoration: none; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions .btn { min-height: 52px; font-size: 1.05rem; }
.panel-box { padding: 18px 20px; border: var(--stroke); border-radius: var(--radius); background: var(--surface); }
.panel-box h2 { margin-bottom: 12px; font-size: 1.2rem; }
.panel-box p { color: var(--muted); font-size: .94rem; }
.example { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; }
.example img { border: 1.5px solid var(--ink); border-radius: 8px; }
.meta { color: var(--muted); font-size: .9rem; }
.related { margin-top: 80px; }
.related h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
.related > p { margin-top: 18px; }
.faq details { padding: 12px 0; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; }

/* Download controls */
.dl { margin: 0; padding: 18px 20px; border: var(--stroke); border-radius: var(--radius); background: var(--surface); }
.dl-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.dl label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .77rem; font-weight: 700; }
.dl select { width: 100%; min-height: 43px; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font-size: .9rem; font-weight: 600; }
.dl.compact { margin: 10px 0 0; padding: 0; border: 0; background: transparent; }
.dl.compact .dl-row { grid-template-columns: 1fr; gap: 10px; }
.dl.compact .btn { width: 100%; }

/* Online coloring tool */
.editor { display: flex; flex-direction: column; height: 100dvh; min-height: 540px; background: #f5f0e4; }
.editor-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.editor-bar .back { color: var(--muted); font-size: .84rem; font-weight: 700; text-decoration: none; }
.editor-bar h1 { margin: 0; font-size: 1.08rem; }
.editor-bar .meta { margin-left: auto; }
.editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; flex: 1; min-height: 0; }
.editor-stage { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 20px 24px 16px; }
/* the picture takes the largest size that fits both ways */
.stage-fit { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.editor-stage .stage { width: min(100cqw, 100cqh * var(--w, 17) / var(--h, 22)); border-radius: 8px; background: #fff; box-shadow: 0 12px 40px rgba(43,58,45,.15); }
.editor-stage #colorbox { width: min(100cqw, 100cqh * 17 / 22); }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stage-actions .btn { min-height: 42px; padding: 9px 16px; font-size: .86rem; }
.stage-actions .zoom-group { display: inline-flex; gap: 4px; }
.stage-actions .zoom-group .btn { min-width: 44px; padding-inline: 12px; }
.stage { position: relative; width: 100%; overflow: hidden; border: 1px solid var(--line); background: #f3f0ea; touch-action: none; cursor: crosshair; user-select: none; }
.stage-inner { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.stage-inner svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.stage-inner svg path { cursor: pointer; }
.stage-inner > svg path:hover { fill-opacity: .85; }
.stage-inner img.lines, .stage-inner .lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage-inner img.lines { mix-blend-mode: multiply; }
.stage-inner .lines svg { display: block; width: 100%; height: 100%; }
#colorCanvas { width: 100%; border: 1px solid var(--line); background: #fff; touch-action: none; cursor: crosshair; }
.editor-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--surface); }
.panel-top { display: grid; gap: 12px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line); }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.editor-panel h2 { margin-bottom: 14px; color: var(--ink); font-size: .92rem; font-weight: 750; letter-spacing: 0; }
.editor-panel .current { width: 40px; height: 40px; flex: none; border: 2px solid #fff; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 1px #c9d0c7; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: var(--sage); }
.seg button { min-height: 36px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: .84rem; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(43,58,45,.15); }
.swatch-group { padding-block: 14px; border-bottom: 1px solid var(--line); }
.swatch-group h3 { margin: 0 0 10px; color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.palette { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.palette button, .swatches button { width: 33px; height: 33px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #c9d0c7; cursor: pointer; }
.palette button[aria-pressed="true"], .swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.editor-panel .palette, .swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.editor-panel .palette button, .swatches button { width: 100%; height: auto; aspect-ratio: 1; }
.swatches.grad button { border-radius: 10px; }
.editor-panel .toolrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-panel .btn { min-height: 40px; padding: 9px 12px; font-size: .83rem; }
.editor-panel .tool[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.editor-panel .custom { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; color: var(--muted); font-size: .85rem; }
.editor-panel .custom input { width: 36px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; }
.editor-panel .fix-panel { margin-top: 14px; padding-block: 18px; border-block: 1px solid var(--line); }
.editor-panel .meta { margin-top: 12px; line-height: 1.5; }
.dl-dialog { width: min(100% - 32px, 400px); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.dl-dialog::backdrop { background: rgba(40,52,47,.35); }
.dl-dialog h2 { font-size: 1.15rem; letter-spacing: 0; }
.dl-dialog > form[method="dialog"] { margin-top: 12px; text-align: center; }

@media (max-width: 1050px) {
  .site-header .wrap { gap: 16px; }
  .theme-grid, .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-hero { gap: 32px; }
  .page-layout { gap: 32px; }
  .facts-strip { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .home-hero { grid-template-columns: 1fr; padding-block: 36px 40px; }
  .try-card { width: min(100%, 440px); }
  .page-layout { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
}
@media (max-width: 780px) {
  .site-header .wrap { min-height: 64px; flex-wrap: wrap; justify-content: space-between; padding-block: 10px; }
  .site-header nav { order: 3; width: 100%; margin: 0 0 2px; overflow-x: auto; scrollbar-width: none; }
  .site-header nav a { font-size: .85rem; padding: 6px 11px; }
  .catalog-intro { grid-template-columns: 1fr; padding: 26px 22px; }
  .catalog-intro .intro-count { display: none; }
  .season { padding: 22px 18px; }
  .editor { height: auto; min-height: 0; }
  .editor-body { grid-template-columns: 1fr; }
  .editor-stage { padding: 14px 16px; }
  .stage-fit { flex: none; height: min(72dvh, calc((100vw - 32px) * var(--h, 22) / var(--w, 17))); }
  .editor-panel { border-left: 0; border-top: 1px solid var(--line); }
  .panel-scroll { overflow: visible; }
  .editor-panel .palette, .swatches { grid-template-columns: repeat(12, 1fr); }
}
@media (max-width: 600px) {
  .wrap { width: min(100% - 32px, var(--max)); }
  main.wrap { padding-bottom: 64px; }
  .brand { font-size: 1.25rem; }
  .header-cta { display: none; }
  .hero-copy h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .try-card { box-shadow: 5px 5px 0 var(--ink); }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .theme-grid, .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .theme-card-content { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 11px 12px; }
  .theme-card-title { font-size: 1rem; }
  .card .t { font-size: .84rem; }
  .card-body { padding: 9px 10px 11px; }
  .actions { grid-template-columns: 1fr; }
  .dl-row { grid-template-columns: 1fr; }
  .related { margin-top: 56px; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 24px; }
  .footer-links { gap: 16px; }
  .editor-bar { padding: 12px 16px; }
  .editor-bar .meta { display: none; }
  .editor-panel .palette, .swatches { grid-template-columns: repeat(8, 1fr); }
  .stage-actions .btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  body { background: #fff; }
  .no-print, .site-header, .site-footer, .detail-panel, .breadcrumb, .related, .faq { display: none !important; }
  .wrap { width: 100%; max-width: none; padding: 0; }
  .page-layout { display: block; margin: 0; }
  .sheet { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .sheet img { width: 100%; height: auto; page-break-inside: avoid; }
  @page { size: letter portrait; margin: .4in; }
}


.linklike { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.linklike:hover { color: var(--ink); }

/* gap fixing & reports (online coloring) */
.editor-stage { position: relative; }
.stage-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 32px); margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .85rem; text-align: center; pointer-events: none; }
.stage-toast { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; width: max-content; max-width: calc(100% - 32px); padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); box-shadow: 0 8px 28px rgba(43,58,45,.18); font-size: .88rem; }
.stage-toast .btn { min-height: 34px; padding: 6px 12px; font-size: .82rem; }
.fix-panel .toolrow + .toolrow { margin-top: 10px; gap: 14px; font-size: .82rem; }
.fix-panel .meta { margin: 0 0 12px; }
.fix-help { max-width: 440px; width: calc(100% - 32px); padding: 22px; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.fix-help::backdrop { background: rgba(20,30,20,.45); }
.fix-help h2 { margin: 0 0 12px; font-size: 1.15rem; }
.fix-steps { margin: 0 0 12px; padding-left: 20px; }
.fix-steps li { margin-bottom: 14px; line-height: 1.45; }
.fix-steps svg { display: block; width: 120px; height: 70px; margin-bottom: 4px; }
