:root {
  --ink: #000;
  --paper: #fff;
  --mute: #6b6b6b;
  --line: #000;
  --soft: #f2f2f0;
  --hint: #e9e9e6;
  --warn: #d9480f;
  --gutter: clamp(16px, 3vw, 40px);
  --gap: clamp(16px, 2.2vw, 32px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f4f1; --paper: #0b0b0b; --mute: #9a9a95; --line: #f4f4f1; --soft: #1a1a19; --hint: #262624; --warn: #ff8a4c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f4f4f1; --paper: #0b0b0b; --mute: #9a9a95; --line: #f4f4f1; --soft: #1a1a19; --hint: #262624; --warn: #ff8a4c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 500 16px/1.4 "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: var(--gutter) var(--gutter) 14px; border-bottom: 3px solid var(--line);
  position: sticky; top: 0; z-index: 5; background: var(--paper);
}
.mark {
  font-weight: 900; font-size: clamp(40px, 7vw, 96px); line-height: .8; letter-spacing: -.055em;
  text-decoration: none; text-transform: uppercase;
}
.mark.big { font-size: clamp(64px, 16vw, 200px); }
.sections { display: flex; flex-wrap: wrap; gap: 8px clamp(16px, 3vw, 40px); }
.sections a {
  text-decoration: none; font-weight: 800; font-size: clamp(18px, 2.2vw, 28px); letter-spacing: -.02em;
  text-transform: uppercase; padding-bottom: 2px; border-bottom: 3px solid transparent;
}
.sections a.on { border-color: var(--ink); }
.sections sup { font-size: .5em; font-weight: 600; margin-left: 2px; vertical-align: super; }

/* ---------- tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px var(--gutter); border-bottom: 1px solid var(--line); }
.tag {
  border: 1.5px solid var(--ink); padding: 7px 14px 6px; font-weight: 600; font-size: 14px; letter-spacing: .01em;
  text-transform: uppercase; line-height: 1;
}
.tag.on { background: var(--ink); color: var(--paper); }
.tag .x { margin-left: 8px; font-weight: 900; }
.tags .sep { width: 1px; background: var(--line); margin: 0 6px; }
@media (max-width: 520px) { .tags .sep { display: none; } }

/* ---------- grid of tiles ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--gap); padding: var(--gap) var(--gutter) 80px;
}
.tile { position: relative; display: flex; flex-direction: column; text-decoration: none; }
.tile .ph { position: relative; aspect-ratio: 1 / 1; background: var(--soft); overflow: hidden; }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.tile:hover .ph img { transform: scale(1.035); }
.tile .ph .none {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--mute);
  font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
}
.tile .price {
  font-weight: 900; font-size: clamp(40px, 4.4vw, 64px); line-height: .9; letter-spacing: -.045em; margin-top: 14px;
}
.tile .price small { font-size: .32em; font-weight: 700; letter-spacing: 0; margin-left: 6px; vertical-align: .55em; }
.tile .name { font-weight: 800; font-size: 20px; line-height: 1.1; letter-spacing: -.015em; margin-top: 8px; text-transform: uppercase; }
.tile .sub { color: var(--mute); font-size: 14px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .bids { font-size: 14px; margin-top: 8px; font-weight: 600; }
.tile .why { font-size: 13px; margin-top: 6px; color: var(--mute); }
.tile .acts { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.icon {
  width: 38px; height: 38px; display: grid; place-items: center; background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); font-size: 17px; line-height: 1;
}
.icon.on { background: var(--ink); color: var(--paper); }
.tile .ribbon { position: absolute; left: 10px; top: 10px; right: 100px; display: flex; flex-wrap: wrap; gap: 6px; }
.empty { padding: 80px var(--gutter); font-size: clamp(24px, 3vw, 40px); font-weight: 800; letter-spacing: -.02em; }

.verdict {
  display: inline-block; padding: 5px 9px 4px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  line-height: 1; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
}
.verdict.conservative { background: var(--ink); color: var(--paper); }
.verdict.unknown_price { border-style: dashed; }
.verdict.over, .verdict.skip { color: var(--mute); border-color: var(--mute); }
.verdict.warn { background: var(--warn); border-color: var(--warn); color: #fff; }

/* ---------- detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); padding: var(--gap) var(--gutter) 96px; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.back { display: inline-block; padding: 18px var(--gutter) 0; font-weight: 700; text-transform: uppercase; font-size: 14px; text-decoration: none; }
.gallery .main { aspect-ratio: 1 / 1; background: var(--soft); }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 8px; }
.thumbs button { aspect-ratio: 1 / 1; background: var(--soft); outline: 1.5px solid transparent; outline-offset: -1.5px; }
.thumbs button.on { outline-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.info h1 { font-weight: 900; font-size: clamp(36px, 5vw, 76px); line-height: .9; letter-spacing: -.05em; margin: 0; text-transform: uppercase; }
.info .ttl { margin: 14px 0 0; font-size: 17px; color: var(--mute); }
.info .bigprice { font-weight: 900; font-size: clamp(56px, 8vw, 120px); line-height: .85; letter-spacing: -.06em; margin: 26px 0 10px; }
.info .bigprice small { font-size: .2em; letter-spacing: 0; font-weight: 700; margin-left: 10px; vertical-align: .9em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--ink); padding: 11px 16px 10px;
  font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; text-decoration: none;
}
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.on { background: var(--ink); color: var(--paper); }

.block { border-top: 3px solid var(--line); margin-top: 32px; padding-top: 14px; }
.block h2 { margin: 0 0 12px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; gap: 12px; }
.block h2 span { color: var(--mute); font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; font-weight: 600; }
.issues { margin: 12px 0 0; padding: 0; list-style: none; color: var(--warn); font-weight: 700; }
.issues li { border-left: 3px solid var(--warn); padding: 2px 0 2px 10px; margin-bottom: 6px; }
.issues li::before { content: "⚠ "; }
.desc { white-space: pre-wrap; font-size: 15px; color: var(--ink); max-height: 9.5em; overflow: hidden; position: relative; margin: 0; }
.desc.open { max-height: none; }
.more { margin-top: 6px; font-weight: 700; text-transform: uppercase; font-size: 13px; text-decoration: underline; }

.msg { background: var(--soft); padding: 16px; font-size: 16px; line-height: 1.45; margin: 0 0 10px; }
.offer { font-weight: 900; font-size: 40px; letter-spacing: -.04em; line-height: 1; margin-bottom: 12px; }

.comps { width: 100%; border-collapse: collapse; font-size: 15px; }
.comps td { padding: 9px 8px 8px 0; border-bottom: 1px solid var(--hint); vertical-align: baseline; }
.comps td.p { font-weight: 800; font-size: 18px; white-space: nowrap; }
.comps td.p a { text-decoration: none; border-bottom: 1.5px solid var(--ink); }
.comps td.p .ask { display: block; font-size: 12px; font-weight: 600; color: var(--mute); }
.comps td.ch { white-space: nowrap; font-weight: 600; }
.comps td.d { color: var(--mute); white-space: nowrap; }
.comps td.t { color: var(--mute); font-size: 13px; max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comps td.f { text-align: right; padding-right: 0; }
.comps tr.bad td { text-decoration: line-through; opacity: .45; }
.comps tr.bad td.f { text-decoration: none; opacity: 1; }
.comps tr.flag td.ch::after { content: " ⚠"; }
.chip { border: 1.5px solid var(--ink); padding: 4px 7px 3px; font-size: 11px; font-weight: 800; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--paper); }
.legend { color: var(--mute); font-size: 13px; margin-top: 8px; }

details.fb { border: 1.5px solid var(--ink); }
details.fb summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 800; text-transform: uppercase; font-size: 15px;
  display: flex; justify-content: space-between;
}
details.fb summary::-webkit-details-marker { display: none; }
details.fb summary::after { content: "+"; font-weight: 900; }
details.fb[open] summary::after { content: "−"; }
.fbbody { padding: 0 16px 16px; }
.seg { display: flex; margin-bottom: 10px; }
.seg button { flex: 1; border: 1.5px solid var(--ink); padding: 10px; font-weight: 700; text-transform: uppercase; font-size: 13px; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }
textarea {
  width: 100%; min-height: 110px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
  font: 500 16px/1.4 inherit; font-family: inherit; padding: 12px; resize: vertical; border-radius: 0;
}
textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.notes { margin: 14px 0 0; padding: 0; list-style: none; }
.notes li { border-top: 1px solid var(--hint); padding: 10px 0; }
.notes .meta { color: var(--mute); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 12px 18px; font-weight: 700; z-index: 20;
}
.locked { padding: var(--gutter); max-width: 900px; }
.locked p { font-size: clamp(18px, 2vw, 24px); }
