/* =====================================================================
   The Lesson Stand: the ONE stylesheet for the whole site.
   Colors are never written below the token block. Every color is a CSS
   variable; the token block is written by `manage.py build_tokens` from
   brand/lessonstand.json (light and dark). See ENGINEERING-STANDARDS.md 8.
   ===================================================================== */

/* TOKENS:START (written by manage.py build_tokens from the brand file; do not edit by hand) */
:root {
  color-scheme: light;
  --font-body: "Lexend", system-ui, "Segoe UI", Arial, sans-serif;
  --font-head: "DM Sans", "Lexend", system-ui, "Segoe UI", Arial, sans-serif;
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --surface-2: #F3ECE0;
  --ink: #2B2622;
  --ink-soft: #5B5249;
  --line: #E6DCCD;
  --line-strong: #CDBFAB;
  --accent: #2F6B4F;
  --accent-hover: #24563F;
  --on-accent: #FFFFFF;
  --accent-soft: #E3EFE6;
  --apple: #B3362B;
  --on-apple: #FFFFFF;
  --apple-soft: #F8E3DF;
  --sun: #E8A93A;
  --on-sun: #2B2622;
  --sun-soft: #FBEFD6;
  --wood: #9A6B43;
  --wood-soft: #EADBC8;
  --badge-bg: #FBEFD6;
  --badge-ink: #2B2622;
  --free-bg: #E3EFE6;
  --free-ink: #24563F;
  --focus: #2F6B4F;
  --band-bg: #1F3A2C;
  --band-ink: #FFFFFF;
  --band-ink-soft: #D5E2D8;
  --band-accent: #F2C26B;
  --band-line: #3A5A49;
  --error: #A3302A;
  --ok: #24563F;
  --shadow-color: rgba(43, 38, 34, 0.09);
  --logo-roof: #2F6B4F;
  --logo-post: #9A6B43;
  --logo-step: #CDBFAB;
  --logo-apple: #B3362B;
  --logo-leaf: #2F6B4F;
  --logo-sun: #E8A93A;
  --logo-art-word: #1E3F2F;
  --logo-art-awning: #36664C;
  --logo-art-cream: #FDF1DC;
  --logo-art-wood: #B67444;
  --logo-art-apple: #DD4240;
  --logo-art-leaf: #7BBA6D;
  --logo-art-line: #3C2D1D;
  --edit-outline: #2F6B4F;
  --edit-bar-bg: #1F3A2C;
  --edit-bar-ink: #FFFFFF;
  --draft-bg: #FBEFD6;
  --draft-ink: #2B2622;
  --error-soft: #F8E3DF;
  --ok-soft: #E3EFE6;
  --gold: #C98A0B;
  --gold-ink: #6E4600;
  --gold-soft: #FBEFD6;
  --sale: #B3362B;
  --sale-soft: #F8E3DF;
  --tint-sage: #E8F1EA;
  --tint-peach: #FBEBDD;
  --btn-dark: #1F3A2C;
  --on-btn-dark: #FFFFFF;
  --btn-dark-hover: #162B20;
  --control-border: #8B7F70;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171411;
    --surface: #221E1A;
    --surface-2: #2B2621;
    --ink: #F4EDE3;
    --ink-soft: #C8BDAF;
    --line: #3A332C;
    --line-strong: #564C42;
    --accent: #8ACBA5;
    --accent-hover: #A6D9BB;
    --on-accent: #10241A;
    --accent-soft: #1E3328;
    --apple: #F08A7E;
    --on-apple: #2A0F0B;
    --apple-soft: #3A201C;
    --sun: #E8B65A;
    --on-sun: #1F1A12;
    --sun-soft: #3A2F1C;
    --wood: #C49A72;
    --wood-soft: #3A2F25;
    --badge-bg: #3A2F1C;
    --badge-ink: #F6DDA6;
    --free-bg: #1E3328;
    --free-ink: #A6D9BB;
    --focus: #F2C26B;
    --band-bg: #0F1F17;
    --band-ink: #F4EDE3;
    --band-ink-soft: #C3D3C8;
    --band-accent: #F2C26B;
    --band-line: #2A3F33;
    --error: #F4A79D;
    --ok: #A6D9BB;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --logo-roof: #8ACBA5;
    --logo-post: #C49A72;
    --logo-step: #564C42;
    --logo-apple: #F08A7E;
    --logo-leaf: #8ACBA5;
    --logo-sun: #E8B65A;
    --logo-art-word: #F4EDE3;
    --logo-art-awning: #4E8A69;
    --logo-art-cream: #FDF1DC;
    --logo-art-wood: #C49A72;
    --logo-art-apple: #F08A7E;
    --logo-art-leaf: #8ACBA5;
    --logo-art-line: #1A130C;
    --edit-outline: #F2C26B;
    --edit-bar-bg: #0F1F17;
    --edit-bar-ink: #F4EDE3;
    --draft-bg: #3A2F1C;
    --draft-ink: #F6DDA6;
    --error-soft: #3A201C;
    --ok-soft: #1E3328;
    --gold: #F2C26B;
    --gold-ink: #F6DDA6;
    --gold-soft: #3A2F1C;
    --sale: #F08A7E;
    --sale-soft: #3A201C;
    --tint-sage: #1B2D23;
    --tint-peach: #33261D;
    --btn-dark: #F4EDE3;
    --on-btn-dark: #171411;
    --btn-dark-hover: #FFFFFF;
    --control-border: #9A8D7E;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171411;
  --surface: #221E1A;
  --surface-2: #2B2621;
  --ink: #F4EDE3;
  --ink-soft: #C8BDAF;
  --line: #3A332C;
  --line-strong: #564C42;
  --accent: #8ACBA5;
  --accent-hover: #A6D9BB;
  --on-accent: #10241A;
  --accent-soft: #1E3328;
  --apple: #F08A7E;
  --on-apple: #2A0F0B;
  --apple-soft: #3A201C;
  --sun: #E8B65A;
  --on-sun: #1F1A12;
  --sun-soft: #3A2F1C;
  --wood: #C49A72;
  --wood-soft: #3A2F25;
  --badge-bg: #3A2F1C;
  --badge-ink: #F6DDA6;
  --free-bg: #1E3328;
  --free-ink: #A6D9BB;
  --focus: #F2C26B;
  --band-bg: #0F1F17;
  --band-ink: #F4EDE3;
  --band-ink-soft: #C3D3C8;
  --band-accent: #F2C26B;
  --band-line: #2A3F33;
  --error: #F4A79D;
  --ok: #A6D9BB;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --logo-roof: #8ACBA5;
  --logo-post: #C49A72;
  --logo-step: #564C42;
  --logo-apple: #F08A7E;
  --logo-leaf: #8ACBA5;
  --logo-sun: #E8B65A;
  --logo-art-word: #F4EDE3;
  --logo-art-awning: #4E8A69;
  --logo-art-cream: #FDF1DC;
  --logo-art-wood: #C49A72;
  --logo-art-apple: #F08A7E;
  --logo-art-leaf: #8ACBA5;
  --logo-art-line: #1A130C;
  --edit-outline: #F2C26B;
  --edit-bar-bg: #0F1F17;
  --edit-bar-ink: #F4EDE3;
  --draft-bg: #3A2F1C;
  --draft-ink: #F6DDA6;
  --error-soft: #3A201C;
  --ok-soft: #1E3328;
  --gold: #F2C26B;
  --gold-ink: #F6DDA6;
  --gold-soft: #3A2F1C;
  --sale: #F08A7E;
  --sale-soft: #3A201C;
  --tint-sage: #1B2D23;
  --tint-peach: #33261D;
  --btn-dark: #F4EDE3;
  --on-btn-dark: #171411;
  --btn-dark-hover: #FFFFFF;
  --control-border: #9A8D7E;
}
/* TOKENS:END */

/* ---------- Fonts (self-hosted, SIL Open Font License, see static/fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Lexend"; src: url("../fonts/Lexend-Regular.9eadae00b3ce.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/Lexend-Bold.761627a1dd24.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/Fredoka-Bold.79040b5108c3.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/DMSans-Variable.09d1eaa1672d.ttf") format("truetype"); font-weight: 500 700; font-style: normal; font-display: swap; }

/* ---------- Shared sizes and spacing (no colors) ---------- */
:root {
  --shadow: 0 1px 2px var(--shadow-color), 0 6px 18px var(--shadow-color);
  --radius-s: 0.5rem;
  --radius: 0.875rem;
  --radius-l: 1.5rem;
  --gutter: 16px;
  --maxw: 72rem;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
  --step-3: clamp(1.25rem, 1.15rem + 0.3vw, 1.375rem);
  --step-4: clamp(1.6rem, 1.4rem + 0.7vw, 2rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
[hidden] { display: none !important; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 var(--space-2); color: var(--ink); }
h1 { font-size: var(--step-4); letter-spacing: -0.01em; font-weight: 700; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }
h4 { font-size: 0.9375rem; font-weight: 600; }
p { margin: 0 0 var(--space-2); }
ul, ol { margin: 0 0 var(--space-2); padding-left: 1.25rem; }
li + li { margin-top: 0.35rem; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 40rem; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--step--1); }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 20;
  background: var(--surface); color: var(--ink); padding: 0.5rem 1rem;
  border-radius: var(--radius-s); box-shadow: var(--shadow);
}
.skip-link:focus { top: 0.75rem; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 46rem; }
.section { padding-block: var(--space-4); }
@media (min-width: 768px) { .section { padding-block: var(--space-5); } }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 44rem; margin-bottom: var(--space-3); }
.eyebrow {
  display: inline-block; font-size: var(--step--1); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
  margin-bottom: var(--space-1);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.875rem; padding: 0.65rem 1.25rem;
  border-radius: 999px; border: 2px solid transparent;
  font: 700 var(--step-0)/1.2 var(--font-body);
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-gold { background: var(--sun); color: var(--on-sun); }
.btn-gold:hover { color: var(--on-sun); filter: brightness(1.05); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { color: var(--ink); border-color: var(--ink); }
.btn-owned { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn-small { min-height: 2.25rem; padding: 0.35rem 0.9rem; font-size: var(--step--1); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn-row > .btn { flex: 1 1 12rem; }
@media (min-width: 640px) { .btn-row > .btn { flex: 0 0 auto; } }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Staging banner ---------- */
.staging-banner { background: var(--sun); color: var(--on-sun); text-align: center; font-weight: 700; padding: 0.35rem var(--gutter); }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 15; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand .logo { height: 2.5rem; width: auto; }
@media (max-width: 360px) { .brand .logo { height: 2rem; } }
.lg-word { fill: var(--logo-art-word); }
.lg-awning { fill: var(--logo-art-awning); }
.lg-cream { fill: var(--logo-art-cream); }
.lg-wood { fill: var(--logo-art-wood); }
.lg-apple { fill: var(--logo-art-apple); }
.lg-leaf { fill: var(--logo-art-leaf); }
.lg-line { stroke: var(--logo-art-line); }
.theme-toggle { min-width: 2.75rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--band-bg); color: var(--band-ink-soft); margin-top: var(--space-4); }
.site-footer a { color: var(--band-ink); }
.site-footer a:hover { color: var(--band-accent); }
.footer-inner { display: grid; gap: var(--space-3); padding-block: var(--space-4); }
@media (min-width: 768px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-inner h2 { color: var(--band-ink); font-size: var(--step-1); margin-bottom: var(--space-1); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-bottom { border-top: 1px solid var(--band-line); padding-block: var(--space-2); font-size: var(--step--1); }

/* ---------- Messages ---------- */
.messages { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: 0.5rem; }
.messages li + li { margin-top: 0; }
.msg { padding: 0.75rem 1rem; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); }
.msg-success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.msg-error { background: var(--error-soft); color: var(--error); border-color: var(--error); }
.msg-warning { background: var(--badge-bg); color: var(--badge-ink); border-color: var(--sun); }
.msg-info { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { background: var(--surface-2); border-bottom: 1px solid var(--line); padding-block: var(--space-4); }
@media (min-width: 768px) { .hero { padding-block: var(--space-5); } }
.hero h1 { max-width: 20ch; text-wrap: balance; }

/* ---------- Product cards ---------- */
.card-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.card-grid > * { min-width: 0; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  overflow: hidden; box-shadow: var(--shadow);
}
.card-media { aspect-ratio: 1 / 1; background: var(--surface-2); display: grid; place-items: center; position: relative; overflow: hidden; }
/* The whole cover is shown (contain) inside a fixed square frame, so every card in a row has the same image height. */
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-media .placeholder-icon { position: static; width: 40%; height: auto; opacity: 0.6; }
.card-body { display: flex; flex-direction: column; gap: 0.5rem; padding: var(--space-2) var(--space-2) var(--space-3); flex: 1; }
.card h3 { font-size: 0.9375rem; font-weight: 600; margin: 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:focus-visible { outline: none; }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.price { font-weight: 700; font-size: var(--step-1); color: var(--ink); }
.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.875rem; font-weight: 700; background: var(--badge-bg); color: var(--badge-ink);
}
.badge-free { background: var(--free-bg); color: var(--free-ink); }
.badge-owned { background: var(--accent-soft); color: var(--accent); }
.badge-draft { background: var(--draft-bg); color: var(--draft-ink); }

/* ---------- Seller badge ---------- */
.seller-badge { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--step--1); color: var(--ink-soft); position: relative; z-index: 1; }
.seller-badge a { color: var(--ink); font-weight: 700; text-decoration: none; }
.seller-badge a:hover { color: var(--accent); }
.seller-badge .plan-pro { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 0.45rem; font-weight: 700; font-size: 0.875rem; }

/* ---------- Product page ---------- */
.breadcrumb { font-size: var(--step--1); padding-top: var(--space-3); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.breadcrumb li + li { margin-top: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.35rem; color: var(--ink-soft); }
.product-top { display: grid; gap: var(--space-3); padding-block: var(--space-3) var(--space-4); }
.product-top > * { min-width: 0; }
/* Phones: picture, then title, price and Buy, then the details. Wide screens: the buy panel
   sits in the right column beside both. */
@media (min-width: 900px) {
  .product-top { grid-template-columns: 1.1fr 0.9fr; grid-template-areas: "media buy" "details buy"; align-items: start; gap: var(--space-4); }
  .product-media { grid-area: media; }
  .product-details { grid-area: details; }
  .product-top > .buy-panel { grid-area: buy; }
}
.product-hero-img { border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.buy-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: var(--space-3); box-shadow: var(--shadow);
}
@media (min-width: 900px) { .buy-panel { position: sticky; top: var(--space-2); } }
@media (max-width: 400px) { .buy-panel { padding: var(--space-2); } }
.buy-panel h1 { font-size: var(--step-3); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0 0 var(--space-3); }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--ink-soft); }
.buy-stack { display: grid; gap: 0.75rem; }
.callout { background: var(--badge-bg); color: var(--badge-ink); border-radius: var(--radius); padding: var(--space-2); margin-bottom: var(--space-2); }
.callout p:last-child { margin-bottom: 0; }
.prose { max-width: 44rem; }
.prose h2 { margin-top: var(--space-4); }
.prose h2:first-child { margin-top: 0; }

/* ---------- Store page ---------- */
.store-head { display: grid; gap: var(--space-2); padding-block: var(--space-4) var(--space-3); }
.store-head .lede { margin: 0; }
.store-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: var(--space-3); box-shadow: var(--shadow);
}
@media (max-width: 400px) { .form-card { padding: var(--space-2); } }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem; margin-bottom: var(--space-2); }
.field label { overflow-wrap: anywhere; }
.field label, .field legend { font-weight: 700; }
.field .help { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }
.field .error { font-size: var(--step--1); color: var(--error); font-weight: 700; margin: 0; }
.field-check { display: flex; gap: 0.6rem; align-items: flex-start; }
.field-check input { margin-top: 0.3rem; width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="url"], .field input[type="file"], .field select, .field textarea {
  width: 100%; min-height: 3rem; padding: 0.6rem 0.85rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-s);
}
.field textarea { min-height: 8rem; }
.field [aria-invalid="true"] { border-color: var(--error); }
.input:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { border-color: var(--focus); }
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--space-2); min-width: 0; }
.form-errors { background: var(--error-soft); color: var(--error); border-radius: var(--radius-s); padding: 0.75rem 1rem; margin-bottom: var(--space-2); }
.form-errors ul { margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.qr { background: var(--logo-art-cream); padding: var(--space-1); border-radius: var(--radius-s); width: 14rem; max-width: 100%; }
.code-list { font-family: ui-monospace, Consolas, monospace; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 1rem; list-style: none; padding: 0; }
.code-list li + li { margin-top: 0; }

/* ---------- Account pages (narrow card) ---------- */
.account-shell { padding-block: var(--space-4); }
.account-shell .wrap { max-width: 30rem; }

/* ---------- Dashboard layout ---------- */
.dash { display: grid; gap: var(--space-3); padding-block: var(--space-3) var(--space-4); }
.dash > * { min-width: 0; }
@media (min-width: 900px) { .dash { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; } }
.dash-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-1); }
.dash-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
@media (min-width: 900px) { .dash-nav ul { flex-direction: column; } }
.dash-nav li + li { margin-top: 0; }
.dash-nav a { display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); font-weight: 700; }
.dash-nav a:hover, .dash-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.stat-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); margin-bottom: var(--space-3); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2); }
.stat b { display: block; font-size: var(--step-2); font-family: var(--font-head); }

/* ---------- Tables ---------- */
.forum-kids { margin-left: 1.25rem; padding-left: 0.75rem; border-left: 2px solid var(--line); }
.brand-badge { display: inline-block; margin-left: 0.5rem; padding: 0.15rem 0.55rem; border-radius: var(--radius-s); background: var(--badge-bg); color: var(--badge-ink); font: 700 var(--step--1)/1.2 var(--font-head); vertical-align: middle; }
/* Security page: plain English or technical, chosen with two radio inputs (no script). */
.detail-modes .mode-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 var(--space-3); }
.mode-button { cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.1rem; border: 2px solid var(--accent); border-radius: 999px; background: var(--surface); color: var(--accent); font-weight: 700; box-shadow: 0 2px 6px color-mix(in srgb, var(--ink) 18%, transparent); transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.mode-button::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.mode-button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 24%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
#mode-tech:checked ~ .mode-buttons [for="mode-tech"]::before, #mode-plain:checked ~ .mode-buttons [for="mode-plain"]::before { background: currentColor; box-shadow: inset 0 0 0 3px var(--accent); }
#mode-tech:checked ~ .mode-buttons [for="mode-tech"], #mode-plain:checked ~ .mode-buttons [for="mode-plain"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
#mode-tech:focus-visible ~ .mode-buttons [for="mode-tech"], #mode-plain:focus-visible ~ .mode-buttons [for="mode-plain"] { outline: 3px solid var(--focus); outline-offset: 2px; }
#mode-plain:checked ~ .mode-body .mode-tech, #mode-tech:checked ~ .mode-body .mode-plain { display: none; }
.launch-badge { display: inline-block; padding: 0.05rem 0.45rem; border-radius: var(--radius-s); background: var(--badge-bg); color: var(--badge-ink); font-size: var(--step--1); font-weight: 700; }
.link-cloud { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: var(--space-2); }
.share-url { display: none; width: 100%; }
.share-url.is-shown { display: block; }
.trust-cues { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: 0.25rem; color: var(--ink-soft); }
.trust-cues li::before { content: "\2713"; margin-right: 0.4rem; color: var(--ok); }
.buy-stack form + form { margin-top: 0.5rem; }
pre { max-width: 100%; overflow-x: auto; white-space: pre; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.6rem 0.8rem; border-top: 1px solid var(--line); }
.table th { color: var(--ink-soft); font-size: var(--step--1); border-top: 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; margin-top: var(--space-3); list-style: none; padding: 0; }
.pagination li + li { margin-top: 0; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Small utilities (no inline styles: the CSP blocks them) ---------- */
.mt-3 { margin-top: var(--space-3); }
.mb-0 { margin-bottom: 0; }
.mx-auto { margin-inline: auto; }
.stack > * + * { margin-top: var(--space-2); }
.inline-form { display: inline; }

/* ---------- Inline page editing (staff only, content app) ---------- */
.edit-bar { background: var(--edit-bar-bg); color: var(--edit-bar-ink); font-size: var(--step--1); }
.edit-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding-block: 0.5rem; }
.btn-outline-light { background: transparent; color: var(--edit-bar-ink); border-color: var(--edit-bar-ink); }
.btn-outline-light:hover { color: var(--edit-bar-ink); background: var(--band-line); }
.edit-hint { opacity: 0.85; }
.edit-status { font-weight: 700; }
.editable { outline: 1px dashed color-mix(in srgb, var(--edit-outline) 55%, transparent); outline-offset: 3px; border-radius: 4px; cursor: text; }
.editable:not(.is-editing):hover::after, .editable:not(.is-editing):focus::after { content: " \270E"; font-size: 0.75em; color: var(--edit-outline); }
.editable-hidden { display: block; padding: 0.35rem 0.6rem; margin-block: 0.5rem; border: 1px dashed color-mix(in srgb, var(--edit-outline) 55%, transparent); border-radius: 4px; color: var(--ink); opacity: 0.8; font-size: var(--step--1); }
.editable:hover, .editable:focus { outline-style: solid; }
.editable.is-editing { outline: 3px solid var(--edit-outline); background: var(--surface); color: var(--ink); }
.editable.is-draft, .is-draft-preview { background: var(--draft-bg); color: var(--draft-ink); border-radius: 4px; }
span.editable, span.is-draft-preview { display: inline; }
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  padding: 0.35rem; margin: 0 0 0.5rem; box-shadow: var(--shadow); position: relative; z-index: 5;
  font-family: var(--font-body); font-size: var(--step--1); color: var(--ink);
}
.editor-btn {
  font: 700 var(--step--1)/1.2 var(--font-body); padding: 0.35rem 0.65rem; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.editor-btn:hover { border-color: var(--ink); }
.editor-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.editor-spacer { flex: 1 1 auto; }
/* Unsaved edits: impossible to miss (badge, ringed block, highlighted Save). */
.editable.has-unsaved { outline-color: var(--sun); outline-style: solid; outline-width: 3px; }
.editor-unsaved, .edit-unsaved { font-weight: 700; background: var(--badge-bg); color: var(--badge-ink); border: 1px solid var(--sun); border-radius: var(--radius-s); padding: 0.2rem 0.55rem; }
.editor-unsaved[hidden], .edit-unsaved[hidden] { display: none; }
.editor-save-pending { box-shadow: 0 0 0 3px var(--sun); animation: save-pulse 1.6s ease-in-out infinite; }
@keyframes save-pulse { 50% { box-shadow: 0 0 0 6px var(--sun); } }
@media (prefers-reduced-motion: reduce) { .editor-save-pending { animation: none; } }
.history-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2); margin: 0.5rem 0; color: var(--ink); }
.history-panel h2 { font-size: var(--step-1); }
.history-row { border-top: 1px solid var(--line); padding-block: 0.5rem; }
.history-preview { font-size: var(--step--1); margin-bottom: 0.35rem; }

/* ---------- Public content pages ---------- */
.page-copy .page-card { margin-bottom: var(--space-4); }
.page-copy .page-card:last-child { margin-bottom: 0; }
.idea-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.idea-list li + li { margin-top: 0; }
.idea { display: flex; gap: var(--space-2); justify-content: space-between; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; }
.idea > * { min-width: 0; }
.idea-vote { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; flex: none; font-size: var(--step--1); }

/* ---------- Store posts and the feed ---------- */
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2); }
.post-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; margin-bottom: 0.5rem; }
.post-photo { border-radius: var(--radius-s); margin-bottom: 0.5rem; max-height: 28rem; width: auto; }
.post-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.comment-list { list-style: none; padding: 0; margin: 0.75rem 0 0.5rem; font-size: var(--step--1); }
.comment-form { display: flex; gap: 0.5rem; }
.comment-form .input { min-height: 2.25rem; padding: 0.35rem 0.6rem; }
.post-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

/* ---------- Seller dashboard checklist ---------- */
.checklist-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.checklist-list li + li { margin-top: 0; }
.checklist-list .is-done { color: var(--ink-soft); }

/* ---------- Embeddable widgets (shown inside other sites) ---------- */
body.embed { min-height: 0; display: block; padding: 0.5rem; background: var(--surface); font-size: var(--step--1); }
.embed-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.embed-card { display: grid; gap: 0.25rem; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.5rem; background: var(--surface); }
.embed-card img { border-radius: var(--radius-s); aspect-ratio: 1 / 1; object-fit: contain; background: var(--surface-2); width: 100%; }
.embed-head { margin-bottom: 0.5rem; }
.embed-credit { margin: 0.5rem 0 0; font-size: 0.875rem; }

/* ---------- Preview gallery ---------- */
.gallery { display: grid; gap: var(--space-1); grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.gallery img { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }

/* ---------- Visual editor (static/js/rich-editor.js, core/widgets.py) ---------- */
.rich-editor { border: 2px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); min-width: 0; }
.rich-editor:focus-within { border-color: var(--focus); }
.re-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.4rem; border-bottom: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-s) var(--radius-s) 0 0; }
.re-btn {
  min-width: 2.75rem; min-height: 2.75rem; padding: 0.25rem 0.55rem; font: inherit; font-size: var(--step--1);
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); cursor: pointer;
}
.re-btn:hover { background: var(--accent-soft); }
.re-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.re-btn:focus-visible, .re-area:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.re-bold { font-weight: 700; }
.re-italic { font-style: italic; }
.re-underline { text-decoration: underline; }
.re-area { min-height: 16rem; max-height: 70vh; overflow-y: auto; padding: 0.75rem 0.85rem; max-width: none; overflow-wrap: anywhere; color: var(--ink); }
.re-area img, .guest-body img { max-width: 100%; height: auto; border-radius: var(--radius-s); }
.re-status { margin: 0; padding: 0.35rem 0.6rem; font-size: var(--step--1); color: var(--ink-soft); }
.re-status.re-error { color: var(--error); font-weight: 700; }
.re-file { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }

/* Store banner, logo and link (stores/templates/stores/detail.html) */
.store-banner { margin-top: var(--space-2); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 1; width: 100%; max-width: 100%; background: var(--surface-2); }
.store-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.store-banner-default { background: linear-gradient(135deg, var(--accent-soft), var(--sun-soft)); border: 1px solid var(--line); }
.store-title { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.store-title h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.store-link { margin: 0; }
.store-banner-preview { display: block; max-width: 100%; max-height: 8rem; border-radius: var(--radius-s); object-fit: cover; }

/* Bundle builder (products/templates/products/bundle_builder.html, static/js/bundle-builder.js) */
.bundle-items { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: 0.35rem; max-height: 24rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-1); background: var(--surface); }
.bundle-items li + li { margin-top: 0; }
.bundle-items .field-check { padding: 0.25rem; }
.bundle-summary { font-weight: 700; }
.bundle-name { font-size: var(--step-1); margin-bottom: var(--space-1); }
.bundle-parts { margin-bottom: 0; }

/* Products table (products/templates/products/product_table.html) */
.ptable-chips ul { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ptable-chips li + li { margin-top: 0; }
.ptable-filters { display: grid; gap: 0 var(--space-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.ptable-filters .btn-row { grid-column: 1 / -1; }
.ptable-bulk .field-check { margin-bottom: 0.5rem; }
.ptable-sub { display: grid; gap: 0 var(--space-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); margin: 0 0 var(--space-2) 1.75rem; }
.ptable { background: var(--surface); }
.ptable td { overflow-wrap: anywhere; }
.ptable-quick summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.ptable-quick form { margin-top: var(--space-1); min-width: 14rem; }
.ptable-grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); gap: 0.25rem 0.75rem; border: 0; padding: 0; }
@media (max-width: 760px) {
  .ptable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ptable, .ptable tbody, .ptable tr, .ptable td { display: block; width: 100%; }
  .ptable tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--space-1); padding: var(--space-1); background: var(--surface); }
  .ptable td { border: 0; padding: 0.25rem 0; display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0.5rem; }
  .ptable td::before { content: attr(data-label); color: var(--ink-soft); font-size: var(--step--1); font-weight: 700; }
  .ptable td[data-label="Pick"]::before { content: "Pick"; }
  .ptable-quick form { min-width: 0; }
}

/* Bulk upload (products/templates/products/bulk_upload.html, static/js/bulk-upload.js) */
.bulk-drop { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: var(--space-3) var(--space-2); background: var(--surface); }
.bulk-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.bulk-drop input[type="file"] { width: 100%; max-width: 100%; }
.bulk-status { padding: var(--space-1) var(--space-2); background: var(--surface-2); border-radius: var(--radius-s); font-weight: 700; }
.bulk-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: var(--space-1); }
.bulk-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-1) var(--space-2); overflow-wrap: anywhere; }
.bulk-item.is-ready { border-color: var(--accent); }
.bulk-item.is-failed { border-color: var(--error); background: var(--error-soft); }
.bulk-item p { margin: 0 0 0.35rem; }
.bulk-item .field { margin: 0.25rem 0 0; }
.bulk-item select { width: 100%; max-width: 100%; }
.bulk-problem { color: var(--error); }

/* Direct-to-storage upload progress (static/js/direct-upload.js) */
.direct-upload { display: grid; gap: var(--space-2, 0.5rem); margin-bottom: 1rem; }
.direct-upload-bar { width: 100%; height: 0.75rem; accent-color: var(--accent); }
.direct-upload-text { margin: 0; color: var(--ink-soft); }
.direct-upload-text.is-error { color: var(--error); font-weight: 700; }

/* ---------- Buyer account: receipts and order history (orders/receipts.py) ---------- */
.receipt-head { margin-bottom: var(--space-2); }
.receipt-business { margin: 0; color: var(--ink-soft); }
.receipt-meta { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin: 0 0 var(--space-3); }
.receipt-meta dt { color: var(--ink-soft); font-size: var(--step--1); }
.receipt-meta dd { margin: 0; overflow-wrap: anywhere; }
.receipt-table .num, .receipt-table td.num, .receipt-table th.num { text-align: right; white-space: nowrap; }
.receipt-table tfoot th { text-align: right; }
.receipt-total th, .receipt-total td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.receipt-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

@media print {
  :root, :root[data-theme] { color-scheme: light; }
  body { background: Canvas; color: CanvasText; }
  .skip-link, .site-header, .site-footer, .staging-banner, .no-print, .content-edit-bar, .messages { display: none !important; }
  .section { padding-block: 0; }
  .wrap, .wrap-narrow { max-width: none; padding-inline: 0; }
  .table-wrap { border: 0; background: none; overflow: visible; }
  .receipt-table th, .receipt-table td { border-top: 1px solid GrayText; color: CanvasText; }
  a { color: CanvasText; text-decoration: none; }
}

/* ---------- Reviews: star breakdown, sort, photos, labels (products/_reviews.html) ---------- */
.review-summary { display: grid; gap: var(--space-3); margin-bottom: var(--space-3); }
@media (min-width: 700px) { .review-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.review-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.review-bars li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 2.5rem; gap: 0.5rem; align-items: center; }
.review-bars li + li { margin-top: 0; }
.review-bars a[aria-current="true"] { font-weight: 700; }
.review-bar { width: 100%; height: 0.7rem; accent-color: var(--accent); }
.review-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; }
.review-tools .field { margin-bottom: 0; }
.review { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; }
.review > * + * { margin-top: 0.5rem; }
.review-photos { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.review-photos li + li { margin-top: 0; }
.review-photos img { display: block; width: 7rem; height: 7rem; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.review-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.review-moderation { display: grid; gap: 0.35rem; min-width: min(100%, 14rem); }

/* ---------- Preview viewer (static/js/preview-viewer.js) ---------- */
.preview-heading { font: 700 var(--step-1)/1.2 var(--font-head); margin-bottom: var(--space-1); }
.preview-bar { margin-bottom: var(--space-1); }
.gallery { list-style: none; padding: 0; margin: 0; }
.gallery li + li { margin-top: 0; }
.gallery a { display: block; border-radius: var(--radius-s); }
.lightbox {
  width: min(96vw, 52rem); max-height: 96vh; padding: var(--space-2); margin: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-l); box-shadow: var(--shadow);
}
.lightbox::backdrop { background: color-mix(in srgb, var(--band-bg) 85%, transparent); }
.lightbox[open] { display: grid; gap: var(--space-1); grid-template-rows: auto minmax(0, 1fr) auto auto; }
.lightbox-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.lightbox-title { font-size: var(--step-1); margin: 0; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.lightbox-count { margin: 0; font-weight: 700; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 12rem; background: var(--surface-2); border-radius: var(--radius-s); overflow: auto; max-height: 68vh; }
.lightbox-img { max-width: 100%; max-height: 66vh; width: auto; height: auto; }
.lightbox-img.is-loading { opacity: 0.3; }
.lightbox-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-weight: 700; color: var(--ink); }
.lightbox-nav { display: flex; justify-content: space-between; gap: 0.5rem; }
.lightbox-hint { margin: 0; }
@media (max-width: 480px) { .lightbox { padding: var(--space-1); } .lightbox-hint { display: none; } }

/* ---------- Product details, What's included, seller card ---------- */
.details-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-2) var(--space-3); margin-top: var(--space-3); }
.details-box .facts { margin: 0; }
.details-box .facts dd { overflow-wrap: anywhere; }
.included-list { padding-left: 1.25rem; }
.avatar { flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.avatar-initial { display: inline-grid; place-items: center; font: 700 0.875rem/1 var(--font-head); color: var(--accent); background: var(--accent-soft); }
.avatar-big { width: 4rem; height: 4rem; font-size: 1.6rem; }
.seller-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-2) var(--space-3); }
.seller-card-body { display: flex; gap: var(--space-2); align-items: flex-start; }
.seller-card-text { min-width: 0; flex: 1; }
.seller-card-name { font: 700 var(--step-1)/1.2 var(--font-head); margin-bottom: 0.25rem; }
.seller-card-name a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.seller-card-bio { margin: var(--space-1) 0; overflow-wrap: anywhere; }
.seller-dot { margin-inline: 0.25rem; }
.seller-card .btn-row form { display: contents; }
@media (max-width: 400px) { .seller-card { padding: var(--space-2); } }

/* ---------- Stars and card extras ---------- */
.stars-glyphs { color: var(--wood); letter-spacing: 0.05em; }
.stars-count { color: var(--ink-soft); font-size: var(--step--1); }
.card-rating { margin: 0; }
.card-grades { margin: 0; }
.badge-grade { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.seller-badge { flex-wrap: wrap; }

/* ---------- Help center (pages/help_*.html) ---------- */
.help-search { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; margin-bottom: var(--space-3); }
.help-search .field { flex: 1 1 14rem; margin-bottom: 0; }
.help-list { padding-left: 1.25rem; }
.help-list li + li { margin-top: 0.5rem; }
.help-topics { margin-bottom: var(--space-3); }

/* ---------- Quick filter chips (Browse) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0.3rem 0.9rem; border: 2px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: var(--step--1); text-decoration: none; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Buyer account: wish list heart, lists (social/wishlist.py) ---------- */
.card-media { position: relative; }
.wish-form { margin: 0; }
.wish-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 2.75rem; min-height: 2.75rem;
  padding: 0.25rem; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; cursor: pointer; text-decoration: none;
}
.wish-btn:hover { background: var(--accent-soft); }
.wish-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wish-btn .wish-heart { fill: none; stroke: currentColor; stroke-width: 2; }
.wish-btn.is-wished { color: var(--apple); border-color: var(--apple); background: var(--apple-soft); }
.wish-btn.is-wished .wish-heart { fill: currentColor; }
.wish-form-card, a.wish-card { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 1; }
/* The card heart sits in the bottom row, not over the cover, so it never hides a title or badge. */
.card-foot .wish-form-card, .card-foot a.wish-card { position: relative; top: auto; right: auto; z-index: 2; }
.wish-full { width: 100%; border-radius: var(--radius-s); padding-inline: 0.75rem; }
.follow-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); }
.follow-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 0.6rem 0.8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Header search (every page) ---------- */

/* ---------- Home page: hero search, grade row, shelves ---------- */
.hero-search { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 40rem; margin-top: var(--space-3); }
.hero-search label { flex: 1 1 100%; font-weight: 700; }
.hero-search input[type="search"] {
  flex: 1 1 12rem; min-width: 0; min-height: 3.25rem; padding: 0.6rem 1rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: 999px;
}
.hero-search input[type="search"]:focus-visible { border-color: var(--focus); }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: var(--space-2); }
.shelf-head h2 { margin: 0; }
.grade-row { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.grade-row li + li { margin-top: 0; }

/* ---------- Buyer account: updated badge and older versions (products/revisions.py) ---------- */
.badge-updated { background: var(--sun); color: var(--on-sun); font-weight: 700; }
.old-versions { margin: 0.25rem 0 0; padding-left: 1.1rem; }

/* ---------- Buyer account: extra licenses (orders/cart.py, products/pricing.py) ---------- */
.license-form { display: grid; gap: 0.25rem; margin-top: var(--space-1); }
.license-form label { font-size: var(--step--1); color: var(--ink-soft); }
.license-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.license-controls input[type="number"] { width: 5rem; min-height: 2.75rem; }

/* ---------- Phone safety: very long words (a store named with no spaces) never push the page wider ---------- */
h1, h2, h3, h4, .lede, .breadcrumb li, .seller-badge a, .card h3 a { overflow-wrap: anywhere; }
.seller-badge { min-width: 0; max-width: 100%; }
.store-head > *, .product-details > *, .product-media > * { min-width: 0; }
.breadcrumb li { min-width: 0; }
.lightbox-title { font-size: var(--step-0); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Preview video and Google link badge (products/preview_video.py, products/google_links.py) ---------- */
.product-video { margin-top: var(--space-3); }
.product-video-title { font-size: var(--step-1); margin: 0 0 var(--space-1); }
.product-video video { display: block; width: 100%; max-width: 100%; height: auto; max-height: 28rem; border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface-2); }
.badge-digital { background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent); font-weight: 700; }

/* ---------- Standards picker (static/js/standards-picker.js) ---------- */
.standards-picker [hidden] { display: none !important; }
.standards-controls { display: grid; gap: var(--space-2); margin-bottom: var(--space-2); }
@media (min-width: 40rem) { .standards-controls { grid-template-columns: minmax(10rem, 14rem) 1fr; align-items: start; } }
.standards-set select, .standards-find input { width: 100%; max-width: 100%; }
.standards-find { position: relative; min-width: 0; }
.standards-listbox {
  position: absolute; z-index: 20; left: 0; right: 0; margin: 0.15rem 0 0; padding: 0; list-style: none;
  max-height: 18rem; overflow-y: auto; background: var(--surface); color: var(--ink);
  border: 2px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 6px 18px var(--shadow-color);
}
.standards-listbox [role="option"] { display: grid; gap: 0.1rem; padding: 0.55rem 0.75rem; min-height: 2.75rem; cursor: pointer; border-bottom: 1px solid var(--line); }
.standards-listbox [role="option"]:last-child { border-bottom: 0; }
.standards-listbox [role="option"]:hover, .standards-listbox [role="option"].is-active { background: var(--accent-soft); outline: 2px solid var(--focus); outline-offset: -2px; }
.standards-code { font-weight: 700; overflow-wrap: anywhere; }
.standards-meta { font-size: var(--step--1); color: var(--ink-soft); }
.standards-text { font-size: var(--step--1); overflow-wrap: anywhere; }
.standards-listbox .standards-text { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.standards-empty { padding: 0.6rem 0.75rem; color: var(--ink-soft); font-size: var(--step--1); }
.standards-chosen-title { font-weight: 700; margin: var(--space-2) 0 var(--space-1); }
.standards-chosen { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.standards-chosen .btn-link { min-height: 2rem; padding: 0.25rem 0.25rem; }
.standards-chosen li { padding: 0.5rem 0.75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Following strip at the top of the Feed (social/services.py following_strip) ---------- */
.following-strip { margin: var(--space-2) 0 var(--space-3); }
.following-strip-title { font-size: var(--step-0); margin: 0 0 var(--space-1); }
.following-strip-list { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0 0 0.25rem; overflow-x: auto; scroll-snap-type: x proximity; }
.following-strip-list li { flex: 0 0 auto; scroll-snap-align: start; margin: 0; }
.following-strip-list a { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.35rem 0.75rem 0.35rem 0.4rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; max-width: 16rem; }
.following-strip-list a:hover { border-color: var(--accent); }
.following-strip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Catalog and search (agent F): suggestions, view toggle, sections, tags ---------- */
.header-search { position: relative; }
.suggest-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin: var(--space-1) 0 0; padding: var(--space-1) 0;
  list-style: none; max-height: 70vh; overflow-y: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: var(--shadow);
}
.suggest-list[hidden] { display: none; }
.suggest-list ul { list-style: none; margin: 0; padding: 0; }
.suggest-heading { padding: var(--space-1) var(--space-2) 0; font-size: 0.875rem; font-weight: 700; color: var(--ink-soft); }
.suggest-list [role="option"] { display: flex; flex-wrap: wrap; gap: 0 var(--space-2); padding: var(--space-2); cursor: pointer; min-height: 2.75rem; align-items: center; }
.suggest-list [role="option"].is-active, .suggest-list [role="option"]:hover { background: var(--surface-2); outline: 2px solid var(--focus); outline-offset: -2px; }
.suggest-hint { color: var(--ink-soft); font-size: 0.875rem; }

/* Results bar, layout toggle, list layout. */
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.view-toggle { display: flex; gap: var(--space-1); }
.card-summary-full { display: none; }
.card-grid.is-list { grid-template-columns: 1fr; }
.card-grid.is-list .card { flex-direction: row; align-items: stretch; }
.card-grid.is-list .card-media { flex: 0 0 8rem; aspect-ratio: auto; min-height: 8rem; }
.card-grid.is-list .card-summary { display: none; }
.card-grid.is-list .card-summary-full { display: block; }
@media (max-width: 480px) { .card-grid.is-list .card-media { flex-basis: 5.5rem; } }
.landing-intro { margin-bottom: var(--space-2); }
.subject-tree details { margin: var(--space-1) 0; }
.subject-tree summary { cursor: pointer; font-weight: 700; padding: 0.4rem 0; min-height: 2.75rem; display: flex; align-items: center; }
.tag-pill { display: inline-block; padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent); font-size: var(--step--1); font-weight: 700; text-decoration: none; }
a.tag-pill:hover { background: var(--accent); color: var(--on-accent); }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-1); list-style: none; padding: 0; margin: 0; }

/* Store sections page and tabs on the store page. */
.section-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.section-row { display: grid; gap: var(--space-2); }
.assign-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
.assign-row { display: grid; gap: var(--space-1); padding: var(--space-2) 0; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .assign-row { grid-template-columns: 1fr 14rem; align-items: center; } }
.store-sections { margin-block: var(--space-3); }
.store-sections ul { list-style: none; padding: 0; margin: 0; }
.store-sections li + li { margin-top: 0; }
.store-featured { margin-block: var(--space-3); }
.seller-extras { margin-top: var(--space-3); padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); }
.seller-extras p:last-child { margin-bottom: 0; }
.tag-list li + li { margin-top: 0; }
fieldset.standards-enhanced { border: 0; padding: 0; margin: 0; min-width: 0; }
.standards-enhanced legend { font-weight: 700; padding: 0; margin-bottom: 0.25rem; }

/* ---------- Store credit, gift cards and school quotes (credits/, quotes/) ---------- */
.inline-form { display: inline; margin: 0; }
.credit-balance { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.credit-amount { font-family: var(--font-head); font-size: var(--step-4); font-weight: 700; color: var(--ink); margin: 0 0 var(--space-2); }
.credit-choice { background: var(--accent-soft); border-radius: var(--radius); padding: var(--space-2); margin-bottom: var(--space-2); }
.credit-choice p { margin: 0.35rem 0 0; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.giftcard { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: var(--space-3); text-align: center; max-width: 34rem; margin-inline: auto; }
.giftcard-brand { font-family: var(--font-head); font-weight: 700; color: var(--accent); letter-spacing: 0.04em; margin: 0; }
.giftcard-amount { font-family: var(--font-head); font-size: var(--step-4); font-weight: 700; margin: 0 0 var(--space-2); }
.giftcard-message { font-style: italic; margin: var(--space-2) 0; padding: 0 var(--space-2); border-left: 3px solid var(--line-strong); text-align: left; }
.giftcard-label { margin: var(--space-2) 0 0; color: var(--ink-soft); font-size: var(--step--1); }
.giftcard-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--step-2); font-weight: 700; letter-spacing: 0.08em; overflow-wrap: anywhere; margin: 0.25rem 0 var(--space-2); }
@media print { .giftcard { border-color: GrayText; background: none; } .credit-choice { display: none; } }

/* ---------- Store credit, gift cards and school quotes (credits/, quotes/) ---------- */
.inline-form { display: inline; margin: 0; }
.credit-balance { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.credit-amount { font-family: var(--font-head); font-size: var(--step-4); font-weight: 700; color: var(--ink); margin: 0 0 var(--space-2); }
.credit-choice { background: var(--accent-soft); border-radius: var(--radius); padding: var(--space-2); margin-bottom: var(--space-2); }
.credit-choice p { margin: 0.35rem 0 0; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.giftcard { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: var(--space-3); text-align: center; max-width: 34rem; margin-inline: auto; }
.giftcard-brand { font-family: var(--font-head); font-weight: 700; color: var(--accent); letter-spacing: 0.04em; margin: 0; }
.giftcard-amount { font-family: var(--font-head); font-size: var(--step-4); font-weight: 700; margin: 0 0 var(--space-2); }
.giftcard-message { font-style: italic; margin: var(--space-2) 0; padding: 0 var(--space-2); border-left: 3px solid var(--line-strong); text-align: left; }
.giftcard-label { margin: var(--space-2) 0 0; color: var(--ink-soft); font-size: var(--step--1); }
.giftcard-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--step-2); font-weight: 700; letter-spacing: 0.08em; overflow-wrap: anywhere; margin: 0.25rem 0 var(--space-2); }
@media print { .giftcard { border-color: GrayText; background: none; } .credit-choice { display: none; } }

/* Seller insights (agent G): date range, daily charts, preview ribbon, notices, calendar, statements. */
.mt-2 { margin-top: var(--space-2); }
.range-picker { margin-bottom: var(--space-2); }
.chart-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); margin-bottom: var(--space-2); }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2); }
.chart figcaption { display: flex; justify-content: space-between; gap: var(--space-1); flex-wrap: wrap; margin-bottom: var(--space-1); }
.chart-total { font-family: var(--font-head); font-weight: 700; }
.chart-svg { display: block; width: 100%; height: 6rem; }
.chart-base { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-bar { fill: var(--accent); }
.chart-bar:hover { fill: var(--accent-hover); }
.chart-sales .chart-bar { fill: var(--wood); }
.chart-saves .chart-bar { fill: var(--apple); }
.chart-cart .chart-bar { fill: var(--sun); }
.chart-axis { display: flex; justify-content: space-between; gap: var(--space-1); margin: 0.25rem 0 0; color: var(--ink-soft); font-size: var(--step--1); }
.preview-ribbon { background: var(--sun); color: var(--on-sun); padding: var(--space-1) var(--space-2); border-bottom: 3px solid var(--wood); }
.preview-ribbon p { margin-bottom: 0.25rem; }
.preview-ribbon .badge { background: var(--on-sun); color: var(--sun); margin-right: 0.5rem; }
.preview-ribbon a { color: var(--on-sun); }
.notice-item { padding: var(--space-1) 0; border-bottom: 1px solid var(--line); list-style: none; }
.notice-list { padding-left: 0; }
.calendar-table th, .calendar-table td { min-width: 6.5rem; vertical-align: top; }
.calendar-day { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.calendar-out { background: var(--bg); color: var(--ink-soft); }
.calendar-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.calendar-chip { display: block; margin-bottom: 0.25rem; padding: 0.1rem 0.4rem; border-radius: var(--radius-s); border: 1px solid var(--line-strong); font-size: var(--step--1); background: var(--surface); color: var(--ink); text-decoration: none; }
.calendar-sale { border-left: 4px solid var(--accent); }
.calendar-coupon { border-left: 4px solid var(--wood); }
.calendar-note { border-left: 4px solid var(--sun); }
.calendar-featured { border-left: 4px solid var(--apple); }
.statement-figures { margin: 0 0 var(--space-3); }
.statement-figures div { display: flex; justify-content: space-between; gap: var(--space-2); padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.statement-figures dt, .statement-figures dd { margin: 0; }
.statement-figures .is-total { font-weight: 700; border-bottom: 2px solid var(--line-strong); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Catalog and search (agent F): suggestions, view toggle, sections, tags ---------- */
.header-search { position: relative; }
.suggest-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin: var(--space-1) 0 0; padding: var(--space-1) 0;
  list-style: none; max-height: 70vh; overflow-y: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: var(--shadow);
}
.suggest-list[hidden] { display: none; }
.suggest-list ul { list-style: none; margin: 0; padding: 0; }
.suggest-heading { padding: var(--space-1) var(--space-2) 0; font-size: 0.875rem; font-weight: 700; color: var(--ink-soft); }
.suggest-list [role="option"] { display: flex; flex-wrap: wrap; gap: 0 var(--space-2); padding: var(--space-2); cursor: pointer; min-height: 2.75rem; align-items: center; }
.suggest-list [role="option"].is-active, .suggest-list [role="option"]:hover { background: var(--surface-2); outline: 2px solid var(--focus); outline-offset: -2px; }
.suggest-hint { color: var(--ink-soft); font-size: 0.875rem; }

/* Results bar, layout toggle, list layout. */
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.view-toggle { display: flex; gap: var(--space-1); }
.card-summary-full { display: none; }
.card-grid.is-list { grid-template-columns: 1fr; }
.card-grid.is-list .card { flex-direction: row; align-items: stretch; }
.card-grid.is-list .card-media { flex: 0 0 8rem; aspect-ratio: auto; min-height: 8rem; }
.card-grid.is-list .card-summary { display: none; }
.card-grid.is-list .card-summary-full { display: block; }
@media (max-width: 480px) { .card-grid.is-list .card-media { flex-basis: 5.5rem; } }
.landing-intro { margin-bottom: var(--space-2); }
.subject-tree details { margin: var(--space-1) 0; }
.subject-tree summary { cursor: pointer; font-weight: 700; padding: 0.4rem 0; min-height: 2.75rem; display: flex; align-items: center; }
.tag-pill { display: inline-block; padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent); font-size: var(--step--1); font-weight: 700; text-decoration: none; }
a.tag-pill:hover { background: var(--accent); color: var(--on-accent); }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-1); list-style: none; padding: 0; margin: 0; }

/* Store sections page and tabs on the store page. */
.section-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.section-row { display: grid; gap: var(--space-2); }
.assign-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
.assign-row { display: grid; gap: var(--space-1); padding: var(--space-2) 0; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .assign-row { grid-template-columns: 1fr 14rem; align-items: center; } }
.store-sections { margin-block: var(--space-3); }
.store-sections ul { list-style: none; padding: 0; margin: 0; }
.store-sections li + li { margin-top: 0; }
.store-featured { margin-block: var(--space-3); }
.seller-extras { margin-top: var(--space-3); padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); }
.seller-extras p:last-child { margin-bottom: 0; }
.tag-list li + li { margin-top: 0; }
fieldset.standards-enhanced { border: 0; padding: 0; margin: 0; min-width: 0; }
.standards-enhanced legend { font-weight: 700; padding: 0; margin-bottom: 0.25rem; }

/* Search highlighting: the matched words in results and suggestions (token colors only). */
mark, .suggest-label mark { background: var(--sun-soft); color: var(--ink); font-weight: 700; padding: 0 0.1em; border-radius: 2px; }
@media (forced-colors: active) { mark { background: Mark; color: MarkText; } }
.extra-licenses summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; gap: 0.5rem; color: var(--accent); font-weight: 600; list-style: none; }
.extra-licenses summary::-webkit-details-marker { display: none; }
.extra-licenses summary::before {
  content: ""; flex: 0 0 auto; width: 0; height: 0; border-style: solid; border-width: 0.35rem 0 0.35rem 0.55rem;
  border-color: transparent transparent transparent currentColor; transition: transform 0.15s;
}
.extra-licenses[open] summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .extra-licenses summary::before { transition: none; } }
.extra-licenses[open] summary { margin-bottom: var(--space-1); }

/* Edit bar: collapse to a small tab (content/templates/content/edit_bar.html, static/js/edit-bar.js) */
.edit-bar-toggle { margin-left: auto; }
.edit-bar-tab { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 1.75rem; padding: 0; margin-left: auto; border: 0; border-radius: 0 0 0 var(--radius-s); background: var(--edit-bar-bg); color: var(--edit-bar-ink); cursor: pointer; }
.edit-bar-tab[hidden] { display: none; }
.edit-bar.is-collapsed { display: flex; background: transparent; }
.edit-bar.is-collapsed .edit-bar-inner { display: none; }
.edit-bar-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.edit-bar-toggle[hidden] { display: none; }

/* ---------- Store page redesign: banner, header, tabs, resources (stores/templates/stores/detail.html) ---------- */
.store-page { padding-bottom: var(--space-4); }
.store-banner { height: 7.5rem; aspect-ratio: auto; position: relative; color: var(--accent); }
.store-banner img { object-fit: cover; object-position: center; }
.store-banner-default { background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface-2) 100%); }
.store-banner-art { display: block; width: 100%; height: 100%; opacity: 0.22; }
@media (min-width: 640px) { .store-banner { height: 12.5rem; } }

.store-header { display: grid; gap: var(--space-3); padding-block: 0 var(--space-3); }
.store-id { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.store-avatar { margin-top: -3rem; padding-inline: var(--space-2); }
.avatar-xl { width: 6rem; height: 6rem; font-size: 2.5rem; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.store-id-text { display: grid; gap: 0.35rem; min-width: 0; }
.store-id-text h1 { font-size: 1.75rem; margin: 0; overflow-wrap: anywhere; }
.store-tagline { margin: 0; color: var(--ink-soft); }
.store-stats { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; color: var(--ink-soft); font-size: var(--step--1); }
.store-stats:empty { display: none; }
.store-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.25rem; }
.store-actions form { margin: 0; }
.store-actions > a.btn { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-about-mini { min-width: 0; }
.store-about-mini h2 { font-size: var(--step-1); margin-bottom: 0.35rem; }
.store-about-text { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.35rem; overflow-wrap: anywhere; }
@media (min-width: 800px) {
  .store-header { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
  .store-avatar { margin-top: -4.5rem; padding-inline: 0; }
  .avatar-xl { width: 8.75rem; height: 8.75rem; font-size: 3.5rem; }
  .store-about-mini { padding-top: var(--space-2); }
}

.icon-btn { padding-inline: 0.65rem; min-width: 2.25rem; justify-content: center; }
.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-panel { position: absolute; z-index: 20; top: calc(100% + 0.4rem); left: 0; min-width: 12rem; max-width: calc(100vw - 2rem); display: grid; padding: 0.35rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.popover-panel form { margin: 0; }
.popover-item { display: block; width: 100%; box-sizing: border-box; padding: 0.55rem 0.75rem; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--ink); font: inherit; font-size: var(--step--1); font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.popover-item:hover { background: var(--accent-soft); color: var(--ink); }
.popover-panel .share-url { margin: 0.25rem; width: calc(100% - 0.5rem); box-sizing: border-box; }
.popover-panel .share-url:not(.is-shown) { display: none; }
@media (max-width: 480px) { .manage-pop .popover-panel, .more-pop .popover-panel { right: 0; left: auto; } }

.store-tabs { border-bottom: 2px solid var(--line); margin-bottom: var(--space-3); }
.store-tabs ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.store-tabs a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.4rem 1rem; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--ink-soft); font-weight: 700; text-decoration: none; }
.store-tabs a:hover { color: var(--ink); }
.store-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.store-featured { margin-block: 0 var(--space-3); }
.store-featured h2, .store-results-title { font-size: var(--step-1); }
.store-featured-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.store-resources { display: grid; gap: var(--space-2); }
.store-result-count { font-size: var(--step--1); font-weight: 600; margin-left: 0.5rem; }
.section-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.section-link { display: inline-flex; gap: 0.4rem; align-items: center; min-height: 2.5rem; padding: 0.3rem 0.9rem; border: 2px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: var(--step--1); text-decoration: none; }
.section-link:hover { border-color: var(--ink); color: var(--ink); }
.section-link.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.section-count { opacity: 0.8; font-weight: 600; }
@media (min-width: 800px) {
  .store-resources.has-sections { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--space-4); align-items: start; }
  .section-list { flex-direction: column; flex-wrap: nowrap; gap: 0.15rem; }
  .section-link { display: flex; justify-content: space-between; border: 0; border-radius: var(--radius-s); background: transparent; min-height: 2.25rem; }
  .section-link:hover { background: var(--accent-soft); }
  .section-link.is-on { background: var(--accent-soft); color: var(--accent); }
}
.store-empty { padding: var(--space-4) var(--space-2); text-align: center; background: var(--surface-2); border-radius: var(--radius); }
.store-facts { display: grid; gap: var(--space-1); margin: var(--space-3) 0 0; }
.store-facts dt { font-weight: 700; }
.store-facts dd { margin: 0; overflow-wrap: anywhere; }
.store-panel { min-width: 0; }

/* Banner uses TpT's shape (1200 x 320 = 15:4) and scales with the page, so a TpT banner shows whole. */
.store-banner, .store-banner.store-banner-default { height: auto; aspect-ratio: 15 / 4; }
@media (min-width: 640px) { .store-banner { height: auto; } }
.store-avatar { position: relative; z-index: 1; }
.store-banner-art { opacity: 0.14; }
.store-id { gap: 0.25rem; }
.store-tabs { margin-bottom: var(--space-2); }
@media (min-width: 800px) { .store-header { gap: var(--space-3); padding-bottom: var(--space-2); } .store-avatar { margin-top: -4.25rem; } }

/* Store helpers: the "Helping: <store>" bar and the helpers page. */
.helping-bar { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.helping-bar.is-acting { background: var(--band-bg); color: var(--band-ink); border-bottom-color: var(--band-line); }
.helping-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem var(--space-2); padding-block: 0.5rem; }
.helping-bar p { margin: 0; overflow-wrap: anywhere; }
.helping-note { color: var(--ink-soft); }
.helping-bar.is-acting .helping-note { color: var(--band-ink-soft); }
.helping-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-left: auto; }
.helping-switch select { max-width: 100%; min-height: 2.25rem; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0.25rem 0.5rem; }
.helping-btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.helper-row { display: grid; gap: var(--space-1); }
.helper-name { margin: 0; overflow-wrap: anywhere; }
.helper-checks .field-check > div { min-width: 0; }

/* D3:START design pass: seller tabs, listing steps, purchases, empty states, art, footer, dark fixes */
/* Art (the stand, apples, chalkboard sign, apple mascot). Colors only from theme tokens. */
.lg-shadow { fill: var(--shadow-color); }
.lg-board { fill: var(--band-bg); }
.lg-eye { fill: var(--logo-art-line); }
.lg-cheek { fill: var(--logo-art-cream); opacity: 0.45; }
.lg-shine { stroke: var(--logo-art-cream); opacity: 0.7; }
.art-chalk { stroke: var(--band-ink); fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.art-chalk circle { fill: var(--band-ink); stroke: none; }
.scene { width: min(100%, 15rem); height: auto; margin-inline: auto; }
.mascot { width: 6rem; height: auto; }
.mascot-side { width: 5rem; }

/* Empty states and the 404 page */
.empty-state { display: grid; justify-items: center; gap: var(--space-1); text-align: center; padding: var(--space-4) var(--space-2); list-style: none; grid-column: 1 / -1; }
.empty-state h2 { margin: var(--space-1) 0 0; font-size: var(--step-3); }
.empty-state p { margin: 0; max-width: 32rem; }
.empty-state .btn { margin-top: var(--space-1); }
.empty-art { position: relative; display: grid; justify-items: center; margin-bottom: var(--space-1); }
.empty-art .mascot-side { position: absolute; right: calc(50% - 11rem); bottom: 0; }
@media (max-width: 520px) { .empty-art .mascot-side { right: 0; } }
.not-found h1 { font-size: var(--step-4); margin-bottom: var(--space-1); }
.empty-search { display: flex; gap: 0.5rem; width: 100%; max-width: 30rem; margin: var(--space-2) 0; }
.empty-search .input { flex: 1 1 auto; min-width: 0; border-radius: 999px; }


/* Seller tabs (across the top of every seller page) */
.seller-tabs-band { background: var(--surface); border-bottom: 1px solid var(--line); }
.seller-tabs ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0.35rem 0 0; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.seller-tabs li + li { margin-top: 0; }
.seller-tabs a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0.5rem 1rem; border-bottom: 3px solid transparent; color: var(--ink); text-decoration: none; font-weight: 700; white-space: nowrap; }
.seller-tabs a:hover { background: var(--accent-soft); border-radius: var(--radius-s) var(--radius-s) 0 0; }
.seller-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.dash-nav a .badge { margin-left: 0.25rem; }

/* Dashboard */
.stat-grid-main .stat b { font-size: var(--step-3); }
.dash-drafts { display: grid; gap: var(--space-1); margin-top: var(--space-3); }
.dash-draft-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2); }
.dash-draft-card.is-ready { border-color: var(--accent); background: var(--accent-soft); }
.ptable-ready h2 { font-size: var(--step-2); margin-bottom: var(--space-1); }

/* Listing form: steps and the Save bar */
.steps { margin-bottom: var(--space-2); }
.steps ol { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { margin: 0; counter-increment: step; }
.steps a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.35rem 0.9rem 0.35rem 0.4rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; }
.steps a::before { content: counter(step); display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: var(--step--1); }
.steps a[aria-current="step"] { border-color: var(--accent); color: var(--accent); }
.steps a[aria-current="step"]::before { background: var(--accent); color: var(--on-accent); }
.pform-step { margin-bottom: var(--space-2); scroll-margin-top: 1rem; }
.pform-step > h2 { font-size: var(--step-2); }
.pform { padding-bottom: 1rem; }
.save-bar { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line-strong); box-shadow: 0 -4px 16px var(--shadow-color); }
.save-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.65rem var(--space-1); }
.save-bar-inner .btn { flex: 1 1 8rem; }
@media (min-width: 640px) { .save-bar-inner .btn { flex: 0 0 auto; } }
.related-chips { list-style: none; margin: 0 0 var(--space-1); padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related-chips li { margin: 0; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.related-search { position: relative; }
.related-results { position: absolute; z-index: 6; left: 0; right: 0; list-style: none; margin: 0.25rem 0 0; padding: 0.25rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); box-shadow: var(--shadow); max-height: 16rem; overflow-y: auto; }
.related-results li { margin: 0; }
.related-option { width: 100%; text-align: left; background: none; border: 0; padding: 0.6rem 0.75rem; min-height: 2.75rem; color: var(--ink); font: inherit; cursor: pointer; border-radius: var(--radius-s); }
.related-option:hover, .related-option:focus-visible { background: var(--accent-soft); }

/* My purchases: cards with a cover and a full-width Download button */
.purchase-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.purchase-list > li + li { margin-top: 0; }
.purchase { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-1) var(--space-2); align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-2); box-shadow: var(--shadow); }
.purchase-cover { display: grid; place-items: center; width: 4.5rem; aspect-ratio: 1; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.purchase-cover img { width: 100%; height: 100%; object-fit: contain; }
.purchase-cover .mascot { width: 70%; }
.purchase-info { min-width: 0; }
.purchase-title { font-size: var(--step-1); margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.purchase-info p { margin: 0.25rem 0 0; }
.purchase-actions { grid-column: 1 / -1; display: grid; gap: 0.5rem; min-width: 0; }
.purchase-actions .btn { white-space: normal; }
.purchase-download { overflow-wrap: break-word; }
@media (min-width: 700px) {
  .purchase { grid-template-columns: 5.5rem minmax(0, 1fr) minmax(14rem, 18rem); }
  .purchase-cover { width: 5.5rem; }
  .purchase-actions { grid-column: auto; }
}

/* Footer: four columns, social icons, plain links (underline on hover only) */
.footer-inner { grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .footer-inner { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-inner h2 { font-size: var(--step-0); letter-spacing: 0.02em; }
.footer-links li { margin: 0; }
.footer-links a { display: inline-block; padding-block: 0.2rem; }
.footer-social { display: flex; gap: 0.75rem; list-style: none; padding: 0; margin: 0 0 var(--space-1); }
.footer-social li { margin: 0; }
.footer-social a { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--band-line); border-radius: 50%; }
.footer-social a:hover { border-color: var(--band-accent); text-decoration: none; }

/* Dark mode fixes: the home band no lighter than the page, visible input borders, readable hints */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { background: var(--bg); }
  :root:not([data-theme="light"]) .input, :root:not([data-theme="light"]) .field input, :root:not([data-theme="light"]) .field select, :root:not([data-theme="light"]) .field textarea, :root:not([data-theme="light"]) .hero-search input[type="search"], :root:not([data-theme="light"]) .header-search-input { border-color: color-mix(in srgb, var(--ink-soft) 65%, var(--surface)); background: var(--surface); }
}
:root[data-theme="dark"] .hero { background: var(--bg); }
:root[data-theme="dark"] .input, :root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .field textarea, :root[data-theme="dark"] .hero-search input[type="search"], :root[data-theme="dark"] .header-search-input { border-color: color-mix(in srgb, var(--ink-soft) 65%, var(--surface)); background: var(--surface); }
::placeholder { color: var(--ink-soft); opacity: 1; }
@media (max-width: 899px) { .dash-nav-last { order: 2; } }
/* D3:END */

/* D2:START (design agent D2, 2026-10-27): buttons, small text, icons, tints, product card, product page buy box, sticky Buy bar, details list, store polish, sign in and sign up. Only this section is D2 work; later rules here win over earlier ones on purpose. */

/* Text sizes: 14px floor, 16px body, 17px long reading text, 1.5 to 1.6 line spacing. */
body { line-height: 1.55; }
.prose, .store-bio, .store-about-text { font-size: 1.0625rem; line-height: 1.6; }
.prose { max-width: 65ch; }
.icon { flex: none; display: inline-block; vertical-align: -0.2em; }

/* Buttons: 44px tall, 16px words; Add to cart and Buy now are 48px; a dark style; outline borders reach 3:1. */
.btn { min-height: 2.75rem; font-size: 1rem; }
.btn-small { min-height: 2.5rem; font-size: 0.9375rem; padding-inline: 1rem; }
.btn-buy { min-height: 3rem; font-size: 1rem; }
.btn-dark { background: var(--btn-dark); color: var(--on-btn-dark); }
.btn-dark:hover { background: var(--btn-dark-hover); color: var(--on-btn-dark); }
.btn-outline { border-color: var(--control-border); }
.btn-outline:hover { border-color: var(--ink); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="url"], .field input[type="file"], .field select, .field textarea { border-color: var(--control-border); }
.wish-btn, .section-link { border-color: var(--control-border); }

/* A second accent for sales and stars; green stays for main actions. */
.stars-glyphs { color: var(--gold); }
.badge-sale { background: var(--gold-soft); color: var(--gold-ink); }
.price-sale { color: var(--gold-ink); }
.badge-new { background: var(--accent-soft); color: var(--accent); }
.badge-bundle { background: var(--tint-peach); color: var(--ink); }
.badge-free { background: var(--gold-soft); color: var(--gold-ink); }

/* Soft tinted panels: no borders, 24px corners; the dark versions come from the tokens. */
.tint-panel { border-radius: var(--radius-l); padding: var(--space-3); margin-top: var(--space-3); }
.tint-sage { background: var(--tint-sage); }
.tint-peach { background: var(--tint-peach); }
.icon-heading, .tint-panel h2 { display: flex; align-items: center; gap: 0.5rem; font-size: var(--step-2); }
.icon-heading .icon, .tint-panel h2 .icon { color: var(--accent); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.check-list li { position: relative; padding-left: 1.6rem; margin: 0; }
.check-list li::before { content: ""; position: absolute; left: 0.3rem; top: 0.3rem; width: 0.5rem; height: 0.9rem; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(40deg); }

/* Product card: cover with heart and Quick add, title, seller, tags, then rating on the left and price on the right. */
.card-shop .card-body { gap: 0.4rem; padding: var(--space-2); }
.card-shop h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-seller { flex-wrap: nowrap; margin: 0; font-size: var(--step--1); color: var(--ink-soft); min-width: 0; }
.card-seller-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-seller a { font-weight: 400; color: var(--ink-soft); }
.card-seller a:hover { color: var(--accent); text-decoration: underline; }
.card-seller .avatar { width: 1.5rem; height: 1.5rem; font-size: 0.875rem; }
.card-grades { margin: 0; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; }
.card-tags:empty { display: none; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.25rem; flex-wrap: wrap; }
.card-rating { display: inline-flex; align-items: center; }
.card-price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; justify-content: flex-end; }
.card-shop .price { font-size: 1.125rem; font-weight: 700; }
.quick-add { position: absolute; z-index: 2; left: 0.5rem; right: 0.5rem; bottom: 0.5rem; margin: 0; display: none; }
.quick-add .btn { width: 100%; }
@media (hover: hover) {
  .card-shop:hover .quick-add, .card-shop:focus-within .quick-add { display: block; }
}

/* Product page: buy box with a big price and side-by-side buttons. */
.product-extra:empty { display: none; }
@media (min-width: 900px) {
  .product-top { grid-template-areas: "media buy" "extra buy" "details buy"; row-gap: 0; }
  .product-media { grid-area: media; }
  .product-extra { grid-area: extra; }
}
.buy-panel h1 { font-size: 1.625rem; line-height: 1.2; margin-bottom: 0.5rem; }
.buy-seller { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.25rem; }
.buy-follow { margin: 0; }
.buy-rating { margin: 0 0 var(--space-1); }
.price-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0 0 var(--space-2); font: 700 2rem/1.1 var(--font-body); color: var(--accent); }
.price-big .price-now { color: var(--gold-ink); }
.price-big .badge { font-size: 0.875rem; }
.price-was { font-size: 1.125rem; font-weight: 400; color: var(--ink-soft); }
.buy-actions { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.buy-actions form { margin: 0; }
@media (min-width: 480px) { .buy-actions:not(.is-single) { grid-template-columns: 1fr 1fr; } }
.buy-more { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.buy-more .wish-form { flex: 1 1 auto; }
.buy-more .wish-full { border-radius: 999px; width: 100%; min-height: 2.75rem; }
.trust-cues { color: var(--ink); gap: 0.6rem; margin-top: var(--space-2); }
.trust-cues li { display: flex; gap: 0.6rem; align-items: flex-start; }
.trust-cues li::before { content: none; }
.trust-cues .icon { color: var(--accent); margin-top: 0.1rem; }
.product-extra .gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 7rem), 1fr)); }

@media (max-width: 899px) { .product-hero-img { max-width: 17rem; margin-inline: auto; } }
.product-details { margin-top: var(--space-3); }

/* Details list: an icon on every row; labels above values on phones. */
.details-box { margin-top: 0; }
.detail-list { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.detail-row { display: grid; grid-template-columns: 1fr; gap: 0.1rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.detail-row:first-child { border-top: 0; }
.detail-row dt { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.detail-row dt .icon { color: var(--accent); }
.detail-row dd { padding-left: 1.75rem; color: var(--ink); margin: 0; }
@media (min-width: 640px) {
  .detail-row { grid-template-columns: 11rem 1fr; align-items: center; gap: 1rem; }
  .detail-row dd { padding-left: 0; }
}
.great-for { margin-top: var(--space-3); }

/* Description and license. */
.description { margin-top: var(--space-4); }
.prose-read h2, .prose-read h3 { font-size: var(--step-2); margin-top: var(--space-3); }
.prose-read ul, .prose-read ol { padding-left: 1.4rem; }
.license-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-3); margin-top: var(--space-4); }

/* Sticky Buy bar (phones only). */
.buy-bar { display: none; }
@media (max-width: 899px) {
  .buy-bar { display: block; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 18px var(--shadow-color); padding-block: 0.6rem; transition: transform 0.2s ease; }
  .buy-bar.is-away { transform: translateY(110%); }
  .buy-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
  .buy-bar-price { margin: 0; font: 700 1.5rem/1 var(--font-body); color: var(--accent); }
  .buy-bar form { margin: 0; flex: 1 1 auto; max-width: 14rem; }
  .buy-bar .btn { width: 100%; }
  body:has(.buy-bar) .site-footer { padding-bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) { .buy-bar { transition: none; } }

/* Store page on wide screens: the logo sits beside the name, so the products start higher. The banner keeps the 15:4 shape. */
@media (min-width: 800px) {
  .store-id { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); align-items: start; }
  .store-id-text { padding-top: var(--space-2); }
}

/* Store page on phones: two cards per row so products sit higher (text stays at 14px or more). */
@media (max-width: 599px) {
  .store-page .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .store-page .card-shop .card-body { padding: 0.75rem; }
  .store-page .card-foot { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .store-page .card-price { margin-left: 0; justify-content: flex-start; }
  .store-page .quick-add { display: none !important; }
}

/* Sign in and sign up: one friendly centered card. */
.auth-card { padding: var(--space-4) var(--space-3); }
.auth-card .eyebrow { margin-bottom: 0.25rem; }
.auth-card h1 { font-size: var(--step-3); margin-bottom: var(--space-2); }
.auth-switch { margin: var(--space-3) 0 0; text-align: center; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 3.25rem; }
.password-eye { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; background: none; border: 0; border-radius: 50%; color: var(--ink-soft); cursor: pointer; }
.password-eye[aria-pressed="true"] { color: var(--accent); }
/* D2:END */

/* ---------- Help, discoverability and wording additions (fix list 5 and 6) ---------- */
.help-topics .card { padding: var(--space-3); gap: var(--space-1); }
.help-topics .card h3 { overflow-wrap: anywhere; }
.help-empty-contact { margin-top: var(--space-2); }
@media (max-width: 44.99rem) { .header-help { display: none; } }
.review-list { list-style: none; padding: 0; margin: 0; }
.field-check input { flex: 0 0 1.15rem; min-width: 1.15rem; margin-inline: 0; }
[data-utm-tip] code { overflow-wrap: anywhere; word-break: break-word; }
.extras-box {
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-2); margin-bottom: var(--space-2);
}
.extras-box h3 { margin: 0 0 0.25rem; font-size: var(--step-0); }
.extras-box ul { margin: 0; padding-left: 1.1rem; }
.extras-box li + li { margin-top: 0.35rem; }
.more-things { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-3); box-shadow: var(--shadow); margin-top: var(--space-3); }
.more-things h2 { margin-top: 0; font-size: var(--step-1); }
.more-things ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.more-things li { min-width: 0; }
.more-things li a { font-weight: 700; }
.more-things li span { display: block; color: var(--ink-soft); font-size: var(--step--1); }
.schools-steps li + li { margin-top: 0.35rem; }

/* D1:START (design agent D1, 2026-10-27): header, category bar, phone menu, home hero, shop-by tiles, trust band, browse filters. Only this section is D1 work; later rules here win over earlier ones on purpose. */

/* Line icons (sprite in partials/icons.html). Color follows the text around them. */
.ic { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-s { width: 1rem; height: 1rem; }
.ic-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.lg-sun { fill: var(--sun); }

/* Header: logo, wide search, cart and account in one row. */
.header-inner {
  display: grid; align-items: center; gap: 0.5rem 0.75rem; padding-block: 0.6rem;
  grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "menu brand actions" "search search search";
}
.menu-pop { grid-area: menu; position: static; }
.brand { grid-area: brand; justify-self: start; }
.header-search { grid-area: search; }
.header-actions { grid-area: actions; display: flex; align-items: center; gap: 0.25rem; justify-self: end; }
.brand .logo { height: 2.25rem; }
.hdr-btn {
  position: relative; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; list-style: none; text-decoration: none;
}
.hdr-btn::-webkit-details-marker { display: none; }
.hdr-btn:hover { background: var(--accent-soft); color: var(--ink); }
.hdr-btn .ic { width: 1.5rem; height: 1.5rem; }
.cart-link[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.cart-badge {
  position: absolute; top: 0.1rem; right: 0; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: 999px;
  background: var(--apple); color: var(--on-apple); font: 700 0.72rem/1.15rem var(--font-body); text-align: center;
}
.header-search {
  position: relative; display: flex; align-items: center; gap: 0.25rem; min-height: 2.75rem; min-width: 0;
  padding: 0.15rem 0.2rem 0.15rem 0.9rem; background: var(--surface); border: 2px solid var(--line-strong); border-radius: 999px;
}
.header-search:focus-within { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 2px; }
.header-search-icon, .hero-search-icon { color: var(--ink-soft); }
.header-search .header-search-input {
  flex: 1 1 auto; min-width: 0; min-height: 2.25rem; padding: 0 0.25rem; border: 0; border-radius: 0; background: transparent; outline: none; color: var(--ink); font: inherit;
}
.header-search .header-search-btn { flex: none; min-height: 2.25rem; padding-inline: 1.1rem; }
.header-signin { padding: 0.5rem 0.65rem; border-radius: var(--radius-s); color: var(--ink); font-weight: 700; text-decoration: none; }
.header-signin:hover { background: var(--accent-soft); color: var(--ink); }
.account-btn { display: inline-flex; align-items: center; gap: 0.2rem; min-height: 2.75rem; padding: 0 0.35rem 0 0.2rem; border-radius: 999px; cursor: pointer; color: var(--ink); list-style: none; }
.account-btn::-webkit-details-marker { display: none; }
.account-btn:hover { background: var(--accent-soft); }
.account-btn .avatar { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
.account-panel { left: auto; right: 0; min-width: 13rem; }
.account-panel .popover-item[aria-current="page"] { color: var(--accent); }

/* Category bar under the header (computer only). */
.category-bar { background: var(--bg); border-top: 1px solid var(--line); }
.category-list { display: flex; align-items: center; gap: 0.25rem; min-height: 2.75rem; margin: 0 auto; padding-block: 0; list-style: none; }
.category-list li { margin: 0; position: relative; }
.cat-pop > summary, .cat-link {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2.75rem; padding: 0 0.75rem;
  color: var(--accent); font-weight: 700; font-size: 0.9375rem; text-decoration: none; list-style: none; cursor: pointer;
}
.cat-pop > summary::-webkit-details-marker { display: none; }
.cat-pop > summary:hover, .cat-link:hover, .cat-pop[open] > summary { background: var(--accent-soft); color: var(--accent); }
.cat-panel { min-width: 15rem; padding: 0.5rem; max-height: 70vh; overflow-y: auto; }
.cat-links { display: grid; margin: 0; padding: 0; list-style: none; }
.cat-links li { margin: 0; }
.cat-links a { display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-s); color: var(--ink); font-size: var(--step--1); font-weight: 600; text-decoration: none; }
.cat-links a:hover { background: var(--accent-soft); color: var(--ink); }
.cat-cols-2 { grid-template-columns: repeat(2, minmax(11rem, 1fr)); }

/* Phone menu: a three-line button that opens a panel under the header. */
.menu-panel { position: absolute; top: 100%; left: 0; right: 0; max-width: none; max-height: calc(100vh - 8rem); overflow-y: auto; padding: 0.5rem var(--gutter) 1rem; border-radius: 0 0 var(--radius) var(--radius); border-width: 1px 0 0; }
.menu-list { margin: 0; padding: 0; list-style: none; }
.menu-list li, .menu-links li { margin: 0; }
.menu-account { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.menu-panel .popover-item { padding: 0.75rem; font-size: 1rem; }
.menu-group > summary { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; padding: 0 0.75rem; border-radius: var(--radius-s); font-weight: 600; cursor: pointer; list-style: none; }
.menu-group > summary::-webkit-details-marker { display: none; }
.menu-group > summary::after { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 0.25rem; }
.menu-group[open] > summary::after { transform: rotate(-135deg); }
.menu-group > summary:hover { background: var(--accent-soft); }
.menu-links { margin: 0 0 0.5rem; padding: 0 0 0 0.75rem; list-style: none; }
.menu-links a { display: block; padding: 0.6rem 0.75rem; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; }
.menu-links a:hover { background: var(--accent-soft); }

/* Computer header: one row, category bar visible, no menu button. */
@media (min-width: 45rem) {
  .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search actions"; gap: 1rem; }
  .menu-pop { display: none; }
  .brand .logo { height: 2.5rem; }
  .header-search { max-width: 44rem; width: 100%; justify-self: center; }
}
@media (max-width: 44.99rem) {
  .category-bar, .header-signin, .header-signup, .account-pop { display: none; }
  .header-inner { padding-block: 0.4rem 0.6rem; }
  .brand .logo { height: 2rem; }
}

/* Footer theme switch (for visitors who are not signed in). */
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem var(--space-2); }
.footer-theme { min-height: 2.75rem; padding: 0 var(--space-2); border: 1px solid var(--band-line); border-radius: 999px; background: none; color: var(--band-ink); font: inherit; cursor: pointer; }
.footer-theme:hover { border-color: var(--band-accent); }

/* Home hero: words and one big search on the left, the stand picture on the right. */
.hero-split { padding-block: var(--space-3); }
@media (min-width: 768px) { .hero-split { padding-block: var(--space-4); } }
.hero-grid { display: grid; gap: var(--space-2); align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.hero-grid > * { min-width: 0; }
.hero-copy .eyebrow { margin-bottom: 0.5rem; }
.hero-buttons .btn { flex: 1 1 8rem; }
@media (min-width: 40rem) { .hero-buttons .btn { flex: 0 0 auto; } }
.hero-copy h1 { font-size: var(--step-4); max-width: 24ch; margin-bottom: var(--space-2); }
.hero-search {
  position: relative; display: flex; align-items: center; flex-wrap: nowrap; gap: 0.5rem; max-width: 36rem; margin-top: 0; min-height: 3.5rem;
  padding: 0.25rem 0.3rem 0.25rem 1.1rem; background: var(--surface); border: 2px solid var(--line-strong); border-radius: 999px;
}
.hero-search:focus-within { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 2px; }
.hero-search input[type="search"] { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; padding: 0 0.25rem; border: 0; border-radius: 0; background: transparent; outline: none; font-size: 1.0625rem; }
.hero-search .btn { flex: none; min-height: 2.75rem; padding-inline: 1.4rem; }
.hero-buttons { margin: var(--space-2) 0 0; }
.hero-art { display: none; }
@media (min-width: 56rem) { .hero-art { display: block; } }
.hero-scene { position: relative; width: min(100%, 22rem); margin-inline: auto; padding: 1.5rem 0 0.5rem; }
.hero-scene .scene { width: 82%; margin-inline: 0; }
.hero-mascot { position: absolute; right: 0; bottom: 0; width: 28%; }
.hero-mascot .mascot { width: 100%; }
.hero-page { position: absolute; display: block; width: 24%; }
.hero-page .art-page { width: 100%; }
.hero-page-a { top: 0; right: 8%; transform: rotate(8deg); }
.hero-page-b { top: 22%; right: -2%; transform: rotate(-6deg); }

/* Shop by subject tiles, shop by type row. */
.section-tight { padding-block: var(--space-3); }
.tile-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile-grid li { margin: 0; }
.subject-tile {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon name" "icon count"; align-items: center; column-gap: 0.75rem; row-gap: 0;
  min-height: 4.5rem; padding: 0.75rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
}
.subject-tile:hover { border-color: var(--accent); color: var(--ink); }
.tile-icon { grid-area: icon; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.tile-icon .ic { width: 1.5rem; height: 1.5rem; }
.tile-name { grid-area: name; font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.25; }
.tile-count { grid-area: count; font-size: var(--step--1); color: var(--ink-soft); }
.subject-tile:not(:has(.tile-count)) .tile-name { grid-row: 1 / span 2; }
.type-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.type-row li { margin: 0; }
.type-chip { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1.1rem; border: 2px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; }
.type-chip:hover { border-color: var(--accent); color: var(--ink); }
.type-chip .ic { color: var(--accent); }

/* Trust band: four tiles on a pale green band. */
.trust-band { background: var(--accent-soft); padding-block: var(--space-4); margin-block: var(--space-3) 0; }
.trust-grid { display: grid; gap: var(--space-2); grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .trust-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trust-tile { margin: 0; padding: var(--space-3) var(--space-2); background: var(--surface); border: 1px solid var(--line); border-radius: 1.5rem; text-align: center; }
.trust-icon { display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: 0.5rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.trust-icon .ic { width: 1.6rem; height: 1.6rem; }
.trust-tile h3 { margin: 0 0 0.25rem; font-size: var(--step-1); }
.trust-tile p { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.trust-link { margin: var(--space-2) 0 0; text-align: center; font-weight: 700; }

/* Browse: filters on the left, results on the right; one Filters button on a phone. */
.browse-page { padding-top: var(--space-2); }
.browse-page h1 { font-size: var(--step-3); margin-bottom: var(--space-1); }
.browse-page .eyebrow { margin-bottom: 0.25rem; }
.browse-layout { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
@media (min-width: 56.25rem) { .browse-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-3); align-items: start; } }
.browse-results { min-width: 0; }
.filters-panel { display: grid; gap: 1.25rem; padding: var(--space-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-field { position: relative; }
.filter-field label { position: absolute; top: -0.65rem; left: 0.75rem; z-index: 1; padding: 0 0.35rem; background: var(--surface); color: var(--ink-soft); font-size: 0.8125rem; font-weight: 700; line-height: 1.3; }
.filter-field select, .filter-field input[type="text"] { width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-s); }
.filter-field select:focus-visible, .filter-field input:focus-visible { border-color: var(--focus); }
.all-filters { display: grid; gap: 1.25rem; }
.all-filters > summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; color: var(--accent); font-weight: 700; }
.all-filters[open] > summary { margin-bottom: 0.75rem; }
.filters-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); }
.filters-clear { font-weight: 700; }
.results-bar { margin-bottom: var(--space-2); gap: var(--space-1) var(--space-2); }
.results-tools { display: flex; align-items: center; gap: 0.5rem; }
.sort-field { display: flex; align-items: center; gap: 0.5rem; }
.sort-field label { font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.sort-field select { min-height: 2.5rem; padding: 0.35rem 0.6rem; font: inherit; font-size: 0.9375rem; color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-s); max-width: 100%; }
.view-toggle { gap: 0.25rem; }
.view-toggle .chip { width: 2.5rem; min-height: 2.5rem; justify-content: center; padding: 0; }
.browse-results .card-grid:not(.is-list) { grid-template-columns: repeat(auto-fill, minmax(11.75rem, 1fr)); gap: var(--space-2); }
@media (min-width: 56.25rem) { .filters-toggle { display: none; } }
@media (max-width: 56.24rem) {
  .results-bar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .results-tools { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .sort-field label { display: none; }
  .sort-field select { width: 100%; }
  .filters-js .filters-panel:not(.is-open) { display: none; }
  .filters-js .filters-panel { margin-bottom: var(--space-2); }
  .browse-layout { margin-top: var(--space-1); }
  .browse-results .card-grid:not(.is-list) { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 30rem) and (max-width: 56.24rem) { .browse-results .card-grid:not(.is-list) { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); } }
/* D1:END */
@media (max-width: 30rem) {
  .hero-search { padding-left: 0.85rem; gap: 0.25rem; }
  .hero-search input[type="search"] { font-size: 1rem; }
  .hero-search .btn { padding-inline: 1rem; }
  .hero-buttons .btn { padding-inline: 0.75rem; }
}
@media (max-width: 39.99rem) { .hero-lede { display: none; } }
.hero-lede { font-size: 1rem; max-width: 34rem; margin-bottom: var(--space-2); }
/* D1:END-MOBILE */
/* F1:START checkout, guests, reviews, receipts (fix agent F1) */
.cart-summary { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.cart-code { display: grid; gap: 0.35rem; }
.cart-code-row { display: flex; gap: 0.5rem; align-items: center; }
.cart-code-row input { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; }
.cart-total { margin: 0; font-size: var(--step-1); }
.cart-checkout { display: grid; gap: var(--space-2); }
.cart-quote { margin-top: var(--space-3); }
.guest-fields { display: grid; gap: var(--space-1); }
.guest-downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2); }
.card-box .btn-block + .btn-block { margin-top: 0.5rem; }
.badge-pending { background: var(--sun-soft); color: var(--ink); }
.purchase-status { margin: 0.35rem 0 0; }
.report-quote { margin: 0 0 var(--space-2); padding: var(--space-2); background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: var(--radius-s); }
.receipt-email { overflow-wrap: normal; word-break: normal; }
.buy-refund { margin-top: 0.5rem; }
.star-field .help, .star-field .review-credit { margin-top: 0.35rem; }
.star-rating { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.star-option { position: relative; display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; cursor: pointer; border-radius: var(--radius-s); }
.star-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.star-glyph { font-size: 2rem; line-height: 1; color: var(--line-strong); pointer-events: none; }
.star-option:has(input:checked) .star-glyph,
.star-option:has(~ .star-option input:checked) .star-glyph,
.star-option:hover .star-glyph,
.star-option:has(~ .star-option:hover) .star-glyph { color: var(--gold); }
.star-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
@supports not selector(:has(*)) {
  .star-option input { position: static; opacity: 1; width: auto; height: auto; }
}
.preview-viewer .gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
.preview-viewer .gallery a { cursor: zoom-in; }
.follow-live { display: inline; }
.ask-private { margin-top: var(--space-1); }
@media (max-width: 30rem) {
  .cart-code-row { flex-wrap: wrap; }
  .cart-code-row .btn { flex: 1 1 100%; }
}
/* F1:END */
.range-picker .chip-row { list-style: none; padding: 0; margin: 0; }

/* Polish: subtopics on Browse, "Sold by" stays together, cart rows stack on phones. */
.subject-tree-name { margin: var(--space-2) 0 0.25rem; font-size: var(--step-0); }
.seller-by { white-space: nowrap; }
@media (max-width: 40rem) {
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; box-sizing: border-box; }
  .cart-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cart-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); align-items: start; padding: 0.6rem 0.8rem; border-top: 1px solid var(--line); }
  .cart-table tr:first-child { border-top: 0; }
  .cart-table td { border-top: 0; padding: 0.25rem 0; }
  .cart-table td:first-child { grid-column: 1 / -1; }
  .cart-table td:nth-child(2) { grid-column: 1; }
  .cart-table td:nth-child(3) { grid-column: 2; text-align: right; }
  .cart-table .license-form { max-width: 100%; }
}

/* ---------- Product card, TpT style: the cover plus a few quiet lines of text on the page background ---------- */
.card-shop { background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.card-shop:focus-within { outline: none; }
.card-shop:focus-within .card-media { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-shop .card-media { border: 1px solid var(--line); border-radius: 6px; }
.card-shop .card-body { gap: 0.25rem; padding: 0.6rem 0 0; }
.card-shop h3 { font-size: 0.9375rem; font-weight: 400; line-height: 1.4; }
.card-shop .card-seller { gap: 0.4rem; margin: 0; }
.card-shop .card-seller .avatar { flex: none; width: 1.375rem; height: 1.375rem; font-size: 0.75rem; }
.card-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.4rem; margin-top: 0.1rem; }
.card .card-price-row { color: var(--ink); }
.card-shop .price { font-size: 1rem; font-weight: 700; }
.card-shop .price-sale { color: var(--sale); }
.card-was { color: var(--ink-soft); font-size: 0.875rem; font-weight: 400; }
.card-shop .badge { font-size: 0.8125rem; padding: 0.05rem 0.5rem; }
.card-shop .badge-sale { background: var(--sale-soft); color: var(--sale); }
.card-shop .badge-free { padding: 0; background: none; color: var(--ink); font-size: 1rem; }
.card-shop .card-rating { margin-left: auto; font-size: 0.875rem; }
.tag-soft { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--tint-sage); color: var(--ink); font-size: 0.8125rem; line-height: 1.4; }
.card-shop .card-tags { margin-top: 0.15rem; }
/* The heart is a small circle over the cover's top-right corner, shown on hover and keyboard focus only. */
.card-media .wish-form-card, .card-media a.wish-card { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 3; opacity: 0; transition: opacity 0.15s; }
.card-shop:hover .wish-form-card, .card-shop:hover a.wish-card, .card-shop:focus-within .wish-form-card, .card-shop:focus-within a.wish-card { opacity: 1; }
.card-media .wish-btn { min-width: 2.25rem; min-height: 2.25rem; padding: 0; }
@media (hover: none) { .card-media .wish-form-card, .card-media a.wish-card { display: none; } }
/* Four across on desktop, three on tablets, two on phones; 24px between columns and 32px between rows. */
.card-grid:has(> .card-shop):not(.is-list) { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 2rem; }
@media (max-width: 56.24rem) { .card-grid:has(> .card-shop):not(.is-list) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 37.4rem) { .card-grid:has(> .card-shop):not(.is-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; } }
.card-grid.is-list .card-shop .card-body { padding: 0 0 0 var(--space-2); }

/* ===== SUPPORT-PANEL:START  Help and support slide-in panel (templates/partials/support_panel.html, static/js/support-panel.js). Tokens only. ===== */
.support-link[aria-expanded="true"] { background: var(--accent-soft); }
.support-open { overflow: hidden; }
.support-backdrop { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--ink) 45%, transparent); opacity: 0; transition: opacity 0.2s ease; }
.support-backdrop.is-open { opacity: 1; }
.support-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; display: flex; flex-direction: column;
  width: min(26rem, 100%); background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform 0.22s ease;
}
.support-panel.is-open { transform: none; }
.support-panel:focus { outline: none; }
@media (max-width: 30rem) { .support-panel { width: 100%; border-left: 0; } }
@media (prefers-reduced-motion: reduce) { .support-panel, .support-backdrop { transition: none; } }
.support-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.support-head h2 { margin: 0; font-size: 1.25rem; font-weight: 500; }
.support-close { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-right: -0.5rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.support-close:hover { background: var(--accent-soft); }
.support-body { flex: 1 1 auto; overflow-y: auto; padding: 0.25rem 1.25rem 1.5rem; font-weight: 400; }
.support-intro { margin: 1rem 0 0; color: var(--ink-soft); }
.support-section { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.support-section h3 { margin: 0 0 0.35rem; font-size: 1.125rem; font-weight: 500; }
.support-note { margin: 0 0 0.75rem; font-size: 0.9375rem; color: var(--ink-soft); }
.support-section > .support-note:last-child { margin-bottom: 0; }
.support-row { display: flex; gap: 0.5rem; }
.support-row .input { flex: 1 1 auto; min-width: 0; }
.support-panel .btn { font-weight: 600; }
.support-panel .field { margin-bottom: 0.9rem; }
.support-panel .field label { font-size: 0.9375rem; font-weight: 400; color: var(--ink-soft); }
.support-answer { margin-top: 0.9rem; padding: 0.9rem 1rem; border-radius: var(--radius-s); background: var(--surface-2); }
.support-answer-text { margin: 0; font-weight: 400; white-space: pre-line; }
.support-sources { margin: 0.75rem 0 0.25rem; font-size: 0.875rem; color: var(--ink-soft); }
.support-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.support-links a { display: inline-block; padding: 0.15rem 0; }
.support-section .support-links + .support-note { margin-top: 0.75rem; }
.support-sent { margin: 0; padding: 0.9rem 1rem; border-radius: var(--radius-s); background: var(--accent-soft); }
.support-foot { margin: 1.25rem 0 0; color: var(--ink-soft); }
.support-panel .error { margin: 0 0 0.75rem; color: var(--error); }
/* In dark mode a light veil would look grey, so the page is dimmed with the dark background color instead. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .support-backdrop { background: color-mix(in srgb, var(--bg) 78%, transparent); } }
:root[data-theme="dark"] .support-backdrop { background: color-mix(in srgb, var(--bg) 78%, transparent); }
/* ===== SUPPORT-PANEL:END ===== */

/* ===== CSV-IMPORT-MATCH:START (Match your columns step) ===== */
.match-table select { width: 100%; max-width: 14rem; min-height: 2.5rem; padding: 0.4rem 0.6rem; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); }
.match-table select:focus-visible { border-color: var(--focus); }
.match-table th[scope="row"] { font-weight: 400; }
.match-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: var(--space-3) 0 var(--space-2); }
@media (max-width: 40rem) {
  .match-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .match-table, .match-table tbody, .match-table tr, .match-table th, .match-table td { display: block; }
  .match-table tr { padding: 0.6rem 0.8rem; border-top: 1px solid var(--line); }
  .match-table tr:first-child { border-top: 0; }
  .match-table th, .match-table td { padding: 0.15rem 0; border-top: 0; }
  .match-table select { max-width: 100%; }
}
/* ===== CSV-IMPORT-MATCH:END ===== */

/* ===== FEATURES-PAGES:START (seller features, buyers page, pipeline accordions; gutter tiles) ===== */
.features-page .part-title { font-size: var(--step-3); margin: var(--space-4) 0 var(--space-2); }
.features-page .h2-like { font-size: var(--step-2); font-weight: 700; margin-bottom: var(--space-1); }
.features-page .acc-lead { color: var(--ink-soft); font-size: var(--step--1); margin-bottom: var(--space-2); }
.features-page .acc-sub { font-family: var(--font-head); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); margin: var(--space-3) 0 0.25rem; }
.features-page .acc-lead + .acc-sub { margin-top: var(--space-1); }
.features-page .plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.features-cta .btn-row { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-bottom: 0; }
.acc { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-summary { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 0.25rem; cursor: pointer; list-style: none; font-family: var(--font-head); font-size: 1rem; font-weight: 400; color: var(--ink); }
.acc-summary::-webkit-details-marker { display: none; }
.acc-summary:hover .acc-title { color: var(--accent); }
.acc-summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-s); }
.acc-title { flex: 1 1 auto; min-width: 0; }
.acc-tag { flex: none; font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; line-height: 1; padding: 0.25rem 0.5rem; border-radius: var(--radius-s); background: var(--free-bg); color: var(--free-ink); }
.acc-tag-pro { background: var(--badge-bg); color: var(--badge-ink); }
.acc-chev { flex: none; width: 1.1rem; height: 1.1rem; stroke: var(--ink-soft); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s ease; }
.acc-item[open] > .acc-summary .acc-chev { transform: rotate(180deg); }
.acc-body { padding: 0 0.25rem 1rem; color: var(--ink-soft); }
.acc-body p { margin: 0 0 0.6rem; max-width: 40rem; }
.acc-body .acc-learn { margin: 0; }
@media (prefers-reduced-motion: reduce) { .acc-chev { transition: none; } }

/* Gutter tiles: only where the empty space beside the 72rem content really fits them
   (content width + 2 x (tile 192px + gap 24px + edge 8px) = 72rem + 464px).  Sticky inside an
   absolute rail that runs the height of main. */
.side-tiles { display: none; }
@media (min-width: calc(72rem + 464px)) and (min-height: 760px) {
  main { position: relative; }
  .side-tiles { display: block; position: absolute; z-index: 1; top: 0; bottom: 0; left: calc(50% - 36rem - 216px); width: 192px; pointer-events: none; }
  .side-tiles-stick { position: sticky; top: 1.25rem; display: grid; gap: 0.75rem; padding-top: 1.25rem; pointer-events: auto; }
  .side-tile { display: flex; flex-direction: column; gap: 0.3rem; min-height: 10.5rem; padding: 0.9rem 0.9rem 0.8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color 0.15s ease, background-color 0.15s ease; }
  .side-tile:hover, .side-tile:focus-visible { border-color: var(--accent); background: var(--surface-2); }
  .side-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .side-tile-art { width: 3.5rem; height: 2.625rem; fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 0.2rem; }
  .side-tile-title { font-family: var(--font-head); font-size: 0.9375rem; font-weight: 600; line-height: 1.25; }
  .side-tile-sub { font-size: 0.8125rem; line-height: 1.35; color: var(--ink-soft); }
}
/* ===== FEATURES-PAGES:END ===== */
