:root {
  --bg: #fff9f1;
  --surface: #ffffff;
  --surface-strong: #fff2e3;
  --ink: #25211d;
  --muted: #70685f;
  --line: #eadfd3;
  --accent: #c94c25;
  --accent-dark: #9f3518;
  --green: #2f775c;
  --yellow: #f5b942;
  --shadow: 0 18px 45px rgba(69, 45, 27, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(201, 76, 37, 0.08), transparent 32rem),
    linear-gradient(180deg, #fff9f1 0%, #fffdf8 48%, #f7fbf4 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100%;
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 249, 241, 0.9);
  border-bottom: 1px solid rgba(234, 223, 211, 0.85);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #df8150);
  color: #fff;
  font-weight: 800;
}

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

.brand strong {
  font-size: 1rem;
}

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

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

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.chip,
.icon-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 750;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.danger-button:focus-visible,
.chip:focus-visible,
.icon-button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(201, 76, 37, 0.22);
  outline-offset: 3px;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(201, 76, 37, 0.22);
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: #d8c4b1;
  background: #fffaf4;
}

.ghost-button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.danger-button {
  background: #9b1c1c;
  color: #fff;
}

.icon-button {
  display: grid;
  width: 42px;
  padding: 0;
  place-items: center;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  font-size: 1.4rem;
}

.full-width {
  width: 100%;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 18px;
  align-items: stretch;
  margin: 4px 0 18px;
}

.hero-copy {
  display: flex;
  min-height: 278px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 4.2vw, 48px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 242, 227, 0.94) 0%, rgba(254, 253, 248, 0.96) 58%, rgba(237, 247, 238, 0.94) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(69, 45, 27, 0.06);
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.25rem, 6vw, 4.45rem);
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

h3 {
  font-size: 1.12rem;
}

.hero-copy p {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
}

.hero-panel {
  position: relative;
  height: 278px;
  min-height: 278px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #28211b;
  box-shadow: var(--shadow);
}

.hero-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-panel figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 800;
}

.control-panel {
  margin: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 28px rgba(69, 45, 27, 0.06);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 0 0 14px;
}

.search-box,
.select-box,
.field {
  display: grid;
  gap: 8px;
}

.search-box span,
.select-box span,
.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.field > span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.requirement-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 850;
}

.requirement-badge.is-required {
  background: #ffe6dc;
  color: var(--accent-dark);
}

.requirement-badge.is-optional {
  background: #edf7ee;
  color: var(--green);
}

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

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 76, 37, 0.12);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.chip {
  min-height: 38px;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.chip:hover {
  border-color: #d8c4b1;
  background: #fffaf4;
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 18px;
}

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

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

.recipe-card {
  display: grid;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(69, 45, 27, 0.07);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.recipe-card:hover {
  border-color: #decab6;
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.recipe-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-strong);
}

.recipe-card-content {
  display: grid;
  gap: 12px;
  padding: 17px;
}

.recipe-card h3 {
  min-height: 2.35em;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-pill,
.collection-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.recipe-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.recipe-card-stats span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fffdf9;
}

.tag-pill {
  background: #f0f7f2;
  color: var(--green);
}

.collection-pill {
  background: #fff4cf;
  color: #785615;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed #d9c9ba;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-state div {
  max-width: 420px;
  padding: 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
  gap: 22px;
  align-items: start;
}

.detail-main,
.side-panel,
.wizard-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(69, 45, 27, 0.075);
}

.detail-main {
  overflow: hidden;
}

.detail-hero-image {
  width: 100%;
  max-height: 520px;
  min-height: 260px;
  object-fit: cover;
  background: var(--surface-strong);
}

.detail-content,
.side-panel,
.wizard-shell {
  padding: clamp(20px, 4vw, 34px);
}

.detail-content h1 {
  font-size: clamp(2rem, 4.6vw, 3.8rem);
}

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

.content-list li {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  line-height: 1.5;
}

.reference-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: #fffdf9;
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: none;
}

.reference-link:hover {
  border-color: var(--accent);
  background: #fff5eb;
}

.reference-block {
  margin-top: 26px;
}

.steps-list {
  counter-reset: steps;
}

.steps-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
}

.steps-list li::before {
  counter-increment: steps;
  content: counter(steps);
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.side-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
}

.side-summary {
  display: grid;
  gap: 12px;
}

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

.summary-grid span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fffdf9;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.summary-grid strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.wizard-shell {
  max-width: 860px;
  margin: 0 auto;
  overflow: hidden;
}

.wizard-header {
  display: grid;
  gap: 16px;
  margin: calc(clamp(20px, 4vw, 34px) * -1) calc(clamp(20px, 4vw, 34px) * -1) 26px;
  padding: clamp(20px, 4vw, 34px);
  background: linear-gradient(135deg, #fff7ec, #f5fbf2);
  border-bottom: 1px solid var(--line);
}

.wizard-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.progress-rail {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e5d8;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--yellow), var(--green));
  transition: width 0.25s ease;
}

.step-dots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.step-dot {
  display: grid;
  min-height: 52px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: center;
}

.step-dot:hover {
  border-color: #d8c4b1;
  background: #fffaf4;
}

.step-dot.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.step-dot small {
  color: inherit;
  font-size: 0.66rem;
  font-weight: 750;
  opacity: 0.76;
}

.wizard-body {
  display: grid;
  gap: 20px;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

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

.dynamic-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  align-items: center;
}

.dynamic-row input {
  min-height: 48px;
}

.image-preview {
  display: grid;
  min-height: 260px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed #d9c9ba;
  border-radius: var(--radius);
  background: #fffdf9;
  color: var(--muted);
  text-align: center;
}

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

.review-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fffdf9;
}

.review-image {
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  border-radius: var(--radius);
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 242, 227, 0.95), rgba(237, 247, 238, 0.95)),
    var(--surface-strong);
  color: var(--muted);
  text-align: center;
}

.image-placeholder span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

.form-error {
  min-height: 24px;
  margin: 2px 0 0;
  color: #9b1c1c;
  font-weight: 750;
}

.form-error:not(:empty) {
  border: 1px solid #f0b4a6;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff0ed;
}

.admin-dialog {
  width: min(460px, calc(100% - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
}

.admin-dialog::backdrop {
  background: rgba(37, 33, 29, 0.42);
  backdrop-filter: blur(4px);
}

.admin-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(420px, calc(100% - 40px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 750;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 880px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero,
  .toolbar,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel {
    height: auto;
    min-height: 230px;
  }

  .hero-panel {
    height: 240px;
  }

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

  .side-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .recipes-grid,
  .step-dots {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    flex-direction: column-reverse;
  }

  .wizard-actions button {
    width: 100%;
  }

  .hero-copy {
    padding: 24px;
    min-height: 210px;
  }

  .hero-panel {
    height: 190px;
    min-height: 190px;
  }
}
