/* 냉장고 요리 (/fridge/) — design pass matching /lab.css tokens and typography.
 * Loaded after /lab.css and fridge/fridge.css. Selectors only; no content: text injection. */

:root {
  --ok: #166534;
  --ok-soft: #e7f4ec;
  --on-ok: #ffffff;
  --miss: #b4410c;
  --miss-soft: #fdf0e7;
  --warn: var(--lab-fb-err, #b42318);
  --warn-soft: #fbe9e7;
  --on-warn: #ffffff;
  --on-accent: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok: #4ade80;
    --ok-soft: #13261a;
    --on-ok: #121213;
    --miss: #ff9a63;
    --miss-soft: #2a1a10;
    --warn: var(--lab-fb-err, #ff8f86);
    --warn-soft: #2c1514;
    --on-warn: #121213;
    --on-accent: #121213;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ok: #4ade80;
  --ok-soft: #13261a;
  --on-ok: #121213;
  --miss: #ff9a63;
  --miss-soft: #2a1a10;
  --warn: var(--lab-fb-err, #ff8f86);
  --warn-soft: #2c1514;
  --on-warn: #121213;
  --on-accent: #121213;
  color-scheme: dark;
}

/* ---------- base, typography & focus ---------- */
html {
  overflow-x: clip;
}

body {
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: var(--lab-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
}

:is(a, button, input, summary):focus-visible {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}

.f-wrap {
  max-width: 860px;
  min-height: calc(100dvh - 57px);
  margin: 0 auto;
  padding: 20px 16px 84px;
}

.mono {
  font-family: var(--lab-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--lab-muted);
}

.n {
  font-family: var(--lab-mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--lab-muted);
  margin-left: 2px;
}

/* ---------- buttons & icon buttons ---------- */
.btn {
  height: auto;
  min-height: 38px;
  max-width: 100%;
  padding: 7px 14px;
  border-radius: var(--lab-radius);
  border: 1px solid var(--lab-line-strong);
  background: var(--lab-surface);
  color: var(--lab-text);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  white-space: normal;
  text-align: center;
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.btn:not(.primary):not(.danger):not(.ghost):not(.armed):not(:disabled):hover {
  border-color: var(--lab-text);
  background: var(--lab-surface2);
}

.btn:not(:disabled):active {
  opacity: .84;
}

.btn.primary {
  background: var(--lab-ink);
  border-color: var(--lab-ink);
  color: var(--lab-on-ink);
}

.btn.primary:not(:disabled):hover {
  border-color: var(--lab-ink);
  opacity: .88;
}

.btn.sm {
  height: auto;
  min-height: 32px;
  padding: 5px 11px;
  font-size: 13px;
  border-radius: var(--lab-radius);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn.ghost:not(.danger):not(.armed):not(:disabled):hover {
  background: var(--lab-surface2);
  border-color: var(--lab-line);
  color: var(--lab-text);
}

.btn.danger {
  color: var(--warn);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn.danger:not(:disabled):hover {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.btn.armed,
.btn.armed:hover,
.btn.danger.armed,
.btn.danger.armed:hover {
  background: var(--warn);
  border-color: var(--warn);
  color: var(--on-warn);
  opacity: 1;
}

.btn:disabled,
.btn:disabled:hover {
  opacity: .55;
  cursor: default;
}

.btn .cnt {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--lab-accent);
  color: var(--on-accent);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

:root[data-theme="dark"] .btn .cnt {
  color: var(--on-accent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn .cnt {
    color: var(--on-accent);
  }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--lab-radius);
  border: 1px solid var(--lab-line);
  background: var(--lab-surface);
  color: var(--lab-text);
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-btn:hover {
  border-color: var(--lab-line-strong);
  background: var(--lab-surface2);
}

.icon-btn:active {
  opacity: .84;
}

/* ---------- top tabs & view navigation ---------- */
.f-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--lab-line);
}

.f-tabs > button:not(.btn) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: auto;
  min-height: 36px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--lab-radius);
  background: transparent;
  color: var(--lab-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, opacity .15s;
}

.f-tabs > button:not(.btn) svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.f-tabs > button:not(.btn):not([aria-current="page"]):hover {
  color: var(--lab-text);
  background: var(--lab-surface2);
}

.f-tabs > button:not(.btn):active {
  opacity: .84;
}

.f-tabs > button:not(.btn)[aria-current="page"] {
  color: var(--lab-text);
  font-weight: 700;
  border-color: var(--lab-line-strong);
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
}

.f-tabs > button:not(.btn)[aria-current="page"] svg {
  color: var(--lab-accent);
}

.f-tabs-sp {
  flex: 1 1 0;
  min-width: 0;
}

.f-tabs > .btn.sm {
  height: auto;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--lab-line-strong);
  background: var(--lab-surface);
  color: var(--lab-text);
  font-size: 13.5px;
  box-shadow: var(--lab-shadow-sm);
}

.f-tabs > .btn.sm:hover {
  border-color: var(--lab-text);
  background: var(--lab-surface2);
}

.f-tabs > .btn.sm svg {
  width: 16px;
  height: 16px;
  color: var(--lab-muted);
}

.f-tabs > .btn.sm:hover svg {
  color: var(--lab-text);
}

.f-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: -4px 0 12px;
}

.f-nav .btn.ghost {
  color: var(--lab-muted);
  margin-left: -6px;
  padding: 5px 10px 5px 6px;
  min-height: 34px;
  font-size: 13.5px;
}

.f-nav .btn.ghost:not(:disabled):hover {
  color: var(--lab-text);
  background: var(--lab-surface2);
  border-color: transparent;
}

/* ---------- intro ---------- */
.f-intro {
  margin-bottom: 18px;
}

.f-intro-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.f-intro h1 {
  margin: 2px 0 8px;
  font-size: clamp(1.4rem, 3.2vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.f-intro p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--lab-muted);
  max-width: 62ch;
}

/* ---------- ingredient box, input, suggestions & chips ---------- */
.f-box {
  margin: 18px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  min-width: 0;
}

.f-add {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.f-add input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--lab-line-strong);
  border-radius: var(--lab-radius);
  background: var(--lab-bg);
  color: var(--lab-text);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color .15s, background-color .15s;
}

.f-add input:hover {
  border-color: var(--lab-muted);
}

.f-add input:focus {
  outline: 2px solid var(--lab-accent);
  outline-offset: -1px;
  border-color: var(--lab-accent);
}

.f-add input::placeholder {
  color: var(--lab-faint);
  opacity: 1;
}

.f-add .btn {
  flex: none;
  height: auto;
  min-height: 44px;
  padding: 0 16px;
  white-space: nowrap;
}

.f-sugg {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  gap: 2px;
  padding: 5px;
  max-height: min(320px, 50dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--lab-line-strong) transparent;
  border: 1px solid var(--lab-line-strong);
  border-radius: 10px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-lg);
}

.f-sugg[hidden] {
  display: none;
}

.sugg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: calc(var(--lab-radius) - 1px);
  background: transparent;
  color: var(--lab-text);
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
  transition: background-color .12s;
}

.sugg-item span {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sugg-item small {
  flex: 0 1 auto;
  max-width: 48%;
  text-align: right;
  color: var(--lab-muted);
  font-size: 12.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.sugg-item:hover,
.sugg-item.act {
  background: var(--lab-surface2);
}

.sugg-item.act {
  box-shadow: inset 2px 0 0 var(--lab-accent);
}

.sugg-item:focus-visible {
  outline-offset: -2px;
}

.f-have-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin: 16px 0 10px;
  min-height: 32px;
}

.f-have-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.f-hint {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--lab-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: auto;
  min-height: 32px;
  max-width: 100%;
  padding: 3px 4px 3px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--lab-line));
  background: var(--ok-soft);
  color: var(--lab-text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chip.custom {
  background: transparent;
  border: 1px dashed var(--lab-line-strong);
  color: var(--lab-muted);
}

.chip-x {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ok);
  padding: 0;
  transition: background-color .15s, color .15s;
}

.chip-x:hover {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--lab-text);
}

.chip.custom .chip-x {
  color: var(--lab-muted);
}

.chip.custom .chip-x:hover {
  background: var(--lab-surface2);
  color: var(--lab-text);
}

.chip-x:focus-visible {
  outline: 2px solid var(--lab-accent);
  outline-offset: 1px;
}

/* ---------- pick lists & toggles ---------- */
.f-pick {
  margin-top: 16px;
  border-top: 1px solid var(--lab-line);
  padding-top: 14px;
}

.f-pick summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 2px 0;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--lab-text);
  transition: color .15s;
}

.f-pick summary:hover {
  color: var(--lab-accent);
}

.f-pick summary::before {
  color: var(--lab-muted);
  transition: transform .15s, color .15s;
}

.f-pick summary:hover::before {
  color: var(--lab-accent);
}

.f-pick summary .muted {
  font-weight: 500;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.f-grp h3 {
  margin: 14px 0 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lab-muted);
  letter-spacing: -.005em;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.f-pantry .toggles {
  margin-top: 10px;
}

.tg {
  height: auto;
  min-height: 34px;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid var(--lab-line-strong);
  border-radius: 999px;
  background: var(--lab-surface);
  color: var(--lab-text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.tg:not(.on):hover {
  border-color: var(--lab-text);
  background: var(--lab-surface2);
}

.tg:active {
  opacity: .84;
}

.tg.on {
  background: var(--lab-ink);
  border-color: var(--lab-ink);
  color: var(--lab-on-ink);
  font-weight: 700;
  box-shadow: none;
}

.tg.on:hover {
  border-color: var(--lab-ink);
  opacity: .9;
}

/* ---------- results, filters, segment & cards ---------- */
.f-results {
  min-width: 0;
}

.f-filter {
  margin: 0 0 16px;
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.f-load {
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--lab-muted);
}

.f-h {
  margin: 24px 0 12px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.35;
  color: var(--lab-text);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
}

.f-h2row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 28px;
}

.f-h2row .f-h {
  margin: 0;
}

.f-h2row + * {
  margin-top: 12px;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  max-width: 100%;
  overflow: visible;
  border: 1px solid var(--lab-line-strong);
  border-radius: var(--lab-radius);
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
}

.seg button {
  height: auto;
  min-height: 30px;
  padding: 5px 11px;
  border: 0;
  border-radius: calc(var(--lab-radius) - 3px);
  background: transparent;
  color: var(--lab-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: color .15s, background-color .15s, opacity .15s;
}

.seg button + button {
  border-left: 0;
}

.seg button:not([aria-pressed="true"]):hover {
  color: var(--lab-text);
  background: var(--lab-surface2);
}

.seg button:active {
  opacity: .86;
}

.seg button[aria-pressed="true"] {
  background: var(--lab-ink);
  color: var(--lab-on-ink);
  font-weight: 700;
}

.seg button[aria-pressed="true"]:hover {
  opacity: .9;
}

.seg button:focus-visible {
  outline: 2px solid var(--lab-accent);
  outline-offset: 1px;
  position: relative;
  z-index: 1;
}

.f-none {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--lab-line-strong);
  border-radius: 10px;
  background: var(--lab-surface);
  color: var(--lab-muted);
  font-size: 14px;
  line-height: 1.55;
}

.f-empty {
  border: 1px dashed var(--lab-line-strong);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  padding: 34px 20px;
  text-align: center;
  color: var(--lab-muted);
}

.f-empty h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--lab-text);
}

.f-empty p {
  margin: 0 auto;
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.6;
}

.f-buy {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--miss) 24%, var(--lab-line));
  border-radius: 12px;
  background: var(--miss-soft);
}

.f-buy p {
  margin: 0 0 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--lab-text);
}

.buy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: auto;
  min-height: 32px;
  max-width: 100%;
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--miss) 32%, var(--lab-line-strong));
  border-radius: 999px;
  background: var(--lab-surface);
  color: var(--lab-text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, background-color .15s, opacity .15s;
}

.buy:hover {
  border-color: var(--miss);
  background: var(--lab-surface2);
}

.buy:active {
  opacity: .84;
}

.buy svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--miss);
}

.buy b {
  font-size: 12px;
  color: var(--miss);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}

.card {
  display: grid;
  gap: 7px;
  align-content: start;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 15px 16px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  color: var(--lab-text);
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}

.card:hover {
  border-color: var(--lab-line-strong);
  box-shadow: 0 3px 12px rgba(20, 20, 18, .06);
}

:root[data-theme="dark"] .card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
  }
}

.card:active {
  opacity: .9;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-name {
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.src {
  display: inline-flex;
  align-items: center;
  vertical-align: 1px;
  margin-left: 5px;
  padding: 1px 6px;
  border: 1px solid var(--lab-line);
  border-radius: 5px;
  background: var(--lab-surface2);
  font-size: 11px;
  font-weight: 600;
  color: var(--lab-muted);
  line-height: 1.35;
  letter-spacing: 0;
}

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: auto;
  min-height: 23px;
  padding: 2px 9px;
  border: 1px solid var(--lab-line);
  border-radius: 999px;
  background: var(--lab-surface2);
  color: var(--lab-text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}

.pill.ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 28%, var(--lab-line));
  color: var(--ok);
}

.pill.miss {
  background: var(--miss-soft);
  border-color: color-mix(in srgb, var(--miss) 28%, var(--lab-line));
  color: var(--miss);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-meta svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.card-meta + .card-line {
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px solid var(--lab-line);
}

.card-line {
  display: block;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--lab-text);
  overflow-wrap: anywhere;
}

.card-line i {
  font-style: normal;
  font-weight: 600;
  color: var(--lab-muted);
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.card-line.miss i {
  color: var(--miss);
  font-weight: 700;
}

.card-line svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.f-more {
  width: 100%;
  margin-top: 12px;
  min-height: 42px;
  border-radius: 10px;
}

/* ---------- recipe screen ---------- */
.rec-cat {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lab-muted);
}

.rec-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.375rem, 3.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.rec-head .card-meta {
  font-size: 13.5px;
  gap: 4px 12px;
}

.rec-img {
  margin: 16px 0 0;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--lab-surface2);
  box-shadow: var(--lab-shadow-sm);
  max-width: 520px;
}

.rec-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.rec-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 16px 0 4px;
  padding: 13px 15px;
  border-radius: 12px;
}

.rec-state.ok {
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 26%, var(--lab-line));
}

.rec-state.ok b {
  color: var(--ok);
  font-weight: 700;
}

.rec-state.miss {
  background: var(--miss-soft);
  border: 1px solid color-mix(in srgb, var(--miss) 26%, var(--lab-line));
}

.rec-state.miss b {
  color: var(--miss);
  font-weight: 700;
}

.rec-state > span {
  font-size: 14px;
  line-height: 1.45;
  color: var(--lab-text);
  flex: 1 1 160px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rec-state .btn {
  flex: none;
}

.rec-state .btn span {
  flex: 0 1 auto;
  min-width: 0;
  font-size: inherit;
}

.rec-sec {
  margin-top: 26px;
}

.rec-sec h2 {
  margin: 0 0 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.rec-sec h2 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--lab-muted);
}

.rec-sec h3 {
  margin: 16px 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--lab-muted);
}

.ings {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  overflow: hidden;
}

.ing {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  border-top: 1px solid var(--lab-line);
  min-width: 0;
}

.ing:first-child {
  border-top: 0;
}

.ing-ic {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

.ing-ic svg {
  width: 14px;
  height: 14px;
}

.ing.have .ing-ic {
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent);
  color: var(--ok);
}

.ing.pan .ing-ic {
  background: var(--lab-surface2);
  border: 1px solid var(--lab-line);
  color: var(--lab-muted);
}

.ing.miss .ing-ic {
  background: var(--miss-soft);
  border: 1px solid color-mix(in srgb, var(--miss) 25%, transparent);
  color: var(--miss);
}

.ing.opt .ing-ic {
  border: 1.5px dashed var(--lab-line-strong);
  background: transparent;
}

.ing-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ing-name small {
  font-weight: 500;
  color: var(--lab-muted);
  font-size: 12px;
  margin-left: 4px;
}

.ing.miss .ing-name {
  color: var(--miss);
  font-weight: 700;
}

.ing.opt .ing-name {
  font-weight: 500;
}

.ing-amt {
  flex: 0 1 auto;
  max-width: 45%;
  text-align: right;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
  display: grid;
  gap: 10px;
}

.steps li {
  counter-increment: s;
  position: relative;
  min-width: 0;
  padding: 14px 16px 14px 52px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  font-size: 15px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.steps li::before {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: var(--lab-surface2);
  border: 1px solid var(--lab-line-strong);
  color: var(--lab-accent);
  font: 700 12.5px/23px var(--lab-mono);
  text-align: center;
}

.tip {
  margin: 14px 0 0;
  padding: 12px 15px;
  border: 1px solid var(--lab-line);
  border-left: 3px solid var(--lab-accent);
  border-radius: 0 10px 10px 0;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  color: var(--lab-text);
  font-size: 14px;
  line-height: 1.6;
}

.tip b {
  margin-right: 8px;
  font-weight: 700;
}

.nut {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
  gap: 8px;
  margin: 0;
}

.nut div {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
}

.nut dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--lab-muted);
}

.nut dd {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--lab-text);
  overflow-wrap: anywhere;
}

.src-line {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--lab-line);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--lab-muted);
}

/* ---------- shopping list ---------- */
.f-add-shop {
  margin: 18px 0 14px;
}

.f-add.f-add-shop input {
  background: var(--lab-surface);
}

.shop {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  overflow: hidden;
}

.shop li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px 8px 14px;
  border-top: 1px solid var(--lab-line);
  transition: background-color .15s;
}

.shop li:first-child {
  border-top: 0;
}

.shop li:not(.done):hover {
  background: var(--lab-surface2);
}

.shop label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 2px 0;
  cursor: pointer;
  position: relative;
}

.shop .box {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.8px solid var(--lab-line-strong);
  border-radius: 6px;
  color: transparent;
  background: var(--lab-surface);
  transition: border-color .15s, background-color .15s, color .15s;
}

.shop label:hover input:not(:checked) + .box {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}

.shop input:checked + .box {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--on-ok);
}

:root[data-theme="dark"] .shop input:checked + .box {
  color: var(--on-ok);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shop input:checked + .box {
    color: var(--on-ok);
  }
}

.shop input:focus-visible + .box {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}

.shop-txt {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.shop-txt b {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.38;
  color: var(--lab-text);
  overflow-wrap: anywhere;
}

.shop-txt small {
  font-size: 12.5px;
  line-height: 1.42;
  color: var(--lab-muted);
  overflow-wrap: anywhere;
}

.shop li.done .shop-txt b {
  text-decoration: line-through;
  color: var(--lab-muted);
}

.shop .icon-btn {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--lab-muted);
}

.shop .icon-btn:hover {
  border-color: color-mix(in srgb, var(--warn) 38%, var(--lab-line));
  background: var(--warn-soft);
  color: var(--warn);
}

.f-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- in season ---------- */
.f-month {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.f-month h1 {
  flex: 1;
  min-width: 0;
  margin: 2px 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.f-cheap h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.cheap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(145px, 100%), 1fr));
  gap: 8px;
}

.cheap button {
  display: grid;
  gap: 3px;
  align-content: start;
  width: 100%;
  height: 100%;
  min-width: 0;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid var(--lab-line);
  border-radius: 10px;
  background: var(--lab-bg);
  color: var(--lab-text);
  transition: border-color .15s, background-color .15s, box-shadow .15s, opacity .15s;
}

.cheap button:hover {
  border-color: var(--lab-line-strong);
  background: var(--lab-surface2);
}

.cheap button:active {
  opacity: .88;
}

.cheap button[aria-pressed="true"] {
  border-color: var(--lab-accent);
  background: var(--lab-surface);
  box-shadow: inset 0 0 0 1px var(--lab-accent), var(--lab-shadow-sm);
}

.cheap b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cheap .mono {
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cheap .mono small {
  font-family: var(--lab-sans);
  font-weight: 500;
  color: var(--lab-muted);
}

.cheap small {
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.f-season .toggles.big .tg {
  height: auto;
  min-height: 36px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
}

.tg small {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ok);
}

.tg.on small {
  color: inherit;
}

.pct {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--lab-mono);
  font-variant-numeric: tabular-nums;
}

.pct svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.pct.dn {
  color: var(--ok);
}

.pct.up {
  color: var(--warn);
}

.tg.on .pct {
  color: inherit;
}

.f-sel {
  margin-top: 28px;
}

.f-sel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.f-sel-head > div {
  min-width: 0;
  flex: 1 1 200px;
}

.f-sel-head h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.f-sel-head p {
  margin: 3px 0 0;
  font-size: 13.5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.f-sel .f-hint {
  margin: 0 0 12px;
}

/* ---------- toast ---------- */
.f-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: var(--lab-radius);
  background: var(--lab-ink);
  color: var(--lab-on-ink);
  box-shadow: var(--lab-shadow-lg);
  font-family: var(--lab-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.f-toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- tablet & desktop ---------- */
@media (min-width: 640px) {
  .f-box {
    padding: 20px 22px;
  }

  .cheap {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (min-width: 960px) {
  .f-wrap {
    padding: 28px 16px 92px;
  }
}

/* ---------- mobile (<= 520px & 360px) ---------- */
@media (max-width: 520px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .f-wrap {
    padding: 16px 12px 76px;
  }

  .f-tabs {
    gap: 4px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  .f-tabs > button:not(.btn) {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 13px;
    gap: 4px;
  }

  .f-tabs > button:not(.btn) svg {
    width: 15px;
    height: 15px;
  }

  .f-tabs > .btn.sm {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12.5px;
    gap: 4px;
  }

  .f-tabs > .btn.sm svg {
    width: 15px;
    height: 15px;
  }

  .f-tabs > .btn.sm .cnt {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 11px;
  }

  .f-box {
    padding: 15px 14px;
  }

  .f-add input {
    padding: 9px 11px;
  }

  .f-add .btn {
    padding: 0 13px;
  }

  .seg button {
    padding: 5px 9px;
    font-size: 12.5px;
  }

  .rec-state {
    padding: 12px 13px;
  }

  .rec-state .btn {
    width: 100%;
  }

  .ing {
    padding: 9px 12px;
    gap: 8px;
  }

  .steps li {
    padding: 13px 14px 13px 48px;
  }

  .steps li::before {
    left: 12px;
    top: 13px;
  }

  .shop li {
    padding: 8px 8px 8px 12px;
  }

  .f-tools .btn.primary {
    flex: 1 1 100%;
  }

  .nut {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .icon-btn,
  .f-tabs > button:not(.btn),
  .f-add input,
  .sugg-item,
  .chip-x,
  .f-pick summary,
  .f-pick summary::before,
  .tg,
  .seg button,
  .buy,
  .card,
  .shop li,
  .shop .box,
  .cheap button,
  .f-toast {
    transition: none;
  }
}
