:root {
  --paper: #f6f5f0;
  --panel: #ffffff;
  --ink: #171a16;
  --soft: #5d6459;
  --line: #e2e3da;
  --good: #2f7d32;
  --good-bg: #e4f2d6;
  --warn: #a35a00;
  --warn-bg: #fbeed3;
  --idle: #b4b8ad;
  --radius: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
.wrap { max-width: 860px; margin-inline: auto; padding-inline: 24px; }

.top { padding-block: 56px 28px; }
.eyebrow { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
h1 { margin: 0 0 12px; font-size: clamp(32px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 650; text-wrap: balance; }
.lead { margin: 0; max-width: 56ch; font-size: 18px; color: var(--soft); text-wrap: balance; }
.note { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); text-wrap: balance; }

main { padding-bottom: 80px; }
.card { margin-top: 20px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.step { margin: 0 0 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 650; text-wrap: balance; }
.sub { margin: 0; max-width: 58ch; color: var(--soft); text-wrap: pretty; }
.actions { font-size: 0; line-height: 0; text-align: right; }
.actions .btn { margin: 0 0 8px 8px; }

.btn { font: 600 15px/1.2 inherit; font-family: inherit; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:hover { opacity: 0.88; }
.btn:focus-visible { outline: 3px solid var(--good); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; }

.rows { margin-top: 20px; }
.row { display: grid; grid-template-columns: 10px minmax(0, 210px) minmax(0, 1fr); gap: 4px 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--idle); align-self: center; }
.r-name { font-weight: 600; text-wrap: balance; }
.r-val { color: var(--soft); overflow-wrap: anywhere; text-wrap: balance; }
.row[data-state="ok"] .dot { background: var(--good); }
.row[data-state="ok"] .r-val { color: var(--ink); }
.row[data-state="warn"] .dot { background: var(--warn); }
.row[data-state="warn"] .r-val { color: var(--warn); }
.row[data-state="run"] .dot { background: var(--ink); animation: pulse 1s ease-in-out infinite; }
.row[data-state="run"] .r-val { color: var(--ink); }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .row[data-state="run"] .dot { animation: none; } }

.preview { display: block; width: 240px; max-width: 100%; margin-top: 20px; border-radius: 12px; background: #000; }

.kb { margin-top: 20px; display: grid; gap: 4px; }
.kb-row { display: grid; grid-template-columns: repeat(60, minmax(0, 1fr)); gap: 4px; }
.key { height: 38px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--soft); font-size: clamp(8px, 1.15vw, 12px); white-space: nowrap; }
.kb-row.opt .key { border-style: dashed; }
.key.hit { background: var(--good-bg); border-color: var(--good); color: var(--good); border-style: solid; }

.pad { position: relative; margin-top: 16px; height: 190px; border: 1px dashed var(--idle); border-radius: 12px; background: var(--paper); display: grid; place-items: center; touch-action: none; }
.pad-hint { margin: 0; max-width: 30ch; padding-inline: 56px; text-align: center; color: var(--soft); text-wrap: balance; }
.corner { position: absolute; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--idle); background: var(--panel); }
.corner[data-c="tl"] { top: 10px; left: 10px; } .corner[data-c="tr"] { top: 10px; right: 10px; }
.corner[data-c="bl"] { bottom: 10px; left: 10px; } .corner[data-c="br"] { bottom: 10px; right: 10px; }
.corner.hit { border-color: var(--good); background: var(--good-bg); }

.question { margin-top: 20px; padding: 16px 20px; border-radius: 12px; background: var(--paper); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.question p { margin: 0; font-weight: 600; text-wrap: balance; }
.question .actions .btn { margin-bottom: 0; }

.spec { width: 100%; margin-top: 20px; border-collapse: collapse; }
.spec th, .spec td { padding: 12px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; text-wrap: balance; }
.spec th { width: 34%; padding-right: 16px; font-weight: 600; }
.spec td { overflow-wrap: anywhere; }
.src { display: block; margin-top: 2px; font-size: 13px; color: var(--soft); }
#save-note { margin-top: 12px; }
.foot { margin: 28px 0 0; color: var(--soft); font-size: 14px; text-wrap: balance; }

.ask { margin-top: 20px; }
.ask p { margin: 0 0 8px; font-weight: 600; text-wrap: balance; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 520px; }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 340px; }
.choice { font: 600 15px/1.25 inherit; font-family: inherit; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; text-wrap: balance; }
.choice[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice:focus-visible { outline: 3px solid var(--good); outline-offset: 2px; }
.offer { margin-top: 24px; padding: 24px; border-radius: 12px; background: var(--good-bg); }
.offer-num { margin: 0; font-size: clamp(44px, 9vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.offer-sub { margin: 10px 0 0; max-width: 52ch; text-wrap: balance; }
.offer-notes { margin: 12px 0 0; padding-left: 20px; color: var(--soft); }
.offer-notes:empty { display: none; }
.offer-notes li { margin: 4px 0; text-wrap: balance; }

/* every way to sell it, lowest to highest */
.ladder { list-style: none; margin: 20px 0 0; padding: 0; }
.ladder:empty { display: none; }
.ladder li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.l-name { font-weight: 600; text-wrap: balance; }
.l-val { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.l-note { grid-column: 1 / -1; font-size: 14px; color: var(--soft); text-wrap: pretty; }
.ladder li:last-child { background: var(--good-bg); margin-top: 4px; padding: 12px; border-radius: 12px; border-top: 0; }

/* public page only */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.why { margin: 20px 0 0; max-width: 60ch; padding: 14px 16px; border-radius: 12px; background: var(--good-bg); color: #1f5a22; text-wrap: pretty; }
.notify { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.notify p { margin: 0 0 10px; text-wrap: pretty; }
.notify form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.notify input { min-width: 0; font: inherit; padding: 11px 14px; border: 1px solid #c9ccc0; border-radius: 999px; }
.notify input:focus-visible { outline: 3px solid var(--good); outline-offset: 1px; }
.notify-msg { margin: 8px 0 0; color: var(--soft); text-wrap: balance; }
.notify-msg:empty { display: none; }
.optional { margin: 40px 0 0; font-size: 20px; text-wrap: balance; }
.optional + p { margin: 6px 0 0; color: var(--soft); max-width: 60ch; text-wrap: pretty; }
@media (max-width: 480px) { .notify form { grid-template-columns: 1fr; } .card { padding: 20px 18px; } .card-head { grid-template-columns: 1fr; } .actions { text-align: left; } .actions .btn { margin: 0 8px 8px 0; } }
details { margin-top: 20px; }
summary { cursor: pointer; font-weight: 600; text-wrap: balance; }
#work-source { margin-top: 12px; }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #fff; cursor: pointer; }
.overlay p { margin: 0; padding: 12px 20px; border-radius: 999px; background: rgba(0, 0, 0, 0.75); color: #fff; text-wrap: balance; }

@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .top { padding-block: 36px 20px; }
  .card { padding: 20px; }
  .card-head, .question { grid-template-columns: minmax(0, 1fr); }
  .actions { text-align: left; }
  .actions .btn { margin: 0 8px 8px 0; }
  .btn { white-space: normal; }
  .row { grid-template-columns: 10px minmax(0, 1fr); }
  .r-val { grid-column: 2; }
  .kb, .kb-row { gap: 2px; }
  .key { height: 30px; border-radius: 4px; }
  .spec th { width: 40%; }
}
