:root {
  color-scheme: light;
  --brand-950: #10271c;
  --brand-900: #173a29;
  --brand-800: #214a36;
  --brand-700: #2f6649;
  --olive-600: #73883f;
  --olive-400: #9cab61;
  --gold-600: #b8892f;
  --gold-500: #cf9f3c;
  --gold-300: #e7c978;
  --paper: #f7f5ee;
  --surface: #ffffff;
  --surface-muted: #f1efe8;
  --text: #183026;
  --text-muted: #66756d;
  --line: #dfe5df;
  --danger: #b54747;
  --danger-soft: #f9e8e8;
  --success: #2f7d57;
  --success-soft: #e5f3eb;
  --warning: #a96e0b;
  --warning-soft: #fff1d6;
  --shadow-sm: 0 4px 16px rgba(16, 39, 28, 0.07);
  --shadow-md: 0 16px 42px rgba(16, 39, 28, 0.12);
  --shadow-lg: 0 26px 70px rgba(16, 39, 28, 0.18);
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-pill: 3px;
  --content: 1220px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1713;
  --surface: #17221c;
  --surface-muted: #1d2b23;
  --text: #f3f5f1;
  --text-muted: #a8b5ae;
  --line: #2c3c33;
  --brand-950: #eff7f1;
  --brand-900: #dcebe1;
  --brand-800: #a7c8b2;
  --brand-700: #79aa88;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 16px 42px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 0%, rgba(207, 159, 60, 0.08), transparent 26rem),
    radial-gradient(circle at 95% 10%, rgba(47, 125, 87, 0.08), transparent 24rem),
    var(--paper);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
svg { width: 1.2em; height: 1.2em; display: block; }

.app-shell { min-height: 100dvh; }
.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 78px;
  padding: 10px max(18px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.brand img { width: 52px; height: 52px; border-radius: 50%; box-shadow: var(--shadow-sm); }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.14rem; letter-spacing: .01em; }
.brand small { margin-top: 4px; color: var(--text-muted); font-size: .76rem; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

main { width: min(var(--content), calc(100% - 32px)); margin: 0 auto; padding-bottom: calc(96px + var(--safe-bottom)); }
.view { display: none; animation: view-in .32s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .7fr);
  align-items: center;
  gap: 2rem;
  min-height: 420px;
  margin-top: 30px;
  padding: clamp(30px, 6vw, 74px);
  border: 1px solid rgba(207, 159, 60, .25);
  border-radius: 4px;
  background:
    radial-gradient(circle at 85% 30%, rgba(231, 201, 120, .25), transparent 18rem),
    linear-gradient(145deg, #173a29, #214a36 52%, #2f6649);
  color: white;
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to right, black, transparent);
}
.hero-copy { position: relative; z-index: 2; max-width: 680px; }
.eyebrow {
  display: inline-block;
  color: var(--gold-500);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero .eyebrow { color: var(--gold-300); }
.hero h1 {
  margin: 10px 0 14px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.55rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.page-header h1 { margin: 6px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 5vw, 4.3rem); }
.hero p { max-width: 620px; margin: 0; color: rgba(255,255,255,.78); font-size: clamp(1rem, 2vw, 1.15rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .button-secondary { background: rgba(255,255,255,.1); color: white; border-color: rgba(255,255,255,.24); }
.hero .button-secondary:hover { background: rgba(255,255,255,.18); }
.hero-orbit { position: relative; z-index: 2; display: grid; place-items: center; min-height: 270px; }
.orbit-card {
  position: relative;
  width: min(240px, 70vw);
  aspect-ratio: 1;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  overflow: visible;
  transform-origin: center;
  animation: float 5s ease-in-out infinite;
}
.orbit-card::before {
  content: "";
  position: absolute;
  inset: -24px;
  aspect-ratio: 1 / 1;
  border: 1px dashed rgba(231,201,120,.45);
  border-radius: 50%;
  background: transparent;
  transform-origin: center;
  animation: spin 22s linear infinite;
}
.orbit-card img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  object-fit: cover;
  object-position: center;
}
.orbit-dot { position: absolute; width: 15px; height: 15px; border-radius: 50%; background: var(--gold-300); box-shadow: 0 0 0 7px rgba(231,201,120,.16); }
.dot-1 { top: 9%; left: 15%; }.dot-2 { right: 8%; bottom: 18%; width: 10px; height: 10px; }.dot-3 { left: 3%; bottom: 4%; width: 8px; height: 8px; }
@keyframes float { 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 750;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.98); }
.button-primary { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: #1f2a20; box-shadow: 0 9px 22px rgba(184,137,47,.25); }
.button-primary:hover { box-shadow: 0 13px 30px rgba(184,137,47,.34); }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-sm); }
.button-ghost { background: transparent; border-color: var(--line); }
.button-danger { background: var(--danger-soft); color: var(--danger); }
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.text-button { padding: 7px 0; border: 0; background: none; color: var(--brand-700); font-weight: 800; cursor: pointer; }

.section-block { padding-top: 54px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.section-heading h2 { margin: 5px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.75rem, 3vw, 2.45rem); line-height: 1.05; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.category-card {
  --category-color: var(--brand-700);
  --category-soft: var(--success-soft);
  position: relative;
  overflow: hidden;
  min-height: 160px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--category-color) 22%, var(--line));
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--category-soft) 75%, var(--surface)));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.category-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -35px;
  bottom: -45px;
  border-radius: 4px;
  background: var(--category-color);
  opacity: .08;
  transform: scale(.8);
  transition: transform .25s ease, opacity .25s ease;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--category-color) 55%, var(--line)); }
.category-card:hover::after { transform: scale(1.15); opacity: .13; }
.category-card.active { outline: 3px solid color-mix(in srgb, var(--category-color) 24%, transparent); border-color: var(--category-color); }
.category-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 4px; color: var(--category-color); background: var(--category-soft); }
.category-card h3 { margin: 18px 0 7px; font-size: 1rem; }
.category-card p { margin: 0; color: var(--text-muted); font-size: .86rem; line-height: 1.45; }
.category-count { position: absolute; top: 20px; right: 18px; color: var(--category-color); font-size: .73rem; font-weight: 850; }

.recipes-heading { align-items: center; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: min(350px, 100%);
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
}
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; min-height: 16px; margin-bottom: 18px; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); font-size: .79rem; font-weight: 700; cursor: pointer; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.recipe-card {
  --category-color: var(--brand-700);
  --category-soft: var(--success-soft);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.recipe-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--category-color) 36%, var(--line)); }
.recipe-card-top { position: relative; min-height: 112px; padding: 20px; background: linear-gradient(135deg, var(--category-soft), color-mix(in srgb, var(--category-soft) 25%, var(--surface))); }
.recipe-card-top::after { content: ""; position: absolute; width: 120px; height: 120px; right: -35px; top: -40px; border-radius: 4px; background: var(--category-color); opacity: .13; }
.recipe-card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 4px; background: var(--surface); color: var(--category-color); box-shadow: var(--shadow-sm); }
.favorite-button { position: absolute; z-index: 2; top: 15px; right: 15px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid color-mix(in srgb, var(--category-color) 20%, var(--line)); border-radius: 50%; background: color-mix(in srgb, var(--surface) 90%, transparent); cursor: pointer; }
.favorite-button.active { color: #c9475c; background: #fff1f3; border-color: #f0a8b4; }
.recipe-card-body { display: flex; flex: 1; flex-direction: column; padding: 18px 20px 20px; }
.recipe-line { color: var(--category-color); font-size: .7rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.recipe-card h3 { margin: 7px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; line-height: 1.12; }
.recipe-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--text-muted); font-size: .87rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.meta-pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 3px; background: var(--surface-muted); color: var(--text-muted); font-size: .72rem; font-weight: 700; }
.recipe-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 18px; }
.compatibility { display: flex; align-items: center; gap: 9px; min-width: 0; }
.compat-ring { --score: 0; width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--category-color) calc(var(--score) * 1%), var(--line) 0); }
.compat-ring::before { content: ""; width: 27px; height: 27px; border-radius: 50%; background: var(--surface); }
.compat-copy { display: grid; min-width: 0; line-height: 1.1; }
.compat-copy strong { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compat-copy small { margin-top: 4px; color: var(--text-muted); font-size: .68rem; }
.card-arrow { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--category-color); background: var(--category-soft); }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; padding: 54px 0 28px; }
.page-header p { max-width: 760px; margin: 0; color: var(--text-muted); }
.page-header-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.pantry-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.summary-card { padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.summary-card span { color: var(--text-muted); font-size: .78rem; }
.summary-card strong { display: block; margin-top: 5px; font-size: 1.45rem; }
.pantry-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-muted); font-size: .78rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }.legend-dot.have { background: var(--success); }.legend-dot.missing { background: #b9c1bc; }.legend-dot.avoid { background: var(--danger); }
.pantry-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.pantry-item { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.ingredient-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 4px; background: var(--surface-muted); color: var(--brand-700); font-weight: 900; text-transform: uppercase; }
.pantry-copy { min-width: 0; }
.pantry-copy strong { display: block; font-size: .93rem; }
.pantry-copy small { display: block; margin-top: 3px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-control { display: grid; grid-template-columns: repeat(3, 34px); gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-muted); }
.status-button { display: grid; place-items: center; width: 34px; height: 32px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--text-muted); cursor: pointer; }
.status-button.active[data-status="have"] { background: var(--success); color: white; }.status-button.active[data-status="missing"] { background: #7d8982; color: white; }.status-button.active[data-status="avoid"] { background: var(--danger); color: white; }

.shopping-list { display: grid; gap: 10px; }
.shopping-item { display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.shopping-item.checked { opacity: .58; }.shopping-item.checked strong { text-decoration: line-through; }
.check-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-muted); cursor: pointer; }
.shopping-item.checked .check-button { color: white; background: var(--success); border-color: var(--success); }
.shopping-copy { flex: 1; }.shopping-copy strong { display: block; }.shopping-copy small { color: var(--text-muted); }
.remove-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; }
.remove-button:hover { background: var(--danger-soft); color: var(--danger); }

.about-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.info-card, .card-panel { padding: 24px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.info-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 4px; color: var(--brand-700); background: var(--success-soft); }
.info-card h2 { margin: 16px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; }
.info-card p { margin: 0; color: var(--text-muted); }
.data-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; }
.data-tools h2 { margin: 0 0 4px; }.data-tools p { margin: 0; color: var(--text-muted); }.data-actions { display: flex; gap: 8px; }.file-button { cursor: pointer; }

.empty-state { display: grid; place-items: center; padding: 55px 20px; border: 1px dashed var(--line); border-radius: 4px; text-align: center; color: var(--text-muted); }
.empty-state > span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 4px; background: var(--surface-muted); color: var(--brand-700); }
.empty-state h3 { margin: 16px 0 4px; color: var(--text); }.empty-state p { max-width: 450px; margin: 0 0 18px; }

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(12px, var(--safe-bottom));
  display: flex;
  gap: 4px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px) saturate(150%);
  transform: translateX(-50%);
}
.nav-item { display: grid; place-items: center; gap: 3px; min-width: 76px; padding: 8px 12px 7px; border: 0; border-radius: 3px; background: transparent; color: var(--text-muted); cursor: pointer; }
.nav-item small { font-size: .68rem; font-weight: 800; }.nav-item.active { color: var(--brand-900); background: var(--success-soft); }

.recipe-dialog, .compact-dialog {
  width: min(980px, calc(100% - 24px));
  max-height: min(92dvh, 940px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.recipe-dialog::backdrop, .compact-dialog::backdrop { background: rgba(8, 18, 13, .62); backdrop-filter: blur(7px); }
.recipe-dialog[open], .compact-dialog[open] { animation: dialog-in .24s ease both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.recipe-modal { --category-color: var(--brand-700); --category-soft: var(--success-soft); }
.recipe-modal-header { position: sticky; z-index: 3; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(18px); }
.modal-title-wrap { display: flex; gap: 14px; align-items: flex-start; }
.modal-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 4px; background: var(--category-soft); color: var(--category-color); }
.modal-title-wrap h2 { margin: 3px 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.5rem,3vw,2.2rem); line-height: 1.05; }
.modal-title-wrap p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.modal-actions { display: flex; gap: 8px; }.modal-actions button { flex: 0 0 auto; }
.dialog-close { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.recipe-modal-body { padding: 24px; }
.recipe-hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.recipe-purpose { padding: 22px; border-radius: 4px; background: linear-gradient(145deg, var(--category-soft), color-mix(in srgb, var(--category-soft) 34%, var(--surface))); }
.recipe-purpose .eyebrow { color: var(--category-color); }.recipe-purpose h3 { margin: 9px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; }.recipe-purpose p { margin: 0; color: var(--text-muted); }
.recipe-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.stat-card { padding: 15px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-muted); }
.stat-card span { display: block; color: var(--text-muted); font-size: .72rem; }.stat-card strong { display: block; margin-top: 4px; font-size: .92rem; }
.modal-section { margin-top: 26px; }.modal-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 12px; }.modal-section h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }.modal-section-head p { margin: 3px 0 0; color: var(--text-muted); font-size: .82rem; }
.ingredient-list { display: grid; gap: 9px; }
.ingredient-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.ingredient-row.optional { opacity: .82; }.ingredient-title { display: flex; align-items: center; gap: 10px; min-width: 0; }.ingredient-title .ingredient-mark { width: 38px; height: 38px; border-radius: 4px; font-size: .78rem; }.ingredient-title strong { display: block; }.ingredient-title small { display: block; color: var(--text-muted); }
.ingredient-amount { text-align: right; }.ingredient-amount strong { display: block; font-size: .88rem; }.ingredient-amount small { display: block; color: var(--text-muted); font-size: .72rem; }
.compact-status { grid-template-columns: repeat(3,30px); }.compact-status .status-button { width: 30px; height: 29px; }
.adaptation-panel { display: none; margin-top: 14px; padding: 18px; border: 1px solid color-mix(in srgb, var(--category-color) 26%, var(--line)); border-radius: 4px; background: color-mix(in srgb, var(--category-soft) 55%, var(--surface)); }
.adaptation-panel.active { display: block; animation: view-in .25s ease both; }.adaptation-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; }.adaptation-status { display: flex; align-items: center; gap: 12px; }.adaptation-status .compat-ring { --category-color: var(--category-color); }.adaptation-status strong { display: block; }.adaptation-status small { color: var(--text-muted); }
.adaptation-list { display: grid; gap: 8px; margin-top: 14px; }.adaptation-item { display: flex; gap: 10px; padding: 10px 11px; border-radius: 3px; background: color-mix(in srgb, var(--surface) 76%, transparent); font-size: .82rem; }.adaptation-item span:first-child { color: var(--category-color); }
.adaptation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.steps-list { display: grid; gap: 10px; counter-reset: steps; }.step-row { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 12px; align-items: start; }.step-row::before { counter-increment: steps; content: counter(steps); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 3px; background: var(--category-soft); color: var(--category-color); font-weight: 900; }.step-row p { margin: 5px 0 0; }
.notes-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }.notes-list li { display: flex; gap: 9px; color: var(--text-muted); }.notes-list li::before { content: "•"; color: var(--category-color); font-weight: 900; }
.timer-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-muted); }.timer-copy strong { display: block; font-size: 1rem; }.timer-copy small { color: var(--text-muted); }.timer-display { min-width: 112px; font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 900; text-align: center; }.timer-actions { display: flex; gap: 8px; grid-column: 1 / -1; }.timer-actions .button { flex: 1; }
.safety-box { display: flex; gap: 12px; margin-top: 24px; padding: 15px; border-radius: 4px; background: var(--warning-soft); color: #6c4a10; }.safety-box > span { flex: 0 0 auto; margin-top: 2px; }.safety-box p { margin: 0; font-size: .82rem; }

.compact-dialog { width: min(500px, calc(100% - 24px)); padding: 28px; }.compact-dialog .dialog-close { position: absolute; top: 16px; right: 16px; }.dialog-intro { text-align: center; }.dialog-badge { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 4px; color: var(--brand-700); background: var(--success-soft); }.dialog-intro h2 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; }.dialog-intro p { margin: 0; color: var(--text-muted); }.install-steps { display: grid; gap: 9px; margin: 20px 0; }.install-steps article { padding: 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-muted); }.install-steps strong, .install-steps span { display: block; }.install-steps span { margin-top: 3px; color: var(--text-muted); font-size: .84rem; }.compact-dialog .button { width: 100%; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(100px + var(--safe-bottom)); max-width: calc(100% - 30px); padding: 12px 16px; border-radius: var(--radius-pill); background: #12271b; color: white; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }.toast.show { opacity: 1; transform: translate(-50%,0); }

.editor-lock { display: flex; align-items: flex-start; gap: 16px; max-width: 760px; }
.editor-lock h2 { margin: 0 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.editor-lock p { margin: 0; color: var(--text-muted); }
.editor-warning { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #e8c77b; border-radius: 4px; background: var(--warning-soft); color: #6c4a10; font-size: .88rem; }
.editor-warning span { flex: 0 0 auto; }.editor-warning p { margin: 0; }
.editor-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-muted); }
.editor-tabs button { min-height: 39px; padding: 8px 14px; border: 0; border-radius: 3px; background: transparent; color: var(--text-muted); font-weight: 800; cursor: pointer; }
.editor-tabs button.active { color: var(--brand-950); background: var(--surface); box-shadow: var(--shadow-sm); }
.editor-layout { display: grid; grid-template-columns: minmax(220px, .29fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.editor-sidebar, .editor-workspace { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.editor-sidebar { position: sticky; top: 94px; max-height: calc(100dvh - 122px); overflow: auto; }
.editor-sidebar-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.editor-picker { display: grid; padding: 8px; }
.editor-picker button { display: grid; gap: 2px; width: 100%; padding: 11px 10px; border: 0; border-radius: 3px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.editor-picker button:hover, .editor-picker button.active { background: var(--success-soft); }
.editor-picker span { overflow: hidden; font-size: .88rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.editor-picker small { overflow: hidden; color: var(--text-muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.editor-workspace { min-width: 0; padding: 22px; }
.editor-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.editor-form-head h2 { margin: 0 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; }
.editor-form-head p { max-width: 590px; margin: 0; color: var(--text-muted); font-size: .86rem; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.editor-field { display: grid; gap: 7px; min-width: 0; color: var(--text-muted); font-size: .76rem; font-weight: 800; }
.editor-field-wide { grid-column: 1 / -1; }
.editor-field input, .editor-field select, .editor-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; outline: 0; background: var(--surface-muted); color: var(--text); font: inherit; font-size: .91rem; font-weight: 500; }
.editor-field textarea { min-height: 80px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.45; }
.editor-field input:focus, .editor-field select:focus, .editor-field textarea:focus { border-color: var(--brand-700); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-soft) 75%, transparent); }
.editor-field small { color: var(--text-muted); font-size: .72rem; font-weight: 500; }
.editor-check { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-muted); color: var(--text); font-size: .84rem; font-weight: 700; }
.editor-check input { width: 17px; height: 17px; accent-color: var(--brand-700); }
.editor-errors { margin-bottom: 18px; padding: 15px 17px; border: 1px solid #dea3a3; border-radius: 4px; background: var(--danger-soft); color: #8c3030; font-size: .86rem; }
.editor-errors strong { display: block; }.editor-errors ul { margin: 7px 0 0; padding-left: 18px; }.editor-errors li + li { margin-top: 4px; }
.editor-protection { margin-top: 18px; background: color-mix(in srgb, var(--warning-soft) 65%, var(--surface)); }
.editor-reset { display: flex; justify-content: flex-end; margin-top: 16px; }

@media (min-width: 1100px) {
  main { padding-bottom: 126px; }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr .55fr; }
  .category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .recipe-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pantry-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .recipe-hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { height: 68px; padding-inline: 14px; }.brand img { width: 44px; height: 44px; }.brand strong { font-size: 1rem; }.brand small { display: none; }.install-button { width: 42px; min-width: 42px; padding: 0; font-size: 0; } .install-button span { font-size: 1rem; }
  main { width: min(100% - 22px, var(--content)); }
  .hero { grid-template-columns: 1fr; min-height: auto; margin-top: 16px; padding: 32px 23px 28px; border-radius: 4px; }.hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }.hero-orbit { display: none; }.hero-actions { display: grid; }.hero-actions .button { width: 100%; }
  .section-block { padding-top: 40px; }.section-heading, .page-header, .pantry-toolbar, .data-tools { align-items: stretch; flex-direction: column; }.section-heading { gap: 14px; }.recipes-heading .search-wrap, .pantry-toolbar .search-wrap { min-width: 100%; }.category-grid { gap: 10px; }.category-card { min-height: 145px; padding: 17px; }.category-count { top: 16px; right: 15px; }
  .recipe-grid { grid-template-columns: 1fr; }.recipe-card { min-height: 310px; }.recipe-card p { -webkit-line-clamp: 3; }
  .page-header { padding-top: 38px; }.page-header-actions { justify-content: flex-start; }.page-header-actions .button { flex: 1; }.pantry-grid { grid-template-columns: 1fr; }.pantry-item { grid-template-columns: 44px minmax(0,1fr); }.pantry-item .status-control { grid-column: 1 / -1; grid-template-columns: repeat(3,1fr); }.pantry-item .status-button { width: auto; }
  .about-grid { grid-template-columns: 1fr; }.data-actions { width: 100%; }.data-actions .button { flex: 1; }
  .bottom-nav { left: 8px; right: 8px; bottom: max(7px,var(--safe-bottom)); justify-content: space-between; transform: none; border-radius: 4px; }.nav-item { min-width: 0; flex: 1; padding-inline: 4px; }
  .recipe-dialog { width: 100%; max-width: none; max-height: 96dvh; margin: auto 0 0; border-radius: 6px 6px 0 0; }.recipe-modal-header { padding: 17px; }.modal-title-wrap { gap: 10px; }.modal-icon { width: 42px; height: 42px; }.modal-title-wrap p { display: none; }.recipe-modal-body { padding: 17px; }.ingredient-row { grid-template-columns: minmax(0,1fr) auto; }.ingredient-row .status-control { grid-column: 1 / -1; grid-template-columns: repeat(3,1fr); }.ingredient-row .status-button { width: auto; }.adaptation-summary { align-items: flex-start; flex-direction: column; }.timer-panel { grid-template-columns: 1fr; }.timer-display { text-align: left; }.modal-actions .favorite-button { position: static; }
  .editor-layout { grid-template-columns: 1fr; }.editor-sidebar { position: static; max-height: 270px; }.editor-workspace { padding: 16px; }.editor-form-head { align-items: stretch; flex-direction: column; }.editor-form-head .button { width: 100%; }.editor-fields { grid-template-columns: 1fr; }.editor-field-wide { grid-column: auto; }.editor-reset .button { width: 100%; }
}
@media (max-width: 430px) {
  .category-grid { grid-template-columns: 1fr; }.category-card { min-height: 128px; }.pantry-summary { grid-template-columns: repeat(2,1fr); }.summary-card { padding: 14px; }.topbar .button { padding-inline: 12px; }.legend { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
