:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #f1ece3;
  --ink: #1f1c18;
  --muted: #6b645a;
  --line: #e3dccf;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --accent-soft: #e2ece8;
  --pass: #2f7a4f;
  --pass-soft: #e3f1e8;
  --warn: #9a6a00;
  --warn-soft: #fbf0d6;
  --fail: #b3412f;
  --fail-soft: #f8e4df;
  --wood: #c89b6a;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 6px 20px rgba(40, 30, 20, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171512; --surface: #211e1a; --surface-2: #2a2621; --ink: #f1ece4; --muted: #a79e91; --line: #3a352e;
    --accent: #8cc4b2; --accent-ink: #10201b; --accent-soft: #1f302b;
    --pass: #7fcf9c; --pass-soft: #1d2d23; --warn: #e7bb5a; --warn-soft: #33291a; --fail: #ef8f7d; --fail-soft: #3a221d;
    --wood: #b48659; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171512; --surface: #211e1a; --surface-2: #2a2621; --ink: #f1ece4; --muted: #a79e91; --line: #3a352e;
  --accent: #8cc4b2; --accent-ink: #10201b; --accent-soft: #1f302b;
  --pass: #7fcf9c; --pass-soft: #1d2d23; --warn: #e7bb5a; --warn-soft: #33291a; --fail: #ef8f7d; --fail-soft: #3a221d;
  --wood: #b48659; color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, system-ui, sans-serif; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 20px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .mark { color: var(--accent); }
.brand small { font: 500 11px Inter, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.top-right { display: flex; gap: 8px; align-items: center; }
.pill { font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.subtle { background: var(--surface-2); color: var(--muted); }

.hero { padding: 48px 0 16px; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: 18px; margin: 0 0 24px; max-width: 620px; }
.ask { display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.ask textarea { flex: 1; border: 0; resize: none; font: inherit; font-size: 17px; background: transparent; color: var(--ink); padding: 6px 8px; outline: none; }
.ask button, .primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 0 20px; font-weight: 600; min-height: 46px; }
.ask button:disabled { opacity: .6; cursor: wait; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.examples button { background: transparent; border: 1px dashed var(--line); color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.examples button:hover { color: var(--ink); border-color: var(--muted); }

.spec { margin: 24px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.spec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.spec .summary { font-family: Fraunces, Georgia, serif; font-size: 22px; margin: 0 0 14px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.spec-col h3 { font-size: 14px; margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 4px 6px 4px 10px; font-size: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.chip.must { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.chip input { width: 56px; font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px; background: var(--surface); color: var(--ink); }
.chip .x { border: 0; background: transparent; color: var(--muted); padding: 0 4px; font-size: 16px; line-height: 1; }
.chip .x:hover { color: var(--fail); }
.empty-note { color: var(--muted); font-size: 14px; }
.assume { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.spec-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secondary { background: transparent; border: 1px solid var(--accent); color: var(--accent); border-radius: 8px; padding: 6px 14px; font-weight: 600; }
.parsed-by { font-size: 12px; color: var(--muted); }

.results { margin: 16px 0 40px; }
.tally { color: var(--muted); font-size: 14px; margin: 8px 0 14px; }
.tally b { color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card .vis { background: var(--surface-2); height: 150px; display: flex; align-items: center; justify-content: center; position: relative; }
.card .vis img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.card .rank { position: absolute; top: 10px; left: 10px; background: var(--surface); border-radius: 999px; font-size: 12px; font-weight: 600; padding: 2px 9px; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 16px; margin: 0; line-height: 1.3; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; gap: 8px; }
.meta .price { color: var(--ink); font-weight: 600; font-size: 16px; }
.why { font-size: 14px; background: var(--pass-soft); color: var(--ink); border-radius: 8px; padding: 6px 10px; }
.miss { font-size: 14px; background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; }
.checks { list-style: none; margin: 0; padding: 0; font-size: 13.5px; display: grid; gap: 3px; }
.checks li { display: flex; gap: 8px; }
.checks .ic { width: 16px; flex: none; font-weight: 700; text-align: center; }
.checks .pass .ic { color: var(--pass); }
.checks .unknown .ic { color: var(--warn); }
.checks .fail .ic { color: var(--fail); }
.softs { display: flex; flex-wrap: wrap; gap: 4px; }
.softs span { font-size: 12px; background: var(--surface-2); border-radius: 6px; padding: 2px 8px; }
.card .shop { margin-top: auto; display: block; text-align: center; padding: 8px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.card .shop.disabled { color: var(--muted); }
h2.section { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 22px; margin: 30px 0 4px; }
.sub { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.none { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 24px; color: var(--muted); }
.loading { color: var(--muted); padding: 20px 0; }

.modal { position: fixed; inset: 0; background: rgba(20, 16, 12, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.sheet { background: var(--surface); border-radius: 18px; max-width: 440px; width: 100%; padding: 26px; box-shadow: var(--shadow); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.sheet h2 { font-family: Fraunces, Georgia, serif; margin: 0 0 14px; font-size: 26px; line-height: 1.15; }
.perks { padding: 0; list-style: none; margin: 0 0 18px; display: grid; gap: 6px; }
.perks li::before { content: "✓"; color: var(--pass); font-weight: 700; margin-right: 8px; }
.soon { font-size: 11px; background: var(--surface-2); color: var(--muted); border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.plans { display: grid; gap: 8px; margin-bottom: 16px; }
.plan { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.plan:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plan em { font-style: normal; color: var(--muted); font-size: 13px; margin-left: 4px; }
.plan .tag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent); }
.sheet .primary { width: 100%; }
.fine { font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 12px; padding: 0; }
.foot { color: var(--muted); font-size: 13px; padding-top: 10px; padding-bottom: 40px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .ask { flex-direction: column; }
  .ask button { width: 100%; }
  .spec-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .top-right #mode { display: none; }
}

.disclose { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; }
.chip .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chip .k:empty { display: none; }
.chip .swap { border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 0 7px; border-radius: 999px; font-size: 14px; line-height: 1.4; }
.chip .swap:hover { color: var(--accent); border-color: var(--accent); }
.chip[draggable] { cursor: grab; }
.spec-col { border-radius: 10px; transition: background .15s; }
.spec-col.drop { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: 4px; }
.spec-col h3 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.softs .hit { background: var(--pass-soft); }
.softs .nohit { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
/* hard / soft meter */
.meter { display: flex; gap: 6px; flex-wrap: wrap; }
.meter .m { font-size: 12px; border-radius: 999px; padding: 2px 10px; background: var(--surface-2); color: var(--muted); }
.meter .m b { color: var(--ink); }
.meter .m.ok { background: var(--pass-soft); }
.meter .m.warn { background: var(--warn-soft); }
.meter .m.bad { background: var(--fail-soft); }
/* cards */
.card .vis { border: 0; width: 100%; padding: 0; cursor: pointer; }
.title-btn { all: unset; cursor: pointer; }
.title-btn:hover, .title-btn:focus-visible { text-decoration: underline; }
.card .actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.card .actions .shop { margin: 0; }
.details { background: var(--surface-2); border: 0; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink); }
/* detail drawer */
.drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.panel { background: var(--surface); width: min(640px, 100%); height: 100%; overflow-y: auto; padding: 24px 24px 40px; position: relative; box-shadow: var(--shadow); }
.panel .close { position: absolute; top: 12px; right: 12px; border: 0; background: var(--surface-2); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; }
.d-top { display: grid; grid-template-columns: 220px 1fr; gap: 18px; margin-bottom: 8px; }
.d-vis { background: var(--surface-2); border-radius: 12px; overflow: hidden; display: flex; align-items: center; }
.d-vis img { width: 100%; }
.d-head h2 { font-family: Fraunces, Georgia, serif; font-size: 24px; line-height: 1.2; margin: 0 0 6px; padding-right: 40px; }
.d-price { font-size: 22px; font-weight: 600; margin: 0 0 10px; }
.d-price span { font-size: 14px; font-weight: 400; color: var(--muted); }
.d-head .meter { margin-bottom: 12px; }
.buy { display: block; text-align: center; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 12px; font-weight: 600; text-decoration: none; }
.buy.disabled { background: var(--surface-2); color: var(--muted); }
.eyebrow.warn { color: var(--warn); }
.panel section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.panel section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.panel section p { margin: 0; }
.d-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts s { color: var(--muted); }
.notes { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.muted, .checks .muted { color: var(--muted); }
@media (max-width: 640px) {
  .d-top, .d-cols { grid-template-columns: 1fr; }
  .panel { padding: 20px 16px 40px; }
}
/* confirm step */
.spec.confirming { border: 2px solid var(--accent); }
.playback { font-size: 18px; line-height: 1.55; margin: 4px 0 16px; }
.playback b { font-weight: 600; background: var(--accent-soft); border-radius: 4px; padding: 0 3px; }
.assume-inline { color: var(--muted); font-size: 14px; }
.questions { display: grid; gap: 10px; margin: 0 0 16px; padding: 14px; background: var(--warn-soft); border-radius: 10px; }
.qa { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.qa input { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.qa.add { margin-top: 14px; }
.spec-actions .primary { padding: 0 18px; min-height: 42px; }
.spec-actions .secondary { min-height: 42px; }

.late { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: #fdf0d8; color: #7a4a00; font-size: 13px; line-height: 1.35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .late { background: #3a2a0c; color: #f3c77a; } }
:root[data-theme="dark"] .late { background: #3a2a0c; color: #f3c77a; }
.chip input[type="date"] { width: auto; }
.qa small { font-weight: 400; color: var(--muted); }

.nophoto { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 150px; padding: 16px; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 10px; margin: 12px; }
.chip select { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 1px 2px; background: var(--surface); color: var(--ink); max-width: 11em; }
