/* EnA — boutique stock book. Motifs: hang tags, stitched seams, receipts. */
:root {
  color-scheme: light;
  --paper: #f6f1e9;
  --paper-2: #eee6da;
  --card: #fffdf9;
  --ink: #2b2233;
  --ink-2: #5e5366;
  --muted: #8a7f8f;
  --line: #e4d9cb;
  --plum: #5b2a4e;
  --plum-ink: #fbf5ee;
  --plum-soft: #efe2ea;
  --clay: #c8643b;
  --clay-soft: #f6e0d4;
  --sage: #4f7349;
  --sage-soft: #e1eadb;
  --good: #2d7346;
  --warn: #9a5b00;
  --bad: #b03636;
  --bad-soft: #f8e1df;
  --warn-soft: #f8ebd2;
  --s1: #6250d6;
  --s2: #eb6834;
  --grid: rgba(43, 34, 51, .08);
  --shadow: 0 1px 2px rgba(43, 34, 51, .06), 0 10px 30px -14px rgba(43, 34, 51, .25);
  --shadow-lg: 0 2px 6px rgba(43, 34, 51, .08), 0 24px 60px -20px rgba(43, 34, 51, .35);
  --r: 22px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --stitch: repeating-linear-gradient(90deg, var(--line) 0 7px, transparent 7px 12px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #17131b; --paper-2: #211a26; --card: #241d2a; --ink: #f3ece4; --ink-2: #cbbfca; --muted: #9b8f9e;
    --line: #3b3142; --plum: #9b5a88; --plum-ink: #fff; --plum-soft: #3a2537; --clay: #e08559; --clay-soft: #42291f;
    --sage: #8fb487; --sage-soft: #24301f; --good: #6fc08b; --warn: #e2a64a; --bad: #f08080; --bad-soft: #3d2022; --warn-soft: #3b2e17;
    --s1: #9085e9; --s2: #d95926; --grid: rgba(255, 255, 255, .08);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17131b; --paper-2: #211a26; --card: #241d2a; --ink: #f3ece4; --ink-2: #cbbfca; --muted: #9b8f9e;
  --line: #3b3142; --plum: #9b5a88; --plum-ink: #fff; --plum-soft: #3a2537; --clay: #e08559; --clay-soft: #42291f;
  --sage: #8fb487; --sage-soft: #24301f; --good: #6fc08b; --warn: #e2a64a; --bad: #f08080; --bad-soft: #3d2022; --warn-soft: #3b2e17;
  --s1: #9085e9; --s2: #d95926; --grid: rgba(255, 255, 255, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 15.5px/1.5 var(--sans); color: var(--ink); background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 90, 60, .025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 90, 60, .02) 0 1px, transparent 1px 4px);
  min-height: 100vh; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.ico { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; justify-content: center; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.warn { color: var(--warn); }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; color: var(--plum); text-decoration: none; }
.link:hover { gap: 8px; }
.link, .btn, .chip, .tag, .dock a { transition: all .2s ease; }

/* ---------- Type ---------- */
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--clay); }
.h-display, .h-page { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
.h-display { font-size: clamp(34px, 6vw, 60px); }
.h-page { font-size: clamp(28px, 4.4vw, 44px); }
.h-display em, .h-page em { font-style: italic; font-weight: 400; color: var(--plum); }
.h-section { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 40px 0 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.h-section small, .h-card small { font: 500 13px var(--sans); color: var(--muted); }
.h-card { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-card .ico { color: var(--clay); }
.lede { font-size: 17px; color: var(--ink-2); max-width: 46ch; margin: 12px 0 0; }
.count { font: 600 13px var(--sans); background: var(--clay); color: #fff; border-radius: 99px; padding: 2px 9px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2)); background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.brand i { font-style: italic; font-weight: 400; color: var(--clay); }
.brand small { display: block; font: 500 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.brand.big { font-size: 34px; margin-bottom: 28px; }
.logo { flex: none; filter: drop-shadow(0 4px 8px rgba(91, 42, 78, .25)); transform: rotate(-6deg); }
.brand:hover .logo { animation: swing 1.2s ease; }
.topsearch { flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 42px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.topsearch input { border: 0; outline: 0; background: none; width: 100%; color: var(--ink); }
.topsearch:focus-within { border-color: var(--plum); box-shadow: 0 0 0 4px var(--plum-soft); }
.me { position: relative; }
.me summary { list-style: none; cursor: pointer; }
.me summary::-webkit-details-marker { display: none; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--plum); color: var(--plum-ink); font: 600 14px var(--sans); flex: none; }
.avatar[style] { color: #2b2233; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 84px; height: 84px; font: 600 30px var(--serif); }
.me-menu { position: absolute; right: 0; top: 50px; width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; animation: pop .18s ease; }
.me-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.me-menu a:hover { background: var(--paper-2); }
.me-who { padding: 10px 12px 12px; margin-bottom: 6px; background: var(--stitch) bottom / 100% 1px no-repeat; }
.me-who small { display: block; color: var(--muted); }

/* ---------- Page ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 20px 16px 140px; }
body.bare .page { max-width: none; padding: 0; }
.page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 24px; }
.page-hero.center { justify-content: center; text-align: center; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 500; margin: 6px 0 14px; }
.backlink:hover { color: var(--plum); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.stack { display: grid; gap: 14px; }

.card { background: var(--card); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head .h-card, .card-head .h-section { margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 99px; border: 1.5px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; background: none; }
.btn:active { transform: scale(.97); }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--plum); color: var(--plum-ink); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--plum) 70%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--plum) 88%, #000); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { border-color: var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--plum); color: var(--plum); }
.btn-ghost.light { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .25); }
.btn-soft { background: var(--plum-soft); color: var(--plum); }
.btn-soft:hover { background: color-mix(in srgb, var(--plum-soft) 70%, var(--plum) 18%); }
.btn-danger-ghost { color: var(--bad); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--bad-soft); }
.iconbtn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--bad-soft); color: var(--bad); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field > span small { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select, .filters input, .filters select {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); outline: 0; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field input:focus, .field textarea:focus, .filters input:focus, .filters select:focus { border-color: var(--plum); box-shadow: 0 0 0 4px var(--plum-soft); }
.hint { color: var(--muted); font-size: 12.5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .narrow { max-width: 110px; }
.row2:has(.narrow) { grid-template-columns: 1fr auto; }
.affix { position: relative; display: block; }
.affix i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; font-style: normal; font-weight: 600; color: var(--muted); font-size: 14px; }
.affix input { padding-left: 46px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pw { position: relative; display: block; }
.pw-toggle { position: absolute; right: 8px; top: 50%; translate: 0 -50%; border: 0; background: var(--paper-2); border-radius: 10px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.stepper { display: flex; align-items: center; height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); overflow: hidden; }
.stepper button { width: 46px; height: 100%; border: 0; background: var(--paper-2); font-size: 22px; cursor: pointer; color: var(--plum); }
.stepper button:hover { background: var(--plum-soft); }
.stepper input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; text-align: center; font-size: 18px; font-weight: 700; height: 100%; background: none; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.big { height: 56px; }
.stepper.big input { font-size: 24px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 15px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip i { font-style: normal; font-size: 12px; color: var(--muted); }
.chip:hover { border-color: var(--plum); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.on i { color: inherit; opacity: .7; }
.chip-input { width: 96px !important; height: 38px !important; border-radius: 99px !important; padding: 0 14px !important; border: 1.5px dashed var(--line); background: none; font-size: 14px; outline: 0; }
.chip-check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 99px; padding: 4px; }
.seg a { padding: 7px 14px; border-radius: 99px; text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.filters .chips.scroll { flex: 1 1 300px; min-width: 0; }
.filter-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { height: 40px; border-radius: 99px; width: auto; padding: 0 14px; }
.filters input[type=search] { width: 180px; }

.alert { background: var(--bad-soft); color: var(--bad); border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; font-weight: 500; }
.toast { position: fixed; z-index: 60; top: 16px; left: 50%; translate: -50% 0; max-width: min(560px, calc(100vw - 32px)); padding: 14px 20px; border-radius: 18px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); font-weight: 500; animation: toastIn .45s cubic-bezier(.2, 1.4, .4, 1); }
.toast-sold { background: var(--plum); color: var(--plum-ink); padding-left: 52px; }
.toast-sold::before { content: '✓'; position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 26px; height: 26px; border-radius: 50%; background: var(--clay); display: grid; place-items: center; font-weight: 700; }
.toast-err { background: var(--bad); color: #fff; }
.toast.hide { animation: toastOut .4s ease forwards; }

.pill { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--paper-2); font-size: 13px; font-weight: 500; text-decoration: none; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.delta { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--paper-2); color: var(--muted); }
.delta.up { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }

/* ---------- Dock ---------- */
.dock {
  position: fixed; z-index: 40; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 4px; padding: 8px; border-radius: 30px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.dock a { display: grid; justify-items: center; gap: 2px; min-width: 66px; padding: 7px 10px; border-radius: 22px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.dock a:hover { color: var(--ink); }
.dock a.on { color: var(--plum); background: var(--plum-soft); }
.dock .dock-sell { padding-top: 0; margin: 0 4px; background: none !important; }
.sell-orb { display: grid; place-items: center; width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; background: var(--plum); color: var(--plum-ink); box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--plum) 75%, transparent), 0 0 0 5px var(--paper); transition: transform .2s; }
.dock-sell:hover .sell-orb { transform: translateY(-3px) rotate(-6deg); }
.dock-sell.on .sell-orb { background: var(--clay); }

/* ---------- Hang tags ---------- */
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 34px 20px; padding-top: 22px; }
.tags.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tags.row-scroll { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 170px; overflow-x: auto; padding: 22px 4px 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.tags.row-scroll .tag { scroll-snap-align: start; }
.tag { --tilt: 0deg; position: relative; display: block; text-decoration: none; transform-origin: 50% -20px; rotate: var(--tilt); filter: drop-shadow(0 10px 14px rgba(43, 34, 51, .14)); }
.tag:nth-child(4n+1) { --tilt: -1.4deg; }
.tag:nth-child(4n+2) { --tilt: .9deg; }
.tag:nth-child(4n+3) { --tilt: -.5deg; }
.tag:nth-child(4n) { --tilt: 1.5deg; }
.tag:hover { animation: swing 1.1s ease; filter: drop-shadow(0 18px 22px rgba(43, 34, 51, .22)); }
.tag-string { position: absolute; left: 50%; top: -24px; width: 1.5px; height: 40px; background: linear-gradient(var(--muted), var(--ink-2)); z-index: 2; translate: -50% 0; }
.tag-string::before { content: ''; position: absolute; top: -5px; left: 50%; translate: -50% 0; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--muted); background: var(--paper); }
.tag-body { position: relative; display: flex; flex-direction: column; background: var(--card); padding: 32px 10px 12px; clip-path: polygon(16% 0, 84% 0, 100% 8%, 100% 100%, 0 100%, 0 8%); border-radius: 0 0 16px 16px; }
.tag-hole { position: absolute; top: 11px; left: 50%; translate: -50% 0; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25); }
.tag-photo { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--sw, var(--paper-2)); }
.tag-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.tag:hover .tag-photo img { transform: scale(1.05); }
.tag-mono { font: italic 400 44px var(--serif); color: rgba(43, 34, 51, .55); }
.stock-pill { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: rgba(255, 253, 249, .92); color: #2b2233; backdrop-filter: blur(6px); }
.tag-low .stock-pill { background: #f5d48c; color: #5a3b00; }
.tag-out .stock-pill { background: #2b2233; color: #fff; }
.tag-out .tag-photo img, .tag-out .tag-mono { filter: grayscale(.85); opacity: .6; }
.tag-info { display: grid; gap: 2px; padding: 10px 4px 0; }
.tag-cat { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--clay); }
.tag-name { font: 600 16.5px/1.2 var(--serif); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-meta { font-size: 12.5px; color: var(--muted); }
.tag-price { margin-top: 8px; padding-top: 8px; background: var(--stitch) top / 100% 1px no-repeat; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

.rack { position: relative; }
.rack-rail { height: 10px; border-radius: 99px; background: linear-gradient(180deg, #d9d2c8, #a79d92 55%, #8b8178); box-shadow: 0 4px 8px rgba(0, 0, 0, .15); margin: 4px -6px 0; }

.ribbon { display: flex; flex-wrap: wrap; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.ribbon > div { flex: 1 1 150px; padding: 16px 20px; display: grid; gap: 2px; position: relative; }
.ribbon > div + div::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 10px); }
.ribbon strong { font: 600 24px var(--serif); font-variant-numeric: tabular-nums; }
.ribbon span { font-size: 13px; color: var(--muted); }
.ribbon .warn strong { color: var(--warn); }
.ribbon .bad strong { color: var(--bad); }
.ribbon .good strong { color: var(--good); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty .ico { color: var(--clay); opacity: .8; }
.empty h2 { font: 600 26px var(--serif); color: var(--ink); margin: 8px 0 0; }
.empty p { margin: 0 0 14px; max-width: 40ch; }

.bigsearch { display: flex; align-items: center; gap: 12px; max-width: 620px; margin: 0 auto 20px; height: 62px; padding: 0 22px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); border: 1.5px solid transparent; color: var(--muted); }
.bigsearch:focus-within { border-color: var(--plum); }
.bigsearch input { flex: 1; border: 0; outline: 0; background: none; font-size: 18px; color: var(--ink); min-width: 0; }

/* ---------- Product form ---------- */
.piece-form { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 30px; margin-top: 24px; align-items: start; }
.photo-col { position: sticky; top: 90px; display: grid; gap: 12px; }
.photo-drop { position: relative; aspect-ratio: 4 / 5; border-radius: 26px; overflow: hidden; background: var(--card); border: 2px dashed var(--line); display: grid; place-items: center; cursor: pointer; transition: border-color .2s, background .2s; }
.photo-drop.drag { border-color: var(--plum); background: var(--plum-soft); }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.photo-drop[data-has="1"] img { display: block; }
.photo-drop[data-has="1"] .photo-empty { display: none; }
.photo-drop[data-has="1"] { border-style: solid; border-color: transparent; }
.photo-empty { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 20px; }
.photo-empty .ico { color: var(--clay); }
.photo-empty strong { color: var(--ink); font: 600 20px var(--serif); }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-actions .btn { flex: 1; }
.fields-col { display: grid; gap: 18px; }
.fields-col > .field > input[name=name] { font: 600 22px var(--serif); height: 58px; }
.money-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.margin-hint { margin: -6px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--sage-soft); color: var(--sage); font-weight: 500; display: none; }
.margin-hint.show { display: block; }
.margin-hint.bad { background: var(--bad-soft); color: var(--bad); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 8px; }

/* Camera */
.cam { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; }
.cam::backdrop { background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; inset: 50% auto auto 50%; translate: -50% -55%; width: min(78vw, 56vh); aspect-ratio: 4 / 5; border-radius: 26px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); outline: 2px dashed rgba(255, 255, 255, .7); outline-offset: -2px; pointer-events: none; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-around; padding: 24px 16px max(28px, env(safe-area-inset-bottom)); }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .25); cursor: pointer; transition: transform .1s; }
.shutter:active { transform: scale(.9); background: #fff; }

/* ---------- Product page ---------- */
.piece { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start; }
.piece-show { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 24px; align-items: start; }
.piece-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 26px; overflow: hidden; background: var(--sw); box-shadow: var(--shadow-lg); rotate: -1.5deg; }
.piece-photo img { width: 100%; height: 100%; object-fit: cover; }
.piece-nophoto { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-decoration: none; color: rgba(43, 34, 51, .7); font-weight: 600; }
.stock-flag { position: absolute; top: 14px; right: -6px; padding: 6px 14px 6px 12px; font-size: 13px; font-weight: 700; background: var(--card); color: var(--ink); border-radius: 8px 0 0 8px; box-shadow: var(--shadow); }
.flag-low { background: #f5d48c; color: #5a3b00; }
.flag-out { background: #2b2233; color: #fff; }
.sell-hero .stock-flag, .sell-hero-cap .stock-flag { position: static; display: inline-block; border-radius: 99px; margin-top: 8px; }
.piece-head { display: grid; gap: 10px; align-content: start; }
.piece-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.price-trio { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border-radius: 18px; box-shadow: var(--shadow); margin: 6px 0; }
.price-trio div { padding: 12px 14px; display: grid; }
.price-trio div + div { background: repeating-linear-gradient(180deg, var(--line) 0 5px, transparent 5px 9px) left / 1px 100% no-repeat; }
.price-trio small { font-size: 12px; color: var(--muted); }
.price-trio strong { font: 600 19px var(--serif); font-variant-numeric: tabular-nums; }
.notes { margin: 0; padding: 12px 16px; background: var(--paper-2); border-radius: 14px; color: var(--ink-2); font-size: 14.5px; }
.piece-act { display: grid; gap: 16px; position: sticky; top: 86px; }
.card-sell { border-top: 5px solid var(--plum); }
.card-restock summary { cursor: pointer; list-style: none; margin: 0; }
.card-restock summary::-webkit-details-marker { display: none; }
.card-restock[open] summary { margin-bottom: 14px; }
.sale-form { display: grid; gap: 16px; }
.sale-sum { display: grid; grid-template-columns: 1fr 1fr; border-radius: 16px; background: var(--paper-2); overflow: hidden; }
.sale-sum div { padding: 12px 16px; display: grid; }
.sale-sum div + div { background: var(--sage-soft); }
.sale-sum small { font-size: 12px; color: var(--muted); }
.sale-sum strong { font: 600 24px var(--serif); font-variant-numeric: tabular-nums; }
.sale-sum div + div strong { color: var(--sage); }
.sale-sum.loss div + div { background: var(--bad-soft); }
.sale-sum.loss div + div strong { color: var(--bad); }
details.cust { border-radius: 16px; border: 1.5px dashed var(--line); }
details.cust summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; color: var(--ink-2); }
details.cust summary::-webkit-details-marker { display: none; }
details.cust summary small { font-weight: 400; color: var(--muted); margin-left: auto; }
details.cust[open] { border-style: solid; background: color-mix(in srgb, var(--paper-2) 45%, transparent); }
.cust-body { padding: 0 14px 14px; display: grid; gap: 12px; }

.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); margin: 26px 0 18px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.stat-band > div { padding: 18px 20px; display: grid; gap: 2px; align-content: center; }
.stat-band > div + div { background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 10px) left / 1px 70% no-repeat; }
.stat-band small { font-size: 12.5px; color: var(--muted); }
.stat-band strong { font: 600 28px var(--serif); font-variant-numeric: tabular-nums; }
.stat-band .small-strong { font-size: 20px; }
.stat-band em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.ring-cell { display: flex !important; align-items: center; gap: 12px; }
.ring { --v: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--clay) calc(var(--v) * 1%), var(--paper-2) 0); }
.ring span { width: 48px; height: 48px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 700; font-size: 13.5px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 20px; top: 10px; bottom: 10px; width: 2px; background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 11px); }
.timeline li { position: relative; display: flex; gap: 14px; align-items: center; padding: 10px 0; }
.tl-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; z-index: 1; background: var(--plum-soft); color: var(--plum); box-shadow: 0 0 0 4px var(--card); }
.tl-stock .tl-dot { background: var(--sage-soft); color: var(--sage); }
.tl-minus .tl-dot { background: var(--warn-soft); color: var(--warn); }
.tl-body { flex: 1; display: grid; min-width: 0; }
.tl-body span { font-size: 13.5px; color: var(--muted); }
.tl-body a { color: var(--plum); }
.timeline time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Sell ---------- */
.sell-focus { display: grid; grid-template-columns: .9fr 1.1fr; gap: 26px; align-items: start; max-width: 980px; margin: 0 auto; }
.sell-hero { position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; background: var(--sw); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.sell-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sell-hero .tag-mono { font-size: 90px; }
.sell-hero-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 22px 22px; background: linear-gradient(transparent, rgba(20, 12, 20, .78)); color: #fff; }
.sell-hero-cap .eyebrow { color: #f3c4a8; }
.sell-hero-cap h1 { font: 600 30px/1.1 var(--serif); margin: 0; }

/* ---------- Dashboard ---------- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 18px 0 28px; }
.hello-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bento { display: grid; grid-template-columns: 1.05fr 1fr 1fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.receipt { grid-row: span 2; position: relative; background: var(--card); padding: 24px 24px 34px; box-shadow: var(--shadow); border-radius: var(--r) var(--r) 0 0; font-family: ui-monospace, 'SF Mono', Menlo, monospace; display: grid; align-content: start; gap: 14px;
  -webkit-mask: radial-gradient(10px at 50% 100%, #0000 98%, #000) 50% / 20px 100%; mask: radial-gradient(10px at 50% 100%, #0000 98%, #000) 50% / 20px 100%; }
.receipt header { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding-bottom: 12px; background: var(--stitch) bottom / 100% 1px no-repeat; }
.receipt-big { font: 600 clamp(32px, 4vw, 44px)/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.receipt dl { margin: 0; display: grid; gap: 8px; font-size: 14px; }
.receipt dl div { display: flex; justify-content: space-between; gap: 8px; }
.receipt dl div::after { content: ''; order: 1; flex: 1; border-bottom: 1.5px dotted var(--line); margin-bottom: 5px; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; order: 2; font-weight: 700; }
.receipt footer { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; background: var(--stitch) top / 100% 1px no-repeat; font-family: var(--sans); }
.tile { border-radius: var(--r); padding: 20px; display: grid; gap: 4px; align-content: space-between; min-height: 140px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile small { font-size: 13px; font-weight: 600; opacity: .8; }
.tile strong { font: 600 clamp(26px, 3vw, 34px)/1.05 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile strong em { font-size: .55em; font-style: italic; font-weight: 400; }
.tile > span { font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; opacity: .9; }
.tile-plum { background: var(--plum); color: var(--plum-ink); }
.tile-plum .delta { background: rgba(255, 255, 255, .16); color: inherit; }
.tile-plum::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .25); }
.tile-sage { background: var(--sage-soft); color: var(--sage); }
.tile-cream { background: var(--clay-soft); color: color-mix(in srgb, var(--clay) 70%, var(--ink)); }
.spark-card { grid-column: span 3; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; background: linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 25%; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; cursor: default; }
.bar { width: 100%; max-width: 28px; height: var(--h); min-height: 0; background: var(--s1); border-radius: 4px 4px 0 0; transition: height .6s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.bar-col small { font-size: 11px; color: var(--muted); }
.bar-col.is-today small { color: var(--ink); font-weight: 700; }
.bar-col:hover .bar { opacity: .8; }
.shelf { margin-top: 30px; }
.shelf .card-head { margin-bottom: 0; }

.podium { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; text-align: center; }
.pod { display: grid; justify-items: center; gap: 4px; }
.pod-1 { order: 2; } .pod-2 { order: 1; } .pod-3 { order: 3; }
.pod-photo { position: relative; width: 100%; max-width: 120px; aspect-ratio: 4 / 5; border-radius: 16px; overflow: visible; background: var(--sw); display: grid; place-items: center; text-decoration: none; font: italic 28px var(--serif); color: rgba(43, 34, 51, .6); }
.pod-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.pod-1 .pod-photo { max-width: 140px; }
.pod-2 .pod-photo, .pod-3 .pod-photo { max-width: 100px; }
.pod-photo i { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--clay); color: #fff; font: 700 14px var(--sans); box-shadow: 0 0 0 3px var(--card); }
.pod-1 .pod-photo i { background: var(--plum); width: 36px; height: 36px; }
.pod strong { font: 600 14.5px/1.2 var(--serif); margin-top: 6px; }
.pod small { color: var(--muted); font-size: 12.5px; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.feed li + li { background: var(--stitch) top / 100% 1px no-repeat; }
.feed-thumb { width: 44px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--sw); font: italic 16px var(--serif); color: rgba(43, 34, 51, .6); }
.feed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-main { flex: 1; display: grid; min-width: 0; }
.feed-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-main a { text-decoration: none; }
.feed-main small, .feed-amt small { font-size: 12.5px; color: var(--muted); }
.feed-amt { display: grid; text-align: right; font-variant-numeric: tabular-nums; }

.nudge { display: flex; gap: 18px; margin-top: 18px; background: linear-gradient(120deg, var(--card), var(--clay-soft)); }
.nudge-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--clay); color: #fff; flex: none; }
.nudge p { margin: -6px 0 12px; }
.mini-list { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Sales book ---------- */
.daybook { margin-top: 22px; }
.daybook > header { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 8px; }
.daybook h3 { font: 600 20px var(--serif); margin: 0; }
.daybook h3 span { font: 400 14px var(--sans); color: var(--muted); margin-left: 6px; }
.daybook > header strong { font: 600 18px var(--serif); }
.slips { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.daybook .slips { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 14px; gap: 0; }
.slip { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.slip + .slip { background: var(--stitch) top / 100% 1px no-repeat; }
.slip-thumb { width: 48px; height: 58px; border-radius: 12px; overflow: hidden; flex: none; background: var(--sw); display: grid; place-items: center; text-decoration: none; font: italic 17px var(--serif); color: rgba(43, 34, 51, .6); }
.slip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slip-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.slip-main a { text-decoration: none; }
.slip-main .muted { font-size: 13.5px; }
.slip-cust { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--plum); font-weight: 500; }
.slip-amt { text-align: right; display: grid; font-variant-numeric: tabular-nums; }
.slip-amt small { font-size: 12.5px; font-weight: 600; }

/* ---------- Customers ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.person { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; transition: transform .2s; }
.person:hover { transform: translateY(-2px); }
.person-main { flex: 1; min-width: 0; display: grid; }
.person-main .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-num { display: grid; text-align: right; }
.person-num strong { font: 600 17px var(--serif); }
.person-num small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.crown { color: var(--clay); }
.cust-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cust-hero p { margin: 4px 0 0; }

/* ---------- Reports ---------- */
.kpis { display: grid; grid-template-columns: 1.5fr repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--card); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.kpi small { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi strong { font: 600 26px/1.1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi > span { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi-hero { background: var(--plum); color: var(--plum-ink); }
.kpi-hero small, .kpi-hero > span { color: inherit; opacity: .85; }
.kpi-hero strong { font-size: 36px; }
.kpi-hero .delta { background: rgba(255, 255, 255, .16); color: inherit; }
.chart-card { position: relative; }
.chart-box { position: relative; height: 300px; }
.chart-empty { position: absolute; inset: 50% 0 auto; text-align: center; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }
.table-view summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 10px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 12px; }
.hb-fill { display: block; height: 100%; width: var(--w); min-width: 3px; background: var(--s1); border-radius: 0 4px 4px 0; }
.hb-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.dow { display: flex; gap: 8px; height: 130px; align-items: flex-end; margin-bottom: 10px; }
.dow div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.dow span { width: 100%; height: var(--h); background: var(--s1); border-radius: 4px 4px 0 0; }
.dow small { font-size: 12px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 8px 8px; }
.tbl td { padding: 9px 8px; background: var(--stitch) top / 100% 1px no-repeat; }
.tbl .r { text-align: right; }
.cell-prod { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; }
.mini-thumb { width: 30px; height: 36px; border-radius: 7px; overflow: hidden; background: var(--sw); flex: none; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12.5px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap; translate: -50% calc(-100% - 10px); opacity: 0; transition: opacity .12s; }
.tip.show { opacity: 1; }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { position: relative; background: var(--plum); color: #fbf5ee; overflow: hidden; display: flex; flex-direction: column; padding: 0 0 48px; }
.auth-art::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 9px); pointer-events: none; }
.rail { height: 12px; margin: 90px -10px 0; background: linear-gradient(180deg, #e7ddd2, #a59b90 60%, #7c736a); box-shadow: 0 6px 12px rgba(0, 0, 0, .3); position: relative; z-index: 1; }
.hangers { display: flex; justify-content: center; gap: 2%; margin: -9px 0 auto; padding: 0 6%; position: relative; z-index: 2; }
.hanging { width: 17%; max-width: 130px; color: #e7ddd2; transform-origin: 50% 8px; animation: sway 5s ease-in-out infinite; animation-delay: var(--d); }
.auth-quote { position: relative; z-index: 1; font: 400 clamp(26px, 3.4vw, 42px)/1.15 var(--serif); margin: 0 48px; letter-spacing: -.01em; }
.auth-quote em { color: #f3b896; }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 6vw, 80px); max-width: 560px; width: 100%; margin: 0 auto; }
.auth-card h1 { font: 600 clamp(30px, 4vw, 42px)/1.1 var(--serif); margin: 0; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin: 8px 0 26px; }

/* ---------- Motion ---------- */
@keyframes swing { 0% { rotate: var(--tilt, 0deg); } 20% { rotate: 4deg; } 45% { rotate: -3deg; } 70% { rotate: 1.5deg; } 100% { rotate: var(--tilt, 0deg); } }
@keyframes sway { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; translate: -50% -30px; } }
@keyframes toastOut { to { opacity: 0; translate: -50% -30px; } }
@keyframes rise { from { transform: translateY(14px); } }
.page > * { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; } .page > *:nth-child(4) { animation-delay: .12s; } .page > *:nth-child(5) { animation-delay: .16s; }
.confetti { position: fixed; z-index: 70; top: -10px; width: 9px; height: 14px; border-radius: 2px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .receipt { grid-row: auto; grid-column: span 2; }
  .spark-card { grid-column: span 2; }
  .piece, .sell-focus { grid-template-columns: 1fr; }
  .piece-act { position: static; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .page { padding-top: 8px; }
  .topbar { gap: 10px; }
  .brand span { display: none; }
  .topsearch { max-width: none; }
  .split, .piece-form, .piece-show { grid-template-columns: 1fr; }
  .photo-col { position: static; }
  .photo-drop { max-width: 360px; width: 100%; margin: 0 auto; }
  .piece-photo { max-width: 340px; width: 100%; margin: 0 auto; }
  .stat-band { grid-template-columns: 1fr 1fr; }
  .stat-band > div:nth-child(3) { background: none; }
  .tile { min-height: 120px; padding: 16px; }
  .tags { grid-template-columns: repeat(2, 1fr); gap: 30px 14px; }
  .tags.compact { grid-template-columns: repeat(2, 1fr); }
  .hello-actions { width: 100%; }
  .hello-actions .btn { flex: 1; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 250px; padding-bottom: 22px; }
  .rail { margin-top: 36px; }
  .hanging { width: 15%; }
  .auth-quote { font-size: 24px; margin: 0 22px; }
  .auth-card { padding: 30px 20px 50px; }
  .brand.big span { display: inline; }
  .dock { left: 12px; right: 12px; translate: none; justify-content: space-between; }
  .dock a { min-width: 0; flex: 1; padding: 6px 4px; }
  .filters input[type=search] { width: 100%; }
  .filter-right { width: 100%; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .ribbon { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ribbon::-webkit-scrollbar { display: none; }
  .ribbon > div { flex: 0 0 auto; min-width: 140px; padding: 14px 16px; scroll-snap-align: start; }
  .ribbon strong { font-size: 21px; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .hbars li { grid-template-columns: 90px 1fr auto; }
  .slip-void { margin-left: -6px; }
}
@media (max-width: 380px) {
  .money-row, .row2 { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .dock, .noprint, .toast { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .card, .kpi, .ribbon { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
