/* Popote — enamelware: cream white, a charcoal rim, a tomato-red tablecloth. */
:root {
  --bg: #f3f0e6; --bg-2: #e9e5d6; --card: #fffdf6; --ink: #2d2723; --text: #2d2723; --soft: #6d645a; --line: #d5d0bd;
  --link: #2c6b4a; --tomato: #cf4a32; --mustard: #d9a11c; --herb: #2f7d4f; --earth: #8a6a4a; --on-ink: #fffdf6;
  --hard: 3px 3px 0 var(--ink);
  --display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a18; --bg-2: #262320; --card: #24211e; --ink: #e9e1d0; --text: #e6dfd0; --soft: #a59d90; --line: #403a34;
    --link: #9fcdb0; --tomato: #ef7f66; --mustard: #e6bd55; --herb: #8ac9a0; --earth: #b79a7c; --on-ink: #1c1a18;
    --hard: 3px 3px 0 #0d0c0b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body { margin: 0; font: 400 1rem/1.5 var(--body); color: var(--text); background: var(--bg); min-height: 100vh; overflow-x: hidden; }
h1, h2, h3, h4, p, ul, ol, dl, dd, dt { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2.5px solid var(--tomato); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--on-ink); padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 0; }
small { font-size: .8rem; color: var(--soft); }
.hint { color: var(--soft); font-size: .88rem; }
.lbl { font: 600 .68rem var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--soft); margin-right: .25rem; }
.gingham { height: 14px; background:
  repeating-linear-gradient(90deg, color-mix(in srgb, var(--tomato) 55%, transparent) 0 14px, transparent 14px 28px),
  repeating-linear-gradient(0deg, color-mix(in srgb, var(--tomato) 55%, transparent) 0 7px, transparent 7px 14px), var(--card); border-bottom: 1.5px solid var(--ink); }

/* ---------- header ---------- */
.top, .tabs, main, footer { max-width: 1280px; margin: 0 auto; padding-left: 1.1rem; padding-right: 1.1rem; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding-top: 1.3rem; padding-bottom: .5rem; }
.brand { display: flex; align-items: center; gap: .8rem; color: var(--ink); }
.brand svg { width: 3.3rem; height: 3.3rem; flex: none; }
.brand h1 { font: 800 clamp(2.2rem, 6vw, 3.3rem)/.9 var(--display); letter-spacing: -.04em; }
.brand p { color: var(--soft); margin-top: .3rem; font-size: .98rem; }
.prefs { display: flex; gap: .45rem .8rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.unit { display: flex; align-items: center; gap: .35rem; font: 500 .7rem var(--mono); color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--card); flex: none; }
.seg button { border: 0; background: none; padding: .42rem .95rem; font-weight: 600; font-size: .92rem; color: var(--soft); white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--on-ink); }
.seg.mini button { padding: .2rem .55rem; font: 500 .74rem var(--mono); text-transform: none; letter-spacing: 0; }
.seg.wide { display: flex; overflow-x: auto; border-radius: 14px; scrollbar-width: none; }
.seg.wide button { flex: 1 0 auto; }
.tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; padding-top: .5rem; padding-bottom: .5rem; background: linear-gradient(var(--bg) 75%, transparent); }
.tabs::-webkit-scrollbar, .seg.wide::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1.5px solid transparent; background: none; padding: .42rem .95rem; border-radius: 99px; font: 700 1rem var(--display); color: var(--soft); white-space: nowrap; }
.tabs button:hover { color: var(--ink); border-color: var(--line); }
.tabs button.on { background: var(--ink); color: var(--on-ink); }
main { padding-top: .4rem; padding-bottom: 3rem; outline: none; display: grid; gap: 1.1rem; }
main > * { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; min-width: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
footer { padding-top: 1rem; padding-bottom: 3rem; color: var(--soft); font-size: .88rem; border-top: 1.5px dashed var(--line); }

/* ---------- common pieces ---------- */
.card { background: var(--card); border: 1.5px solid var(--ink); border-radius: 16px; padding: 1.1rem 1.15rem; box-shadow: var(--hard); display: grid; gap: .75rem; align-content: start; min-width: 0; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
h2 { font: 800 1.45rem/1.1 var(--display); letter-spacing: -.02em; color: var(--ink); }
h3 { font: 700 1.05rem/1.2 var(--display); color: var(--ink); }
h4 { font: 600 .68rem var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--soft); }
.grouptitle { margin-top: .5rem; padding-bottom: .25rem; border-bottom: 1.5px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.chip { border: 1.5px solid var(--line); background: var(--bg); border-radius: 99px; padding: .22rem .7rem; font-size: .9rem; line-height: 1.35; transition: border-color .15s, background .15s; text-align: left; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip.tick.on::before { content: '✓ '; }
.chip.plus { border-style: dashed; border-color: var(--herb); color: var(--herb); font-weight: 600; background: none; }
.chip.classic { border-color: var(--tomato); }
.btn { border: 1.5px solid var(--ink); background: var(--ink); color: var(--on-ink); border-radius: 10px; padding: .4rem .85rem; font-weight: 600; font-size: .92rem; }
.btn.ghost { background: none; color: var(--ink); }
.btn:hover { filter: brightness(1.12); }
.inglink { border: 0; background: none; padding: 0; color: var(--link); font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: 3px; }
.inglink:hover { text-decoration-color: currentColor; }
.inglink.chip { border: 1.5px solid var(--line); background: var(--bg); padding: .22rem .7rem; text-decoration: none; font-weight: 500; color: var(--text); }
.inglink.small { font-size: .85rem; }
.x { border: 0; background: none; color: var(--soft); font-size: 1.2rem; line-height: 1; padding: .15rem .4rem; border-radius: 6px; }
.x:hover { color: var(--tomato); background: var(--bg-2); }
.tag { font: 600 .66rem var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--line); border-radius: 5px; padding: .08rem .35rem; color: var(--soft); white-space: nowrap; }
.tag.need { color: var(--tomato); border-color: var(--tomato); }
.tag.ok { color: var(--herb); border-color: var(--herb); }
input[type=search], input[type=text], input[type=number], select { border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: .4rem .65rem; min-width: 0; }
input:hover, select:hover { border-color: var(--soft); }
input[type=search] { width: 100%; max-width: 26rem; }
.field { display: grid; gap: .2rem; }
.field > span:first-child { font: 600 .68rem var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--soft); }
.field.inline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.field input[type=number] { width: 5.5rem; font-family: var(--mono); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.2rem 1.6rem; }
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.2rem 1.6rem; align-items: start; }
.cols > *, .cols3 > *, section { display: grid; gap: .55rem; align-content: start; min-width: 0; }
.tblwrap { overflow-x: auto; }
.tbl th, .tbl td, .nutri th, .nutri td { text-align: left; padding: .35rem .5rem .35rem 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
.tbl th { font-weight: 600; }
.tbl thead th, .nutri thead th { font: 600 .66rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.tbl td { font-family: var(--mono); font-size: .86rem; white-space: nowrap; }
.tbl td.note, .tbl .note { font-family: var(--body); white-space: normal; color: var(--soft); font-size: .86rem; min-width: 14rem; }
.tbl small.note { display: block; min-width: 0; font-weight: 400; }
.tbl caption { text-align: left; font: 700 1rem var(--display); color: var(--ink); padding-bottom: .3rem; }
.nutri td { font-family: var(--mono); font-size: .86rem; text-align: right; padding-right: 0; white-space: nowrap; }
.nutri thead th:not(:first-child) { text-align: right; }
.nutri tbody th { font-weight: 500; }
.bars { display: grid; gap: .32rem; }
.bars li { display: grid; grid-template-columns: 4.6rem 1fr; align-items: center; gap: .5rem; font-size: .86rem; }
.bars i { height: .7rem; border-radius: 99px; background: var(--bg-2); overflow: hidden; display: block; }
.bars b { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--ink)); transition: width .35s; }
.t-sweet { --c: #d9739c; } .t-salty { --c: #8c9aa3; } .t-sour { --c: #a9b324; } .t-bitter { --c: #557a5a; } .t-umami { --c: #a2623f; } .t-fat { --c: var(--mustard); } .t-heat { --c: var(--tomato); }
.plainsteps { list-style: decimal; padding-left: 1.3rem; display: grid; gap: .4rem; }
.plainsteps li::marker { font: 600 .85rem var(--mono); color: var(--tomato); }
.bul { list-style: disc; padding-left: 1.2rem; display: grid; gap: .3rem; }
.fixes { display: grid; grid-template-columns: minmax(8rem, 15rem) 1fr; gap: .5rem 1.2rem; }
.fixes dt { font-weight: 700; color: var(--ink); }
.fixes dd { padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.until { background: color-mix(in srgb, var(--herb) 11%, transparent); border-left: 3px solid var(--herb); padding: .4rem .65rem; border-radius: 0 8px 8px 0; font-size: .94rem; }
.times { display: flex; gap: .3rem 1.2rem; flex-wrap: wrap; font-size: .9rem; color: var(--soft); }
.times b { font-family: var(--mono); color: var(--text); }
.dur { font: 500 .74rem var(--mono); color: var(--soft); white-space: nowrap; }
details > summary { cursor: pointer; }

/* ---------- build: picker ---------- */
.dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .5rem; }
.dish { text-align: left; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: .55rem .7rem; display: grid; gap: .1rem; align-content: start; transition: transform .15s, border-color .15s; }
.dish b { font: 700 1rem var(--display); color: var(--ink); }
.dish small { line-height: 1.3; }
.dish:hover { border-color: var(--ink); transform: translateY(-2px); }
.dish.on { background: var(--ink); border-color: var(--ink); }
.dish.on b, .dish.on small { color: var(--on-ink); }
.presets { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding-top: .6rem; border-top: 1.5px dashed var(--line); }
.haverow { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.havegroups { display: grid; gap: .35rem; }
.havegroups summary { font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--soft); padding: .25rem 0; }
.havegroups .chips { padding: .3rem 0 .5rem; }
.fits { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .6rem; }
.fit { border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem; display: grid; gap: .4rem; align-content: start; font-size: .9rem; background: var(--bg); }
.fithead { display: grid; }
.fithead b { font: 700 1rem var(--display); color: var(--ink); }
.fit .btn { justify-self: start; margin-top: .2rem; }
.meter { height: .5rem; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--herb); border-radius: 99px; }

/* ---------- build: bench ---------- */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.1rem; align-items: start; }
.slots { display: grid; gap: .7rem; min-width: 0; }
.benchhead { padding: 0 .2rem; }
.slot { background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; padding: .8rem .95rem; gap: .5rem; }
.slot header { display: flex; gap: .2rem .8rem; align-items: baseline; flex-wrap: wrap; }
.slot header p { color: var(--soft); font-size: .86rem; }
.items { display: grid; gap: .15rem; }
.items li { display: grid; grid-template-columns: minmax(7rem, 1.4fr) auto minmax(0, 1fr) auto auto; gap: .2rem .6rem; align-items: center; padding: .22rem 0; border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; gap: .25rem; font: 500 .82rem var(--mono); color: var(--soft); }
.qty input { width: 4.6rem; padding: .22rem .4rem; font: 500 .92rem var(--mono); text-align: right; color: var(--text); }
.alt, .kc { font: 400 .78rem var(--mono); color: var(--soft); }
.kc { text-align: right; white-space: nowrap; }
.none { font-style: italic; }
.sug { display: flex; flex-wrap: wrap; gap: .35rem; align-items: stretch; }
.sug .lbl { align-self: center; width: 100%; }
.add { border: 1.5px dashed var(--line); background: none; border-radius: 10px; padding: .25rem .6rem; text-align: left; display: grid; align-content: center; max-width: 15rem; transition: border-color .15s, background .15s; }
.add b { font-weight: 600; font-size: .9rem; color: var(--herb); }
.add small { font-size: .72rem; line-height: 1.25; }
.add:hover { border-color: var(--herb); border-style: solid; background: color-mix(in srgb, var(--herb) 8%, transparent); }
.sug select { max-width: 11rem; font-size: .88rem; color: var(--soft); }
.side { display: grid; gap: .8rem; position: sticky; top: 3.6rem; max-height: calc(100vh - 4.2rem); overflow-y: auto; padding: 0 4px 6px 0; scrollbar-width: thin; }
.side .card { padding: .9rem 1rem; }
.ticket input[type=text] { width: 100%; font: 700 1.1rem var(--display); }
.stepper { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: var(--bg-2); width: 2rem; font-weight: 700; }
.stepper input { border: 0; border-radius: 0; width: 3.2rem !important; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.saved ul { display: grid; gap: .25rem; padding-top: .4rem; }
.saved li { display: grid; grid-template-columns: 1fr auto auto; gap: .4rem; align-items: center; font-size: .92rem; }
.saved .btn { padding: .15rem .55rem; font-size: .82rem; }
.plate { font-size: .9rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.dot { width: .9rem; height: .9rem; border-radius: 50%; display: inline-block; border: 1.5px solid var(--ink); }
.tip { display: grid; gap: .25rem; padding: .5rem .65rem; border-left: 3px solid var(--mustard); background: color-mix(in srgb, var(--mustard) 11%, transparent); border-radius: 0 8px 8px 0; font-size: .9rem; }
.tip b { color: var(--ink); }
.kcal { font-size: .9rem; color: var(--soft); }
.kcal b { font: 800 2.2rem/1 var(--display); color: var(--ink); letter-spacing: -.03em; }
.split { display: flex; height: .8rem; border-radius: 99px; overflow: hidden; border: 1.5px solid var(--ink); }
.split b { display: block; height: 100%; }
.split .s-p { background: var(--tomato); } .split .s-c { background: var(--mustard); } .split .s-f { background: var(--earth); }
.splitkey { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font: 500 .72rem var(--mono); color: var(--soft); }
.splitkey span::before { content: ''; display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; margin-right: .3rem; }
.splitkey .s-p::before { background: var(--tomato); } .splitkey .s-c::before { background: var(--mustard); } .splitkey .s-f::before { background: var(--earth); }

/* ---------- method ---------- */
.steps { display: grid; gap: .6rem; counter-reset: s; }
.step { border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .85rem; display: grid; gap: .45rem; background: var(--bg); }
.step header { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.step h3 { flex: 1; min-width: 8rem; }
.check { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); font: 600 .85rem var(--mono); color: var(--ink); flex: none; }
.step.done { opacity: .55; }
.step.done .check { background: var(--herb); border-color: var(--herb); color: #fff; }
.step.done h3 { text-decoration: line-through; }
.todo { display: grid; gap: .3rem; padding-left: 1.1rem; list-style: square; }
.todo li::marker { color: var(--tomato); }
.more summary, .printlist summary, .saved summary { font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.more p { padding-top: .3rem; font-size: .92rem; color: var(--soft); }
.printlist ul { columns: 2 14rem; padding-top: .4rem; font-size: .94rem; }
.printlist b { font: 500 .88rem var(--mono); }

/* ---------- pairings ---------- */
.pairsel { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chosen { display: inline-flex; align-items: center; gap: .2rem; background: var(--ink); color: var(--on-ink); border-radius: 12px; padding: .35rem .4rem .35rem .85rem; font: 700 1.1rem var(--display); }
.chosen .x { color: var(--on-ink); }
.pairsel .plus { font: 800 1.3rem var(--display); color: var(--tomato); font-style: normal; }
.pairsel input { flex: 1 1 12rem; }
.legend, .pagelinks { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; font-size: .86rem; color: var(--soft); }
.pd { display: inline-block; width: .62rem; height: .62rem; border-radius: 50%; border: 1.5px solid var(--soft); vertical-align: middle; }
.pd1 { background: var(--mustard); border-color: var(--mustard); }
.pd2 { background: var(--tomato); border-color: var(--tomato); }
.pds { display: inline-flex; gap: 2px; margin-right: .35rem; }
.chip.pair { display: inline-flex; align-items: center; }
.pgroup { display: grid; grid-template-columns: 9.5rem 1fr; gap: .4rem .8rem; align-items: start; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.pgroup h4 { padding-top: .4rem; }
.bases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .7rem; }
.base { border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem; display: grid; gap: .4rem; align-content: start; background: var(--bg); font-size: .92rem; }

/* ---------- ingredients ---------- */
.lib { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.liblist { position: sticky; top: 3.6rem; max-height: calc(100vh - 4.6rem); grid-template-rows: auto auto auto 1fr; }
.libscroll { overflow-y: auto; display: grid; gap: .3rem; scrollbar-width: thin; min-height: 8rem; }
.libscroll h4 { padding-top: .5rem; }
.libscroll button { width: 100%; border: 0; background: none; text-align: left; padding: .22rem .5rem; border-radius: 8px; display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.libscroll button:hover { background: var(--bg-2); }
.libscroll button.on { background: var(--ink); color: var(--on-ink); }
.libscroll button.on small { color: var(--on-ink); }
.libscroll small { font: 400 .72rem var(--mono); white-space: nowrap; }
.cats .chip { font-size: .78rem; padding: .12rem .5rem; }
.ingdetail header, .stapledetail header { display: grid; gap: .35rem; }
.ingdetail header h2, .stapledetail header h2 { font-size: 2rem; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; max-width: 26rem; }
.months i { font: 500 .72rem var(--mono); font-style: normal; text-align: center; padding: .25rem 0; border-radius: 5px; background: var(--bg-2); color: var(--soft); }
.months i.in { background: var(--herb); color: #fff; }
.months i.now { outline: 2px solid var(--tomato); outline-offset: 1px; }

/* ---------- staples, techniques, reference ---------- */
.staples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .5rem; }
.staple { text-align: left; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: .6rem .75rem; display: grid; gap: .15rem; align-content: start; transition: transform .15s, border-color .15s; }
.staple b { font: 700 1rem var(--display); color: var(--ink); }
.staple small { line-height: 1.3; }
.staple:hover { border-color: var(--ink); transform: translateY(-2px); }
.backbtn { justify-self: start; }
.ratio { font: 500 1rem var(--mono); background: var(--bg-2); padding: .5rem .7rem; border-radius: 10px; }
.scale, .opt { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.ilist { display: grid; gap: .1rem; }
.ilist li { padding: .28rem 0; border-bottom: 1px solid var(--line); }
.ilist b { font: 600 .92rem var(--mono); display: inline-block; min-width: 5.2rem; }
.family { font-size: .92rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; }
.techs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: .5rem; align-items: start; }
.tech { border: 1.5px solid var(--line); border-radius: 12px; padding: .55rem .8rem; background: var(--bg); }
.tech[open] { grid-column: 1 / -1; border-color: var(--ink); display: grid; gap: .55rem; }
.tech summary { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.tech summary b { font: 700 1rem var(--display); color: var(--ink); }
.myth { font-size: .92rem; color: var(--soft); }
.timegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0 1.2rem; }
.timegrid > div { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: baseline; padding: .28rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.timegrid b, .timegrid small { font: 500 .82rem var(--mono); }
.donegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); gap: 1.2rem 1.6rem; align-items: start; }
.done td { white-space: normal; font-family: var(--body); color: var(--soft); }
.done td.deg { font: 600 .92rem var(--mono); white-space: nowrap; color: var(--text); }
.done tr.safe td.deg { color: var(--herb); }
.shield { color: var(--herb); }
.conv { display: grid; gap: .6rem; padding-bottom: .6rem; }
.convgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .4rem; }
.convgrid div { border: 1.5px solid var(--line); border-radius: 10px; padding: .35rem .55rem; display: grid; background: var(--bg); }
.convgrid small { font: 500 .7rem var(--mono); }
.convgrid b { font: 600 1.05rem var(--mono); }
.refpane { display: grid; gap: .8rem; }
.subs th { min-width: 9rem; }
.subs td { white-space: normal; font-family: var(--body); font-size: .92rem; min-width: 12rem; }

#toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 2rem); background: var(--ink); color: var(--on-ink); padding: .6rem 1rem; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; z-index: 60; font-weight: 600; overflow-wrap: anywhere; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- narrow screens ---------- */
@media (max-width: 980px) {
  .bench, .lib { grid-template-columns: minmax(0, 1fr); }
  .side, .liblist { position: static; max-height: none; overflow: visible; padding: 0; }
  .libscroll { max-height: 15rem; }
}
@media (max-width: 620px) {
  .top, .tabs, main, footer { padding-left: 1rem; padding-right: 1rem; }
  .card { padding: .9rem; box-shadow: 2px 2px 0 var(--ink); }
  .items li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .items .alt { grid-column: 1 / 2; grid-row: 2; }
  .items .kc { grid-column: 2 / 4; grid-row: 2; }
  .fixes, .pgroup { grid-template-columns: 1fr; gap: .15rem; }
  .fixes dd { padding-bottom: .6rem; }
  .pgroup h4 { padding-top: .2rem; }
  .add { max-width: 100%; }
  .prefs { justify-content: flex-start; }
}

@media print {
  :root { --bg: #fff; --card: #fff; --ink: #000; --text: #000; --soft: #444; --line: #bbb; --hard: none; }
  .gingham, .tabs, .prefs, footer, .pick, .side .actions, .saved, .sug, .x, .check, #toast, .side > .card:last-child, .backbtn, .scale .chip { display: none !important; }
  .bench { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; overflow: visible; }
  .card, .slot, .step { box-shadow: none; break-inside: avoid; }
  details.more > *, details.printlist > * { display: block; }
  .qty input { border: 0; background: none; }
}
