:root {
  --bg: #faf6ee;
  --surface: #ffffff;
  --ink: #1b2233;
  --muted: #5d6475;
  --line: #e7e0d2;
  --accent: #1f3a6e;
  --accent-ink: #ffffff;
  --good: #1f8a4c;
  --good-bg: #e3f4e8;
  --warn: #9a5b00;
  --warn-bg: #fff3d6;
  --gold: #f2c14e;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(27, 34, 51, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171f; --surface: #1d212c; --ink: #eef0f5; --muted: #a3a9b8; --line: #2d3240;
    --accent: #8fb0ff; --accent-ink: #10131a; --good: #5fd08f; --good-bg: #183324;
    --warn: #ffc864; --warn-bg: #3a2c10; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; font-size: .95rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent); }
@media (max-width: 640px) { .nav a.hide-sm { display: none; } .nav { gap: 14px; } }

/* hero */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(1.8rem, 4.6vw, 2.7rem); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 620px; font-size: 1.05rem; }

/* tool */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .tool { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.drop {
  border: 2px dashed var(--line); border-radius: 14px; min-height: 300px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px; cursor: pointer;
}
.drop.over { border-color: var(--accent); background: rgba(31, 58, 110, .04); }
.drop .big { font-weight: 700; font-size: 1.1rem; }
.drop small { color: var(--muted); }
.photo { position: relative; border-radius: 14px; overflow: hidden; line-height: 0; }
.photo img { width: 100%; display: block; }
.badge {
  position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #1f3a6e; border: 2px solid #1f3a6e; font: 700 15px/30px system-ui, sans-serif;
  text-align: center;
}
.badge.locked { background: rgba(27, 34, 51, .78); color: #fff; border-color: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 11px 22px;
  font: 600 1rem system-ui, sans-serif; cursor: pointer; border: 1.5px solid var(--accent); text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.gold { background: var(--gold); color: #1b2233; border-color: #c99a2e; }
.row-btns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.result-empty { color: var(--muted); text-align: center; padding: 60px 10px; }
.total { text-align: center; padding: 6px 0 14px; }
.total .num { font-size: clamp(2.2rem, 6vw, 3.1rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.total .lbl { color: var(--muted); }
.pill { display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 999px; background: var(--good-bg); color: var(--good); font-weight: 650; font-size: .88rem; }
.cards { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.card { display: grid; grid-template-columns: 26px 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.card.sell { background: var(--good-bg); }
.card > div { min-width: 0; }
.card .no { font-weight: 700; color: var(--muted); text-align: center; }
.card .thumb { width: 44px; height: 61px; border-radius: 4px; background: var(--line); object-fit: cover; }
.card .nm { font-weight: 650; line-height: 1.25; }
.card .meta { color: var(--muted); font-size: .86rem; line-height: 1.3; }
.card .pr { text-align: right; font-weight: 700; white-space: nowrap; }
.card .tag { display: block; font-size: .75rem; font-weight: 650; color: var(--good); }
.card .tag.low { color: var(--warn); }
.card select { margin-top: 4px; width: 100%; max-width: 100%; font-size: .8rem; text-overflow: ellipsis; }
.lockbox { position: relative; }
.lockbox .ghostrow { filter: blur(5px); opacity: .55; pointer-events: none; }
.lockbox .cta {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.lockbox .cta .btn { white-space: normal; max-width: 100%; }
.lockbox .cta b { background: var(--surface); padding: 2px 10px; border-radius: 8px; }
.note { color: var(--muted); font-size: .85rem; text-align: center; margin: 14px 0 0; }
.alert { border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--warn-bg); color: var(--warn); }
.passline { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: .9rem; }
.passline input { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-width: 0; flex: 1 1 200px; max-width: 280px; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sections */
section.block { padding: 48px 0 8px; }
section.block h2 { text-align: center; font-size: 1.6rem; margin: 0 0 22px; letter-spacing: -.01em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: center; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }
.steps .ic { font-size: 2rem; }
.steps h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .grid6 { grid-template-columns: repeat(2, 1fr); } }
.gcard {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 14px; text-align: center;
  color: var(--ink); text-decoration: none; font-weight: 650;
}
.gcard img { height: 34px; width: auto; display: block; margin: 0 auto 8px; }
.gcard small { display: block; color: var(--muted); font-weight: 500; }
.gcard:hover { border-color: var(--accent); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin: 0 auto 10px; max-width: 820px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 10px 0; }
.faq h3 { display: inline; font-size: 1rem; }
.faq p { margin: 0 0 12px; color: var(--muted); }

/* article / guide */
.article { max-width: 860px; margin: 0 auto; padding: 28px 0 10px; }
.article h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.2; margin: 0 0 8px; }
.article .sub { color: var(--muted); margin: 0 0 18px; }
.article h2 { margin: 34px 0 10px; font-size: 1.35rem; }
.crumbs { font-size: .88rem; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: .9rem; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.pt { border-collapse: collapse; width: 100%; font-size: .93rem; }
table.pt th, table.pt td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.pt th { background: var(--bg); position: sticky; top: 0; font-size: .85rem; }
table.pt td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.pt td.nm { white-space: normal; min-width: 140px; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin: 18px 0; }
.price-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 18px 0; }
@media (max-width: 640px) { .price-cards { grid-template-columns: 1fr; } }

footer { margin-top: 60px; border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: .88rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
footer a { color: var(--muted); }
footer .links { display: flex; gap: 16px; flex-wrap: wrap; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
