/* The Flourishing Chapter Awaits — storefront
   Colors come from Admin → Branding and are injected as CSS variables. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --paper: #f1e5d3;
  --card: #f8f0e3;
  --linen: #e3ceb5;
  --sepia: #a37f5f;
  --walnut: #5d402a;
  --ink: #311808;
  --ink-soft: color-mix(in srgb, var(--ink) 72%, var(--paper));
  --rule: color-mix(in srgb, var(--sepia) 45%, var(--paper));
  --ok: #56603a;
  --bad: #8a3324;
  --display: 'IM Fell English', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --text: 'Alegreya', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --ui: 'Alegreya Sans', 'Gill Sans', 'Segoe UI', system-ui, sans-serif;
  --wrap: 1180px;
  --radius: 3px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}
/* Faint paper grain so large areas don't read as flat fill. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--walnut); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--walnut); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; color: var(--ink); letter-spacing: 0.005em; }
h1 { font-size: clamp(2.1rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.15rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 720px); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--walnut); color: var(--card); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

/* ---------- Announcement + header ---------- */
.announce {
  background: var(--walnut);
  color: var(--card);
  text-align: center;
  font-family: var(--ui);
  font-size: 0.95rem;
  padding: 0.45rem 1rem;
}
.site-header { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 92%, white); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.brand span { font-family: var(--display); font-size: 1.35rem; line-height: 1.1; }
.nav { display: flex; align-items: center; gap: 1.4rem; font-family: var(--ui); font-size: 1.02rem; }
.nav a { text-decoration: none; color: var(--ink); padding: 0.3rem 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current='page'] { border-bottom-color: var(--walnut); }
.header-tools { display: flex; align-items: center; gap: 0.35rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  min-width: 44px; height: 44px; padding: 0 0.5rem; border: 0; background: none; color: var(--ink);
  border-radius: var(--radius); cursor: pointer; text-decoration: none; font-family: var(--ui); font-size: 0.95rem;
}
.icon-btn:hover { background: color-mix(in srgb, var(--linen) 55%, transparent); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.cart-count {
  min-width: 1.35rem; height: 1.35rem; border-radius: 1rem; background: var(--walnut); color: var(--card);
  font-size: 0.78rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 0.3rem;
  font-variant-numeric: lining-nums;
}
.cart-count[data-count='0'] { display: none; }
.menu-toggle { display: none; }

.search-bar { display: none; border-top: 1px solid var(--rule); padding: 0.9rem 0; }
.search-bar.open { display: block; }
.search-bar form { display: flex; gap: 0.5rem; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0; background: var(--card); border-bottom: 1px solid var(--rule);
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--rule); }
  .site-header { position: relative; }
  .brand span { font-size: 1.1rem; }
  .brand img { width: 44px; height: 44px; }
}
@media (max-width: 420px) { .brand span { display: none; } }

/* ---------- Buttons + forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--ui); font-size: 1.05rem; font-weight: 500; line-height: 1;
  padding: 0.85rem 1.4rem; min-height: 48px; border-radius: var(--radius);
  background: var(--walnut); color: var(--card); border: 1px solid var(--walnut);
  text-decoration: none; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--walnut); }
.btn.secondary:hover { background: var(--walnut); color: var(--card); }
.btn.small { min-height: 38px; padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--walnut); text-decoration: underline; cursor: pointer; font: inherit; }

label { display: block; font-family: var(--ui); font-size: 0.98rem; margin-bottom: 0.3rem; color: var(--ink); }
.field { margin-bottom: 1rem; }
.field .hint { font-family: var(--ui); font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.25rem; }
.field .err { font-family: var(--ui); font-size: 0.92rem; color: var(--bad); margin-top: 0.25rem; }
input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='search'], input[type='number'], select, textarea {
  width: 100%; font: inherit; font-family: var(--ui); font-size: 1.05rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.7rem 0.8rem; min-height: 48px;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--walnut); outline-offset: 0; border-color: var(--walnut); }
.invalid input, .invalid select, input.invalid { border-color: var(--bad); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-family: var(--ui); }
.check input { width: 20px; height: 20px; margin-top: 0.15rem; accent-color: var(--walnut); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.flash { font-family: var(--ui); padding: 0.85rem 1.1rem; border-radius: var(--radius); margin: 1.2rem 0; border: 1px solid; }
.flash.success { background: color-mix(in srgb, var(--ok) 10%, var(--card)); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.flash.error { background: color-mix(in srgb, var(--bad) 8%, var(--card)); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }

/* ---------- Home ---------- */
.hero { padding: clamp(2rem, 5vw, 4rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-art { position: relative; }
.hero-art img {
  width: 100%; max-width: 560px; margin-inline: auto;
  /* The logo's own paper blends into the page; a soft vignette hides the square edge. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
}
.hero-copy h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); margin-bottom: 0.4em; }
.hero-copy p { font-size: 1.22rem; color: var(--ink-soft); max-width: 34ch; }
.hero-copy .btn { margin-top: 0.6rem; }
.hero-note { font-family: var(--ui); font-size: 0.98rem; color: var(--ink-soft); margin-top: 1.1rem; }
.fleuron { font-family: var(--display); color: var(--sepia); font-size: 1.6rem; line-height: 1; display: block; margin-bottom: 0.9rem; }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero-art img { max-width: 380px; }
  .hero-copy p { margin-inline: auto; }
}

.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head a { font-family: var(--ui); }

/* Categories as a table of contents */
.contents { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 3.5rem; }
.contents li { break-inside: avoid; }
.contents a { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.45rem 0; text-decoration: none; color: var(--ink); font-size: 1.2rem; }
.contents a::after { content: ''; order: 2; flex: 1; border-bottom: 1px dotted var(--sepia); transform: translateY(-0.3em); }
.contents .n { order: 3; font-variant-numeric: oldstyle-nums; color: var(--ink-soft); }
.contents a:hover .t { text-decoration: underline; }
@media (max-width: 640px) { .contents { columns: 1; } }

.about-teaser { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; align-items: center; }
.about-teaser img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; border: 1px solid var(--rule); }
.about-teaser p { font-size: 1.2rem; }
@media (max-width: 600px) { .about-teaser { grid-template-columns: 1fr; text-align: center; } .about-teaser img { margin-inline: auto; width: 140px; height: 140px; } }

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2.2rem 1.6rem; }
.card { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.card .cover {
  aspect-ratio: 2 / 3; background: var(--linen); border-radius: 2px; overflow: hidden; margin-bottom: 0.8rem;
  box-shadow: 0 1px 0 rgba(49, 24, 8, 0.12), 0 10px 22px -14px rgba(49, 24, 8, 0.55);
  display: flex; align-items: center; justify-content: center;
}
/* Crafts are square in craft-only rows; in mixed rows everything shares the book shape so rows line up. */
.grid.crafts .card .cover { aspect-ratio: 1 / 1; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .cover .placeholder { font-family: var(--display); color: var(--sepia); text-align: center; padding: 1rem; font-size: 1.15rem; }
.card .title { font-weight: 500; font-size: 1.1rem; line-height: 1.3; margin: 0; }
.card:hover .title { text-decoration: underline; text-underline-offset: 0.2em; }
.card .by { font-style: italic; color: var(--ink-soft); font-size: 1rem; margin: 0.1rem 0 0; }
.card .price { font-family: var(--ui); font-size: 1.02rem; margin-top: 0.35rem; font-variant-numeric: lining-nums; }
.card .price s { color: var(--ink-soft); margin-left: 0.35rem; font-size: 0.9rem; }
.card .tag {
  position: absolute; top: 0.55rem; left: 0.55rem; font-family: var(--ui); font-size: 0.8rem;
  background: var(--card); color: var(--ink); padding: 0.2rem 0.5rem; border-radius: 2px; border: 1px solid var(--rule);
}

/* ---------- Listing ---------- */
.page-head { padding: 2.2rem 0 0.4rem; }
.page-head h1 { margin-bottom: 0.2em; }
.page-head p { color: var(--ink-soft); max-width: 60ch; margin: 0; }
.listing-page { padding-bottom: 3.5rem; }

/* Section tabs sit on a single rule, like chapter headings on a contents page. */
.section-tabs { display: flex; align-items: flex-end; gap: 1.8rem; margin-top: 1.6rem; border-bottom: 1px solid var(--rule); font-family: var(--ui); overflow-x: auto; }
.section-tabs a { padding: 0.6rem 0; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 1.05rem; }
.section-tabs a:hover { color: var(--ink); }
.section-tabs a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--walnut); }

.toolbar { display: flex; gap: 0.9rem 1.2rem; align-items: center; flex-wrap: wrap; margin: 1.1rem 0 1.8rem; font-family: var(--ui); font-size: 1rem; }
.toolbar .count { color: var(--ink-soft); font-variant-numeric: lining-nums; }
.toolbar .spacer { flex: 1; }
.toolbar .check { margin: 0; align-items: center; }
.toolbar .check input { margin: 0; }
.toolbar .sort { margin: 0; display: flex; gap: 0.5rem; align-items: center; }
.toolbar select { width: auto; min-height: 40px; padding: 0.35rem 0.6rem; font-size: 0.98rem; }
.chips { display: inline-flex; gap: 0.35rem; }
.chips a { padding: 0.3rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.chips a:hover { border-color: var(--walnut); }
.chips a[aria-current='true'] { background: var(--walnut); border-color: var(--walnut); color: var(--card); }

.sold-note { font-style: italic; color: var(--ink-soft); margin: -0.6rem 0 1.6rem; }

/* Empty pages: centered, calm, one clear next step. */
.rest-note { text-align: center; max-width: 34rem; margin: 3.5rem auto 2rem; }
.rest-note h2 { margin-bottom: 0.4em; }
.rest-note p { color: var(--ink-soft); }
.rest-note.small { margin-top: 2.5rem; }
.rest-note.small h2 { font-size: 1.7rem; }
.rest-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.3rem; }

/* Sold pieces stay visible as a record of past work, softened to sepia. */
.card.soldout .cover { box-shadow: 0 1px 0 rgba(49, 24, 8, 0.08); }
.card.soldout .cover img { filter: sepia(0.55) saturate(0.6) brightness(1.04); opacity: 0.72; }
.card .tag.sold { background: var(--ink); color: var(--card); border-color: var(--ink); }
.card .price.sold { color: var(--ink-soft); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-soft); }
.empty h2 { color: var(--ink); }
@media (max-width: 640px) {
  .section-tabs { gap: 1.2rem; }
  .toolbar .spacer { display: none; }
}

.pager { display: flex; gap: 0.35rem; justify-content: center; margin-top: 2.5rem; font-family: var(--ui); flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); padding: 0 0.6rem; }
.pager span[aria-current] { background: var(--walnut); color: var(--card); border-color: var(--walnut); }

/* ---------- Product page ---------- */
.crumbs { font-family: var(--ui); font-size: 0.95rem; padding: 1.2rem 0 0; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); padding: 1.6rem 0 3rem; }
.gallery .main {
  background: var(--linen); border-radius: 2px; overflow: hidden; width: fit-content; max-width: min(100%, 520px);
  box-shadow: 0 1px 0 rgba(49, 24, 8, 0.12), 0 22px 40px -26px rgba(49, 24, 8, 0.6);
}
.gallery .main img { width: auto; max-width: 100%; max-height: 720px; }
.thumbs { display: flex; gap: 0.6rem; margin-top: 0.9rem; flex-wrap: wrap; }
.thumbs button { width: 72px; height: 72px; padding: 0; border: 1px solid var(--rule); background: var(--card); border-radius: 2px; cursor: pointer; overflow: hidden; }
.thumbs button[aria-pressed='true'] { outline: 2px solid var(--walnut); outline-offset: 1px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { margin-bottom: 0.15em; }
.product .subtitle { font-size: 1.25rem; color: var(--ink-soft); margin: 0 0 0.3rem; }
.product .author { font-size: 1.3rem; font-style: italic; margin: 0 0 1.2rem; }
.product .price { font-family: var(--ui); font-size: 1.7rem; font-variant-numeric: lining-nums; margin-bottom: 0.3rem; }
.product .price s { font-size: 1.1rem; color: var(--ink-soft); margin-left: 0.5rem; }
.stock-line { font-family: var(--ui); color: var(--ink-soft); margin-bottom: 1.3rem; }
.stock-line.low { color: var(--walnut); font-weight: 500; }
.buy { display: flex; gap: 0.7rem; align-items: stretch; flex-wrap: wrap; margin-bottom: 1.8rem; }
.qty { width: 92px !important; text-align: center; }
.buy .btn { flex: 1; min-width: 200px; }
.added { font-family: var(--ui); color: var(--ok); margin: -1rem 0 1.5rem; min-height: 1.5em; }
.description { max-width: 62ch; }
.description :is(h2, h3) { margin-top: 1.4em; }

/* The library catalog card */
.catalog-card {
  position: relative; background: color-mix(in srgb, var(--card) 70%, white);
  border: 1px solid color-mix(in srgb, var(--sepia) 40%, transparent); border-radius: 6px;
  padding: 1.1rem 1.4rem 2.6rem; margin: 0 0 1.8rem; max-width: 520px; font-size: 1.05rem;
  box-shadow: 0 1px 1px rgba(49, 24, 8, 0.08), 0 8px 18px -12px rgba(49, 24, 8, 0.45);
  --ruling: color-mix(in srgb, #6b86a6 30%, transparent);
}
.catalog-card::after { /* the punched hole for the drawer rod */
  content: ''; position: absolute; bottom: 0.8rem; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 2px rgba(49, 24, 8, 0.35);
}
.catalog-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2px solid color-mix(in srgb, var(--bad) 55%, transparent); padding-bottom: 0.35rem; }
.catalog-card .head strong { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.catalog-card .head span { font-family: var(--ui); font-size: 0.9rem; color: var(--ink-soft); font-variant-numeric: lining-nums; }
/* Each row sits on its own ruled line, like a typed index card. */
.catalog-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; }
.catalog-card dt { padding-right: 1.2rem !important; }
.catalog-card dt, .catalog-card dd { margin: 0; padding: 0.3rem 0 0.2rem; border-bottom: 1px solid var(--ruling); }
.catalog-card dt { color: var(--ink-soft); font-style: italic; }
.catalog-card dd { font-variant-numeric: lining-nums; }
.catalog-card .cond-note { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.98rem; }

.related { padding: 2.5rem 0 3.5rem; border-top: 1px solid var(--rule); }
@media (max-width: 820px) { .product { grid-template-columns: 1fr; } .gallery .main { margin-inline: auto; } }

/* ---------- Cart + checkout ---------- */
.cart-page { padding: 2rem 0 4rem; }
.cart-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cart-line { display: grid; grid-template-columns: 76px 1fr auto; gap: 1.1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--rule); align-items: center; }
.cart-line .thumb { width: 76px; aspect-ratio: 2/3; background: var(--linen); overflow: hidden; border-radius: 2px; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .t { font-weight: 500; text-decoration: none; color: var(--ink); }
.cart-line .by { font-style: italic; color: var(--ink-soft); font-size: 1rem; }
.cart-line .controls { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.5rem; font-family: var(--ui); flex-wrap: wrap; }
.cart-line .controls select { width: auto; min-height: 40px; padding: 0.3rem 0.5rem; }
.cart-line .amt { font-family: var(--ui); font-variant-numeric: lining-nums; text-align: right; }
.cart-summary { margin-top: 1.6rem; margin-left: auto; max-width: 380px; font-family: var(--ui); }
.sum-row { display: flex; justify-content: space-between; padding: 0.35rem 0; font-variant-numeric: lining-nums; }
.sum-row.total { border-top: 1px solid var(--rule); margin-top: 0.4rem; padding-top: 0.8rem; font-size: 1.25rem; font-weight: 600; }
.sum-note { font-size: 0.95rem; color: var(--ink-soft); }

.checkout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); padding: 2rem 0 4rem; }
.checkout h2 { font-size: 1.55rem; margin-top: 1.8rem; }
.checkout h2:first-child { margin-top: 0; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.4rem; }
.order-panel { position: sticky; top: 1.2rem; align-self: start; }
.mini-lines { list-style: none; margin: 0 0 1rem; padding: 0; }
.mini-lines li { display: grid; grid-template-columns: 48px 1fr auto; gap: 0.8rem; align-items: center; padding: 0.5rem 0; font-family: var(--ui); font-size: 0.98rem; }
.mini-lines .thumb { width: 48px; aspect-ratio: 2/3; background: var(--linen); border-radius: 2px; position: relative; }
.mini-lines .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.mini-lines .q { position: absolute; top: -6px; right: -6px; background: var(--walnut); color: var(--card); border-radius: 1rem; font-size: 0.72rem; min-width: 1.2rem; height: 1.2rem; display: flex; align-items: center; justify-content: center; }
.ship-options { display: grid; gap: 0.6rem; }
.ship-option { display: flex; gap: 0.8rem; align-items: center; padding: 0.9rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); cursor: pointer; font-family: var(--ui); }
.ship-option:has(input:checked) { border-color: var(--walnut); box-shadow: inset 0 0 0 1px var(--walnut); }
.ship-option input { accent-color: var(--walnut); width: 20px; height: 20px; }
.ship-option .n { flex: 1; }
.ship-option .n small { display: block; color: var(--ink-soft); font-size: 0.9rem; }
.ship-option .c { font-variant-numeric: lining-nums; font-weight: 600; }
.muted { color: var(--ink-soft); font-family: var(--ui); }
#paypal-buttons { margin-top: 1.2rem; min-height: 50px; }
.pay-status { font-family: var(--ui); margin-top: 0.8rem; min-height: 1.4em; }
.pay-status.error { color: var(--bad); }
.secure-note { font-family: var(--ui); font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.8rem; }
@media (max-width: 880px) { .checkout { grid-template-columns: 1fr; } .order-panel { position: static; order: -1; } }

/* ---------- Order status ---------- */
.receipt { padding: 2.2rem 0 4rem; }
.steps { display: flex; list-style: none; padding: 0; margin: 1.5rem 0 2rem; font-family: var(--ui); counter-reset: s; }
.steps li { flex: 1; text-align: center; position: relative; padding-top: 2.2rem; color: var(--ink-soft); font-size: 0.95rem; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--card); display: flex; align-items: center; justify-content: center; font-variant-numeric: lining-nums; }
.steps li::after { content: ''; position: absolute; top: 0.9rem; left: calc(50% + 1rem); right: calc(-50% + 1rem); border-top: 1px solid var(--rule); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--walnut); border-color: var(--walnut); color: var(--card); }
.addr { font-family: var(--ui); line-height: 1.5; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Plain pages + accounts ---------- */
.prose { padding: 2rem 0 4rem; }
.prose .content { font-size: 1.18rem; line-height: 1.7; }
.prose .content h2 { margin-top: 1.5em; font-size: 1.7rem; }
.prose .content blockquote { border-left: 2px solid var(--sepia); margin: 1.4em 0; padding-left: 1.2rem; font-style: italic; color: var(--ink-soft); }
.auth { padding: 3rem 0 5rem; }
.auth .panel { max-width: 460px; margin-inline: auto; }
.auth h1 { font-size: 2.1rem; text-align: center; }
.auth .alt { text-align: center; font-family: var(--ui); margin-top: 1.2rem; }
.table { width: 100%; border-collapse: collapse; font-family: var(--ui); }
.table th, .table td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--rule); }
.table th { font-weight: 600; font-size: 0.95rem; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: lining-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: color-mix(in srgb, var(--card) 88%, transparent); margin-top: 2rem; padding: 3rem 0 2rem; font-family: var(--ui); }
.site-footer a { color: var(--card); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h3 { color: var(--card); font-size: 1.3rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer .fine { border-top: 1px solid color-mix(in srgb, var(--card) 20%, transparent); margin-top: 2.5rem; padding-top: 1.2rem; font-size: 0.9rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.social { display: flex; gap: 0.9rem; margin-top: 0.8rem; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0;
  background: var(--ink); color: var(--card); font-family: var(--ui); padding: 0.85rem 1.2rem; border-radius: var(--radius);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5); transition: opacity 0.2s, transform 0.2s; z-index: 50; display: flex; gap: 1rem; align-items: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast a { color: var(--card); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .announce { display: none; } body::before { display: none; } }

/* Keep the footer at the bottom on short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

/* Two items per row on phones, so browsing doesn't mean endless scrolling. */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 0.9rem; }
  .card .title { font-size: 1rem; }
  .card .by { font-size: 0.92rem; }
  .card .tag { font-size: 0.72rem; top: 0.35rem; left: 0.35rem; }
}

/* With a single section, the tab row is just a quiet rule under the heading. */
.section-tabs.single { min-height: 0; }
