:root {
  --paper: #fbf4e7;
  --paper-deep: #f2e4cf;
  --panel: #fffdf8;
  --panel-soft: #fff8ed;
  --ink: #342a22;
  --muted: #786a5d;
  --line: #e4d5bf;
  --primary: #8b4d34;
  --primary-dark: #653420;
  --sage: #788a64;
  --sage-soft: #e8eddd;
  --gold: #b9853f;
  --rose: #f4ded4;
  --pastel: #f8eadb;
  --shadow: 0 18px 42px rgba(89, 61, 35, 0.12);
  --shadow-soft: 0 10px 26px rgba(89, 61, 35, 0.09);
  --radius: 8px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18px 18px, rgba(139, 77, 52, 0.045) 1.2px, transparent 1.4px),
    linear-gradient(180deg, #fffaf0 0%, var(--paper) 44%, #f7ecdc 100%);
  background-size: 34px 34px, auto;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 250, 241, 0.92);
  border-bottom: 1px solid rgba(139, 77, 52, 0.14);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background:
    linear-gradient(145deg, #a86a4b, var(--primary-dark));
  box-shadow: 0 8px 20px rgba(101, 52, 32, 0.22);
  color: #fffaf0;
  font-family: var(--serif);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.08rem;
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a,
.nav-auth-button {
  border-radius: 999px;
  color: #66584b;
  padding: 8px 13px;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a.active,
.nav-auth-button:hover {
  background: var(--sage-soft);
  color: #46573c;
}

.nav-auth-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 11px;
  font-weight: 700;
}

.hero {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: clamp(48px, 8vw, 96px) clamp(18px, 4vw, 56px);
  color: white;
}

.home-hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: clamp(28px, 6vw, 76px);
  background:
    linear-gradient(90deg, rgba(48, 37, 28, 0.82), rgba(73, 55, 39, 0.44)),
    url("https://images.unsplash.com/photo-1495521821757-a1efb6729352?auto=format&fit=crop&w=1800&q=82") center / cover;
}

.hero-content {
  width: min(760px, 100%);
}

.hero h1,
.page-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 5.7rem;
  font-weight: 700;
  line-height: 0.95;
}

.hero-lead,
.hero p {
  max-width: 660px;
  font-size: 1.28rem;
}

.hero-lead {
  margin: 20px 0 0;
}

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

.hero .eyebrow {
  color: #f8d98f;
}

.hero-search {
  width: min(700px, 100%);
  margin-top: 34px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.18);
  box-shadow: 0 22px 70px rgba(25, 18, 14, 0.22);
  backdrop-filter: blur(12px);
}

.hero-search label,
.field span {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.hero-search label {
  color: #fff8ea;
}

.search-row {
  display: flex;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.hero-search input {
  min-height: 58px;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 253, 248, 0.96);
  font-size: 1.06rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(120, 138, 100, 0.16);
}

textarea {
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 17px;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(145deg, #9a5b3e, var(--primary-dark));
  box-shadow: 0 14px 28px rgba(101, 52, 32, 0.22);
  color: white;
}

.button.primary:hover {
  background: linear-gradient(145deg, var(--primary), #552817);
}

.button.secondary {
  background: #fffdf8;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.button.danger {
  background: #fff0ed;
  border-color: #e8b7ad;
  color: #8d2419;
}

.button-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.hero-note {
  position: relative;
  align-self: end;
  padding: 30px 24px 24px;
  border: 1px solid rgba(255, 249, 235, 0.85);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.96), rgba(248, 234, 211, 0.94));
  box-shadow: 0 28px 60px rgba(25, 18, 14, 0.28);
  color: var(--ink);
  transform: rotate(-1.2deg);
}

.hero-note::before {
  content: "";
  position: absolute;
  inset: 16px 18px;
  border: 1px solid rgba(139, 77, 52, 0.16);
  border-radius: var(--radius);
  pointer-events: none;
}

.hero-note p {
  position: relative;
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.08rem;
}

.hero-note strong {
  position: relative;
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  color: var(--primary-dark);
  font-size: 0.95rem;
}

.note-pin {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 8px 18px rgba(70, 87, 60, 0.24);
}

.section,
.page-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section {
  padding: clamp(46px, 7vw, 88px) 0;
}

.page-shell {
  padding: clamp(34px, 6vw, 72px) 0;
}

.page-shell.narrow {
  width: min(860px, calc(100% - 36px));
}

.section-heading,
.page-title {
  margin-bottom: 28px;
}

.section-heading.centered {
  width: min(760px, 100%);
  margin-inline: auto;
  text-align: center;
}

.section-heading h2,
.page-title h1,
.admin-panel h2 {
  color: var(--ink);
  font-family: var(--serif);
}

.section-heading h2,
.admin-panel h2 {
  margin: 0;
  font-size: 3.15rem;
  line-height: 1;
}

.section-heading p,
.page-title p {
  max-width: 760px;
  color: var(--muted);
}

.section-heading.centered p {
  margin-inline: auto;
}

.intro-section {
  position: relative;
}

.feature-grid,
.recipe-grid,
.people-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.feature-card,
.recipe-card,
.person-card,
.stat-card,
.admin-panel,
.form-panel,
.recipe-group,
.detail-panel {
  border: 1px solid rgba(139, 77, 52, 0.16);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.feature-card,
.recipe-card,
.person-card,
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature-card::before,
.recipe-card::before,
.person-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--sage), var(--gold), var(--rose));
}

.feature-card:hover,
.recipe-card:hover,
.person-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.recipe-card-photo {
  display: block;
  width: calc(100% + 44px);
  height: 170px;
  margin: -22px -22px 18px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.heart-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-soft);
  color: var(--primary);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.heart-button:hover {
  transform: translateY(-1px) scale(1.04);
}

.heart-button.active {
  background: var(--primary);
  color: #fffaf0;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #f3e4cf, #e7eddc);
  color: var(--primary);
  font-size: 2.4rem;
}

.recipe-owner {
  color: var(--primary-dark) !important;
  font-weight: 800;
}

.person-card-photo {
  display: grid;
  width: calc(100% + 44px);
  height: 210px;
  margin: -22px -22px 18px;
  place-items: center;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f3e4cf, #e7eddc);
  color: var(--primary);
  font-size: 2.8rem;
}

.person-card blockquote {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(255, 248, 237, 0.78);
  color: #5f4f42;
  font-family: var(--serif);
}

.feature-icon,
.card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(120, 138, 100, 0.18);
  border-radius: 50%;
  background: var(--sage-soft);
  color: #556846;
  font-size: 1.45rem;
}

.feature-card:nth-child(2) .feature-icon,
.recipe-card .card-icon {
  background: var(--pastel);
  color: var(--primary);
}

.feature-card:nth-child(3) .feature-icon,
.person-card .card-icon {
  background: #f1e7cf;
  color: #946829;
}

.feature-card h3,
.recipe-card h3,
.person-card h3 {
  margin: 16px 0 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.15;
}

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

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-link {
  margin-top: 16px !important;
  font-weight: 800;
  color: var(--primary-dark) !important;
}

.soft-band,
.warm-band {
  width: 100%;
  max-width: none;
  padding-inline: max(18px, calc((100% - 1180px) / 2));
}

.soft-band {
  background:
    linear-gradient(180deg, rgba(232, 237, 221, 0.82), rgba(255, 248, 237, 0.7));
  border-block: 1px solid rgba(120, 138, 100, 0.16);
}

.warm-band {
  background:
    linear-gradient(180deg, #f7ecdd, #f2e2c9);
  border-top: 1px solid rgba(139, 77, 52, 0.12);
}

.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 24px;
}

.search-field {
  flex: 1;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid rgba(139, 77, 52, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow-soft);
}

.filter-panel .field {
  margin-bottom: 0;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 47px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: #5d4b3d;
  font-weight: 800;
}

.check-field input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.search-results {
  align-items: stretch;
}

.recipe-list {
  display: grid;
  gap: 18px;
}

.recipe-group {
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.recipe-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(90deg, #fbf0de, #f4ead8);
  border-bottom: 1px solid var(--line);
}

.recipe-group-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
}

.recipe-version {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.76);
}

.recipe-version:last-child {
  border-bottom: 0;
}

.recipe-version h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  border-radius: 999px;
  background: #f2eadf;
  color: #67564a;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.favorite-button {
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--primary);
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow-soft);
}

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

.form-panel,
.admin-panel,
.detail-panel {
  padding: clamp(18px, 4vw, 32px);
}

.form-panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 237, 0.96));
}

.login-panel {
  display: grid;
  gap: 2px;
}

.login-status {
  min-height: 24px;
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.recipe-form-shell {
  width: min(1040px, calc(100% - 36px));
}

.recipe-form-layout {
  display: grid;
  gap: 22px;
  padding: clamp(18px, 4vw, 34px);
}

.form-section {
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(139, 77, 52, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.form-section-heading {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.form-section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 1.1;
}

.form-section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-step {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sage-soft);
  color: #4f6242;
  font-weight: 900;
}

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

.field {
  display: block;
  margin-bottom: 18px;
}

.field span {
  color: #5d4b3d;
}

.file-field input {
  min-height: 48px;
  padding: 10px;
}

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

.upload-dropzone {
  position: relative;
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border: 2px dashed rgba(120, 138, 100, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.88), rgba(232, 237, 221, 0.5));
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: var(--sage);
  background: linear-gradient(180deg, #fffdf8, #e8eddd);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-soft);
  color: #4f6242;
  font-size: 1.7rem;
}

.upload-dropzone strong {
  font-family: var(--serif);
  font-size: 1.25rem;
}

.upload-dropzone small {
  max-width: 270px;
  color: var(--muted);
  font-weight: 700;
}

.person-form-layout {
  display: grid;
  gap: 22px;
}

.person-photo-zone {
  margin-top: 4px;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-preview p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.photo-preview figure,
.gallery-grid img {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

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

.photo-preview figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.photo-preview figcaption button {
  border: 0;
  border-radius: 999px;
  background: #fff0ed;
  color: #8d2419;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 8px;
}

.person-photo-preview {
  grid-template-columns: minmax(180px, 260px);
}

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

.repeater-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.repeater-remove {
  min-height: 44px;
  box-shadow: none;
}

.repeater-add {
  margin-top: 12px;
}

.form-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 0 calc(clamp(18px, 4vw, 34px) * -1) calc(clamp(18px, 4vw, 34px) * -1);
  padding: 16px clamp(18px, 4vw, 34px);
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.94);
  backdrop-filter: blur(12px);
}

.recipe-book {
  display: grid;
  gap: 22px;
}

.person-profile {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: stretch;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(139, 77, 52, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(232, 237, 221, 0.72));
  box-shadow: var(--shadow);
}

.person-profile-photo img,
.person-profile-photo .person-photo-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 360px;
  place-items: center;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f3e4cf, #e7eddc);
  color: var(--primary);
  font-size: 3.2rem;
  box-shadow: var(--shadow-soft);
}

.person-profile-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.person-profile-content h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 4rem;
  line-height: 0.96;
}

.person-profile-content > p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.person-profile-content blockquote {
  margin: 24px 0 0;
  padding: 20px 22px;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.68);
  color: #5f4f42;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.5;
}

.person-recipes-section {
  width: 100%;
  padding-bottom: 0;
}

.recipe-cover {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: stretch;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(139, 77, 52, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(242, 228, 207, 0.9));
  box-shadow: var(--shadow);
}

.recipe-cover-photo {
  min-height: 360px;
}

.recipe-cover-photo .detail-photo {
  height: 100%;
  min-height: 360px;
}

.recipe-cover-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.recipe-cover-content h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 4.2rem;
  line-height: 0.96;
}

.recipe-owner-line {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.recipe-owner-line strong {
  color: var(--primary-dark);
}

.recipe-cover blockquote {
  margin: 24px 0 0;
  padding: 20px 22px;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.64);
  color: #5f4f42;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
}

.recipe-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

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

.recipe-facts div {
  padding: 18px;
  border: 1px solid rgba(139, 77, 52, 0.16);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.recipe-facts span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.recipe-facts strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
}

.recipe-pages,
.recipe-notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.recipe-page {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 237, 0.96));
}

.recipe-page h2,
.recipe-notes-grid h2 {
  font-size: 2rem;
}

.ingredients-page ul,
.steps-page ol {
  margin-bottom: 0;
  padding-left: 1.35rem;
}

.steps-page li::marker,
.ingredients-page li::marker {
  color: var(--primary);
  font-weight: 900;
}

.recipe-gallery-section {
  padding-top: 8px;
}

.detail-hero {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(139, 77, 52, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(242, 228, 207, 0.82));
  box-shadow: var(--shadow);
}

.detail-photo {
  display: block;
  width: 100%;
  max-height: 420px;
  min-height: 240px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.detail-photo.photo-placeholder {
  display: grid;
  place-items: center;
  min-height: 360px;
  font-size: 3rem;
}

.detail-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.detail-title-row h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 3.6rem;
  line-height: 1;
}

.detail-columns {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
  margin-top: 20px;
}

.detail-panel h2 {
  margin-top: 0;
  font-family: var(--serif);
}

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

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.empty-state {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.78);
  color: var(--muted);
  text-align: center;
}

.stat-card strong {
  display: block;
  color: var(--primary);
  font-family: var(--serif);
  font-size: 2.2rem;
}

.admin-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  background: var(--panel);
}

.admin-shell {
  width: min(1280px, calc(100% - 36px));
}

.admin-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid rgba(139, 77, 52, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-soft);
}

.admin-toolbar .field {
  margin-bottom: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.admin-card {
  padding: 20px;
  border: 1px solid rgba(139, 77, 52, 0.16);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.admin-card-wide {
  grid-column: span 1;
}

.admin-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-card-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1;
}

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

.admin-list.compact {
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 237, 0.54);
}

.admin-row-main strong,
.admin-row-main span {
  display: block;
}

.admin-row-main strong {
  color: var(--ink);
}

.admin-row-main span {
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-row-actions .button {
  min-height: 38px;
  padding: 8px 11px;
}

.admin-inline-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

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

.admin-photo-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.admin-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.admin-photo-card figcaption {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.admin-photo-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(52, 42, 34, 0.42);
  backdrop-filter: blur(4px);
}

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

.confirm-modal {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(52, 42, 34, 0.28);
}

.confirm-modal h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
}

.confirm-modal p {
  color: var(--muted);
}

.site-footer {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .recipe-cover,
  .person-profile,
  .recipe-pages,
  .recipe-notes-grid {
    grid-template-columns: 1fr;
  }

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

  .hero h1,
  .page-title h1 {
    font-size: 4.2rem;
  }

  .recipe-cover-content h1 {
    font-size: 3.25rem;
  }

  .person-profile-content h1 {
    font-size: 3.2rem;
  }

  .section-heading h2,
  .admin-panel h2 {
    font-size: 2.65rem;
  }

  .detail-title-row h1 {
    font-size: 3rem;
  }

  .hero-note {
    align-self: stretch;
    width: min(520px, 100%);
  }

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

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

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

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    border-radius: var(--radius);
  }

  .feature-grid,
  .recipe-grid,
  .people-grid,
  .detail-columns,
  .recipe-facts,
  .upload-grid,
  .photo-preview,
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .hero-lead,
  .hero p {
    font-size: 1.14rem;
  }
}

@media (max-width: 640px) {
  .brand small {
    display: none;
  }

  .site-header {
    gap: 12px;
  }

  .search-row,
  .toolbar,
  .admin-toolbar,
  .split,
  .recipe-version,
  .form-grid,
  .admin-panel,
  .detail-title-row,
  .detail-columns,
  .recipe-cover,
  .person-profile,
  .recipe-pages,
  .recipe-notes-grid,
  .recipe-facts,
  .feature-grid,
  .recipe-grid,
  .people-grid,
  .stats-grid,
  .upload-grid,
  .photo-preview,
  .gallery-grid,
  .repeater-item {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .hero h1,
  .page-title h1 {
    font-size: 3.05rem;
  }

  .section-heading h2,
  .admin-panel h2 {
    font-size: 2.25rem;
  }

  .detail-title-row h1 {
    font-size: 2.45rem;
  }

  .recipe-cover-content h1 {
    font-size: 2.65rem;
  }

  .person-profile-content h1 {
    font-size: 2.7rem;
  }

  .recipe-cover-photo,
  .recipe-cover-photo .detail-photo,
  .person-profile-photo img,
  .person-profile-photo .person-photo-placeholder {
    min-height: 260px;
  }

  .recipe-action-bar .button {
    width: 100%;
  }

  .hero-search {
    padding: 10px;
  }

  .recipe-version {
    display: grid;
  }

  .favorite-button {
    width: 100%;
    min-height: 44px;
  }

  .admin-row,
  .admin-inline-form,
  .admin-photo-grid {
    grid-template-columns: 1fr;
  }

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

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

@media print {
  .site-header,
  .site-footer,
  .recipe-action-bar {
    display: none !important;
  }

  body {
    background: white;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .recipe-book,
  .recipe-cover,
  .detail-panel,
  .recipe-facts div {
    box-shadow: none;
  }

  .recipe-cover,
  .recipe-pages,
  .recipe-notes-grid {
    grid-template-columns: 1fr;
  }

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