:root {
  --bg: #fbf8f3;
  --panel: #ffffff;
  --ink: #2b2520;
  --muted: #6b6159;
  --line: #e3dbcf;
  --accent: #8c2f1b;
  --accent-ink: #ffffff;
  --soft: #f4ece1;
  --warn-bg: #fdecea;
  --warn-ink: #8c1c13;
  --ok-bg: #e9f3e6;
  --ok-ink: #2d5a27;
  --oven: #f3d9b8;
  --oven2: #e9c46a;
  --stove: #cfe3c8;
  --maybe: #a86b00;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; margin-top: 1rem; }
h4 { font-size: 1rem; }
a { color: var(--accent); }
p { margin: 0 0 .6rem; }
.small { font-size: .85rem; color: var(--muted); }
.help { font-size: .9rem; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

header.site { padding: 1.5rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.lede { color: var(--muted); }
.filebar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
#file-msg { font-size: .9rem; color: var(--muted); }

button, .button {
  font: inherit; font-size: .95rem; padding: .45rem .9rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); display: inline-block;
}
button:hover, .button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.quiet { background: transparent; color: var(--muted); }
button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input, select {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: .35rem .5rem; max-width: 100%;
}
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); vertical-align: -2px; }

.step, .printbar {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem 1.1rem; margin-bottom: 1rem;
}
.step h2 .n {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: .9rem; margin-right: .35rem; vertical-align: 2px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem 1rem; }
.grid label { display: flex; flex-direction: column; font-size: .9rem; color: var(--muted); gap: .2rem; }
.grid label input, .grid label select { color: var(--ink); }
fieldset.turkey { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1rem; padding: .6rem .9rem .9rem; }
fieldset.turkey legend { font-weight: 600; padding: 0 .3rem; }

.need-group { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .6rem; }
.need-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.need-head .count { width: 4.5rem; }
.needs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .15rem .8rem; }
.need { font-size: .92rem; }

.course h3 { border-bottom: 1px solid var(--line); padding-bottom: .2rem; }
.dish {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .8rem;
  padding: .45rem 0; border-bottom: 1px dashed var(--line);
}
.dish .pick { font-weight: 600; }
.dish .role { font-size: .75rem; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; margin-left: .4rem; }
.dish .tags { justify-self: end; }
.dish .info { font-size: .88rem; color: var(--muted); }
.dish .by { justify-self: end; font-size: .85rem; color: var(--muted); }
.dish .by input { width: 9rem; padding: .2rem .4rem; font-size: .9rem; }
.dish .note, .dish .warn, .dish .method { grid-column: 1 / -1; font-size: .85rem; }
.dish .method { color: var(--muted); }
.dish .method select { font-size: .9rem; max-width: 100%; }
.card .tsteps { padding-left: 1.3rem; }
.dish .note { color: var(--muted); }
.dish .warn:empty { display: none; }
.dish .warn { color: var(--warn-ink); }
.dish .warn .notmade { color: var(--muted); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: 0 .35rem; margin: 0 .15rem .1rem 0;
  border-radius: 4px; background: var(--soft); border: 1px solid var(--line); white-space: nowrap;
}
.tag.maybe { color: var(--maybe); }

.issues { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: .6rem 1rem .6rem 2rem; }
.ok { background: var(--ok-bg); color: var(--ok-ink); border-radius: 8px; padding: .6rem 1rem; }
.coverage { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .6rem; margin-top: .8rem; }
.cov { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; font-size: .92rem; }

.printbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.printbar h2 { margin: 0; }
.print-opts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.printbar .help { flex-basis: 100%; margin: 0; }

.out { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-weight: 700; padding: .8rem 0 .3rem; }
th, td { text-align: left; vertical-align: top; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.box, th.box { width: 1.6rem; color: var(--muted); }
.facts th { width: 40%; font-weight: 600; color: var(--muted); }
.shop .check { font-size: .82rem; color: var(--maybe); }
.tl td.time { width: 6.5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl tr.k-oven td { background: color-mix(in srgb, var(--oven) 45%, transparent); }
.tl tr.k-stove td { background: color-mix(in srgb, var(--stove) 45%, transparent); }
.tl tr.k-serve td { font-weight: 700; }

.gridwrap { overflow-x: auto; margin-bottom: 1rem; }
.sched { table-layout: fixed; font-size: .72rem; min-width: 640px; }
.sched th, .sched td { padding: 1px; border: 1px solid var(--line); text-align: center; }
.sched .dishcol { width: 11rem; text-align: left; padding: 1px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched .u { width: 3.2rem; }
.sched th.slot { font-weight: 400; color: var(--muted); white-space: nowrap; overflow: visible; text-align: left; }
.sched td.on { background: var(--oven); }
.sched td.on.o2 { background: var(--oven2); }
.sched .used td { color: var(--muted); }
.sched td.over { background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; }
.gridwrap.stove .sched td.on { background: var(--stove); }

.card { border-top: 2px solid var(--accent); padding-top: .6rem; margin-top: 1.2rem; }
.card h3 { margin-top: 0; font-size: 1.2rem; }
.card .when { font-size: .92rem; }
.card .ings { width: auto; min-width: 60%; margin-bottom: .6rem; }
.card .ings td { padding: .15rem .5rem .15rem 0; }
.card .safety { background: var(--warn-bg); color: var(--warn-ink); padding: .4rem .6rem; border-radius: 6px; font-size: .9rem; margin-bottom: .6rem; }
.card .notes { font-size: .9rem; padding-left: 1.2rem; }
.src .url { display: none; }

footer.site { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1rem 0 2rem; font-size: .85rem; color: var(--muted); }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .dish { grid-template-columns: 1fr; }
  .dish .tags, .dish .by { justify-self: start; }
  .facts th { width: auto; }
}

@media print {
  :root { --bg: #fff; --panel: #fff; --ink: #000; --muted: #333; --line: #999; --soft: #fff;
    --warn-bg: #fff; --warn-ink: #000; --oven: #bbb; --oven2: #888; --stove: #ccc; --maybe: #000; }
  @page { size: letter; margin: 0.5in; }
  body { font-size: 10.5pt; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header.site, footer.site, #inputs, #s-check, .printbar { display: none; }
  .wrap { max-width: none; padding: 0; }
  .out { border: 0; padding: 0; margin: 0; break-after: page; }
  .out.noprint { display: none; }
  @page wide { size: letter landscape; margin: 0.4in; }
  #out-schedule { page: wide; }
  .shop .usedin { display: none; }
  .shop td, .shop th { padding: 2px 4px; }
  .tl tr:last-child { break-before: avoid; }
  .out:last-child { break-after: auto; }
  tr, .cov, .card .ings, .card .safety { break-inside: avoid; }
  .card h3, .card .meta, .card .when { break-after: avoid; }
  caption { break-after: avoid; }
  h2, h3 { break-after: avoid; }
  .gridwrap { overflow: visible; }
  .sched { min-width: 0; font-size: 7.5pt; }
  .sched td, .sched th { height: 14pt; }
  .sched .dishcol { width: 1.6in; }
  .sched td.on { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tl tr td { background: none !important; }
  a { color: #000; text-decoration: none; }
  .src .url { display: inline; font-size: 8pt; }
  .issues, .safety { border: 1px solid #000; }
}
