:root {
  --bg: #fff; --fg: #111; --muted: #5b6168; --line: #e3e5e8; --soft: #f4f5f7;
  --on: #1a7f37; --wa: #128c4a; --on-fg: #fff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171a; --fg: #eceef0; --muted: #a0a7ae; --line: #2e3338; --soft: #1e2226; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
header { position: sticky; top: 0; z-index: 1; background: var(--soft); border-bottom: 1px solid var(--line); padding: 12px 16px; font-weight: 600; font-size: 17px; }
main { max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; }
.lbl { font-size: 12px; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--fg); font: inherit; font-size: 15px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--on); border-color: var(--on); color: var(--on-fg); }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.card-link { display: flex; gap: 10px; color: inherit; text-decoration: none; }
.thumb { width: 96px; height: 80px; flex-shrink: 0; border-radius: 8px; object-fit: cover; background: var(--soft); }
.price { font-size: 18px; font-weight: 700; white-space: nowrap; }
.price.big { font-size: 26px; margin-top: 12px; }
.meta { color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .6; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: var(--on-fg); }
.btn-danger { color: #b42318; }
.wide { display: flex; width: 100%; margin-top: 10px; }
#empty, #none { text-align: center; padding: 32px 0; }
.back { display: inline-block; padding: 8px 0; color: var(--muted); text-decoration: none; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 4px -16px 0; padding: 0 16px; }
.gallery img { flex: 0 0 92%; width: 92%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; scroll-snap-align: center; background: var(--soft); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { width: 100%; max-width: 640px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 14px 14px 0 0; background: var(--bg); color: var(--fg); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.sheet { padding: 14px 16px 24px; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; }
.link { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.field { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }
.field span.err, .err { color: #b42318; font-size: 14px; }
input, textarea, select { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-size: 16px; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pick { position: relative; display: block; width: 76px; height: 76px; }
.pick img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.pick input { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; margin: 0; }
.pick:has(input:not(:checked)) img { opacity: .35; }
.pick.failed { opacity: .4; }
.note { font-size: 14px; color: var(--muted); }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { margin: 14px 0 12px; }
.chip { text-decoration: none; display: inline-flex; align-items: center; }
.inline { display: contents; }
.invalid input, .invalid select { border-color: #b42318; background: color-mix(in srgb, #b42318 8%, var(--bg)); }
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.photo { position: relative; width: calc(33.33% - 6px); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--soft); }
.photo:first-child { border-color: var(--on); }
.photo-bar { display: flex; justify-content: space-between; }
.photo-bar .link { min-width: 32px; flex: 1; }
.photo.loading img { opacity: .4; }
.photo-state { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: 13px; }
.with-input { flex-wrap: nowrap; align-items: center; }
.with-input .chip { flex: none; }
.with-input input { flex: 1; min-width: 0; margin: 0; min-height: 40px; padding: 8px 12px; border-radius: 20px; }
.suggest { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.suggest button { display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.suggest button:last-child { border-bottom: 0; }
.suggest span { color: var(--muted); }
#price-hint { margin-top: 4px; }
