:root {
  --brand: #e8577e;
  --brand-soft: color-mix(in srgb, var(--brand) 14%, #fff);
  --brand-softer: color-mix(in srgb, var(--brand) 7%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 28%, #fff);
  --brand-deep: color-mix(in srgb, var(--brand) 78%, #2a1420);
  --cream: #fff8ef;
  --card: #fffdfa;
  --ink: #4a3540;
  --ink-soft: #8a727c;
  --line: #f0e3d6;
  --ok: #3f9d6b;
  --radius: 18px;
  --shadow: 0 6px 22px rgba(120, 70, 60, .10);
  --font-title: 'Huninn', 'Noto Sans TC', system-ui, sans-serif;
  --font-body: 'Noto Sans TC', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.6 var(--font-body);
  overflow-x: hidden;
  min-width: 320px;
}
body.lock { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; margin: 0; line-height: 1.3; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, #fff); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 10px; z-index: 200; }
.skip:focus { left: 8px; }

/* ---------- 公告跑馬燈 ---------- */
.ticker { background: var(--brand-deep); color: #fff; font-size: 13px; overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-flex; gap: 48px; padding: 6px 24px; animation: ticker 28s linear infinite; }
.ticker-track span::before { content: '✦'; margin-right: 10px; opacity: .6; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { white-space: normal; }
  .ticker-track { animation: none; flex-wrap: wrap; gap: 4px 24px; }
  .ticker-track .dup { display: none; }
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Hero ---------- */
.hero { position: relative; background: linear-gradient(180deg, var(--brand-soft), var(--brand-softer)); padding: 26px 20px 34px; }
.hero-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo {
  width: 62px; height: 62px; flex: none; border-radius: 20px; background: #fff; border: 2px solid var(--brand-line);
  display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow);
  font: 30px/1 var(--font-title); color: var(--brand);
}
.logo img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.hero h1 { font-size: clamp(24px, 4vw, 34px); color: var(--brand-deep); overflow-wrap: anywhere; }
.tagline { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contacts { display: flex; gap: 8px; flex-wrap: wrap; }
.scallop {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 14px;
  background: radial-gradient(circle at 12px 14px, var(--cream) 11px, transparent 12px) 0 0 / 24px 14px repeat-x;
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid transparent; border-radius: 999px; padding: 8px 16px; min-height: 40px;
  background: #fff; font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.primary:hover { background: var(--brand-deep); }
.btn.soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn.soft:hover { background: var(--brand-line); }
.btn.ghost { background: rgba(255, 255, 255, .7); border-color: var(--brand-line); color: var(--brand-deep); }
.btn.ghost:hover { background: #fff; }
.btn.wide { width: 100%; }
.btn.on { background: var(--brand-deep); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.icon-btn:hover { background: var(--brand-soft); }
.chip-btn { border: 0; border-radius: 999px; padding: 4px 12px; font-size: 12px; background: rgba(255, 255, 255, .85); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }

/* ---------- 版面 ---------- */
.layout { max-width: 1240px; margin: 0 auto; padding: 22px 20px 40px; display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 26px; align-items: start; }
.fitting { position: sticky; top: 14px; }
.fit-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.fit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fit-head h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; color: var(--brand-deep); }
.only-mobile { display: none; }

.stage-wrap { position: relative; }
.stage { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; border: 1.5px solid var(--line); background: #eaf7ff; }
.stage.checker, .swatch.checker { background: repeating-conic-gradient(#f1ebe6 0 25%, #fff 0 50%) 0 0 / 20px 20px !important; }
.stage { touch-action: pan-y; }
.stage-inner { position: absolute; inset: 0; transition: transform .22s ease-out; transform-origin: 0 0; will-change: transform; }
.stage.zoomed { cursor: grab; touch-action: none; }
.stage.zoomed.dragging { cursor: grabbing; }
.stage.dragging .stage-inner { transition: none; }
.stage.zoomed .stage-hint { background: rgba(255, 255, 255, .78); width: fit-content; margin: 0 auto; padding: 2px 12px; border-radius: 999px; color: rgba(60, 40, 50, .8); }
.layer { position: absolute; height: auto; max-width: none; image-rendering: pixelated; user-select: none; pointer-events: none; }
.layer.tile { display: block; aspect-ratio: 1; background-repeat: no-repeat; }
.seg.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 28px 2px 0; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg.scroll button { flex: none; }
.fit-row { min-width: 0; }
.stage-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.stage-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; color: rgba(60, 40, 50, .6); pointer-events: none; }

.fit-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.fit-label { font-size: 13px; color: var(--ink-soft); flex: none; width: 2.4em; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--brand); }

.worn { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
.worn-empty { font-size: 13px; color: var(--ink-soft); }
.worn-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand-deep); border: 0; border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12.5px; max-width: 100%; }
.worn-chip b { font-weight: 700; font-family: ui-monospace, Menlo, monospace; }
.worn-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worn-chip svg { width: 16px; height: 16px; opacity: .7; }
.worn-chip:hover { background: var(--brand-line); }
.worn-total { font-size: 12.5px; color: var(--ink-soft); margin-left: auto; }
.link-btn { border: 0; background: none; color: var(--ink-soft); text-decoration: underline; font-size: 12.5px; padding: 4px; }

.fit-actions { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fit-actions .btn { padding: 8px 6px; font-size: 13px; }
.fit-actions .wide { grid-column: 1 / -1; font-size: 15px; }

/* ---------- 目錄 ---------- */
.catalog { min-width: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.search { flex: 1 1 200px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 14px; min-height: 42px; }
.search:focus-within { border-color: var(--brand); }
.search svg { color: var(--ink-soft); }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; padding: 8px 0; }
#sort, .toggle { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 0 14px; min-height: 42px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; }
.toggle[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }
.toggle[aria-pressed="true"] svg { fill: var(--brand); stroke: var(--brand); }

.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px; min-height: 36px; font-size: 14px; }
.chip small { color: var(--ink-soft); margin-left: 4px; font-size: 12px; }
.chip[aria-selected="true"], .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip[aria-selected="true"] small, .chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .8); }
.chips.tags .chip { border-style: dashed; font-size: 13px; min-height: 32px; padding: 3px 12px; }
.chips.tags .chip::before { content: '#'; opacity: .5; margin-right: 2px; }
.result-meta { margin: 12px 2px 10px; font-size: 13px; color: var(--ink-soft); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.card { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-line); }
.card.is-worn { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.thumb { position: relative; aspect-ratio: 1; background: linear-gradient(180deg, var(--brand-softer), #fff); border: 0; padding: 12%; display: grid; place-items: center; width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; transition: transform .2s; }
.card:hover .thumb img { transform: scale(1.08); }
.thumb .noimg { font-size: 34px; opacity: .35; }
.badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; z-index: 2; pointer-events: none; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--brand); color: #fff; letter-spacing: .04em; }
.badge.sold { background: #9a8f94; }
.fav { position: absolute; right: 6px; top: 6px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .85); display: grid; place-items: center; color: var(--ink-soft); }
.fav[aria-pressed="true"] { color: var(--brand); }
.fav[aria-pressed="true"] svg { fill: var(--brand); }
.card.soldout .thumb img { filter: grayscale(.7); opacity: .6; }
.card-body { padding: 10px 12px 4px; flex: 1; }
.code { font: 700 12px/1 ui-monospace, Menlo, monospace; color: var(--brand-deep); background: var(--brand-soft); padding: 3px 7px; border-radius: 6px; display: inline-block; }
.card-name { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0; margin-top: 6px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.card-name:hover { color: var(--brand-deep); }
.price { font-weight: 700; color: var(--brand-deep); margin-top: 2px; }
.price small { font-weight: 400; font-size: 12px; color: var(--ink-soft); margin-left: 3px; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 10px 10px; }
.card-actions .btn { min-height: 36px; padding: 4px 6px; font-size: 13px; }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-soft); }
.empty-art { font-size: 48px; }
.empty .btn { margin-top: 12px; }
.load-error { grid-column: 1 / -1; text-align: center; padding: 40px 16px; color: var(--ink-soft); }
.skeleton { aspect-ratio: .72; border-radius: var(--radius); background: linear-gradient(100deg, #f6ece2 30%, #fdf6ee 50%, #f6ece2 70%) 0 0 / 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.foot { text-align: center; padding: 24px 16px 40px; color: var(--ink-soft); font-size: 13px; }
.foot-sub { font-size: 12px; opacity: .8; }

/* ---------- 浮動按鈕 ---------- */
.bottom-bar { display: none; }
.cart-float { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--brand); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent); font-weight: 500; }
.cart-float b { background: #fff; color: var(--brand-deep); border-radius: 999px; min-width: 24px; padding: 0 6px; text-align: center; font-size: 13px; }
.cart-float.bump, .bottom-bar .bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.12); } }
.dot-count { position: absolute; top: 4px; left: calc(50% + 8px); background: var(--brand); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; padding: 0 5px; text-align: center; }

/* ---------- Drawer / Modal ---------- */
.drawer, .modal { position: fixed; inset: 0; z-index: 100; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(60, 35, 45, .45); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(430px, 100%); background: var(--cream); display: flex; flex-direction: column; animation: slideIn .25s; box-shadow: -8px 0 30px rgba(0, 0, 0, .15); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 20px; }
.drawer-head h2 { font-size: 22px; color: var(--brand-deep); }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 20px 16px; }
.drawer-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--line); background: #fff; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 14px; counter-reset: s; font-size: 12.5px; color: var(--ink-soft); }
.steps li { flex: 1; counter-increment: s; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 5px 6px; text-align: center; }
.steps li::before { content: counter(s) '. '; font-weight: 700; }
.steps li.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-deep); }
.cart-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cart-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; }
.cart-item img, .cart-item .ph { width: 52px; height: 52px; object-fit: contain; image-rendering: pixelated; background: var(--brand-softer); border-radius: 10px; }
.cart-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cart-item .sub { font-size: 13px; color: var(--ink-soft); }
.cart-item.gone { opacity: .6; }
.cart-item.gone .sub { color: #b4443c; }
.cart-empty { text-align: center; padding: 36px 0; color: var(--ink-soft); }
.cart-empty small { display: block; }
.cart-form { margin-top: 14px; display: grid; gap: 12px; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; background: var(--brand-soft); border-radius: 14px; color: var(--brand-deep); }
.total strong { font-size: 20px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.field input, .field textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; background: #fff; font-size: 16px; color: var(--ink); width: 100%; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--brand); }
.field.err input { border-color: #d9534f; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.preview summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.preview pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px 12px; font: 13px/1.6 var(--font-body); margin: 8px 0 0; }
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.contact-row .btn { flex: 1; }
.contact-row.glow .btn { animation: bump .5s; border-color: var(--brand); }

.modal { display: grid; place-items: center; padding: 16px; }
.modal-panel { position: relative; background: var(--cream); border-radius: 26px; width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); animation: pop .22s; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-panel.narrow { width: min(520px, 100%); grid-template-columns: 1fr; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-x { position: absolute; right: 8px; top: 8px; z-index: 3; background: rgba(255, 255, 255, .8); }
.m-media { padding: 18px; display: grid; gap: 10px; align-content: start; }
.m-main { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, var(--brand-softer), #fff); border: 1.5px solid var(--line); }
.m-main > img { width: 100%; height: 100%; object-fit: contain; padding: 12%; image-rendering: pixelated; }
.m-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.m-thumbs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.m-thumbs button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.m-info { padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.m-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-right: 36px; }
.code-pill { border: 0; font: 700 14px/1 ui-monospace, Menlo, monospace; color: var(--brand-deep); background: var(--brand-soft); padding: 7px 12px; border-radius: 10px; }
.code-pill::after { content: ' ⧉'; font-weight: 400; opacity: .6; }
.m-cat { font-size: 13px; color: var(--ink-soft); }
.m-info h2 { font-size: 24px; overflow-wrap: anywhere; }
.m-price { font-size: 22px; font-weight: 700; color: var(--brand-deep); }
.m-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.m-tags button { border: 1.5px dashed var(--brand-line); background: none; border-radius: 999px; padding: 1px 10px; font-size: 12.5px; color: var(--brand-deep); }
.m-desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 10px; }
.howto { padding-left: 1.4em; margin: 6px 0 0; display: grid; gap: 8px; }
.howto li::marker { color: var(--brand); font-weight: 700; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 12px; right: 12px; margin: 0 auto; width: fit-content; bottom: 28px; z-index: 300; transform: translateY(30px); opacity: 0; pointer-events: none; background: #3d2a33; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); transition: transform .25s, opacity .25s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast button { border: 0; background: #fff; color: #3d2a33; border-radius: 999px; padding: 2px 12px; font-size: 13px; flex: none; }

/* ---------- 手機 ---------- */
@media (max-width: 959px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px 12px 24px; }
  .hero { padding: 18px 14px 28px; }
  .logo { width: 52px; height: 52px; font-size: 26px; border-radius: 16px; }
  .only-mobile { display: grid; }
  .cart-float { display: none; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: 80px; }

  .fitting { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 80; transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain; }
  .fitting.open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .fit-card { border-radius: 26px 26px 0 0; border-bottom: 0; box-shadow: 0 -10px 40px rgba(60, 35, 45, .28); padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
  .fit-head { margin-bottom: 6px; }
  .stage-wrap { width: min(100%, 44dvh); margin: 0 auto; }

  .bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: 1fr 1fr; background: rgba(255, 253, 250, .96); backdrop-filter: blur(8px); border-top: 1.5px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-bar button { position: relative; border: 0; background: none; padding: 8px 4px 9px; display: grid; justify-items: center; gap: 0; font-size: 12px; color: var(--ink); min-height: 58px; }
  .bottom-bar svg { width: 24px; height: 24px; color: var(--brand-deep); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }

  .grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 10px; }
  .modal { padding: 0; place-items: end center; }
  .modal-panel { grid-template-columns: 1fr; border-radius: 26px 26px 0 0; max-height: 92dvh; width: 100%; }
  .modal-panel.narrow { width: 100%; }
  .m-media { padding: 16px 16px 0; }
  .m-main { width: min(100%, 38dvh); margin: 0 auto; }
  .m-thumbs { justify-content: center; }
  .m-info { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
  .hero-actions { width: 100%; }
}
@media (max-width: 400px) {
  .toolbar .search { flex-basis: 100%; }
  #sort { flex: 1; min-width: 0; }
  .fit-actions .btn svg { display: none; }
}
