:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8f8f2;
  color: #20291f;
  --ink: #20291f;
  --muted: #596354;
  --line: #dce1d4;
  --surface: #fff;
  --sidebar: #eef1e7;
  --tint: #e6eddc;
  --accent: #48673d;
  --accent-strong: #36532e;
  --warm: #f5ede1;
  --radius: 16px;
  font-size: 15px;
}
:root[data-store="carrot"] {
  background: #fcf8f3;
  --sidebar: #faecdf;
  --tint: #e5eee6;
  --accent: #134b2e;
  --accent-strong: #0e3923;
  --line: #e4ded4;
  --warm: #ffe9d8;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 5; padding: 12px; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
aside { background: var(--sidebar); border-right: 1px solid var(--line); padding: 28px 16px; position: sticky; top: 0; align-self: start; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; margin-bottom: 42px; font-size: 18px; font-weight: 770; letter-spacing: -.025em; }
.brand small { display: block; font-size: 11px; font-weight: 550; letter-spacing: .01em; margin-top: 2px; }
.brand-mark, .record-icon { flex: 0 0 auto; display: grid; place-items: center; font-size: 20px; min-width: 40px; height: 40px; border-radius: 11px; color: white; background: var(--accent); font-weight: 740; }
.record-icon { color: var(--accent-strong); background: var(--tint); width: 44px; height: 44px; font-size: 17px; }
aside label { display: block; margin: 0 9px 7px; font-size: 12px; font-weight: 690; color: var(--muted); }
aside select { width: 100%; margin-bottom: 23px; cursor: pointer; }
nav { display: grid; gap: 4px; }
nav a { display: flex; align-items: center; min-height: 42px; border-radius: 9px; padding: 0 11px; font-weight: 640; }
nav a:hover, nav a[aria-current="page"] { background: var(--surface); color: var(--accent-strong); }
nav a[aria-current="page"] { box-shadow: inset 3px 0 var(--accent); }
main { width: 100%; max-width: 1420px; padding: clamp(28px,5vw,68px) clamp(20px,4vw,64px); margin-inline: auto; min-width: 0; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(34px,5vw,56px); line-height: 1.03; letter-spacing: -.054em; font-weight: 750; }
h2 { font-size: 20px; letter-spacing: -.025em; margin-bottom: 15px; }
h3 { font-size: 15px; margin: 18px 0 9px; }
p { line-height: 1.55; }
small, .muted, .page-heading p { color: var(--muted); }
.page-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 28px; }
.page-heading p { margin-top: 10px; }
input, select, textarea, button, .button {
  border: 1px solid var(--line); border-radius: 9px; background: white; padding: 10px 11px;
  min-height: 42px;
}
input, select, textarea { min-width: 0; }
textarea { resize: vertical; line-height: 1.6; }
button, .button { display: inline-flex; align-items: center; justify-content: center; font-weight: 650; }
button:not(:disabled):hover, .button:hover { border-color: var(--accent); }
.primary { color: white; background: var(--accent); border-color: var(--accent); padding-inline: 18px; }
.primary:not(:disabled):hover { background: var(--accent-strong); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.bar input { flex: 1 1 190px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; gap: 2px; background: var(--surface); }
.segmented button { border-color: transparent; min-height: 34px; padding: 5px 10px; }
.segmented button[aria-pressed="true"] { background: var(--tint); color: var(--accent-strong); }
.results-count { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.recipe-list { overflow: hidden; }
.recipe-item { background: var(--surface); display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(120px,auto) auto; align-items: center; gap: 14px; padding: 11px 16px; min-width: 0; width: 100%; text-align: left; }
button.recipe-item { border: 0; border-radius: 0; grid-template-columns: auto minmax(0,1fr) auto; font-weight: 400; }
.recipe-item:hover { background: var(--tint); }
.recipe-list .recipe-item + .recipe-item { border-top: 1px solid var(--line); }
.recipe-title { display: grid; gap: 3px; overflow-wrap: anywhere; }
.recipe-title strong { font-size: 14px; }
.recipe-title small { font-size: 12px; }
.recipe-price { font-weight: 720; white-space: nowrap; text-align: right; }
.photo { position: relative; display: grid; place-items: center; width: 51px; height: 51px; overflow: hidden; border-radius: 9px; background: var(--tint); color: var(--accent); font-size: 20px; font-weight: 750; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tag { display: inline-block; max-width: 100%; overflow-wrap: anywhere; border-radius: 20px; padding: 4px 8px; background: #eef0ec; color: #485247; font-size: 11px; font-weight: 660; }
.tag.source { background: var(--tint); color: var(--accent-strong); }
.tag.brouillon { background: var(--warm); color: #754420; }
.tag.calculé { background: #dcebd9; color: #2a5627; }
.recipe-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.recipe-grid .recipe-item { grid-template-columns: 1fr auto; gap: 9px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; align-content: start; }
.recipe-grid .recipe-title, .recipe-grid .photo { grid-column: 1 / -1; }
.recipe-grid .photo { width: 100%; height: auto; aspect-ratio: 16 / 10; }
.back { color: var(--accent-strong); display: inline-flex; min-height: 35px; align-items: center; font-weight: 670; margin-bottom: 15px; }
.editor-heading { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 15px; align-items: center; margin-bottom: 25px; }
.editor-heading h1 { font-size: clamp(27px,4.1vw,47px); overflow-wrap: break-word; }
.editor-heading .photo, .editor-heading .record-icon { width: 76px; height: 76px; border-radius: 13px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 650; margin-bottom: 4px; }
.portions { margin-bottom: 16px; }
.dot { height: 5px; width: 5px; margin-left: 5px; border-radius: 50%; background: var(--accent); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 310px); align-items: start; gap: 17px; }
.pane-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 13px; border-bottom: 1px solid var(--line); }
.pane-tabs button { font-size: 13px; padding: 8px 10px; background: transparent; border: 0; border-radius: 6px 6px 0 0; }
.pane-tabs button[aria-pressed="true"] { color: var(--accent-strong); box-shadow: inset 0 -3px var(--accent); background: var(--tint); }
.section { padding: 20px; margin-bottom: 12px; }
.cost { position: sticky; top: 16px; }
.cost h2 { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cost p { margin: 12px 0 0; font-size: 12px; }
.stats { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 9px; margin: 0; font-size: 13px; }
.stats dd { font-weight: 750; white-space: nowrap; margin: 0; }
.stats dt:last-of-type,.stats dd:last-of-type { padding-top: 8px; border-top: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.cost-fields { margin-top: 18px; grid-template-columns: 1fr; }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
.field input, .field select { width: 100%; }
.field textarea { font-weight: 400; }
.line-head,.recipe-line { display: grid; grid-template-columns: minmax(130px, 2fr) minmax(74px, 1fr) minmax(84px,1fr) minmax(54px,auto) auto; align-items: center; gap: 7px; }
.line-head { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.recipe-line { margin-bottom: 8px; }
.recipe-line select,.recipe-line input { padding: 7px; }
.recipe-line output { font-size: 12px; white-space: nowrap; }
.icon-button { padding: 4px 9px; line-height: 1; font-size: 19px; }
.quantity { position: relative; min-width: 0; }
.quantity span { display: block; font-size: 10px; color: var(--muted); }
.quantity input { width: 100%; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.check { display: flex; align-items: center; gap: 7px; margin-top: 15px; font-size: 13px; }
.check input { min-height: 0; accent-color: var(--accent); height: 16px; width: 16px; }
.empty,.feedback,.yield { padding: 15px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.feedback { margin: 0 0 16px; background: var(--tint); color: var(--accent-strong); }
.feedback.error,.form-error:not(:empty) { background: #fff0e6; color: #852d16; }
.form-error:not(:empty) { padding: 9px; border-radius: 8px; }
dialog { width: min(550px,calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); padding: 0; box-shadow: 0 24px 80px #1a25193f; }
dialog::backdrop { background: #18211777; }
dialog .section { margin: 0; }
dialog .muted { font-size: 12px; margin: 12px 0; }
.composition { white-space: pre-wrap; margin-top: 9px; }
details { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
summary { cursor: pointer; font-weight: 650; }
.hint-list,.batch-list { list-style: none; padding: 0; margin: 0; }
.hint-list li,.batch-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.hint-list button { min-height: 35px; flex-shrink: 0; font-size: 12px; padding: 6px 9px; }
.batch-control { display: flex; gap: 8px; align-items: end; margin-bottom: 11px; }
#batch-results > p { margin-top: 10px; }
.stat-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: grid; gap: 9px; padding: 16px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 25px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
caption { text-align: left; font-weight: 750; padding: 16px; }
th,td { padding: 11px 13px; border-top: 1px solid var(--line); white-space: nowrap; }
td:first-child { white-space: normal; min-width: 185px; }
td a { color: var(--accent-strong); font-weight: 650; }
@media(max-width:1140px) {
  .layout { grid-template-columns: 192px minmax(0,1fr); }
  .editor-layout { grid-template-columns: minmax(0,1fr); }
  .cost { position: static; }
  .cost-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .layout { display: block; }
  aside { position: static; min-height: 0; display: grid; grid-template-columns: minmax(100px,1fr) minmax(130px,auto); padding: 12px; gap: 8px 10px; }
  .brand { margin: 0; padding: 0; font-size: 16px; }
  .brand-mark { min-width: 35px; height: 35px; }
  aside label { position: absolute; clip-path: inset(50%); }
  aside select { margin: 0; }
  nav { display: flex; flex-wrap: wrap; grid-column: 1 / -1; }
  nav a { padding: 0 8px; min-height: 37px; font-size: 13px; }
  nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
  main { padding: 26px 13px; }
  .recipe-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .editor-heading .photo,.editor-heading .record-icon { width: 51px; height: 51px; }
  .editor-heading { gap: 9px; }
  .section { padding: 15px; }
}
@media(max-width:510px) {
  .recipe-item { padding: 9px; gap: 9px; grid-template-columns: auto minmax(0,1fr) auto; }
  .recipe-list .recipe-state { grid-column: 2; grid-row: 2; }
  .recipe-list .recipe-price { grid-column: 3; grid-row: 1; }
  .recipe-list .photo { grid-row: 1 / 3; }
  .recipe-grid .recipe-price { font-size: 12px; }
  .recipe-line,.line-head { grid-template-columns: minmax(98px,1.6fr) minmax(48px,.7fr) minmax(72px,1fr) auto; gap: 4px; }
  .line-head span:last-child,.recipe-line output { display: none; }
  .recipe-line select,.recipe-line input { padding-inline: 4px; font-size: 12px; }
  .editor-heading .save { grid-column: 2; justify-self: start; }
  .section,.stat { padding: 11px; }
  .pane-tabs button { padding-inline: 7px; }
}
.line-actions { display: flex; gap: 4px; }
.line-actions .icon-button { min-height: 35px; font-size: 15px; padding-inline: 6px; }
