﻿:root {
  --green-900: #17382b;
  --green-800: #23543f;
  --green-700: #2f6b4f;
  --green-100: #e5efe7;
  --sage: #cfdccf;
  --cream: #f7f1e8;
  --cream-2: #fbf8f2;
  --white: #ffffff;
  --gold: #c8a752;
  --gold-soft: #ead8a4;
  --terracotta: #b9694f;
  --ink: #24312a;
  --muted: #68756d;
  --line: #ded7c9;
  --shadow: 0 20px 60px rgba(28, 44, 36, 0.12);
  --radius: 8px;
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream-2);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

body.auth-loading,
body.auth-locked {
  min-height: 100vh;
  background: var(--cream);
}

body.auth-loading .topbar,
body.auth-loading main,
body.auth-loading .app-footer,
body.auth-locked .topbar,
body.auth-locked main,
body.auth-locked .app-footer {
  display: none;
}

body.auth-ready .auth-screen {
  display: none;
}

body.reset-action-active .auth-screen {
  display: none;
}

.app-screen:not(.active-screen) {
  display: none !important;
}

.app-loader[hidden] {
  display: none;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(247, 241, 232, 0.84);
  backdrop-filter: blur(8px);
}

.app-loader-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(200, 167, 82, 0.36);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.app-loader-card h2 {
  margin: 0;
  color: var(--green-900);
  font-size: clamp(1.35rem, 4vw, 1.95rem);
}

.app-loader-card p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
}

.loader-ring {
  width: 42px;
  height: 42px;
  border: 4px solid var(--green-100);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: loader-spin 0.9s linear infinite;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

img {
  display: block;
  max-width: 100%;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  background:
    linear-gradient(135deg, rgba(247, 241, 232, 0.96), rgba(229, 239, 231, 0.9)),
    url("assets/hero-food.png") center / cover;
}

.auth-card {
  width: min(100%, 460px);
  padding: clamp(22px, 5vw, 34px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(200, 167, 82, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.password-reset-action-screen[hidden] {
  display: none;
}

.password-reset-action-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  background:
    linear-gradient(135deg, rgba(247, 241, 232, 0.96), rgba(229, 239, 231, 0.9)),
    url("assets/hero-food.png") center / cover;
}

.password-reset-action-card {
  width: min(100%, 500px);
  padding: clamp(22px, 5vw, 34px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(200, 167, 82, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--green-900);
  font-weight: 850;
}

.auth-card h1 {
  max-width: 11ch;
  margin: 0;
  color: var(--green-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 9vw, 3.45rem);
  line-height: 0.98;
}

.password-reset-action-card h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--green-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
}

.auth-copy,
.auth-note,
.auth-status {
  color: var(--muted);
}

.auth-copy {
  margin: 16px 0 22px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--green-900);
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.auth-link-button {
  justify-self: center;
  padding: 4px 8px;
  color: var(--green-800);
  background: transparent;
  border: 0;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link-button:hover,
.auth-link-button:focus-visible {
  color: var(--green-900);
  outline: none;
}

.auth-status {
  min-height: 24px;
  margin: 14px 0 0;
  font-weight: 750;
}

.auth-status.error {
  color: var(--terracotta);
}

.reset-password-status:not(:empty) {
  padding: 12px 14px;
  color: var(--green-900);
  background: rgba(47, 107, 79, 0.1);
  border: 1px solid rgba(47, 107, 79, 0.22);
  border-radius: var(--radius);
}

.reset-password-status.error {
  color: var(--terracotta);
  background: rgba(182, 91, 67, 0.1);
  border-color: rgba(182, 91, 67, 0.26);
}

.password-reset-action-status:not(:empty) {
  padding: 12px 14px;
  color: var(--green-900);
  background: rgba(47, 107, 79, 0.1);
  border: 1px solid rgba(47, 107, 79, 0.22);
  border-radius: var(--radius);
}

.password-reset-action-status.error {
  color: var(--terracotta);
  background: rgba(182, 91, 67, 0.1);
  border-color: rgba(182, 91, 67, 0.26);
}

.auth-note {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  min-height: 68px;
  padding: calc(10px + env(safe-area-inset-top)) clamp(16px, 4vw, 44px) 10px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(222, 215, 201, 0.85);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--green-900);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--green-800);
  color: var(--gold-soft);
  border: 1px solid rgba(200, 167, 82, 0.75);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 11px;
  color: var(--muted);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 650;
}

.topnav a:hover,
.topnav a:focus-visible,
.topnav a.active {
  background: var(--green-100);
  color: var(--green-900);
}

.account-box {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.account-box span {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-box .small-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.button,
.print-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.button {
  padding: 10px 18px;
}

.button-primary,
.print-button {
  background: var(--green-800);
  color: var(--white);
}

.button-primary:hover,
.print-button:hover {
  background: var(--green-900);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--green-900);
  border-color: rgba(35, 84, 63, 0.18);
}

.button-secondary:hover {
  border-color: var(--gold);
}

.print-button,
.small-button {
  padding: 8px 14px;
  white-space: normal;
}

.print-button {
  min-width: 128px;
  box-shadow: 0 10px 25px rgba(23, 56, 43, 0.18);
}

.small-button {
  min-height: 38px;
  background: var(--white);
  color: var(--green-800);
  border-color: rgba(35, 84, 63, 0.18);
}

.small-button:hover,
.small-button.active {
  background: var(--green-800);
  color: var(--white);
}

.cover {
  position: relative;
  display: grid;
  min-height: 82vh;
  overflow: hidden;
  background: var(--cream);
}

.cover-image,
.cover-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cover-image {
  object-fit: cover;
}

.cover-shade {
  background:
    linear-gradient(90deg, rgba(247, 241, 232, 0.98) 0%, rgba(247, 241, 232, 0.82) 34%, rgba(247, 241, 232, 0.1) 70%),
    linear-gradient(0deg, rgba(23, 56, 43, 0.18), rgba(23, 56, 43, 0));
}

.cover-content {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(720px, 100%);
  padding: clamp(40px, 8vw, 86px) clamp(18px, 5vw, 64px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--green-900);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.08;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 8vw, 6.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.45rem);
}

h3 {
  font-size: 1.35rem;
}

h4 {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.25;
}

.cover-subtitle {
  max-width: 560px;
  margin: 20px 0 0;
  color: #425348;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.cover-eyebrow-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
  margin: 0 0 10px;
}

.cover-eyebrow-line .eyebrow {
  margin: 0;
}

.cover-parent-brand {
  display: inline-flex;
  align-items: baseline;
  flex-basis: 100%;
  gap: 5px;
  margin: 0;
  color: rgba(35, 49, 42, 0.7);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: none;
}

.cypalat-word {
  display: inline-flex;
  gap: 0;
  align-items: baseline;
  color: inherit;
  letter-spacing: 0;
  white-space: nowrap;
}

.cypalat-word strong {
  font-weight: 850;
}

.cypalat-word span {
  font-weight: 400;
}

.home-greeting {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--green-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin-top: 30px;
}

.quick-action-card {
  display: grid;
  gap: 6px;
  min-height: 106px;
  padding: 16px;
  border: 1px solid rgba(200, 167, 82, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(28, 44, 36, 0.07);
}

.quick-action-card:hover,
.quick-action-card:focus-visible {
  border-color: var(--gold);
  background: var(--white);
  outline: none;
}

.quick-action-card strong {
  color: var(--green-900);
  font-size: 1.05rem;
}

.quick-action-card span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.cover-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 500px;
  gap: 10px;
  margin: 34px 0 0;
}

.cover-stats div {
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(200, 167, 82, 0.35);
  border-radius: var(--radius);
}

.cover-stats dt {
  color: var(--green-900);
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1;
}

.cover-stats dd {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.section-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 74px 0;
}

.app-footer {
  padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
  color: var(--muted);
  background: var(--cream-2);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  text-align: center;
}

.app-footer span {
  overflow-wrap: anywhere;
}

.intro-band {
  background: var(--green-900);
  color: var(--cream);
}

.intro-band h2,
.intro-band .eyebrow {
  color: var(--gold-soft);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
}

.intro-grid p:last-child {
  margin: 0;
  font-size: 1.13rem;
}

.index-section {
  background: var(--cream-2);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-width: 820px;
  margin-bottom: 28px;
}

.compact-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  max-width: none;
  gap: 16px;
}

.heading-actions,
.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.control-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-field {
  display: grid;
  gap: 6px;
  color: var(--green-900);
  font-weight: 800;
}

.field-label {
  margin: 0;
  color: var(--green-900);
  font-weight: 800;
}

.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--green-800);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.35;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--green-700);
}

.search-field input,
.shopping-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-size: 16px;
}

.search-field input:focus,
.shopping-form input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 44px;
  padding: 7px 12px;
  color: var(--green-800);
  background: var(--green-100);
  border: 1px solid rgba(47, 107, 79, 0.16);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 760;
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--green-800);
  color: var(--white);
}

.result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.section-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.section-link {
  min-height: 94px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--green-900);
  text-decoration: none;
}

.section-link strong,
.section-link span {
  display: block;
}

.section-link strong {
  font-size: 1rem;
  line-height: 1.2;
}

.section-link span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.section-link:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(33, 66, 49, 0.1);
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.recipe-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(28, 44, 36, 0.07);
}

.recipe-card-loading {
  min-height: 220px;
  align-content: center;
  border-style: dashed;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f2 100%);
}

.image-slot {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  min-height: 164px;
  overflow: hidden;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(229, 239, 231, 0.95), rgba(247, 241, 232, 0.95)),
    repeating-linear-gradient(45deg, rgba(200, 167, 82, 0.16) 0 8px, transparent 8px 16px);
  color: var(--green-800);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 850;
  text-transform: uppercase;
}

.image-placeholder {
  gap: 8px;
  align-content: center;
}

.image-placeholder strong {
  color: var(--green-900);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.15;
  text-transform: none;
}

.image-placeholder small {
  max-width: 24ch;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.image-placeholder-mark {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(200, 167, 82, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.96) 0 18%, transparent 19%),
    radial-gradient(circle at 60% 62%, rgba(47, 107, 79, 0.18) 0 28%, transparent 29%),
    linear-gradient(135deg, rgba(200, 167, 82, 0.24), rgba(47, 107, 79, 0.16));
}

.image-slot.has-image {
  display: block;
  padding: 0;
  background: var(--cream);
}

.image-slot.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.recipe-thumb {
  display: inline-grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(47, 107, 79, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(229, 239, 231, 0.95), rgba(247, 241, 232, 0.96)),
    repeating-linear-gradient(45deg, rgba(200, 167, 82, 0.14) 0 6px, transparent 6px 12px);
}

.recipe-thumb.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-thumb-placeholder::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 1px solid rgba(200, 167, 82, 0.5);
  border-radius: 50%;
  background: rgba(47, 107, 79, 0.12);
}

.recipe-card-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.card-kicker {
  color: var(--terracotta);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.recipe-card h3 {
  font-size: 1.35rem;
}

.recipe-card p {
  margin: 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  background: #f1ead9;
  color: #69542a;
  border: 1px solid rgba(200, 167, 82, 0.26);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 760;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 680;
}

.card-actions,
.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.favorite-button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  color: var(--green-800);
  background: var(--white);
  border: 1px solid rgba(35, 84, 63, 0.18);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 850;
}

.favorite-button.active {
  color: var(--white);
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.reader-section {
  background: var(--green-100);
}

.recipe-reader {
  min-height: 360px;
  background: var(--white);
  border: 1px solid rgba(47, 107, 79, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.reader-empty {
  padding: clamp(28px, 6vw, 58px);
}

.recipe-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1fr);
  gap: 0;
}

.recipe-hero .image-slot {
  aspect-ratio: auto;
  min-height: 100%;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.recipe-hero-content {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 5vw, 48px);
}

.recipe-hero-content h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.recipe-body {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1fr);
  gap: 28px;
  padding: 0 clamp(24px, 5vw, 48px) clamp(28px, 5vw, 48px);
}

.recipe-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.recipe-panel h3 {
  padding-top: 4px;
  border-top: 2px solid var(--gold);
}

.recipe-panel h4 {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--green);
}

.recipe-panel ul,
.recipe-panel ol {
  margin: 0;
  padding-left: 1.25rem;
}

.recipe-panel li + li {
  margin-top: 8px;
}

.info-box {
  padding: 16px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.info-box p {
  margin: 0;
}

.info-box p + p {
  margin-top: 8px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.nutrition-item {
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nutrition-item strong,
.nutrition-item span {
  display: block;
}

.nutrition-item strong {
  color: var(--green-900);
  font-size: 0.78rem;
}

.nutrition-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 760;
}

.sections-band {
  background: var(--white);
}

.category-sections {
  display: grid;
  gap: 28px;
}

.category-block {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.category-block:last-child {
  border-bottom: 0;
}

.category-header {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
}

.category-intro {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.category-intro p {
  margin: 0;
}

.mini-recipe-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-recipe-list a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--green-900);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.mini-recipe-list a:hover {
  border-color: var(--gold);
}

.support-section,
.planner-section,
.shopping-section,
.admin-section,
.template-section {
  background: var(--cream-2);
}

.support-section:nth-of-type(even),
.shopping-section {
  background: var(--white);
}

.two-column,
.shopping-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 52px);
  align-items: start;
}

.support-copy p,
.shopping-grid p {
  max-width: 520px;
  color: var(--muted);
}

.replacements-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 52px);
  align-items: start;
  margin-bottom: 24px;
}

.replacement-tools {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(28, 44, 36, 0.07);
}

.replacement-tools .result-count {
  margin-left: 0;
}

.replacement-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 18px;
  align-items: start;
}

.replacement-table-panel {
  min-width: 0;
}

.replacement-table th:nth-child(1) {
  min-width: 170px;
}

.replacement-table th:nth-child(3),
.replacement-table th:nth-child(5) {
  min-width: 260px;
}

.equivalence-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: var(--green-900);
  color: var(--cream);
  border: 1px solid rgba(200, 167, 82, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(28, 44, 36, 0.1);
}

.equivalence-panel h3,
.equivalence-panel h4 {
  color: var(--gold-soft);
}

.equivalence-list {
  display: grid;
  gap: 10px;
}

.equivalence-list div {
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.equivalence-list strong,
.equivalence-list span {
  display: block;
}

.equivalence-list strong {
  color: var(--white);
}

.equivalence-list span,
.flavor-note p {
  margin: 6px 0 0;
  color: rgba(247, 241, 232, 0.82);
}

.editable-panel,
.shopping-panel,
.template-box {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(28, 44, 36, 0.07);
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}



table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  min-width: 150px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--green-800);
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 800;
}

td[contenteditable="true"] {
  background: #fffdf8;
  outline: none;
}

td[contenteditable="true"]:focus {
  box-shadow: inset 0 0 0 2px var(--gold);
}

[contenteditable="true"][data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #9c988d;
}

.storage-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 52px);
  align-items: start;
  margin-bottom: 24px;
}

.storage-tools {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(28, 44, 36, 0.07);
}

.storage-tools .result-count {
  margin-left: 0;
}

.storage-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.storage-detail-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(28, 44, 36, 0.07);
}

.storage-card-head {
  display: grid;
  gap: 10px;
}

.storage-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.storage-times div {
  padding: 12px;
  background: var(--green-100);
  border: 1px solid rgba(47, 107, 79, 0.16);
  border-radius: var(--radius);
}

.storage-times strong,
.storage-times span {
  display: block;
}

.storage-times strong {
  color: var(--green-900);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.storage-times span {
  margin-top: 4px;
  color: var(--green-800);
  font-weight: 850;
}

.storage-notes {
  display: grid;
  gap: 12px;
  margin: 0;
}

.storage-notes div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.storage-notes dt {
  color: var(--green-900);
  font-weight: 850;
}

.storage-notes dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.storage-advice {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0;
  padding: 20px;
  background: var(--green-900);
  color: var(--cream);
  border: 1px solid rgba(200, 167, 82, 0.35);
  border-radius: var(--radius);
}

.storage-advice h3 {
  color: var(--gold-soft);
}

.storage-advice ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.15rem;
}

.storage-advice li {
  color: rgba(247, 241, 232, 0.88);
}

.storage-basics,
.storage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.storage-card {
  min-height: 160px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.storage-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.source-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.source-note a {
  color: var(--green-800);
  font-weight: 760;
}

.planner-table-wrap {
  overflow: visible;
}

.planner-table {
  table-layout: fixed;
}

.planner-table th,
.planner-table td {
  min-width: 0;
  padding: 10px;
}

.planner-table th:first-child,
.planner-table td:first-child {
  width: 92px;
  font-weight: 800;
  color: var(--green-900);
  background: #f1ead9;
}

.planner-table td {
  height: auto;
  overflow: visible;
}

.planner-picker {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.planner-picker label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.planner-cell-label {
  color: var(--green-900);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.planner-search {
  width: 100%;
  min-height: 56px;
  max-height: 82px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.28;
  outline: none;
  resize: none;
  white-space: normal;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.planner-search:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.planner-clear {
  justify-self: start;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--green-800);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 850;
}

.planner-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, max(100%, calc(100vw - 32px)));
  max-height: var(--planner-menu-max-height, min(430px, 62vh));
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid rgba(47, 107, 79, 0.18);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(28, 44, 36, 0.12);
}

.planner-menu-above {
  top: auto;
  bottom: calc(100% + 6px);
}

.planner-table td:last-child .planner-menu {
  right: 0;
  left: auto;
}

.planner-menu[hidden] {
  display: none;
}

.planner-option-list {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.planner-option {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  width: 100%;
  min-height: 74px;
  height: auto;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  background: var(--white);
  border: 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.planner-option:last-child {
  border-bottom: 0;
}

.planner-option:hover,
.planner-option:focus {
  background: var(--green-100);
  outline: none;
}

.planner-option .recipe-thumb {
  align-self: start;
  width: 52px;
  height: 52px;
  min-width: 52px;
  flex-basis: 52px;
}

.planner-option-title {
  display: block;
  font-weight: 850;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.3;
}

.planner-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.planner-selected-recipe {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  color: var(--green-900);
  background: rgba(229, 239, 231, 0.72);
  border: 1px solid rgba(47, 107, 79, 0.12);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.planner-selected-recipe .recipe-thumb {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.planner-option small,
.planner-option-empty,
.planner-option-count {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.planner-option-empty {
  padding: 12px;
}

.planner-option-count {
  flex: 0 0 auto;
  padding: 10px 12px;
  background: var(--cream-2);
  border-top: 1px solid var(--line);
  color: var(--green-800);
  font-weight: 850;
}

.shopping-form {
  display: grid;
  gap: 8px;
}

.shopping-form label {
  color: var(--green-900);
  font-weight: 800;
}

.shopping-form div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.shopping-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.shopping-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.shopping-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.shopping-list .shopping-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.shopping-list .shopping-text small {
  color: var(--muted);
  font-size: 0.78rem;
}

.shopping-list li.checked .shopping-text {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping-list li.shopping-auto {
  background: #f8f3e7;
  border-color: rgba(200, 167, 82, 0.34);
}

.shopping-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--green-900);
  background: var(--gold-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
}

.delete-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--terracotta);
  background: var(--white);
  border: 1px solid rgba(185, 105, 79, 0.22);
  border-radius: 50%;
  font-weight: 850;
}

.delete-item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  pointer-events: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.38fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(28, 44, 36, 0.07);
}

.admin-sidebar .result-count {
  margin-left: 0;
}

.admin-recipe-list {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: min(640px, 62vh);
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  -webkit-overflow-scrolling: touch;
}

.admin-recipe-option {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas: "thumb copy";
  gap: 12px;
  align-items: start;
  width: 100%;
  height: auto;
  min-height: 94px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-sizing: border-box;
  cursor: pointer;
}

.admin-recipe-option .recipe-thumb {
  grid-area: thumb;
  display: inline-grid;
  width: 64px;
  height: 64px;
  min-width: 64px;
  flex: 0 0 64px;
  align-self: start;
  overflow: hidden;
}

.admin-recipe-option.active,
.admin-recipe-option:hover {
  border-color: var(--green-700);
  background: var(--green-100);
}

.admin-recipe-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 8px;
  align-self: start;
  padding-top: 1px;
}

.admin-recipe-option strong,
.admin-recipe-option small {
  display: block;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: normal;
}

.admin-recipe-option strong {
  color: var(--green-900);
  font-size: 0.92rem;
  font-weight: 850;
  min-height: 0;
}

.admin-recipe-option small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
}

.admin-empty,
.admin-empty-list {
  padding: 14px;
  color: var(--muted);
  background: var(--cream-2);
  border: 1px dashed rgba(47, 107, 79, 0.22);
  border-radius: var(--radius);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form-grid .full {
  grid-column: 1 / -1;
}

.admin-form-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--green-900);
  font-weight: 800;
}

.admin-form-grid small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.42;
  outline: none;
}

.admin-form-grid textarea {
  resize: vertical;
}

.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-form-grid textarea:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.admin-image-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-image-panel p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.admin-file-button {
  width: fit-content;
}

.admin-import-input,
.admin-image-panel input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.admin-image-preview {
  display: grid;
  min-height: 210px;
  overflow: hidden;
  place-items: center;
  color: var(--muted);
  background: var(--cream-2);
  border: 1px dashed rgba(47, 107, 79, 0.22);
  border-radius: var(--radius);
  text-align: center;
}

.admin-image-preview img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
}

.admin-image-preview > span {
  padding: 8px 10px;
  color: var(--green-900);
  font-size: 0.82rem;
  font-weight: 850;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-save-state {
  color: var(--green-800);
  font-size: 0.9rem;
  font-weight: 850;
}

.admin-save-state.error {
  color: var(--terracotta);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.admin-panel[hidden] {
  display: none !important;
}

.admin-panel.active {
  display: block;
}

.admin-manager {
  display: grid;
  gap: 16px;
}

.admin-manager-list {
  display: grid;
  gap: 14px;
  max-height: min(720px, 70vh);
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  -webkit-overflow-scrolling: touch;
}

.admin-manager-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(28, 44, 36, 0.05);
}

.admin-manager-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.admin-manager-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--green-900);
  font-weight: 800;
}

.admin-manager-grid label.full {
  grid-column: 1 / -1;
}

.admin-manager-grid span {
  line-height: 1.25;
}

.admin-manager-grid input,
.admin-manager-grid textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.42;
  outline: none;
}

.admin-manager-grid textarea {
  resize: vertical;
}

.admin-manager-grid input:focus,
.admin-manager-grid textarea:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.admin-manager-grid input[readonly] {
  color: var(--muted);
  background: #f2eee5;
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.admin-importer {
  display: grid;
  gap: 18px;
}

.admin-import-setup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(260px, 1.25fr);
  gap: 14px;
  align-items: end;
}

.admin-import-setup > label,
.admin-import-file-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--green-900);
  font-weight: 800;
}

.admin-import-setup select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.42;
}

.admin-import-file-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.admin-import-file-field small {
  min-height: 1.3em;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.admin-import-file-button {
  width: 100%;
}

.admin-import-note {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  color: var(--green-900);
  background: var(--green-100);
  border: 1px solid rgba(47, 107, 79, 0.18);
  border-radius: var(--radius);
}

.admin-import-note span {
  color: var(--muted);
  line-height: 1.45;
}

.admin-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-import-summary[hidden],
.admin-import-preview[hidden] {
  display: none !important;
}

.admin-import-stat {
  display: grid;
  gap: 3px;
  min-height: 76px;
  padding: 12px 13px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-import-stat strong {
  color: var(--green-900);
  font-size: 1.3rem;
}

.admin-import-stat span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.admin-import-stat.warning strong {
  color: #8a651d;
}

.admin-import-stat.error strong {
  color: var(--terracotta);
}

.admin-import-preview {
  min-width: 0;
}

.admin-import-table-wrap {
  width: 100%;
  max-height: min(560px, 58vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.admin-import-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.88rem;
}

.admin-import-table th,
.admin-import-table td {
  padding: 12px 13px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
}

.admin-import-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--green-900);
  background: var(--cream-2);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-import-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-import-table td:first-child {
  width: 31%;
  color: var(--green-900);
  font-weight: 800;
}

.admin-import-table td:nth-child(2) {
  width: 14%;
}

.admin-import-table td:last-child {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-import-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 8px;
  color: var(--green-900);
  background: var(--green-100);
  border: 1px solid rgba(47, 107, 79, 0.18);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.admin-import-badge.warning {
  color: #785713;
  background: #fff7dc;
  border-color: rgba(163, 121, 33, 0.22);
}

.admin-import-badge.error {
  color: var(--terracotta);
  background: #fff7f4;
  border-color: rgba(185, 105, 79, 0.26);
}

.admin-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-import-actions .admin-save-state {
  flex: 1 1 260px;
}

.danger-button {
  color: var(--terracotta);
  background: #fff7f4;
  border-color: rgba(185, 105, 79, 0.28);
}

.danger-button:hover,
.danger-button:focus-visible {
  color: var(--white);
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.dynamic-module {
  background: var(--cream-2);
}

.dynamic-module-body {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(28, 44, 36, 0.07);
}

.dynamic-module-body p {
  max-width: 820px;
  margin: 0;
  color: var(--ink);
}

.dynamic-module-body .lead {
  color: var(--green-800);
  font-size: 1.08rem;
  font-weight: 760;
}

.template-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.template-box p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.benefit-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 22px rgba(28, 44, 36, 0.06);
}

.benefit-card strong {
  color: var(--green-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.benefit-card strong [data-recipe-total-count] {
  color: inherit;
}

.benefit-card span {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(380px, calc(100% - 36px));
  padding: 12px 14px;
  background: var(--green-900);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.reset-password-modal[hidden],
.account-modal[hidden],
.password-modal[hidden] {
  display: none;
}

.reset-password-modal,
.account-modal,
.password-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 22px;
}

.reset-password-backdrop,
.account-backdrop,
.password-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  border: 0;
  background: rgba(23, 56, 43, 0.42);
}

.reset-password-dialog,
.account-dialog,
.password-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: min(680px, calc(100vh - 44px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(200, 167, 82, 0.36);
  border-radius: var(--radius);
  background: var(--cream-2);
  box-shadow: var(--shadow);
}

.reset-password-dialog-head,
.account-dialog-head,
.password-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.reset-password-dialog-head h2,
.account-dialog-head h2,
.password-dialog-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.reset-password-copy {
  margin: 0 0 18px;
  color: var(--muted);
}

.reset-password-actions {
  gap: 12px;
}

.reset-password-actions .auth-link-button {
  justify-self: start;
}

.account-detail,
.account-security {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.account-detail span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.account-detail strong {
  color: var(--green-900);
  overflow-wrap: anywhere;
}

.account-security {
  margin-top: 12px;
}

.account-security h3 {
  margin: 0;
  color: var(--green-900);
  font-size: 1rem;
}

.account-security .small-button {
  justify-self: start;
}

.password-fields {
  display: grid;
  gap: 14px;
}

.password-fields label {
  display: grid;
  gap: 7px;
  color: var(--green-900);
  font-weight: 800;
}

.password-fields input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  outline: none;
}

.password-fields input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.password-status {
  margin-top: 14px;
}

.password-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.export-modal[hidden] {
  display: none;
}

.export-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
}

.export-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  border: 0;
  background: rgba(23, 56, 43, 0.42);
}

.export-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(200, 167, 82, 0.36);
  border-radius: var(--radius);
  background: var(--cream-2);
  box-shadow: var(--shadow);
}

.export-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.export-dialog-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.export-dialog-head p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
}

.export-options {
  display: grid;
  gap: 10px;
}

.export-option {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 24px rgba(28, 44, 36, 0.06);
}

.export-option:hover,
.export-option:focus {
  border-color: var(--gold);
  outline: none;
}

.export-option.featured {
  border-color: var(--gold);
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.export-option:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.export-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.export-option-copy strong {
  color: var(--green-900);
  font-size: 1rem;
}

.export-option-copy span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.export-option-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.print-book {
  display: none;
}

.print-recipe {
  break-inside: avoid;
  page-break-inside: avoid;
  padding: 22px 0;
  border-bottom: 1px solid #d8d0bf;
}

.print-toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
  margin: 18px 0 28px;
  page-break-after: always;
}

.print-toc ol {
  margin: 10px 0 0;
  padding-left: 1.25rem;
}

.print-toc li + li {
  margin-top: 4px;
}

.print-recipe h3 {
  font-size: 1.55rem;
}

.print-cols {
  display: grid;
  grid-template-columns: 0.42fr 0.58fr;
  gap: 20px;
}

.print-section {
  break-inside: avoid;
  page-break-inside: avoid;
  padding: 18px 0 24px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 24px;
  font-size: 0.94rem;
}

.print-table th,
.print-table td {
  padding: 8px 10px;
  border: 1px solid #d8d0bf;
  vertical-align: top;
  text-align: left;
}

.print-table th {
  background: #f7f1e8;
  color: #23543f;
}

.print-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 24px;
  padding-left: 1.15rem;
}

.print-note {
  margin: 10px 0 20px;
  color: #68756d;
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .account-box {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

  .mini-recipe-list,
  .storage-basics,
  .storage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-hero,
  .recipe-body,
  .category-header,
  .two-column,
  .shopping-grid,
  .replacements-layout,
  .replacement-content,
  .storage-layout,
  .storage-advice,
  .admin-layout,
  .admin-image-panel,
  .quick-actions,
  .benefit-grid,
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .storage-card-grid {
    grid-template-columns: 1fr;
  }

  .recipe-hero .image-slot {
    min-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

  .planner-table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .planner-table,
  .planner-table thead,
  .planner-table tbody,
  .planner-table tr,
  .planner-table th,
  .planner-table td {
    display: block;
  }

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

  .planner-table tbody {
    display: grid;
    gap: 14px;
  }

  .planner-table tr {
    display: grid;
    gap: 10px;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(28, 44, 36, 0.07);
  }

  .planner-table th,
  .planner-table td,
  .planner-table td:last-child {
    border: 0;
  }

  .planner-table th:first-child,
  .planner-table td:first-child {
    width: 100%;
    min-height: 0;
    padding: 0 0 8px;
    color: var(--green-900);
    background: transparent;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .planner-table td[data-planner-meal] {
    display: grid;
    gap: 8px;
    padding: 0;
  }

  .planner-table td[data-planner-meal]::before {
    content: attr(data-planner-meal);
    color: var(--green-900);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  .planner-table td[data-planner-meal] .planner-cell-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .planner-menu,
  .planner-table td:last-child .planner-menu {
    position: static;
    right: auto;
    left: auto;
    width: 100%;
    max-height: var(--planner-menu-max-height, min(420px, 70vh));
    margin-top: 2px;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  }

  .brand {
    max-width: 100%;
  }

  .topnav {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav a {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
  }

  .print-button {
    justify-self: start;
    width: 100%;
  }

  .account-box {
    width: 100%;
    flex-wrap: wrap;
  }

  .account-box span {
    max-width: 100%;
  }

  .cover {
    min-height: 78vh;
  }

  .cover-shade {
    background: linear-gradient(180deg, rgba(247, 241, 232, 0.97) 0%, rgba(247, 241, 232, 0.82) 64%, rgba(247, 241, 232, 0.35) 100%);
  }

  .cover-content {
    align-self: start;
    padding-top: 44px;
  }

  h1 {
    max-width: 10ch;
    font-size: 3rem;
  }

  .cover-stats,
  .section-links,
  .recipe-grid,
  .mini-recipe-list,
  .storage-basics,
  .storage-grid,
  .storage-card-grid,
  .nutrition-grid {
    grid-template-columns: 1fr;
  }

  .section-inner {
    width: min(100% - 24px, 1180px);
    padding: 52px 0;
  }

  .control-panel,
  .recipe-card-body,
  .editable-panel,
  .shopping-panel,
  .admin-sidebar,
  .template-box {
    padding: 14px;
  }

  .compact-heading {
    align-items: start;
    flex-direction: column;
  }

  .result-count {
    width: 100%;
    margin-left: 0;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-manager-list {
    gap: 12px;
    max-height: min(620px, 68vh);
    padding-right: 4px;
  }

  .admin-manager-card,
  .dynamic-module-body {
    padding: 14px;
  }

  .admin-manager-grid {
    grid-template-columns: 1fr;
  }

  .admin-manager .panel-toolbar,
  .admin-manager .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-manager .heading-actions,
  .admin-manager .heading-actions .button,
  .admin-manager .heading-actions .small-button,
  .admin-card-actions .small-button {
    width: 100%;
  }

  .admin-import-setup,
  .admin-import-summary {
    grid-template-columns: 1fr;
  }

  .admin-import-table-wrap {
    max-height: 62vh;
  }

  .admin-import-actions .button,
  .admin-import-actions .small-button {
    width: 100%;
  }

  .admin-import-actions .admin-save-state {
    flex-basis: 100%;
  }

  .planner-search {
    min-height: 62px;
    max-height: 86px;
    line-height: 1.3;
  }

  .planner-menu {
    width: 100%;
    max-height: var(--planner-menu-max-height, min(380px, 68vh));
  }

  .planner-option {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 70px;
    padding: 10px;
  }

  .planner-option .recipe-thumb {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .planner-selected-recipe {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-recipe-list {
    gap: 10px;
    max-height: min(440px, 58vh);
    padding-right: 4px;
  }

  .admin-recipe-option {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 88px;
    padding: 11px;
  }

  .admin-recipe-option .recipe-thumb {
    width: 58px;
    height: 58px;
    min-width: 58px;
    flex-basis: 58px;
  }

  .admin-recipe-copy {
    gap: 7px;
  }

  .admin-recipe-option strong {
    font-size: 0.9rem;
  }

  .admin-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions .button,
  .admin-actions .small-button {
    width: 100%;
  }

  .shopping-form div {
    grid-template-columns: 1fr;
  }

  .recipe-hero-content,
  .recipe-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .recipe-body {
    gap: 22px;
  }
}

@media (max-width: 680px) {
  .app-loader {
    align-items: end;
    padding: 12px;
  }

  .app-loader-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .export-modal {
    align-items: end;
    padding: 12px;
  }

  .export-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .export-dialog-head {
    display: grid;
  }

  .export-dialog-head .small-button {
    width: 100%;
  }

  .export-option {
    grid-template-columns: 1fr;
    min-height: 86px;
  }

  .export-option-badge {
    width: fit-content;
  }
}
