/* Leave the Dishes - a front desk after hours: cream wallpaper, a walnut pigeonhole rack with brass plates, paper
 * slips, and a die-cut door hanger in card stock. Light and dark themes via [data-theme] on <html>. */
:root {
  --bg: #f3ede2; --panel: #fffaf1; --ink: #1f2433; --muted: #5a5f6e; --line: #dccfb8; --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 6px 18px rgba(60, 40, 20, .07);
  --wood: #7a4b2a; --wood-d: #55321a; --wood-l: #9a6438; --hole: #3b2414; --brass: #b8862e; --brass-l: #e6c67e; --brass-ink: #1a1204;
  --slip: #fffdf6; --slip-line: #e6dcc7; --slip-ink: #2a2a33;
  --keep: #2c7656; --keep-bg: #dcefe4; --soften: #8a5a0e; --soften-bg: #f7e6c4; --cleaner: #a8322a; --cleaner-bg: #f8dcd7; --local: #285b88; --local-bg: #dbe8f5;
  --accent: #1f4e5f; --accent-ink: #ffffff; --chip: #efe5d2; --note: #fbefd3; --warn: #a8322a; --info: #4a5468;
  --stock-warm: #f5d9a6; --stock-brisk: #d3e5dd; --stock-playful: #f3c9c1; --stock-ink: #222630;
  --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: #15171c; --panel: #1e2128; --ink: #ece6d9; --muted: #aaa597; --line: #363a47; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
  --wood: #4d301c; --wood-d: #351f11; --wood-l: #6a4428; --hole: #120b06; --brass: #b58a3c; --brass-l: #d9b56a; --brass-ink: #1a1204;
  --slip: #2b2a26; --slip-line: #3d3b35; --slip-ink: #ece6d9;
  --keep: #7fd0a6; --keep-bg: #1d3a2d; --soften: #f0bd5e; --soften-bg: #40301a; --cleaner: #ff9a8c; --cleaner-bg: #4a2420; --local: #94c2ee; --local-bg: #1e3349;
  --accent: #86c7cf; --accent-ink: #0f1c20; --chip: #2a2d36; --note: #3a3220; --warn: #ff9a8c; --info: #b9c2d6;
  --stock-warm: #e9cc95; --stock-brisk: #c4d9cf; --stock-playful: #e5b7ae; --stock-ink: #1d2028;
}
* { 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-card { fill: var(--stock-warm); stroke: var(--wood); stroke-width: 1.6; }
.lg-hole { fill: var(--panel); stroke: var(--wood); stroke-width: 1.4; }
.lg-slit { stroke: var(--wood); stroke-width: 1.6; }
.lg-tick { fill: none; stroke: var(--stock-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: 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(--wood-l); 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(--brass); padding-left: .7rem; margin: 0 0 1rem; max-width: 62rem; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -.01em; }
.h1b { color: var(--wood-l); font-style: italic; }
[data-theme="dark"] .h1b { color: var(--brass-l); }
.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: 50%; background: var(--brass); color: var(--brass-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; }
.two { display: grid; grid-template-columns: 2fr 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-ready { color: var(--keep); background: var(--keep-bg); }
.badge.v-trim { color: var(--soften); background: var(--soften-bg); }
.badge.v-rewrite { color: var(--cleaner); background: var(--cleaner-bg); }
.badge.v-none { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .4rem 0 1rem; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; background: var(--bg); }
.tile b { display: block; font: 700 1.35rem var(--serif); }

/* The pigeonhole rack */
.rack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; border-radius: 10px;
  background: linear-gradient(180deg, var(--wood-l), var(--wood) 12%, var(--wood) 88%, var(--wood-d)); box-shadow: inset 0 0 0 2px var(--wood-d), 0 4px 10px rgba(40, 20, 5, .25); }
.cubby { display: flex; flex-direction: column; min-width: 0; }
.hole-in { min-height: 170px; flex: 1; padding: 10px 8px 6px; border-radius: 4px; background: linear-gradient(180deg, var(--hole), color-mix(in srgb, var(--hole) 70%, var(--wood))); box-shadow: inset 0 6px 12px rgba(0, 0, 0, .55), inset 0 -2px 0 rgba(255, 255, 255, .06); }
.empty-slot { margin: 2.2rem 0 0; text-align: center; color: rgba(255, 255, 255, .45); font-size: .8rem; font-style: italic; }
.slip { position: relative; display: block; background: var(--slip); color: var(--slip-ink); border: 1px solid var(--slip-line); border-radius: 2px; padding: .4rem .5rem .45rem 2.1rem; margin: 0 0 6px;
  font-size: .8rem; line-height: 1.3; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 2px 3px rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.slip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 2px 0 0 2px; background: var(--muted); }
.s-keep .slip::before { background: var(--keep); }
.s-soften .slip::before { background: var(--soften); }
.s-cleaner .slip::before { background: var(--cleaner); }
.s-local .slip::before { background: var(--local); }
.slip-no { position: absolute; left: .5rem; top: .4rem; font: 700 .72rem var(--mono); color: var(--muted); }
.slip-tag { display: inline-block; margin-left: .35rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.slip.unsent { opacity: .6; }
.plate { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin-top: 7px; padding: .3rem .55rem; border-radius: 3px;
  background-color: var(--brass-l); background-image: linear-gradient(180deg, var(--brass-l), color-mix(in srgb, var(--brass-l) 55%, var(--brass))); color: var(--brass-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .4); font-size: .82rem; }
.plate b { font-family: var(--serif); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-n { font: 700 .85rem var(--mono); border: 1px solid currentColor; border-radius: 3px; padding: 0 .35rem; }
.cub-hint { min-height: 2.6em; margin: .35rem .1rem 0; color: #f3e6cf; opacity: .85; font-size: .75rem; line-height: 1.3; }

/* The door hanger */
.hang-wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.hanger-host { display: flex; justify-content: center; padding: .4rem 0 .8rem; }
.hanger { position: relative; width: 270px; max-width: 100%; min-height: 470px; padding: 92px 22px 26px; border-radius: 22px 22px 14px 14px; color: var(--stock-ink);
  background: var(--stock-warm); box-shadow: 0 10px 22px rgba(40, 25, 10, .22), inset 0 0 0 1px rgba(0, 0, 0, .06); transform: rotate(-1.2deg); }
.hanger.t-brisk { background: var(--stock-brisk); }
.hanger.t-playful { background: var(--stock-playful); }
.hanger-top { position: absolute; left: 0; right: 0; top: 0; height: 80px; }
.hanger-hole { position: absolute; left: 50%; top: 22px; width: 50px; height: 50px; margin-left: -25px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .25); }
.hanger-slit { position: absolute; left: calc(50% + 18px); top: 8px; width: 3px; height: 30px; background: var(--panel); transform: rotate(38deg); transform-origin: bottom; border-radius: 2px; }
.hanger-eyebrow { margin: 0; font: 700 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .7; text-align: center; }
.hanger-h { font-size: 1.45rem; text-align: center; margin: .2rem 0 .9rem; color: var(--stock-ink); }
.hanger-lines { list-style: none; margin: 0; padding: 0; }
.hanger-lines li { display: flex; gap: .55rem; align-items: flex-start; padding: .38rem 0; border-bottom: 1px dashed rgba(0, 0, 0, .18); font-size: .92rem; line-height: 1.35; }
.tbox { flex: none; width: 15px; height: 15px; margin-top: .15rem; border: 1.6px solid var(--stock-ink); border-radius: 3px; }
.hanger-more { font-size: .8rem; opacity: .75; margin: .5rem 0 0; }
.hanger-sign { font-family: var(--serif); font-style: italic; text-align: center; margin: 1rem 0 0; }
.hanger-stamp { position: absolute; right: 14px; bottom: 10px; font: 700 .62rem var(--sans); letter-spacing: .12em; text-transform: uppercase; opacity: .55; }
.clean-list { margin: .3rem 0 0; padding-left: 1.2rem; }
.clean-list li { padding: .2rem 0; }
.clean-list li.none, .ledger li.none, .recon li.none, .saved li.none { list-style: none; margin-left: -1.2rem; color: var(--muted); font-style: italic; }
.cardrow, .exports, .runrow { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .7rem; }

/* Run, progress, result */
.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(--keep); }
.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-keep { border-left-color: var(--keep); } .lrow.s-soften { border-left-color: var(--soften); } .lrow.s-cleaner { border-left-color: var(--cleaner); } .lrow.s-local { border-left-color: var(--local); }
.lhead { display: flex; gap: .5rem; align-items: center; }
.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-keep { color: var(--keep); background: var(--keep-bg); } .ltag.s-soften { color: var(--soften); background: var(--soften-bg); }
.ltag.s-cleaner { color: var(--cleaner); background: var(--cleaner-bg); } .ltag.s-local { color: var(--local); background: var(--local-bg); }
.lorig { margin: .3rem 0 .1rem; font-weight: 600; }
.lguest { margin: .1rem 0; }
.lrow p.small { margin: .15rem 0 0; }
.recon { padding-left: 1.2rem; }
.recon li { padding: .15rem 0; }
.recon li.warn { color: var(--warn); }
.recon li.info { color: var(--info); }

/* Saved cards */
.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; }
.hbtns { display: flex; gap: .3rem; }
.mini { width: 22px; height: 36px; flex: none; }
.mini-card { fill: var(--stock-warm); stroke: var(--wood); stroke-width: 1.2; }
.mini.v-trim .mini-card { fill: var(--soften-bg); } .mini.v-rewrite .mini-card { fill: var(--cleaner-bg); } .mini.v-ready .mini-card { fill: var(--keep-bg); }
.mini-hole { fill: var(--panel); stroke: var(--wood); stroke-width: 1; }
.mini-line { stroke: var(--wood); stroke-width: 1.4; stroke-linecap: round; }

/* Light versus heavy */
.pairs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: .4rem 0 .8rem; }
.pair { display: flex; flex-direction: column; gap: .3rem; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; background: var(--bg); font-size: .88rem; }
.pair .heavy { color: var(--cleaner); text-decoration: line-through; text-decoration-thickness: 1px; }
.pair .light { color: var(--keep); font-weight: 600; }

.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(--cleaner); color: #fff; }
[data-theme="dark"] .toast.err { color: #1a0c0a; }
.toast a { color: inherit; font-weight: 700; }
.toast.gone { opacity: 0; }

@media (max-width: 860px) {
  .rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hang-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { padding: .6rem 1rem 1.5rem; }
  .two { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .back-t { display: none; }
  .bar { padding: .5rem .75rem; gap: .4rem; }
  .brand { font-size: .98rem; }
  .rack { gap: 8px; padding: 8px; }
  .pairs { grid-template-columns: 1fr; }
  .panel { padding: .95rem .85rem; }
}
@media print {
  .bar, .samples, .askbox, .histbox, .toasts, .cardrow, .exports, .foot, .lightbox, .aboutbox { display: none !important; }
  body { background: #fff; }
  body.print-hanger main > * { display: none !important; }
  body.print-hanger main > .hangbox { display: block !important; border: 0; box-shadow: none; }
  body.print-hanger .hangbox .ph, body.print-hanger .clean-col, body.print-hanger #cardSource { display: none !important; }
  body.print-hanger .hanger { transform: none; box-shadow: none; border: 1px dashed #999; }
}
