:root {
  color-scheme: light;
  --ink: #25211e;
  --muted: #756e68;
  --line: #ded8cf;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --butter: #f6c453;
  --cherry: #9f2737;
  --sage: #7c9277;
  --cocoa: #4b332b;
  --shadow: 0 18px 50px rgba(50, 40, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: #fffdfa;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--cocoa);
  color: #fff;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 700;
}

.nav-item.is-active,
.nav-item:hover {
  background: #f1ebe2;
  color: var(--ink);
}

.mini-panel {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mini-panel h2 {
  margin: 8px 0;
  font-size: 18px;
}

.mini-panel p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.workspace {
  display: grid;
  gap: 32px;
  padding: 32px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  align-items: stretch;
  gap: 28px;
  min-height: 360px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
    url("https://images.unsplash.com/photo-1488477181946-6428a0291777?auto=format&fit=crop&w=1300&q=80");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--cherry);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
}

.hero p:last-child {
  max-width: 610px;
  margin: 0;
  color: #554d47;
  font-size: 18px;
  line-height: 1.7;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-card img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.hero-card div {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.hero-card span,
.hero-card strong {
  display: block;
}

.hero-card span {
  color: var(--cherry);
  font-size: 12px;
  font-weight: 800;
}

.hero-card strong {
  margin-top: 4px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.toolbar h2,
.upload-section h2 {
  margin: 6px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 36px;
}

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

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

.chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

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

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1.08fr);
  gap: 26px;
  align-items: start;
}

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

.recipe-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  box-shadow: 0 12px 32px rgba(50, 40, 32, 0.08);
}

.recipe-card.is-selected {
  outline: 3px solid rgba(159, 39, 55, 0.25);
  border-color: var(--cherry);
}

.recipe-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.recipe-card-body {
  padding: 14px;
}

.recipe-card span {
  color: var(--cherry);
  font-size: 12px;
  font-weight: 800;
}

.recipe-card h3 {
  margin: 7px 0;
  font-size: 18px;
}

.recipe-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.detail-page,
.upload-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-page {
  overflow: hidden;
}

.detail-image-wrap img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.detail-header,
.detail-columns,
.notes-section {
  padding: 24px;
}

.detail-header h2 {
  margin: 8px 0 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 42px;
}

.detail-header p:last-child,
.notes-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: #fffaf0;
}

.stat {
  padding: 15px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 22px;
}

.detail-columns h3,
.notes-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.detail-columns ul,
.detail-columns ol {
  margin: 0;
  padding-left: 20px;
  color: #554d47;
  line-height: 1.75;
}

.notes-section {
  border-top: 1px solid var(--line);
  background: #fbfaf7;
}

.upload-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(360px, 0.58fr);
  gap: 24px;
  padding: 24px;
}

.recipe-form {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.image-drop {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 260px;
  border: 2px dashed #cfc5b9;
  border-radius: 8px;
  background: #fffaf0;
  color: var(--cocoa);
  font-weight: 800;
}

.image-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-drop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-drop span {
  z-index: 1;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.form-fields {
  display: grid;
  gap: 13px;
}

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

.form-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-fields input,
.form-fields select,
.form-fields textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.form-fields input,
.form-fields select {
  height: 44px;
  padding: 0 12px;
}

.form-fields textarea {
  resize: vertical;
  min-height: 86px;
  padding: 12px;
}

.primary-button {
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--cherry);
  color: #fff;
  font-weight: 800;
}

.secondary-button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--cocoa);
  font-weight: 800;
}

.detail-edit-button {
  margin-top: 18px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions .primary-button,
.form-actions .secondary-button {
  min-width: 150px;
}

@media (max-width: 1120px) {
  .app-shell,
  .content-grid,
  .upload-section {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

@media (max-width: 760px) {
  .workspace,
  .hero-copy,
  .detail-header,
  .detail-columns,
  .notes-section,
  .upload-section {
    padding: 18px;
  }

  .hero,
  .detail-columns,
  .recipe-form,
  .compact-fields {
    grid-template-columns: 1fr;
  }

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

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

  .filter-row {
    justify-content: flex-start;
  }

  .data-actions {
    justify-content: flex-start;
  }

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

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