:root {
  --bg: #f6f7fb; --panel: #ffffff; --ink: #141826; --muted: #687087; --line: #e3e6ef;
  --brand: #e63946; --brand-ink: #ffffff; --top: #121726; --hot: #ffb703; --ok: #2a9d8f;
  --shadow: 0 1px 2px rgba(20, 24, 38, .06), 0 4px 16px rgba(20, 24, 38, .06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1220; --panel: #161b2e; --ink: #e8eaf2; --muted: #98a0b8; --line: #262d45;
    --top: #0a0d18; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.2; margin: 28px 0 12px; }
h2 { font-size: 1.35rem; margin: 36px 0 14px; }
h3 { font-size: 1.05rem; margin: 4px 0; }

/* шапка */
.top { background: var(--top); color: #fff; position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -.02em; }
.logo b { color: var(--brand); }
nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
nav a, .linkbtn { text-decoration: none; padding: 8px 10px; border-radius: 8px; color: inherit; }
nav a:hover, .linkbtn:hover { background: rgba(255, 255, 255, .08); }
.linkbtn { background: none; border: 0; font: inherit; cursor: pointer; color: var(--muted); }
.top .linkbtn { color: #fff; }
form.inline { display: inline; }

/* кнопки */
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px;
  padding: 11px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.07); }
.btn.small { padding: 7px 12px; font-size: .9rem; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
nav .btn { color: #fff; }

/* главная */
.hero { padding: 36px 0 8px; }
.hero h1 { max-width: 820px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.stats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stats li { background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stats b { display: block; font-size: 1.6rem; }
.stats span { color: var(--muted); font-size: .9rem; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; counter-reset: s; }
.steps li { background: var(--panel); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 8px; }
.steps p { margin: 6px 0 0; color: var(--muted); }
.section-head, .page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.plan { background: var(--panel); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 2px solid transparent; }
.plan.best { border-color: var(--brand); }
.plan .price { font-size: 1.8rem; font-weight: 800; margin: 6px 0; }
.plan .price span { font-size: .95rem; color: var(--muted); font-weight: 400; }
.plan ul { padding-left: 18px; margin: 8px 0 0; }
.faq details { background: var(--panel); border-radius: 10px; padding: 12px 16px; margin: 8px 0; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 600; }

/* находки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.deal { display: grid; grid-template-columns: 120px 1fr; gap: 12px; background: var(--panel); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); border-left: 4px solid var(--line); }
.deal.deal { border-left-color: var(--hot); }
.deal.cheaper { border-left-color: var(--ok); }
.deal.new { animation: flash 2s ease-out; }
@keyframes flash { from { background: rgba(255, 183, 3, .25); } to { background: var(--panel); } }
.thumb { width: 120px; height: 120px; border-radius: 10px; overflow: hidden; background: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.deal .body { min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.tag { font-size: .72rem; padding: 2px 7px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tag.hot { background: var(--hot); color: #3b2a00; font-weight: 600; }
.tag.warm { background: rgba(42, 157, 143, .15); color: var(--ok); font-weight: 600; }
.tag.src.mercari { background: rgba(230, 57, 70, .12); color: var(--brand); }
.tag.src.yahoo { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.tag.src.rakuma { background: rgba(14, 116, 144, .12); color: #0e7490; }
.deal h3 a, .cardtile h3 a, .witem h3 a { text-decoration: none; }
.deal h3 a:hover, .cardtile h3 a:hover { text-decoration: underline; }
.listing-title { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 6px; }
.prices { font-size: .9rem; display: grid; gap: 2px; }
.prices .label { display: inline-block; min-width: 86px; color: var(--muted); }
.foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; align-items: baseline; flex-wrap: wrap; }
.save { font-weight: 700; color: var(--ok); font-size: .9rem; }
.switch { display: flex; background: var(--panel); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); }
.switch a { padding: 6px 12px; border-radius: 8px; text-decoration: none; font-size: .9rem; color: var(--muted); }
.switch a.on { background: var(--brand); color: #fff; }
.live { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.notice { background: rgba(255, 183, 3, .15); border-radius: 10px; padding: 10px 14px; }
.notice.ok { background: rgba(42, 157, 143, .15); }

/* поиск и карты */
.searchbar { display: flex; gap: 8px; max-width: 680px; }
.searchbar input { flex: 1; }
input, select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--panel); color: var(--ink); min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.cardtile { background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.cardtile .pic { aspect-ratio: 63 / 88; background: var(--line); display: grid; place-items: center; }
.cardtile .pic img { width: 100%; height: 100%; object-fit: contain; }
.cardtile .body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.cardtile form { margin-top: 4px; }
.noimg { padding: 12px; text-align: center; color: var(--muted); }
.cardpage { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 28px; margin-top: 24px; }
.cardpage .pic img { border-radius: 14px; box-shadow: var(--shadow); width: 100%; }
.cardpage h1 { margin-top: 0; }
.facts { border-collapse: collapse; margin: 12px 0; }
.facts th, .facts td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { color: var(--muted); font-weight: 500; }
.watchbox { background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); max-width: 460px; }
.watchform { display: grid; gap: 10px; }
.watchform label { display: grid; gap: 4px; }
label.check { display: flex !important; gap: 8px; align-items: flex-start; }
label.check input { margin-top: 4px; }

/* вишлист, настройки, вход */
.watchlist { display: grid; gap: 10px; margin-top: 12px; }
.witem { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: var(--panel);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.witem .pic { width: 64px; aspect-ratio: 63 / 88; background: var(--line); border-radius: 6px; overflow: hidden; }
.witem p { margin: 2px 0; }
.empty { background: var(--panel); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: center; }
.settings { display: grid; gap: 14px; max-width: 640px; }
.settings fieldset { border: 0; background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.settings legend { font-weight: 700; padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.settings label { display: grid; gap: 4px; }
.inp { display: flex; align-items: center; gap: 6px; }
.inp input { width: 110px; }
.inline-form { margin-top: 12px; }
.narrow { max-width: 520px; margin: 0 auto; padding: 24px 0; }
.loginform { display: flex; gap: 8px; flex-wrap: wrap; }
.loginform input { flex: 1 1 240px; }

footer { margin-top: 56px; padding: 24px 0 36px; border-top: 1px solid var(--line); font-size: .85rem; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .deal { grid-template-columns: 92px 1fr; }
  .thumb { width: 92px; height: 92px; }
  .cardpage { grid-template-columns: 1fr; }
  .cardpage .pic { max-width: 280px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  nav a { padding: 6px 8px; }
}
