:root {
  color: #222d25;
  background: #faf8f1;
  font: 100% / 1.55 system-ui, -apple-system, sans-serif;
  --ink: #222d25;
  --muted: #4b584c;
  --green: #254b35;
  --soft-green: #eaf1e5;
  --border: #c7cec2;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }
main { padding-bottom: 44px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.028em; }
h1 { font-family: Georgia, serif; font-size: clamp(2.35rem, 5.5vw, 4.25rem); color: #243c29; }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.62rem); }
h3 { font-size: 1.11rem; }
a { color: var(--green); text-underline-offset: .17em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 200; top: 10px; left: 10px; padding: 10px 14px; background: white; transform: translateY(calc(-100% - 15px)); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid #2867d8; outline-offset: 3px; }
#workspace, #card-output { scroll-margin-top: 108px; }
.breadcrumb { display: flex; gap: 9px; align-items: baseline; margin-block: 20px 12px; font-size: .92rem; }
.intro { margin-bottom: 20px; }
.intro > p { max-width: 62ch; margin-top: 10px; }
.trust, .notice { padding: 10px 14px; border-radius: 8px; background: var(--soft-green); font-size: .95rem; }

.toolbar, .actions, .pager { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.toolbar { padding-block: 0 14px; }
.toolbar a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 6px; font-weight: 670; }
.toolbar [role="status"] { flex: 1 1 260px; min-width: 0; }
button, select, input, textarea { font: inherit; color: inherit; }
button { min-height: 44px; padding: 8px 13px; border: 1px solid #859681; border-radius: 8px; background: white; font-weight: 670; cursor: pointer; }
button:hover:not(:disabled) { background: #edf4e9; }
button:disabled { color: #556052; opacity: .63; cursor: default; }
button.primary, button[aria-pressed="true"] { color: #fff; background: var(--green); border-color: var(--green); }
button.primary:hover:not(:disabled), button[aria-pressed="true"]:hover { background: #386045; }
input, select, textarea { display: block; min-height: 44px; min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid #899886; border-radius: 8px; background: #fff; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 35px; background: linear-gradient(45deg, transparent 50%, #516152 50%) calc(100% - 17px) 52% / 6px 6px no-repeat, linear-gradient(135deg, #516152 50%, transparent 50%) calc(100% - 11px) 52% / 6px 6px no-repeat, #fff; }
label, summary { font-weight: 660; }
label > input:not([type="checkbox"]), label > textarea { margin-top: 5px; }
label > input[type="checkbox"] { appearance: auto; display: inline-block; width: 22px; height: 22px; min-height: auto; padding: 0; accent-color: var(--green); }
summary { cursor: pointer; padding-block: 8px; }
.hint { color: var(--muted); font-size: .92rem; }
[role="status"] { color: var(--muted); font-size: .94rem; }
[role="status"]:empty { display: none; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel, .local-controls { min-width: 0; padding: clamp(15px, 2.4vw, 24px); border: 1px solid var(--border); border-radius: 14px; background: white; }
.panel > h2 { margin-bottom: 12px; }
.paste-box { margin-bottom: 16px; padding: 4px 13px 13px; border: 1px solid var(--border); border-radius: 10px; background: #f3f6ef; }
.paste-box:not([open]) { padding-bottom: 4px; }
.paste-box label, .output > label { display: block; margin-bottom: 5px; }
.paste-box .hint, .output .hint, .cook-sidebar .hint { margin-block: 8px; }
.fields.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; }
.list-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; }
.recipe-list, .notes { margin-top: 15px; }
.notes { display: block; }
.edit-list, .timer-list, .checklist { padding: 0; margin-block: 8px 0; list-style: none; }
.edit-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fdfefc; }
.edit-row + .edit-row { margin-top: 7px; }
.edit-row textarea { margin-block: 4px 0; }
.row-tools summary { width: fit-content; min-height: 44px; color: var(--green); font-size: .9rem; }
.row-tools button { font-size: .9rem; }
.editor-tools { margin-top: 12px; }

.output { align-self: start; }
.paper-preview { min-height: 110px; margin-block: 12px; padding: 15px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: #edf1eb; }
.paper-preview svg { width: min(100%, 380px); height: auto; box-shadow: 0 1px 6px #28382b33; }
.pager { justify-content: space-between; }
.pager span { font-size: .9rem; color: var(--muted); text-align: center; }
.output-actions { margin-top: 12px; }
#output-status { margin-top: 8px; }

.cook-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cook-step { min-height: 270px; display: flex; flex-direction: column; gap: 10px; }
.cook-step > h2 { margin: 0; overflow-wrap: anywhere; }
.step-count { color: #365943; font-weight: 700; }
#step-text { font-size: clamp(1.4rem, 3vw, 2.13rem); line-height: 1.43; white-space: pre-wrap; overflow-wrap: anywhere; scroll-margin-top: 100px; }
#step-timers:empty { display: none; }
.step-pager { margin-top: auto; padding-top: 12px; }
.step-pager button { min-height: 50px; }
.cook-sidebar { display: grid; gap: 14px; }
.timer-list li { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 7px; padding: 8px 10px; border: 1px solid var(--border); background: #f7faf6; border-radius: 8px; }
.timer-list strong { flex: 1 1 95px; min-width: 0; overflow-wrap: anywhere; }
.timer-list .expired { background: #fff2da; border-color: #bd9c56; }
.timer-readout { font-variant-numeric: tabular-nums; font-weight: 700; }
.checklist label { display: flex; align-items: flex-start; gap: 10px; padding-block: 10px; border-bottom: 1px solid #e5eadf; font-weight: 500; cursor: pointer; }
.checklist input { flex: 0 0 22px; margin: 0; }
.checklist span { overflow-wrap: anywhere; white-space: pre-wrap; }
.checklist label:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
.ingredient-heading { margin-top: 8px; font-weight: 700; overflow-wrap: anywhere; }
.local-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 17px; }
.local-controls label { display: flex; align-items: center; gap: 8px; flex: 1 1 360px; cursor: pointer; }
.local-controls input { flex: 0 0 22px; margin: 0; }
.local-controls [role="status"] { flex: 1 1 100%; }
.help { max-width: 72ch; margin-top: 30px; }
.help p { margin-top: 9px; }

dialog { width: min(470px, calc(100% - 32px)); padding: 22px; border: 1px solid #7b8d79; border-radius: 13px; color: var(--ink); }
dialog::backdrop { background: #1e302b80; }
dialog form { display: grid; gap: 12px; }
dialog .actions { margin-top: 3px; }

#print-output { display: none; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .work-grid, .cook-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .breadcrumb { margin-block: 14px 8px; }
  .intro { margin-bottom: 15px; }
  .toolbar { padding-bottom: 10px; }
  .cook-step { min-height: 240px; }
  .paper-preview svg { width: min(100%, 308px); }
}
@media (max-width: 350px) {
  .fields.two { grid-template-columns: minmax(0, 1fr); }
  .pager { justify-content: flex-start; }
}
@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: white; }
  body > :not(#print-output) { display: none !important; }
  #print-output { display: block; }
  .print-sheet { margin: 0; padding: 0; overflow: hidden; break-after: page; }
  .print-sheet:last-child { break-after: auto; }
  .print-sheet svg { display: block; }
}
