/* MealPlanFactory: enamelware kitchen palette, accent follows the season. */

@font-face { font-family: "Zilla Slab"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/zilla-slab-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/zilla-slab-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --enamel: #F6F7F4;
  --surface: #FFFFFF;
  --rim: #1F2B45;
  --graphite: #5B6474;
  --hairline: #D8DCE2;
  --muted: #9AA1AC;
  --danger: #B3261E;

  --fall: #A65A16;    --fall-soft: #F5E6D5;
  --winter: #2D7383;  --winter-soft: #DCECEF;
  --spring: #4A8236;  --spring-soft: #E1EEDA;
  --summer: #C8402F;  --summer-soft: #F8E1DC;

  --accent: var(--fall);
  --accent-soft: var(--fall-soft);

  --slab: "Zilla Slab", "Rockwell", "Roboto Slab", Georgia, serif;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 12px;
}

body[data-season="fall"]   { --accent: var(--fall);   --accent-soft: var(--fall-soft);
  --strike: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6.2 C 18 4.4, 34 7, 52 5.2 S 82 4.6, 99 4' stroke='%23A65A16' stroke-width='2.4' fill='none' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
body[data-season="winter"] { --accent: var(--winter); --accent-soft: var(--winter-soft);
  --strike: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6.2 C 18 4.4, 34 7, 52 5.2 S 82 4.6, 99 4' stroke='%232D7383' stroke-width='2.4' fill='none' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
body[data-season="spring"] { --accent: var(--spring); --accent-soft: var(--spring-soft);
  --strike: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6.2 C 18 4.4, 34 7, 52 5.2 S 82 4.6, 99 4' stroke='%234A8236' stroke-width='2.4' fill='none' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
body[data-season="summer"] { --accent: var(--summer); --accent-soft: var(--summer-soft);
  --strike: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6.2 C 18 4.4, 34 7, 52 5.2 S 82 4.6, 99 4' stroke='%23C8402F' stroke-width='2.4' fill='none' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--enamel);
  color: var(--rim);
  font: 400 17px/1.45 var(--sans);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
body.sheet-open { overflow: hidden; }

#app { max-width: 640px; margin: 0 auto; padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 24px); }
#view { outline: none; padding: 0 18px; }

h1, h2, h3 { font-family: var(--slab); font-weight: 700; margin: 0; line-height: 1.1; }
h1 { font-size: 34px; letter-spacing: -0.01em; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; } /* headings focused for screen readers, not controls */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ week bar */
.weekbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  margin: 0 -18px; padding: calc(env(safe-area-inset-top, 0px) + 6px) 6px 6px;
  background: var(--enamel);
  border-bottom: 1px solid var(--hairline);
}
.weekbar button {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center;
}
.weekbar button:active { background: var(--hairline); }
.weekbar svg { width: 22px; height: 22px; stroke: var(--rim); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.weekbar .week { text-align: center; line-height: 1.15; }
.weekbar .week-dates { font-family: var(--slab); font-weight: 600; font-size: 20px; display: block; }
.weekbar .week-rel { font-size: 14px; color: var(--graphite); }
.season-tag {
  display: inline-block; padding: 0 8px; margin-left: 6px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; line-height: 20px;
}

/* ------------------------------------------------------------ page head */
.page-head { padding: 22px 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head .sub { color: var(--graphite); font-size: 15px; margin-top: 4px; min-height: 1.45em; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radius);
  border: 2px solid var(--rim); background: var(--surface); color: var(--rim);
  font-weight: 700; text-decoration: none; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.block { width: 100%; min-height: 54px; font-size: 18px; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn.ghost { border-color: var(--hairline); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn[disabled] { opacity: .55; pointer-events: none; }

.link-btn {
  border: 0; background: none; padding: 8px 4px; color: var(--accent); font-weight: 700; font-size: 15px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}

.icon-btn {
  width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: none;
  display: grid; place-items: center; color: var(--graphite);
}
.icon-btn:active { background: var(--enamel); }
.icon-btn svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn[aria-pressed="true"] svg .shackle { transform: none; }
.icon-btn.spinning svg { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ meal counts */
.plan-setup { padding: 4px 0 8px; }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stepper {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 10px 10px 8px 14px;
}
.stepper-label { font-size: 15px; color: var(--graphite); display: block; }
.stepper-ctl { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.stepper-ctl output { font-family: var(--slab); font-weight: 700; font-size: 30px; min-width: 2ch; text-align: center; }
.stepper-ctl button {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--hairline); background: var(--surface);
  font-size: 22px; line-height: 1; display: grid; place-items: center; color: var(--rim);
}
.stepper-ctl button:active { border-color: var(--rim); }

.counts-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  font-size: 15px; color: var(--graphite);
}
.counts-summary strong { color: var(--rim); }
.setup-actions { display: flex; gap: 10px; }
.setup-actions .btn.primary { flex: 1; }
.hint { color: var(--graphite); font-size: 14px; margin-top: 8px; }

.notice {
  margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--rim); font-size: 15px;
}
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice.offline { background: #E6E8EC; }

/* ------------------------------------------------------------ menu */
.meal-group { margin-top: 26px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 6px; border-bottom: 2px solid var(--rim); }
.group-head h2 .n { font-family: var(--sans); font-weight: 400; color: var(--graphite); font-size: 16px; margin-left: 6px; }
.meals { list-style: none; margin: 0; padding: 0; }
.meal { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--hairline); min-height: 64px; }
.meal-main {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 10px 6px 10px 0;
  display: flex; flex-direction: column; gap: 1px;
}
.meal-name { font-weight: 700; font-size: 18px; }
.meal-meta { font-size: 14px; color: var(--graphite); }
.meal.locked .meal-name::after {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-left: 8px; vertical-align: middle;
}
.meal-meta .fresh { color: var(--accent); font-weight: 700; }
.empty-slot { color: var(--graphite); font-size: 15px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }

.empty {
  margin: 28px 0; padding: 22px 18px; border: 2px dashed var(--hairline); border-radius: var(--radius);
  color: var(--graphite);
}
.empty h2 { color: var(--rim); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.foot-actions { margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------ groceries */
.add-item { display: flex; gap: 8px; margin-bottom: 6px; }
.add-item input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px;
  border: 2px solid var(--hairline); border-radius: var(--radius); background: var(--surface);
}
.add-item input:focus { border-color: var(--rim); outline: none; }

.progress { height: 6px; border-radius: 3px; background: var(--hairline); overflow: hidden; margin: -4px 0 16px; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }

.aisle { margin-top: 22px; }
.aisle-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 4px; border-bottom: 2px solid var(--rim); }
.aisle-head .left { font-size: 14px; color: var(--graphite); }
.items { list-style: none; margin: 0; padding: 0; }
.item { border-bottom: 1px solid var(--hairline); }
.item-main {
  width: 100%; display: flex; align-items: flex-start; gap: 14px; text-align: left;
  border: 0; background: none; padding: 11px 2px;
}
.box {
  flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--rim); display: grid; place-items: center; transition: background .2s, border-color .2s;
}
.box svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; stroke-linecap: round; stroke-linejoin: round; }
.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-name { font-size: 18px; font-weight: 700; }
.item-for { font-size: 13px; color: var(--graphite); margin-top: 1px; }
.item-amt { flex: none; font-size: 16px; color: var(--graphite); padding-top: 2px; text-align: right; max-width: 40%; }

/* The pen stroke: drawn left to right across the name, wrapping with it. */
.strike {
  background-image: var(--strike);
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% 0.62em;
  transition: background-size .38s cubic-bezier(.6, .1, .3, 1), color .25s;
}
.item.checked .strike { background-size: 100% 0.62em; color: var(--muted); }
.item.checked .item-for,
.item.checked .item-amt { color: var(--muted); }
.item.checked .box { background: var(--muted); border-color: var(--muted); }
.item.checked .box svg { opacity: 1; }

.item-edit { display: flex; gap: 8px; align-items: center; padding: 0 0 12px 40px; }
.item-edit select {
  flex: 1; min-width: 0; min-height: 40px; border: 2px solid var(--hairline); border-radius: 10px;
  background: var(--surface); padding: 0 8px; font-size: 15px;
}

/* ------------------------------------------------------------ recipes */
.search {
  width: 100%; min-height: 48px; padding: 0 14px; border: 2px solid var(--hairline);
  border-radius: var(--radius); background: var(--surface);
}
.search:focus { border-color: var(--rim); outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--hairline);
  background: var(--surface); font-weight: 700; font-size: 15px; color: var(--rim);
}
.chip[aria-pressed="true"] { background: var(--rim); border-color: var(--rim); color: #fff; }
.chip[data-value="spring"][aria-pressed="true"] { background: var(--spring); border-color: var(--spring); }
.chip[data-value="summer"][aria-pressed="true"] { background: var(--summer); border-color: var(--summer); }
.chip[data-value="fall"][aria-pressed="true"]   { background: var(--fall);   border-color: var(--fall); }
.chip[data-value="winter"][aria-pressed="true"] { background: var(--winter); border-color: var(--winter); }

.recipe-list { list-style: none; margin: 10px 0 0; padding: 0; }
.recipe-row {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--hairline); padding: 12px 0;
}
.recipe-row .r-main { flex: 1; min-width: 0; }
.recipe-row .r-name { font-weight: 700; font-size: 18px; display: block; }
.recipe-row .r-meta { font-size: 14px; color: var(--graphite); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.recipe-row .r-last { flex: none; font-size: 13px; color: var(--graphite); text-align: right; max-width: 34%; }
.recipe-row.paused .r-name { color: var(--muted); }
.recipe-item { display: flex; align-items: center; border-bottom: 1px solid var(--hairline); }
.recipe-item .recipe-row { flex: 1; min-width: 0; border-bottom: 0; }
.fav-btn { margin-left: 4px; color: var(--muted); }
.fav-btn[aria-pressed="true"] svg, .fav-on svg, .fav-mark svg, .fav-tag svg { fill: var(--accent); stroke: var(--accent); }

/* favorites */
.fav-mark { display: inline-flex; vertical-align: -2px; margin-left: 6px; }
.fav-mark svg { width: 16px; height: 16px; stroke-width: 2; stroke-linejoin: round; }
.fav-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); }
.fav-tag svg { width: 15px; height: 15px; stroke-width: 2; stroke-linejoin: round; }
.switch small { display: block; font-weight: 400; font-size: 14px; color: var(--graphite); margin-top: 2px; }

.season-pill { font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 19px; }
.season-pill.spring { background: var(--spring-soft); color: var(--spring); }
.season-pill.summer { background: var(--summer-soft); color: var(--summer); }
.season-pill.fall   { background: var(--fall-soft);   color: var(--fall); }
.season-pill.winter { background: var(--winter-soft); color: var(--winter); }
.season-pill.any    { background: #ECEEF1; color: var(--graphite); }

.head-actions { display: flex; gap: 10px; margin: -4px 0 14px; }
.head-actions .btn { flex: 1; min-height: 46px; padding: 0 10px; font-size: 16px; }

/* import */
.import-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
[data-import-fallback] { margin-top: 10px; }
.paste { margin-top: 18px; border-top: 1px solid var(--hairline); }
.paste summary {
  cursor: pointer; padding: 14px 0 6px; font-weight: 700; color: var(--accent); list-style: none;
}
.paste summary::-webkit-details-marker { display: none; }
.paste summary::after { content: " +"; }
.paste[open] summary::after { content: " –"; }
.paste form { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.paste-text {
  width: 100%; min-height: 160px; padding: 10px 12px; border: 2px solid var(--hairline); border-radius: 10px;
  background: var(--surface); line-height: 1.45; resize: vertical;
}
.paste-text:focus { border-color: var(--rim); outline: none; }
.sheet .notice p + p { margin-top: 6px; }
.sheet .notice .link-btn { padding: 2px 0; display: inline; }

/* ------------------------------------------------------------ settings */
.setting { padding: 20px 0; border-bottom: 1px solid var(--hairline); }
.setting h2 { margin-bottom: 6px; }
.setting p { color: var(--graphite); font-size: 15px; max-width: 60ch; }
.setting .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.setting select {
  min-height: 48px; padding: 0 12px; border: 2px solid var(--hairline); border-radius: var(--radius); background: var(--surface);
}
.inline-stepper { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; }
.inline-stepper output { font-family: var(--slab); font-weight: 700; font-size: 28px; min-width: 2ch; text-align: center; }
.inline-stepper button {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--hairline); background: var(--surface); font-size: 22px;
}
.version { color: var(--muted); font-size: 13px; padding: 20px 0; }
.checks { list-style: none; margin: 12px 0 0; padding: 0; }
.checks li { position: relative; padding: 8px 0 8px 30px; border-top: 1px solid var(--hairline); }
.checks li:first-child { border-top: 0; }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: 11px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--hairline);
}
.checks li.ok::before { background: var(--spring); }
.checks li.ok::after {
  content: ""; position: absolute; left: 8px; top: 14px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checks li.bad::before { background: var(--danger); }
.checks li.bad::after { content: "!"; position: absolute; left: 9px; top: 9px; color: #fff; font-weight: 700; font-size: 14px; }
.checks strong { display: block; }
.checks span { display: block; color: var(--graphite); font-size: 14px; margin-top: 2px; }

/* ------------------------------------------------------------ tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--rim);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #AEB6C6; text-decoration: none; font-size: 12.5px; font-weight: 700;
}
.tabs svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: #fff; }
.tabs a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 4px; border-radius: 0 0 4px 4px; background: var(--accent);
  filter: brightness(1.25);
}
.tabs a:focus-visible { outline-offset: -4px; }

/* ------------------------------------------------------------ sheets */
#sheet-root { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(31, 43, 69, .45); animation: fade .18s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(20px + var(--safe-b));
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}
.sheet.full { top: env(safe-area-inset-top, 0px); max-height: none; border-radius: 0; padding-top: 0; }
.sheet .handle { width: 40px; height: 5px; border-radius: 3px; background: var(--hairline); margin: 0 auto 12px; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 12px;
}
.sheet.full .sheet-head { position: sticky; top: 0; background: var(--surface); z-index: 2; padding-top: 12px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.sheet h2 { font-size: 24px; }
.sheet .sub { color: var(--graphite); font-size: 15px; margin-top: 4px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list button {
  width: 100%; text-align: left; border: 0; background: none; padding: 13px 2px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sheet-list .s-name { font-weight: 700; }
.sheet-list .s-meta { font-size: 13px; color: var(--graphite); text-align: right; }
.sheet-list .divider { padding: 16px 0 4px; font-family: var(--slab); font-weight: 600; font-size: 17px; color: var(--graphite); }
.menu-actions button { justify-content: flex-start; gap: 14px; font-weight: 700; font-size: 17px; }
.menu-actions svg { width: 22px; height: 22px; stroke: var(--graphite); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.menu-actions .danger { color: var(--danger); }
.menu-actions .danger svg { stroke: var(--danger); }

@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* recipe detail */
.r-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; font-size: 14px; color: var(--graphite); }
.ing-list { margin: 8px 0 0; padding-left: 20px; }
.ing-list li { padding: 3px 0; }
.r-notes { white-space: pre-wrap; margin-top: 8px; }
.r-section { margin-top: 20px; }

/* forms */
.field { display: block; margin-top: 16px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
.field small { display: block; color: var(--graphite); font-size: 14px; margin: -2px 0 6px; font-weight: 400; }
.field input[type="text"], .field input[type="url"], .field input[type="number"], .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--hairline); border-radius: 10px; background: var(--surface);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field textarea.ingredients { min-height: 200px; }
.field input:focus, .field textarea:focus { border-color: var(--rim); outline: none; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 8px; }
.switch { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-weight: 700; }
.switch input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--accent); }
.switch.with-help { align-items: flex-start; }
.form-error { color: var(--danger); font-weight: 700; margin-top: 12px; }

/* ------------------------------------------------------------ toast */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 10px;
  background: var(--rim); color: #fff; font-weight: 700; font-size: 15px;
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); }

.loading { padding: 40px 0; color: var(--graphite); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------ recipe page */
.btn.icon-text svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn.small.icon-text svg { width: 17px; height: 17px; }
.cook-start { margin-top: 18px; }
.cook-hint { font-size: 14px; color: var(--graphite); margin-top: 6px; text-align: center; }

/* ------------------------------------------------------------ cooking mode */
.cook { --cook-size: 20px; font-size: var(--cook-size); }
.cook[data-size="l"] { --cook-size: 23px; }
.cook[data-size="xl"] { --cook-size: 27px; }
.cook-head { gap: 8px; }
.wake {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.wake svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.wake.off { background: #F9E3E1; color: var(--danger); }
.wake-help { font-size: 15px; color: var(--graphite); margin-top: 8px; }
.sheet .cook-title { font-size: calc(var(--cook-size) * 1.35); line-height: 1.2; margin-top: 4px; }
.cook-section { margin-top: 24px; }
.cook-section h3 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: calc(var(--cook-size) * 1.05); padding-bottom: 6px; border-bottom: 2px solid var(--rim);
}
.cook-count { font-family: var(--sans); font-weight: 400; font-size: 15px; color: var(--graphite); }
.cook-list { list-style: none; margin: 0; padding: 0; }
.cook-ing, .cook-step {
  width: 100%; display: flex; gap: 14px; align-items: flex-start; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--hairline); padding: 14px 6px; font: inherit; color: var(--rim); line-height: 1.45;
}
.cook-box {
  flex: none; width: 1.15em; height: 1.15em; margin-top: .15em; border: 2px solid var(--muted); border-radius: 6px;
  display: grid; place-items: center;
}
.cook-box svg { width: .85em; height: .85em; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.cook-ing[aria-pressed="true"] .cook-box { background: var(--accent); border-color: var(--accent); }
.cook-ing[aria-pressed="true"] .cook-box svg { opacity: 1; }
.cook-ing[aria-pressed="true"] .cook-text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.cook-num {
  flex: none; width: 1.55em; height: 1.55em; border-radius: 50%; display: grid; place-items: center;
  background: var(--enamel); border: 2px solid var(--hairline); font-weight: 700; font-size: .78em; margin-top: .1em;
}
.cook-step.current { background: var(--accent-soft); border-radius: 10px; border-bottom-color: transparent; }
.cook-step.current .cook-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.cook-step[aria-pressed="true"] .cook-text { color: var(--muted); }
.cook-step[aria-pressed="true"] .cook-num { color: var(--muted); }
.cook-sub { font-family: var(--slab); font-weight: 600; font-size: .9em; color: var(--graphite); padding: 18px 6px 4px; }
.cook-link { margin-top: 16px; }
.cook-reset { margin-top: 26px; }

/* ------------------------------------------------------------ send from the browser */
.setting .steps { margin: 10px 0 0; padding-left: 22px; font-size: 15px; color: var(--rim); max-width: 60ch; }
.setting .steps li { padding: 3px 0; }
.bookmarklet { width: 100%; min-height: 90px; margin-top: 10px; font: 12px/1.4 ui-monospace, monospace; padding: 8px;
  border: 2px solid var(--hairline); border-radius: var(--radius); color: var(--graphite); }
.hint a { color: var(--accent); font-weight: 700; }

/* ------------------------------------------------------------ family */
.members { list-style: none; margin: 12px 0 0; padding: 0; }
.members li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.members li:first-child { border-top: 0; }
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 17px;
}
.m-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-name { font-weight: 700; }
.m-mail { font-size: 14px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-tag { font-size: 12px; font-weight: 700; color: var(--graphite); background: var(--enamel); border: 1px solid var(--hairline);
  border-radius: 99px; padding: 0 7px; margin-left: 4px; vertical-align: 1px; }
.family-title { font-family: var(--slab); font-size: 20px; font-weight: 600; color: var(--rim) !important; }
.family-name .search { flex: 1; min-width: 0; margin: 0; }
.invite-box { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--accent-soft); }
.invite-box p { color: var(--rim); }
.invite-url { width: 100%; margin: 10px 0 0; font-size: 14px; }
.account-row { justify-content: space-between; margin-top: 18px !important; }
.account-row .hint { margin: 0; flex-basis: 100%; }
.danger-link { color: var(--danger); }

/* ------------------------------------------------------------ sign-in page */
.auth-page { background: var(--enamel); }
.auth { max-width: 420px; margin: 0 auto; padding: calc(48px + env(safe-area-inset-top, 0px)) 22px 40px; text-align: center; }
.auth-logo { border-radius: 18px; }
.auth h1 { margin-top: 16px; font-size: 28px; }
.auth-msg { margin-top: 12px; color: var(--rim); font-size: 16px; }
.auth-msg.bad { color: var(--danger); font-weight: 700; }
.auth-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.auth-btn { background: var(--surface); }
.auth form { margin-top: 20px; }
.auth-who { margin-top: 26px; color: var(--graphite); }
.auth-fine { margin-top: 28px; font-size: 14px; color: var(--graphite); }
.privacy { text-align: left; }
.privacy h2 { margin-top: 22px; font-size: 20px; }
.privacy p, .privacy li { margin-top: 8px; color: var(--rim); }
.privacy ul { padding-left: 20px; }
