/* Room in the Tank - a fish-shop look: deep teal rim, sand gravel, coral price stickers, goldfish orange. */
:root {
  --bg: #f3efe4; --paper: #fbf8f0; --card: #ffffff; --ink: #1f2a2c; --muted: #52646a; --line: #d5d9cf; --rim: #24464c; --rim-ink: #eef7f6;
  --teal: #1f6670; --teal-soft: #dcefee; --coral: #b8432c; --coral-soft: #fbe5de; --gold: #8a4a03; --gold-soft: #fcebd3; --sand: #e9dcc0;
  --accent: #1f6670; --accent-ink: #ffffff; --focus: #c26a1a;
  --v-overstocked: #a8231c; --v-no_room: #a8461a; --v-murky: #6b5c16; --v-snug: #1f6670; --v-room: #22693f;
  --b-overstocked: #fbe1df; --b-no_room: #fbe6d8; --b-murky: #f1ecd0; --b-snug: #dcefee; --b-room: #dcf0e2;
  --f-lifts: #8a4a03; --f-even: #275f8a; --f-drains: #4b5759; --fb-lifts: #fcebd3; --fb-even: #dde9f5; --fb-drains: #e5e8e8;
  --ok: #22693f; --warn: #a8461a; --shadow: 0 1px 0 rgba(20, 50, 55, .06), 0 6px 18px rgba(20, 50, 55, .08);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --round: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #0f1719; --paper: #152023; --card: #192629; --ink: #e4efee; --muted: #a2b7ba; --line: #2c3d40; --rim: #10282c; --rim-ink: #dff0ee;
  --teal: #7fc7cf; --teal-soft: #173538; --coral: #ff9a84; --coral-soft: #3a211b; --gold: #f4b25c; --gold-soft: #3a2a14; --sand: #3a3322;
  --accent: #7fc7cf; --accent-ink: #0d1c1f; --focus: #f4b25c;
  --v-overstocked: #ff8f86; --v-no_room: #ffab7a; --v-murky: #e2cf73; --v-snug: #7fc7cf; --v-room: #8fdcaa;
  --b-overstocked: #3d1b19; --b-no_room: #3c2416; --b-murky: #34301a; --b-snug: #173538; --b-room: #183526;
  --f-lifts: #f4b25c; --f-even: #8cc0ea; --f-drains: #b5c0c2; --fb-lifts: #3a2a14; --fb-even: #182c3d; --fb-drains: #263133;
  --ok: #8fdcaa; --warn: #ffab7a; --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
}
* { 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(--teal); }
.hidden { display: none !important; }
.small { font-size: .9rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Header: the tank's rim. */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--rim); color: var(--rim-ink); border-bottom: 4px solid #c9b48e; }
.back { color: var(--rim-ink); text-decoration: none; font-size: .95rem; white-space: nowrap; opacity: .9; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--round); font-weight: 700; min-width: 0; }
.brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 26px; height: 26px; flex: none; }
.logo .lg-t { fill: #7fbcc0; stroke: #eef7f6; stroke-width: 1.4; }
.logo .lg-f { fill: #e58a1f; }
.logo .lg-b { fill: none; stroke: #eef7f6; stroke-width: 1; }
.session { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bar .pill { color: var(--rim-ink); border-color: rgba(223, 240, 238, .45); background: transparent; }
.bar .pill.solid { background: #f4b25c; border-color: #f4b25c; color: #1b1205; }
.bar .pill.ghost { border-style: dashed; }

/* Buttons and chips. */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; font-size: .95rem; line-height: 1.2; }
.pill:hover:not(:disabled) { border-color: var(--teal); }
.pill.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.big { min-height: 46px; padding: 10px 22px; font-size: 1.05rem; }
.pill.tiny { min-height: 30px; padding: 4px 11px; font-size: .85rem; }
.pill:disabled { opacity: .5; cursor: not-allowed; }
.chip { border: 1.5px dashed var(--teal); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .9rem; }
.chip.on { border-style: solid; background: var(--teal-soft); font-weight: 600; }

main { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
.hero { padding: 28px 0 8px; }
.kicker { margin: 0 0 6px; font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--coral); }
h1 { margin: 0; font-family: var(--round); font-size: clamp(2rem, 6vw, 3rem); line-height: 1.08; color: var(--teal); }
.h1b { display: block; margin-top: 6px; font-size: clamp(1.05rem, 3.2vw, 1.35rem); font-weight: 400; color: var(--muted); }
.lede { max-width: 62ch; font-size: 1.05rem; }
.samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

/* Panels. */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 16px 0; box-shadow: var(--shadow); }
.ph { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font-family: var(--round); font-size: 1.3rem; }
.step-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-family: var(--mono); font-size: .9rem; border: 2px solid var(--teal); }
.free { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: var(--b-room); color: var(--v-room); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.lab { font-size: .88rem; font-weight: 600; color: var(--muted); }
.lenshint { font-weight: 400; font-style: italic; }
.inp { width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--paper); color: var(--ink); min-height: 40px; }
.cardrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.note { padding: 8px 10px; border-left: 3px solid var(--coral); background: var(--coral-soft); border-radius: 4px; }
.hint { color: var(--ink); }

/* Commitment rows: each a little fish-shop card with a fin-coloured edge. */
.cs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.crow { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; background: var(--paper); }
.crow.f-lifts { border-left-color: var(--f-lifts); } .crow.f-even { border-left-color: var(--f-even); } .crow.f-drains { border-left-color: var(--f-drains); }
.cno { font-family: var(--mono); font-weight: 700; padding-top: 28px; }
.cgrid { display: grid; grid-template-columns: 1fr 92px 130px 80px; gap: 10px; min-width: 0; align-items: end; }
.cbtns { display: flex; flex-direction: column; gap: 4px; padding-top: 22px; }
.ib { width: 34px; min-height: 30px; padding: 0; }
.fixedfld { flex-direction: row; align-items: center; gap: 6px; min-height: 40px; }
.fixedfld input { width: 18px; height: 18px; }

/* The tank and the call. */
.board { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.board svg { display: block; width: 100%; height: auto; }
.verdictline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.callchip { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .88rem; font-weight: 700; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); white-space: nowrap; }
.callchip.sm { font-size: .8rem; padding: 2px 8px; font-weight: 600; }
.callchip.v-overstocked { background: var(--b-overstocked); border-color: var(--v-overstocked); color: var(--v-overstocked); }
.callchip.v-no_room { background: var(--b-no_room); border-color: var(--v-no_room); color: var(--v-no_room); }
.callchip.v-murky { background: var(--b-murky); border-color: var(--v-murky); color: var(--v-murky); }
.callchip.v-snug { background: var(--b-snug); border-color: var(--v-snug); color: var(--v-snug); }
.callchip.v-room { background: var(--b-room); border-color: var(--v-room); color: var(--v-room); }
.callchip.f-lifts { background: var(--fb-lifts); border-color: var(--f-lifts); color: var(--f-lifts); }
.callchip.f-even { background: var(--fb-even); border-color: var(--f-even); color: var(--f-even); }
.callchip.f-drains { background: var(--fb-drains); border-color: var(--f-drains); color: var(--f-drains); }
.sums { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.sums li { padding: 8px 10px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.sums b { display: block; font-family: var(--mono); font-size: 1.15rem; }
.sums span { font-size: .85rem; color: var(--muted); }

/* Run box and progress. */
.runrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.gate { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--gold-soft); }
.steps { list-style: none; padding: 0; margin: 8px 0; }
.step { padding: 3px 0; color: var(--muted); font-family: var(--mono); font-size: .9rem; }
.step.active { color: var(--ink); font-weight: 700; }
.step.done { color: var(--ok); }
.step-ic { display: inline-block; width: 1.2em; }
.raw { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .85rem; background: var(--paper); padding: 10px; border-radius: 6px; }

/* The notes. */
.res-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-kick { margin: 0; color: var(--muted); }
.badge { font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); }
.badge.on.v-overstocked { border-color: var(--v-overstocked); color: var(--v-overstocked); background: var(--b-overstocked); }
.badge.on.v-no_room { border-color: var(--v-no_room); color: var(--v-no_room); background: var(--b-no_room); }
.badge.on.v-murky { border-color: var(--v-murky); color: var(--v-murky); background: var(--b-murky); }
.badge.on.v-snug { border-color: var(--v-snug); color: var(--v-snug); background: var(--b-snug); }
.badge.on.v-room { border-color: var(--v-room); color: var(--v-room); background: var(--b-room); }
.headline { font-family: var(--round); font-size: 1.25rem; margin: 12px 0; }
.notes { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.fishnote { border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.fishnote.f-lifts { border-left-color: var(--f-lifts); } .fishnote.f-even { border-left-color: var(--f-even); } .fishnote.f-drains { border-left-color: var(--f-drains); }
.fishnote.re { box-shadow: inset 0 0 0 2px var(--coral); }
.fishnote p { margin: 6px 0 0; }
.notes .none { color: var(--muted); font-style: italic; }
.fn-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.fn-name { flex: 1 1 200px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.fn-hrs { font-family: var(--mono); font-size: .88rem; color: var(--muted); }
.aside { margin: 14px 0; padding: 10px 12px; border-radius: 10px; background: var(--teal-soft); }
.aside.rehome { background: var(--coral-soft); }
.aside.smaller { background: var(--gold-soft); }
.aside p { margin: 2px 0; }
.ticket { margin: 14px 0; padding: 12px 14px; border: 2px dashed var(--teal); border-radius: 12px; background: var(--paper); }
.tk-h { margin: 0; font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.tk-b { margin: 4px 0 0; font-family: var(--round); font-size: 1.1rem; }
.recon { padding-left: 20px; }
.recon li.warn { color: var(--warn); }
.recon li.info { color: var(--muted); }
.recon li.none { color: var(--ok); list-style: none; margin-left: -20px; }
.exports { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.saved { list-style: none; padding: 0; margin: 10px 0 0; }
.hrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hrow.none { color: var(--muted); font-style: italic; border-top: 0; }
.hinfo { display: flex; flex-direction: column; min-width: 0; }
.hbtns { display: flex; gap: 6px; }
.aboutbox p { max-width: 75ch; }
.foot { max-width: 980px; margin: 0 auto; padding: 8px 16px 40px; color: var(--muted); font-size: .9rem; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; width: min(92vw, 460px); }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--rim); color: var(--rim-ink); box-shadow: var(--shadow); transition: opacity .5s; }
.toast.err { background: #7a1f1f; color: #fff4f0; }
.toast a { color: inherit; font-weight: 700; }
.toast.gone { opacity: 0; }

@media (max-width: 760px) {
  .cgrid { grid-template-columns: 1fr 1fr; }
  .cgrid .wide { grid-column: 1 / -1; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 .fld:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .crow { grid-template-columns: 1fr auto; }
  .cno { grid-column: 1 / -1; padding-top: 0; }
  .cbtns { padding-top: 0; }
  .back-t { display: none; }
  .bar { padding: 8px 10px; gap: 8px; }
  .brand strong { font-size: .92rem; }
  .bar .pill { min-height: 32px; padding: 4px 9px; font-size: .85rem; }
  .panel { padding: 14px; }
}
@media print {
  .bar, .askbox, .histbox, .exports, .samples, .cardrow, .cbtns, .toasts, #gate, #gateAct { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border-color: #bbb; }
}
