/* Not For Sale - a front lawn on a clear day: a hanging yard sign with a rider, and a printed listing sheet with a
 * fact box and a listing-versus-truth column. Light and dark themes via [data-theme] on <html>. */
:root {
  --bg: #eef2ea; --panel: #fffdf8; --ink: #1c2622; --muted: #56635c; --line: #d3dccf; --shadow: 0 1px 2px rgba(30, 50, 35, .07), 0 6px 18px rgba(30, 50, 35, .07);
  --sky: #d9e9f1; --sky-2: #f3f8f6; --grass: #6c9a45; --grass-d: #4f7a31; --hill: #8fb565; --post: #f7f4ec; --post-line: #b9b2a2;
  --board: #fffaf1; --board-ink: #a3241b; --rider: #1f3a5f; --rider-ink: #ffffff; --chain: #7d7a72; --illo: #c9b79a; --illo-d: #8a7a62; --illo-l: #efe6d6;
  --sign: #a3241b; --sign-ink: #ffffff;
  --flaw: #9b2c1f; --flaw-bg: #f8e0d9; --history: #6b3a7a; --history-bg: #eee0f2; --view: #1f5c86; --view-bg: #dcebf6;
  --neighbours: #2e6b3a; --neighbours-bg: #dcefdc; --feature: #4a5260; --feature-bg: #e6e9ee;
  --fix: #9a4d07; --fix-bg: #fbe7cc; --asis: #1f3a5f; --asis-bg: #dde6f2; --movein: #23683a; --movein-bg: #d8efdd;
  --accent: #a3241b; --accent-ink: #ffffff; --chip: #f4efe4; --note: #fbf1d6; --warn: #a3241b; --info: #43506a;
  --paper: #fffef9; --paper-line: #e3ddcf; --paper-ink: #1f2622; --ls: #b8860b;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #111613; --panel: #1a211d; --ink: #e7eee8; --muted: #a5b3aa; --line: #2f3a34; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
  --sky: #1d2b38; --sky-2: #253645; --grass: #3f6230; --grass-d: #2e4a23; --hill: #4d7238; --post: #ddd8cc; --post-line: #8f897c;
  --board: #f6f0e3; --board-ink: #9e2219; --rider: #2a4a75; --rider-ink: #ffffff; --chain: #a19d93; --illo: #6f6352; --illo-d: #4b4234; --illo-l: #8d7f6a;
  --sign: #e0645a; --sign-ink: #1a0b09;
  --flaw: #ffa596; --flaw-bg: #4a2620; --history: #dcb2ea; --history-bg: #3a2543; --view: #9cccf0; --view-bg: #1d3449;
  --neighbours: #9edbab; --neighbours-bg: #1f3a25; --feature: #c7cedb; --feature-bg: #2c323c;
  --fix: #f5b873; --fix-bg: #43301a; --asis: #a9c3ea; --asis-bg: #22324a; --movein: #93d9a7; --movein-bg: #1d3a26;
  --accent: #f07a6f; --accent-ink: #1a0b09; --chip: #232b26; --note: #3a3322; --warn: #ffa596; --info: #b9c4d8;
  --paper: #f7f3ea; --paper-line: #d8d1c1; --paper-ink: #1f2622; --ls: #8a6100;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--accent); }
.hidden { display: none !important; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5rem; overflow-wrap: anywhere; }

/* Header */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.back { text-decoration: none; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: .45rem; font-family: var(--serif); font-size: 1.05rem; flex: 1 1 auto; min-width: 0; }
.brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 26px; height: 26px; flex: none; }
.lg-post { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.lg-board { fill: var(--sign); }
.lg-x { stroke: var(--sign-ink); stroke-width: 2; stroke-linecap: round; }
.session { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Buttons and chips */
.pill { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: .38rem .85rem; font: inherit; font-size: .875rem; cursor: pointer; text-decoration: none; line-height: 1.2; }
.pill:hover { border-color: var(--accent); }
.pill.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill.ghost { cursor: default; background: transparent; }
.pill.big { padding: .65rem 1.3rem; font-size: 1rem; font-weight: 600; }
.pill.tiny { padding: .22rem .6rem; font-size: .8rem; }
.pill:disabled { opacity: .55; cursor: not-allowed; }
.chip { border: 1px dashed var(--grass-d); background: var(--chip); color: var(--ink); border-radius: 6px; padding: .35rem .7rem; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { border-style: solid; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Layout */
main { max-width: 1080px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.hero { padding: 1.4rem 0 .6rem; }
.kicker { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--sign); padding-left: .7rem; margin: 0 0 1rem; max-width: 62rem; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -.01em; }
.h1b { color: #3d6622; font-style: italic; }
[data-theme="dark"] .h1b { color: #b5d98c; }
.lede { max-width: 46rem; font-size: 1.05rem; }
.samples { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.15rem; margin: 1rem 0; box-shadow: var(--shadow); }
.ph { display: flex; align-items: center; gap: .55rem; font-size: 1.3rem; }
.step-no { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 4px; background: var(--sign); color: var(--sign-ink); font: 700 .9rem var(--sans); flex: none; }
.sub { font-size: 1.05rem; }
.lbl { display: block; font-weight: 600; font-size: .9rem; margin: .7rem 0 .3rem; }
textarea, input[type="text"], select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .65rem; }
textarea { resize: vertical; line-height: 1.5; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.three { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 1rem; }
.note { background: var(--note); border-radius: 8px; padding: .5rem .7rem; }
.verdict-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.badge { display: inline-block; border-radius: 4px; padding: .22rem .6rem; font-weight: 700; font-size: .85rem; border: 1px solid currentColor; white-space: nowrap; }
.badge.v-fixer_upper { color: var(--fix); background: var(--fix-bg); }
.badge.v-as_is { color: var(--asis); background: var(--asis-bg); }
.badge.v-move_in { color: var(--movein); background: var(--movein-bg); }
.badge.v-none { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin: .4rem 0 1rem; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; background: var(--bg); min-width: 0; }
.tile b { display: block; font: 700 1.35rem var(--serif); }
.tile.t-flaw b { color: var(--flaw); } .tile.t-history b { color: var(--history); } .tile.t-view b { color: var(--view); }
.tile.t-neighbours b { color: var(--neighbours); } .tile.t-feature b { color: var(--feature); }

/* The yard */
.yard-host { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--sky); }
.yard { display: block; width: 100%; height: auto; }
.y-sky { fill: url(#ySky); }
.y-sky-a { stop-color: var(--sky); } .y-sky-b { stop-color: var(--sky-2); }
.y-hill { fill: var(--hill); } .y-lawn { fill: var(--grass); } .y-lawn-d { fill: var(--grass-d); }
.y-illo { fill: var(--illo); stroke: var(--illo-d); stroke-width: 2; stroke-linejoin: round; }
.y-illo-d { fill: var(--illo-d); } .y-illo-l { fill: var(--illo-l); stroke: var(--illo-d); stroke-width: 1.5; }
.y-post { fill: var(--post); stroke: var(--post-line); stroke-width: 1.5; }
.y-chain { stroke: var(--chain); stroke-width: 2; fill: none; }
.y-tuft { stroke: var(--grass-d); stroke-width: 2; fill: none; stroke-linejoin: round; }
.y-board { fill: var(--board); stroke: var(--board-ink); stroke-width: 4; }
.y-board-t { fill: var(--board-ink); font-family: var(--sans); font-weight: 800; letter-spacing: .04em; }
.y-rider { fill: var(--rider); }
.y-rider-t { fill: var(--rider-ink); font-family: var(--sans); font-weight: 700; }
.y-stk { stroke: rgba(0, 0, 0, .25); stroke-width: 1; }
.y-stk.v-fixer_upper { fill: #f2a541; } .y-stk.v-as_is { fill: #8fb3e6; } .y-stk.v-move_in { fill: #8fd19e; }
.y-stk-t { fill: #1b1b1b; font-family: var(--sans); font-weight: 800; letter-spacing: .05em; }
.y-swing { transform-origin: 300px 86px; animation: swing 5s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@media (prefers-reduced-motion: reduce) { .y-swing { animation: none; } }

/* The listing sheet */
.sheet-host { display: flex; justify-content: center; }
.sheet { width: 100%; max-width: 760px; background: var(--paper); color: var(--paper-ink); border: 1px solid var(--paper-line); border-radius: 4px; padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 12px 24px rgba(0, 0, 0, .08); }
.sh-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; border-bottom: 3px double var(--paper-line); padding-bottom: .5rem; margin-bottom: .7rem; }
.sh-status { background: var(--sign); color: var(--sign-ink); font: 800 .8rem var(--sans); letter-spacing: .12em; padding: .25rem .6rem; border-radius: 2px; }
[data-theme="dark"] .sh-status { background: #a3241b; color: #fff; }
.sh-ref { font: .75rem var(--mono); color: #5b6560; }
.sh-head { font-size: clamp(1.25rem, 3.2vw, 1.75rem); margin: 0 0 .15rem; color: var(--paper-ink); }
.sh-place { margin: 0 0 .8rem; color: #5b6560; font-style: italic; }
.sh-grid { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; }
.sh-photo { border: 1px solid var(--paper-line); background: #e9f1f4; border-radius: 3px; overflow: hidden; }
.sh-photo svg { display: block; width: 100%; height: auto; }
.sh-box { margin: .6rem 0 0; display: grid; grid-template-columns: auto 1fr; border: 1px solid var(--paper-line); font-size: .85rem; }
.sh-box dt, .sh-box dd { margin: 0; padding: .3rem .5rem; border-bottom: 1px solid var(--paper-line); }
.sh-box dt { font-weight: 700; background: #f2eee4; text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: #3b4440; }
.sh-box dt:nth-last-of-type(1), .sh-box dd:last-child { border-bottom: 0; }
.sh-desc { margin: 0 0 .8rem; font-family: var(--serif); font-size: 1.02rem; line-height: 1.55; }
.sh-pairs { width: 100%; border-collapse: collapse; font-size: .88rem; }
.sh-pairs th { text-align: left; font: 700 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #3b4440; border-bottom: 2px solid var(--paper-ink); padding: .3rem .4rem; }
.sh-pairs td { vertical-align: top; padding: .4rem .4rem; border-bottom: 1px dashed var(--paper-line); overflow-wrap: anywhere; }
.sh-pairs td.say { font-family: var(--serif); width: 52%; }
.sh-pairs td.truth { font-family: var(--mono); font-size: .8rem; color: #39423e; }
.sh-tag { display: inline-block; margin-right: .35rem; font: 700 .66rem var(--sans); letter-spacing: .05em; text-transform: uppercase; border-radius: 3px; padding: .04rem .35rem; border: 1px solid currentColor; vertical-align: 1px; }
.sh-close { margin: .8rem 0 0; text-align: center; font: italic 1rem var(--serif); }
abbr.ls { text-decoration: underline dotted var(--ls); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; }
/* Slot tags read on paper in both themes (the sheet is always light paper). */
.sh-tag.s-flaw { color: #9b2c1f; background: #f8e0d9; } .sh-tag.s-history { color: #6b3a7a; background: #eee0f2; } .sh-tag.s-view { color: #1f5c86; background: #dcebf6; }
.sh-tag.s-neighbours { color: #2e6b3a; background: #dcefdc; } .sh-tag.s-feature { color: #4a5260; background: #e6e9ee; }

/* Rows and lists */
.cardrow, .exports, .runrow { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .7rem; }
.gate { background: var(--note); border-radius: 8px; padding: .55rem .75rem; }
.steps { list-style: none; padding: 0; margin: .3rem 0; }
.step { padding: .15rem 0; color: var(--muted); }
.step.active { color: var(--ink); font-weight: 600; }
.step.done { color: var(--movein); }
.step-ic { display: inline-block; width: 1.1rem; font-family: var(--mono); }
.raw { white-space: pre-wrap; overflow-wrap: anywhere; font: .8rem/1.45 var(--mono); background: var(--bg); padding: .7rem; border-radius: 8px; max-height: 360px; overflow: auto; }
.res-head { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.res-head h2 { margin: 0; font-size: 1.4rem; }
.summary { font-size: 1.05rem; }
.ledger { list-style: none; padding: 0; margin: .3rem 0 1rem; display: grid; gap: .5rem; }
.lrow { border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: 6px; padding: .5rem .7rem; background: var(--bg); }
.lrow.s-flaw { border-left-color: var(--flaw); } .lrow.s-history { border-left-color: var(--history); } .lrow.s-view { border-left-color: var(--view); }
.lrow.s-neighbours { border-left-color: var(--neighbours); } .lrow.s-feature { border-left-color: var(--feature); }
.lhead { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.lno { font: 700 .8rem var(--mono); color: var(--muted); }
.ltag { font-size: .75rem; font-weight: 700; border-radius: 3px; padding: .05rem .45rem; border: 1px solid currentColor; }
.ltag.s-flaw { color: var(--flaw); background: var(--flaw-bg); } .ltag.s-history { color: var(--history); background: var(--history-bg); }
.ltag.s-view { color: var(--view); background: var(--view-bg); } .ltag.s-neighbours { color: var(--neighbours); background: var(--neighbours-bg); }
.ltag.s-feature { color: var(--feature); background: var(--feature-bg); }
.lorig { margin: .3rem 0 .1rem; font-weight: 600; }
.lsay { margin: .1rem 0; font-family: var(--serif); }
.ltruth { margin: .1rem 0; font-family: var(--mono); font-size: .85rem; }
.recon { padding-left: 1.2rem; }
.recon li { padding: .15rem 0; }
.recon li.warn { color: var(--warn); }
.recon li.info { color: var(--info); }
.ledger li.none, .recon li.none, .saved li.none, .dec-out li.none { list-style: none; margin-left: -1.2rem; color: var(--muted); font-style: italic; }

/* Saved listings */
.saved { list-style: none; padding: 0; margin: .7rem 0 0; }
.hrow { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
.hinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hinfo b { overflow-wrap: anywhere; }
.hbtns { display: flex; gap: .3rem; }
.mini { width: 30px; height: 30px; flex: none; }
.mini-post { stroke: var(--muted); stroke-width: 2; fill: none; }
.mini-board { stroke: var(--sign); stroke-width: 1.5; fill: var(--board); }
.mini.v-fixer_upper .mini-dot { fill: #f2a541; } .mini.v-as_is .mini-dot { fill: #8fb3e6; } .mini.v-move_in .mini-dot { fill: #8fd19e; } .mini-dot { fill: var(--line); }

/* The decoder */
.dec-out { padding-left: 1.2rem; margin: .5rem 0 0; }
.dec-out li { padding: .15rem 0; }
.dec-out b { font-family: var(--serif); }
.gloss { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.gloss span { font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem; background: var(--bg); }

.foot { max-width: 1080px; margin: 0 auto; padding: 1rem 1rem 2.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .4rem; z-index: 50; max-width: min(92vw, 380px); }
.toast { background: var(--ink); color: var(--bg); padding: .55rem .8rem; border-radius: 8px; font-size: .875rem; box-shadow: var(--shadow); transition: opacity .5s; }
.toast.err { background: var(--warn); color: #fff; }
[data-theme="dark"] .toast.err { color: #1a0c0a; }
.toast a { color: inherit; font-weight: 700; }
.toast.gone { opacity: 0; }

@media (max-width: 860px) {
  .three { grid-template-columns: 1fr 1fr; } .three > :first-child { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .sh-grid { grid-template-columns: 1fr; }
  .sh-photo { max-width: 300px; }
}
@media (max-width: 560px) {
  main { padding: .6rem 1rem 1.5rem; }
  .back-t { display: none; }
  .bar { padding: .5rem .75rem; gap: .4rem; }
  .brand { font-size: .98rem; }
  .panel { padding: .95rem .85rem; }
  .sheet { padding: .9rem .8rem 1rem; }
  .sh-pairs td.say { width: 50%; }
  .sh-photo { max-width: 200px; }
  .hrow { flex-wrap: wrap; }
}
@media print {
  .bar, .hero, .samples, .askbox, .histbox, .toasts, .cardrow, .exports, .foot, .decbox, .aboutbox, .placebox, .yardbox .ph, .yardbox .verdict-row, .yardbox .tiles, #sourceNote, #result, #progressPanel, #how, #rawResult { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .sheetbox .ph, .sheetbox .small { display: none; }
  .sheet { box-shadow: none; border: 0; max-width: none; }
  .yardbox { break-inside: avoid; margin-bottom: 12px; }
  .y-swing { animation: none; }
}
