/*
 * Timeless Treasure Ceramics, prototype styles.
 * Brand: off-black #161616 + teal #09757a (taken from the current site).
 * Shape rule: everything is 10px radius, except filter chips and counters (full pill).
 * Z-index scale: header 20, toast 40. Dialogs use the browser top layer.
 */

:root {
  --bg: #f4f5f3;
  --surface: #fbfbfa;
  --surface-2: #e8eae7;
  --ink: #161616;
  --ink-2: #474c49;
  --ink-3: #636864;
  --line: #d6d9d5;
  --accent: #09757a;
  --accent-hover: #075f63;
  --accent-ink: #f4f7f6;
  --accent-soft: #d9ebea;
  --warn: #8a5300;
  --warn-soft: #f6ead6;
  --error: #a3352a;
  --paper: #f1f1ec;
  --paper-ink: #1d1d1b;
  --shadow: 0 1px 2px rgb(22 30 28 / 0.06), 0 8px 24px rgb(22 30 28 / 0.07);
  --r: 10px;
  --font: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --display: 'Bricolage Grotesque', 'Geist', ui-sans-serif, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121413; --surface: #191c1b; --surface-2: #222624; --ink: #eceeed; --ink-2: #b6bcb9;
    --ink-3: #959c98; --line: #2f3432; --accent: #45b9bc; --accent-hover: #63c9cb; --accent-ink: #071413;
    --accent-soft: #163233; --warn: #e2b062; --warn-soft: #33281a; --error: #f08a7e;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121413; --surface: #191c1b; --surface-2: #222624; --ink: #eceeed; --ink-2: #b6bcb9;
  --ink-3: #959c98; --line: #2f3432; --accent: #45b9bc; --accent-hover: #63c9cb; --accent-ink: #071413;
  --accent-soft: #163233; --warn: #e2b062; --warn-soft: #33281a; --error: #f08a7e;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100dvh; display: flex; flex-direction: column;
}
main { flex: 1; }
main:focus, main:focus-visible { outline: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 0; }
.muted { color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 32px; } }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r); }
.skip:focus { top: 12px; }

/* ---------- Prototype bar + header ---------- */
.proto-bar { background: var(--ink); color: var(--bg); font-size: 14px; }
.proto-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 36px; }
.proto-row a { color: inherit; font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.proto-row a:hover { text-decoration: underline; }

.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 14px/1 var(--display); letter-spacing: 0.02em; }
.brand-name { font: 700 18px/1.1 var(--display); letter-spacing: -0.015em; white-space: nowrap; }
.brand-name span { font-weight: 600; color: var(--ink-3); }
.main-nav { display: none; gap: 4px; }
.main-nav a { text-decoration: none; padding: 8px 12px; border-radius: var(--r); color: var(--ink-2); font-weight: 500; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.head-search { display: none; position: relative; margin-right: 6px; }
.head-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 18px; pointer-events: none; }
.head-search input { width: 250px; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.head-search input::placeholder { color: var(--ink-3); }
.icon-btn { position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: var(--r); cursor: pointer; font-size: 22px; color: var(--ink); text-decoration: none; transition: background .2s var(--ease); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.96); }
.cart-count { position: absolute; top: 3px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 11px/19px var(--font); text-align: center; }
.mobile-nav { display: grid; padding-bottom: 12px; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 12px 0; text-decoration: none; font-weight: 500; border-top: 1px solid var(--line); }
.mobile-nav button { text-align: left; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: none; font-weight: 500; cursor: pointer; display: flex; gap: 8px; align-items: center; }
@media (max-width: 639px) {
  .head-row { gap: 10px; }
  .head-tools { gap: 0; }
  .head-tools [data-theme-toggle] { display: none; }
  .brand-name { font-size: 16px; line-height: 1.05; }
  .brand-name span { display: block; font-size: 13px; }
}
@media (min-width: 1024px) {
  .main-nav { display: flex; }
  .menu-btn, .mobile-nav { display: none !important; }
}
@media (min-width: 1200px) {
  .head-search { display: block; }
  .head-search-icon { display: none; }
}

/* ---------- Buttons, inputs, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--r); border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 15px; }
.link { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
button.link { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-weight: 600; }

.field { display: grid; gap: 6px; align-content: start; }
.field .err:empty { display: none; }
input[type="file"] { font-size: 15px; color: var(--ink-2); }
input[type="file"]::file-selector-button { font: 600 15px var(--font); margin-right: 12px; padding: 9px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--surface-2); }
.field label, .label { font-size: 15px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 14px; color: var(--ink-3); }
.field .err { font-size: 14px; color: var(--error); min-height: 0; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--error); }
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); transition: background .2s var(--ease), border-color .2s var(--ease); }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-family: var(--mono); font-size: 13px; color: inherit; opacity: .7; }

/* ---------- Generic section rhythm ---------- */
.section { padding-block: 56px; }
@media (min-width: 768px) { .section { padding-block: 88px; } }
.section-head { display: grid; gap: 10px; margin-bottom: 28px; max-width: 65ch; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }
.section-head p { color: var(--ink-2); }
.page-head { padding-top: 40px; padding-bottom: 24px; display: grid; gap: 10px; }
.page-head h1 { font-size: clamp(32px, 4vw, 48px); }
.page-head p { color: var(--ink-2); max-width: 65ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--ink-3); padding-top: 24px; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Home: hero ---------- */
.hero { padding-top: 40px; padding-bottom: 56px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(40px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.035em; }
.hero-sub { margin-top: 18px; font-size: 19px; color: var(--ink-2); max-width: 44ch; }
.hero-search { margin-top: 28px; display: grid; gap: 8px; max-width: 520px; }
.hero-search .row { display: flex; gap: 8px; }
.hero-search .input { min-height: 54px; font-size: 18px; }
.hero-search .btn { min-height: 54px; }
.hero-links { margin-top: 18px; }
.hero-art { position: relative; }
.hero-art .main-img { border-radius: var(--r); aspect-ratio: 4 / 3; width: 100%; object-fit: cover; object-position: 50% 30%; background: var(--surface-2); }
.hero-art .inset-img { display: none; }
@media (min-width: 900px) {
  .hero { padding-top: 56px; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; }
  .hero-art { padding-left: 48px; }
  .hero-art .main-img { aspect-ratio: 4 / 4.4; max-height: calc(100dvh - 200px); }
  .hero-art .inset-img { display: block; position: absolute; left: 0; bottom: -28px; width: 38%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); border: 6px solid var(--bg); box-shadow: var(--shadow); }
}

/* ---------- Home: makers grid ---------- */
.makers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.maker-tile { display: grid; align-content: space-between; gap: 18px; min-height: 128px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.maker-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.maker-tile h3 { font-size: 21px; }
.maker-tile .meta { font-size: 14px; color: var(--ink-3); display: grid; gap: 2px; }
.maker-tile .meta .mono { color: var(--ink-2); font-size: 15px; }
.maker-tile.is-feature { grid-column: span 2; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.maker-tile.is-feature h3 { font-size: clamp(28px, 3vw, 40px); }
.maker-tile.is-feature p { max-width: 34ch; opacity: .92; }
.maker-tile.is-feature .big { font: 700 clamp(44px, 6vw, 72px)/1 var(--display); letter-spacing: -0.03em; }
.maker-tile.is-all { background: var(--surface-2); }
.maker-tile.is-all h3 { display: flex; align-items: center; gap: 8px; }
@media (min-width: 900px) {
  .makers { grid-template-columns: repeat(4, 1fr); }
  .maker-tile.is-feature { grid-row: span 2; }
}

/* ---------- Home: season bento ---------- */
.bento { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.bento-tile { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.bento-tile .img { flex: 1; min-height: 180px; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.bento-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.bento-tile:hover img { transform: scale(1.03); }
.bento-tile .cap { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.bento-tile .cap strong { font: 700 19px/1.2 var(--display); }
.bento-tile .cap span { font-size: 14px; color: var(--ink-3); }
.bento-tile.t1 { grid-column: span 2; }
.bento-tile.t1 .img { min-height: 260px; }
.bento-tile.t4 { grid-column: span 2; }
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(4, 1fr); grid-template-rows: 300px 300px; }
  .bento-tile .img { min-height: 0; }
  .bento-tile.t1 { grid-column: 1 / span 2; grid-row: 1 / span 2; }
  .bento-tile.t2 { grid-column: 3; grid-row: 1; }
  .bento-tile.t3 { grid-column: 4; grid-row: 1; }
  .bento-tile.t4 { grid-column: 3 / span 2; grid-row: 2; }
}

/* ---------- Home: how it works / split rows ---------- */
.split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 72px; } .split.flip > :first-child { order: 2; } .split.top { align-items: start; } }
.split-img { border-radius: var(--r); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.split-cap { margin-top: 10px; font-size: 14px; color: var(--ink-3); }
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 22px; }
.steps li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.steps .ico { width: 48px; height: 48px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 24px; }
.steps strong { display: block; font: 700 19px/1.3 var(--display); margin-bottom: 2px; }
.steps p { color: var(--ink-2); }

.sheet-fan { position: relative; height: 420px; }
.sheet-fan .sheet-frame { position: absolute; width: 56%; top: 0; box-shadow: var(--shadow); }
.sheet-fan .sheet-frame:nth-child(1) { left: 0; top: 34px; transform: rotate(-5deg); }
.sheet-fan .sheet-frame:nth-child(2) { left: 22%; top: 0; z-index: 2; }
.sheet-fan .sheet-frame:nth-child(3) { right: 0; top: 46px; transform: rotate(4.5deg); }
@media (min-width: 900px) { .sheet-fan { height: 520px; } }
@media (max-width: 520px) { .sheet-fan { height: 330px; } }

/* ---------- Horizontal rail (retired molds, related) ---------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 68%); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .rail { grid-auto-columns: minmax(220px, 40%); } }
@media (min-width: 1024px) { .rail { grid-auto-columns: calc((100% - 64px) / 5); } }
.rail-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.rail-head .section-head { margin-bottom: 0; }

/* ---------- Product card ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: grid; gap: 12px; text-decoration: none; color: inherit; align-content: start; }
.card-media { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease), transform .6s var(--ease); }
.card-media img.is-loaded { opacity: 1; }
.card:hover .card-media img { transform: scale(1.035); }
.card-body { display: grid; gap: 4px; }
.card-meta { display: flex; gap: 8px; font-size: 14px; color: var(--ink-3); align-items: baseline; flex-wrap: wrap; }
.card-meta .mono { color: var(--ink-2); font-weight: 500; }
.card-title { font: 600 17px/1.35 var(--font); letter-spacing: 0; }
.card:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }
.card-price { font-size: 15px; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; }
.card-price b { color: var(--ink); font-weight: 600; }
.card-new { color: var(--accent); font-weight: 600; }

.nophoto { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 16px; text-align: center; color: var(--ink-3);
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--line) 45%, transparent) 14px 15px), var(--surface-2); }
.nophoto .num { font: 600 clamp(22px, 3vw, 34px)/1 var(--mono); color: var(--ink-2); letter-spacing: -0.02em; }
.nophoto .what { font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Catalog page ---------- */
.catalog { display: grid; gap: 28px; padding-bottom: 80px; }
@media (min-width: 1024px) { .catalog { grid-template-columns: 260px 1fr; gap: 40px; } }
.filters { display: none; }
@media (min-width: 1024px) { .filters { display: block; position: sticky; top: 92px; align-self: start; max-height: calc(100dvh - 110px); overflow: auto; padding-right: 6px; scrollbar-width: thin; } }
.filters.is-open { display: block; }
.f-group { padding-block: 18px; }
.f-group + .f-group { border-top: 1px solid var(--line); }
.f-group h2 { font: 600 15px/1.2 var(--font); letter-spacing: 0; margin-bottom: 12px; }
.f-opt { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; font-size: 15px; }
.f-opt input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.f-opt .count { margin-left: auto; font: 400 13px var(--mono); color: var(--ink-3); }
.f-opt.is-zero { color: var(--ink-3); }
.toolbar { display: grid; gap: 14px; margin-bottom: 24px; }
.toolbar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 320px; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-left: 44px; min-height: 50px; font-size: 17px; }
.result-count { font-size: 15px; color: var(--ink-2); }
.result-count b { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.active-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { display: inline-flex; }
@media (min-width: 1024px) { .filter-btn { display: none; } }
.more-row { display: grid; justify-items: center; gap: 10px; margin-top: 40px; color: var(--ink-3); font-size: 15px; }

.empty { display: grid; justify-items: start; gap: 14px; padding: 40px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface); }
.empty i { font-size: 34px; color: var(--ink-3); }
.empty h2 { font-size: 24px; }
.empty p { color: var(--ink-2); max-width: 52ch; }

/* ---------- Product page ---------- */
.product { display: grid; gap: 36px; padding-top: 20px; padding-bottom: 72px; }
@media (min-width: 960px) { .product { grid-template-columns: 1.1fr 0.9fr; gap: 64px; } }
.gallery { display: grid; gap: 12px; align-content: start; }
@media (min-width: 960px) { .gallery { position: sticky; top: 92px; } }
.gallery-main { position: relative; border-radius: var(--r); overflow: hidden; background: var(--surface-2); aspect-ratio: 1 / 1; border: 0; padding: 0; cursor: zoom-in; width: 100%; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; transition: opacity .3s var(--ease); }
.gallery-main .zoom { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: var(--r); background: var(--surface); display: grid; place-items: center; font-size: 20px; color: var(--ink); box-shadow: var(--shadow); }
.gallery-cap { font-size: 14px; color: var(--ink-3); min-height: 22px; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: 0 0 78px; height: 78px; padding: 0; border: 2px solid transparent; border-radius: var(--r); overflow: hidden; background: var(--surface-2); cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { display: grid; gap: 22px; align-content: start; }
.pinfo .sku-line { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; color: var(--ink-3); font-size: 15px; }
.pinfo .sku-line .mono { font-size: 16px; color: var(--ink); font-weight: 600; }
.pinfo h1 { font-size: clamp(30px, 3.4vw, 44px); margin-top: 6px; }
.options { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.options legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.opt input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.opt strong { font-weight: 600; }
.opt .price { font-weight: 600; font-variant-numeric: tabular-nums; }
.opt small { grid-column: 2 / -1; color: var(--ink-3); font-size: 14px; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); height: 46px; }
.qty button { width: 42px; height: 100%; border: 0; background: transparent; cursor: pointer; font-size: 18px; display: grid; place-items: center; border-radius: var(--r); }
.qty button:hover { background: var(--surface-2); }
.qty output, .qty input { width: 40px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; border: 0; background: transparent; }
.buy-row .btn-primary { flex: 1 1 200px; }
.note { display: flex; gap: 10px; font-size: 15px; color: var(--ink-2); }
.note i { font-size: 20px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin: 0; }
.specs div { display: grid; gap: 2px; }
.specs dt { font-size: 13px; color: var(--ink-3); }
.specs dd { margin: 0; font-weight: 600; }
.on-sheet { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); text-decoration: none; background: var(--surface); transition: border-color .2s var(--ease); }
.on-sheet:hover { border-color: var(--accent); }
.on-sheet strong { display: block; }
.on-sheet span { font-size: 14px; color: var(--ink-3); }

/* ---------- Cut sheet (rendered stand-in for a scanned catalog page) ---------- */
/* Laid out at a fixed 600px page, then scaled to the frame (--k is set by a ResizeObserver),
   so tiny thumbnails never hit the browser's minimum font size. */
.sheet-frame { position: relative; display: block; aspect-ratio: 8.5 / 11; overflow: hidden; border-radius: 4px; background: var(--paper); }
.sheet { position: absolute; top: 0; left: 0; width: 600px; height: 776px; transform-origin: 0 0; transform: scale(var(--k, 0.4));
  padding: 36px 36px 30px; color: var(--paper-ink); background: var(--paper);
  display: grid; grid-template-rows: auto 1fr auto; gap: 18px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06), inset 0 0 36px rgb(0 0 0 / 0.05); font-family: var(--mono); }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px solid var(--paper-ink); padding-bottom: 10px; font-size: 14px; letter-spacing: 0.04em; }
.sheet-head b { font: 800 32px/1 var(--display); letter-spacing: -0.01em; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 14px; min-height: 0; }
.sheet-cell { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 6px; min-height: 0; }
.sheet-cell img { width: 100%; height: 100%; min-height: 0; object-fit: cover; filter: grayscale(1) contrast(1.2) brightness(1.04); mix-blend-mode: multiply; border-radius: 1px; }
.sheet-cell .noimg { border: 2px solid rgb(0 0 0 / 0.25); display: grid; place-items: center; text-align: center; padding: 12px; font: 600 16px/1.2 var(--display); }
.sheet-cap { font-size: 12px; line-height: 1.25; }
.sheet-cap b { font-size: 14px; }
.sheet-foot { display: flex; justify-content: space-between; font-size: 12px; border-top: 1.5px solid rgb(0 0 0 / 0.4); padding-top: 8px; }
.sheet-upload { width: 100%; height: 100%; object-fit: contain; background: var(--paper); }
.sheet-pdf { width: 100%; aspect-ratio: 8.5 / 11; border: 0; border-radius: 4px; background: var(--paper); }

.sheet-lib { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; padding-bottom: 80px; }
@media (min-width: 760px) { .sheet-lib { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .sheet-lib { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 36px 24px; } }
.sheet-link { display: grid; gap: 10px; text-decoration: none; }
.sheet-link .sheet-frame { box-shadow: var(--shadow); transition: transform .3s var(--ease); }
.sheet-link:hover .sheet-frame { transform: translateY(-3px); }
.sheet-link strong { font-weight: 600; display: block; }
.sheet-link span { font-size: 14px; color: var(--ink-3); }
.maker-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.maker-chips .chip { scroll-snap-align: start; }

.viewer { display: grid; gap: 36px; padding-top: 20px; padding-bottom: 80px; }
@media (min-width: 960px) { .viewer { grid-template-columns: 1.15fr 0.85fr; gap: 56px; } .viewer .sheet-big { position: sticky; top: 92px; align-self: start; } }
.sheet-big .sheet-frame { box-shadow: var(--shadow); }
.viewer-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.on-page { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.on-page a { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: var(--r); text-decoration: none; transition: background .2s var(--ease); }
.on-page a:hover { background: var(--surface); }
.on-page .thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--surface-2); position: relative; }
.on-page .thumb img { width: 100%; height: 100%; object-fit: cover; }
.on-page .thumb .nophoto .num { font-size: 13px; }
.on-page .thumb .nophoto .what { display: none; }
.on-page strong { display: block; font-weight: 600; }
.on-page span { font-size: 14px; color: var(--ink-3); }
.on-page .price { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Importer ---------- */
.imp { display: grid; gap: 48px; padding-bottom: 96px; }
.imp-block { display: grid; gap: 22px; }
.imp-block > header { display: grid; gap: 8px; max-width: 70ch; }
.imp-block > header h2 { font-size: clamp(24px, 2.6vw, 32px); }
.imp-block > header p { color: var(--ink-2); }
.naming { display: grid; gap: 16px; padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 900px) { .naming { grid-template-columns: 1fr 1fr; gap: 32px; } }
.naming h3 { font: 600 16px/1.3 var(--font); letter-spacing: 0; margin-bottom: 10px; }
.naming code { font-family: var(--mono); font-size: 14px; }
.files-ex { display: grid; gap: 6px; font: 400 14px/1.4 var(--mono); }
.files-ex div { display: flex; gap: 10px; align-items: center; }
.files-ex i { color: var(--ink-3); }
.files-ex .arrow { color: var(--accent); font-weight: 600; font-family: var(--font); }
.naming details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-top: 12px; font-size: 15px; }
.codes .mono { font-weight: 600; display: inline-block; width: 34px; }
.drop { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 40px 20px; border: 2px dashed var(--line); border-radius: var(--r); background: var(--surface); transition: border-color .2s var(--ease), background .2s var(--ease); }
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop > i { font-size: 40px; color: var(--accent); }
.drop strong { font: 700 21px/1.2 var(--display); }
.drop p { color: var(--ink-2); max-width: 52ch; }
.drop .btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.side-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 15px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 32px; }
.stats div { display: grid; }
.stats b { font: 700 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stats span { font-size: 14px; color: var(--ink-3); }
.stats .is-warn b { color: var(--warn); }
.review { display: grid; gap: 10px; }
.review-row { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); align-items: center; }
@media (min-width: 1000px) { .review-row { grid-template-columns: 184px 112px minmax(200px, 1fr) 196px 104px 180px; gap: 16px; } .review-head { display: grid !important; } }
.review-head { display: none !important; grid-template-columns: 184px 112px minmax(200px, 1fr) 196px 104px 180px; gap: 16px; padding: 0 15px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.strip { display: flex; gap: 4px; }
.strip img, .strip .more { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.strip .more { display: grid; place-items: center; font: 600 13px var(--mono); color: var(--ink-2); }
.review-row .sku { font: 600 15px var(--mono); }
.review-row .sku small { display: block; font: 400 13px var(--font); color: var(--ink-3); }
.review-row .input { min-height: 40px; padding: 8px 10px; font-size: 15px; }
.status { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 500; line-height: 1.35; }
.status i { font-size: 18px; flex-shrink: 0; }
.status.ok { color: var(--accent); }
.status.warn { color: var(--warn); }
.unmatched { padding: 16px 18px; border-radius: var(--r); background: var(--warn-soft); color: var(--ink); display: grid; gap: 8px; font-size: 15px; }
.unmatched strong { color: var(--warn); display: flex; gap: 8px; align-items: center; }
.unmatched code { font-family: var(--mono); font-size: 14px; }
.publish-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); position: sticky; bottom: 12px; box-shadow: var(--shadow); }
.publish-bar p { color: var(--ink-2); font-size: 15px; }
.sheet-rows { display: grid; gap: 10px; }
.sheet-row { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); align-items: center; }
@media (min-width: 900px) { .sheet-row { grid-template-columns: 64px 220px 1fr 180px; gap: 18px; } }
.sheet-row .prev { width: 64px; height: 82px; border-radius: 6px; background: var(--paper); overflow: hidden; display: grid; place-items: center; color: #555; font-size: 28px; }
.sheet-row .prev img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Visit / forms ---------- */
.visit { display: grid; gap: 40px; }
@media (min-width: 960px) { .visit { grid-template-columns: 1.2fr 0.8fr; gap: 72px; } }
.form { display: grid; gap: 18px; }
.form .two { display: grid; gap: 18px; }
@media (min-width: 640px) { .form .two { grid-template-columns: 1fr 1fr; } }
.form-ok { display: flex; gap: 10px; align-items: center; color: var(--accent); font-weight: 600; }
.aside-stack { display: grid; gap: 28px; align-content: start; }
.aside-block { display: grid; gap: 10px; padding: 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.aside-block h3 { font-size: 22px; }
.aside-block p { color: var(--ink-2); }
.hours { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.hours i { color: var(--accent); font-size: 22px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 200px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 40px; margin-top: 24px; }
.foot-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.2fr 1fr auto; align-items: start; } }
.foot-note { margin-top: 12px; color: var(--ink-3); font-size: 15px; max-width: 42ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { text-decoration: none; color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-copy { color: var(--ink-3); font-size: 14px; }

/* ---------- Drawer, lightbox, toast ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgb(10 14 13 / 0.45); }
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw); max-width: 100vw; padding: 0; border: 0; background: var(--bg); }
.drawer[open] { animation: slide-in .35s var(--ease); }
.drawer-inner { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 24px; }
.drawer-body { overflow: auto; padding: 8px 20px; }
.drawer-foot { padding: 18px 20px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.drawer-foot:empty { display: none; }
.line-item { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 14px 0; }
.line-item + .line-item { border-top: 1px solid var(--line); }
.line-item .thumb { width: 72px; height: 88px; border-radius: 8px; overflow: hidden; background: var(--surface-2); position: relative; }
.line-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-item .thumb .nophoto .num { font-size: 13px; }
.line-item .thumb .nophoto .what { display: none; }
.line-item .top { display: flex; justify-content: space-between; gap: 10px; }
.line-item a { text-decoration: none; font-weight: 600; }
.line-item .sub { font-size: 14px; color: var(--ink-3); }
.line-item .bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.line-item .qty { height: 38px; }
.line-item .qty button { width: 34px; }
.remove { border: 0; background: none; color: var(--ink-3); font-size: 14px; cursor: pointer; text-decoration: underline; padding: 4px; }
.subtotal { display: flex; justify-content: space-between; font-weight: 600; font-size: 18px; }
.drawer-empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 64px 10px; color: var(--ink-2); }
.drawer-empty i { font-size: 40px; color: var(--ink-3); }

.lightbox { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: rgb(12 14 13 / 0.94); color: #eceeed; }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lb-figure { margin: 0; display: grid; justify-items: center; gap: 12px; padding: 56px 0 24px; height: 100dvh; grid-template-rows: 1fr auto; }
.lb-figure img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lb-figure figcaption { font-size: 15px; color: #b6bcb9; min-height: 22px; }
.lightbox .icon-btn { color: #eceeed; }
.lightbox .icon-btn:hover { background: rgb(255 255 255 / 0.1); }
.lb-close { position: absolute; top: 12px; right: 12px; }
.lb-prev, .lb-next { justify-self: center; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--r); box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; font-size: 15px; max-width: calc(100vw - 32px); }
.toast a { color: inherit; font-weight: 600; }
.toast[hidden] { display: none; }

/* ---------- Motion ---------- */
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.view-enter { animation: rise .45s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
