:root {
  --bg: #14110e; --surface: #1d1914; --surface2: #26211a; --line: #3a3228;
  --text: #ece4d8; --muted: #b0a493; --accent: #d89a52; --accent-ink: #1a1208; --accent-hover: #e8ad6a;
  --warn: #e8b86a; --ok: #9fcf9a; --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 650; }
h1 { font-size: 1.7rem; margin-top: .6em; }
h2 { font-size: 1.25rem; margin-top: 1.6em; }
h3 { font-size: 1.05rem; margin: 0 0 .3em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; justify-content: space-between; align-items: center; min-height: 56px; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; padding: 8px 0; }
.brand:hover { color: var(--accent); }
.cartlink { min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; text-decoration: none; font-weight: 600; }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; margin-left: 6px; font-size: .85rem; }
.nav { display: flex; flex-wrap: wrap; gap: 0 18px; padding-bottom: 4px; }
.nav a { color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--accent); }

main { padding-bottom: 40px; flex: 1 0 auto; width: 100%; }
.hero { padding: 12px 0 8px; max-width: 760px; }
.lead { font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; border: 1px solid var(--accent); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--surface2); color: var(--accent-hover); }
.btn.wide { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; min-height: 44px; padding: 0 4px; cursor: pointer; }
.linkbtn:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.flash { padding: 12px 14px; border-radius: var(--radius); background: var(--surface2); border: 1px solid var(--line); margin: 14px 0 0; }
.flash.warn { border-color: var(--warn); }
.flash.ok { border-color: var(--ok); }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-photo { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface2); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card.is-sold .card-photo img, .card.is-held .card-photo img { opacity: .5; }
.badge { position: absolute; left: 10px; top: 10px; background: rgba(20,17,14,.88); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: .85rem; }
.card-body { padding: 12px 14px 14px; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent); }
.meta { color: var(--muted); font-size: .9rem; margin: 0 0 .4em; display: block; }
.price { font-weight: 700; margin: 0; }
.price.big { font-size: 1.6rem; margin: 0 0 .6em; }
.nophoto { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--muted); min-height: 160px; }
.more { margin-top: 16px; }

.filters { display: grid; grid-template-columns: 1fr; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.filters label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 4px; }
select { min-height: 48px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; width: 100%; }
@media (min-width: 760px) { .filters { grid-template-columns: repeat(3, 1fr) auto; align-items: end; } }
.count-line { margin: 14px 0 10px; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 24px; }

.crumbs { margin: 14px 0 0; font-size: .9rem; color: var(--muted); }
.piece { display: grid; gap: 20px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 900px) { .piece { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 36px; } }
.main-photo { display: block; background: var(--surface2); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.main-photo img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs a { display: block; width: 76px; height: 58px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; }
.thumbs a.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info h1 { margin-top: 0; }
.status { display: inline-block; border: 1px solid var(--line); background: var(--surface2); border-radius: 999px; padding: 4px 16px; font-weight: 600; }
.status.sold { border-color: var(--warn); color: var(--warn); }
.desc { margin-top: 1.2em; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1.2em; padding: 14px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.shipline { color: var(--muted); font-size: .95rem; }

.lines { list-style: none; padding: 0; margin: 0 0 20px; }
.line { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line:not(:has(img)) { grid-template-columns: 1fr auto; }
.line img { border-radius: 6px; width: 96px; height: 72px; object-fit: cover; }
.line-main a { font-weight: 600; text-decoration: none; color: var(--text); }
.line-end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.warnline { color: var(--warn); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 18px 0; max-width: 640px; }
.panel h2 { margin-top: 0; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; min-height: 56px; cursor: pointer; }
.opt input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.total { font-weight: 700; }

.prose { max-width: 680px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .25em 0; }
blockquote { margin: 1em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--text); font-size: 1.05rem; }
.rates { border-collapse: collapse; width: 100%; max-width: 420px; margin-bottom: 1em; }
.rates th, .rates td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }

.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; color: var(--muted); }
.foot p { margin: 0 0 .4em; }
.panel .btn.wide { margin: 6px 0 12px; }
.resnote { grid-column: 1 / -1; margin: 0; color: var(--warn); }
.returnline { color: var(--muted); font-size: .95rem; margin: -.2em 0 .9em; }
