:root {
  color-scheme: dark;
  --bg: #110d0a;
  --panel: #1f1712;
  --panel-2: #2a1e17;
  --text: #fff7ed;
  --muted: #d7bfa7;
  --line: rgba(255, 244, 225, 0.14);
  --gold: #f4b860;
  --orange: #e56b2e;
  --green: #78b66f;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(229, 107, 46, 0.22), transparent 34rem),
    radial-gradient(circle at 70% 20%, rgba(244, 184, 96, 0.12), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
a {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.random-tile,
.recipe-card,
.shopping-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(42, 30, 23, 0.96), rgba(31, 23, 18, 0.94));
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(28px, 5vw, 56px);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-actions,
.shopping-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.mode-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mode-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.mode-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mode-heading strong {
  color: var(--gold);
}

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-chip {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
  min-width: 128px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mode-chip span,
.mode-chip small {
  display: block;
}

.mode-chip span {
  font-weight: 900;
}

.mode-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
}

.mode-chip:hover,
.mode-chip.active {
  transform: translateY(-2px);
  border-color: rgba(244, 184, 96, 0.7);
  background: rgba(244, 184, 96, 0.14);
}

.primary-button,
.ghost-button,
.primary-link {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
}

.primary-button,
.primary-link {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1b1008;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-button:hover,
.ghost-button:hover,
.primary-link:hover,
.random-tile:hover {
  transform: translateY(-2px);
}

.random-tile {
  position: relative;
  min-height: 360px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease;
}

.random-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(17, 13, 10, 0.95), rgba(17, 13, 10, 0.1) 55%);
}

.tile-label,
.tile-subtitle {
  position: absolute;
  z-index: 2;
  left: 26px;
}

.tile-label {
  bottom: 56px;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  font-weight: 950;
  letter-spacing: -0.05em;
}

.tile-subtitle {
  bottom: 30px;
  color: var(--muted);
  font-weight: 750;
}

.collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.collage img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.85fr);
  gap: 24px;
  margin-top: 28px;
}

.recipe-card {
  overflow: hidden;
}

.recipe-hero {
  min-height: 360px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 30px;
}

.recipe-cover-fallback {
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 16%, color-mix(in srgb, var(--cover-accent) 72%, white 10%), transparent 15rem),
    radial-gradient(circle at 85% 20%, rgba(244, 184, 96, 0.2), transparent 18rem),
    linear-gradient(145deg, color-mix(in srgb, var(--cover-accent) 38%, #1f1712), #15100d);
}

.cover-emoji {
  position: absolute;
  right: 28px;
  top: 22px;
  z-index: 1;
  font-size: clamp(4rem, 15vw, 8rem);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.4));
  opacity: 0.92;
}

.recipe-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(12, 8, 5, 0.92), rgba(12, 8, 5, 0.1) 60%);
}

.recipe-hero > * {
  position: relative;
  z-index: 1;
}

.recipe-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4.5vw, 3.7rem);
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.88rem;
  font-weight: 800;
}

.recipe-body {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.recipe-body p {
  color: var(--muted);
  line-height: 1.65;
}

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

.ratings-row div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
}

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

.ratings-row span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ratings-row strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.steps-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: recipe-step;
}

.steps-list li {
  counter-increment: recipe-step;
  position: relative;
  min-height: 54px;
  padding: 14px 14px 14px 58px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  line-height: 1.55;
}

.steps-list li::before {
  content: counter(recipe-step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1b1008;
  font-weight: 950;
}

.helper-notes {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.helper-notes details {
  border: 1px solid rgba(244, 184, 96, 0.28);
  border-radius: 16px;
  background: rgba(244, 184, 96, 0.08);
  overflow: hidden;
}

.helper-notes summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--gold);
  font-weight: 900;
}

.helper-notes p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--text);
  line-height: 1.6;
}

.ingredients-grid li,
.shopping-list li {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}

.shopping-panel {
  padding: 24px;
  align-self: start;
  position: sticky;
  top: 20px;
}

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

.shopping-list strong {
  color: var(--gold);
}

.shopping-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.shopping-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
  cursor: pointer;
}

.shopping-check input:checked + span strong,
.shopping-check input:checked + span span {
  color: var(--text);
}

.shopping-check input:not(:checked) + span span {
  color: var(--muted);
}

.ingredients-grid strong,
.shopping-list strong {
  display: block;
}

.ingredients-grid span,
.shopping-list span {
  display: block;
}

.ingredient-search {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.07);
}

.ingredient-search:hover {
  background: rgba(244, 184, 96, 0.16);
  border-color: rgba(244, 184, 96, 0.6);
}

.shopping-note {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}

.manual-copy-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(244, 184, 96, 0.32);
  border-radius: 18px;
  background: rgba(244, 184, 96, 0.08);
}

.manual-copy-box label {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-weight: 900;
}

.manual-copy-box textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  resize: vertical;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  font: inherit;
  line-height: 1.45;
}

.manual-copy-box p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.print-area {
  display: none;
}

.disabled {
  opacity: 0.45;
  pointer-events: none;
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .print-area {
    display: block !important;
    visibility: visible !important;
    position: fixed;
    inset: 0;
    padding: 24px;
    color: #202020;
    background: #ffffff;
    font-family: Arial, sans-serif;
  }

  .print-area * {
    visibility: visible !important;
  }

  .print-area h1 {
    margin: 0 0 6px;
    font-size: 28px;
  }

  .print-area p {
    margin: 0 0 18px;
    color: #555555;
  }

  .print-area li {
    margin: 10px 0;
    font-size: 18px;
  }
}

.collections-panel,
.profile-panel,
.custom-recipe-panel,
.browse-strip {
  margin-top: 34px;
}

.profile-panel,
.custom-recipe-panel,
.feedback-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 10% 0%, rgba(120, 182, 111, 0.14), transparent 12rem),
    linear-gradient(145deg, rgba(42, 30, 23, 0.92), rgba(31, 23, 18, 0.92));
}

.profile-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: end;
  padding: 20px;
}

.profile-panel p,
.custom-recipe-panel p,
.feedback-panel p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.profile-panel p {
  max-width: 64ch;
}

.profile-actions label,
.custom-recipe-form label,
.feedback-controls label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 850;
}

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

.profile-row input,
.custom-recipe-form input,
.custom-recipe-form textarea,
.feedback-controls select,
.feedback-controls textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  outline: none;
}

.profile-row input:focus,
.custom-recipe-form input:focus,
.custom-recipe-form textarea:focus,
.feedback-controls select:focus,
.feedback-controls textarea:focus {
  border-color: rgba(244, 184, 96, 0.85);
  box-shadow: 0 0 0 3px rgba(244, 184, 96, 0.16);
}

.custom-recipe-panel {
  padding: 20px;
}

.custom-recipe-form {
  margin-top: 18px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.feedback-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.feedback-controls {
  display: grid;
  gap: 12px;
}

.feedback-note {
  font-size: 0.9rem;
}

.strip-heading {
  margin-bottom: 14px;
}

.browse-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.search-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  margin: 0 0 18px;
  background:
    radial-gradient(circle at 10% 0%, rgba(244, 184, 96, 0.12), transparent 10rem),
    var(--panel);
}

.search-panel label {
  display: block;
  font-weight: 850;
  margin-bottom: 10px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.search-row input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  outline: none;
}

.search-row input:focus {
  border-color: rgba(244, 184, 96, 0.85);
  box-shadow: 0 0 0 3px rgba(244, 184, 96, 0.16);
}

.search-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.collection-card {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  text-align: left;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.collection-card:hover,
.collection-card.active {
  transform: translateY(-4px);
  border-color: rgba(244, 184, 96, 0.75);
  background:
    radial-gradient(circle at 20% 0%, rgba(244, 184, 96, 0.18), transparent 9rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    var(--panel);
}

.collection-emoji {
  font-size: 2rem;
}

.collection-card strong {
  font-size: 1.04rem;
}

.collection-card > span:not(.eyebrow):not(.collection-emoji) {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.collection-count {
  margin-top: auto;
  color: var(--gold);
  font-weight: 850;
}

.recipe-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  min-height: 240px;
  transition: transform 180ms ease;
  text-align: left;
  padding: 0;
  color: var(--text);
}

.mini-card:hover {
  transform: translateY(-4px);
}

.mini-card img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  display: block;
}

.mini-cover {
  height: 145px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--cover-accent) 70%, white 8%), transparent 7rem),
    linear-gradient(135deg, color-mix(in srgb, var(--cover-accent) 45%, #1f1712), #17100d);
}

.mini-cover span {
  font-size: 4rem;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.35));
}

.mini-card div {
  padding: 14px;
}

.mini-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.mini-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.88rem;
}

.empty-collection-card {
  border: 1px dashed rgba(244, 184, 96, 0.45);
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.empty-collection-card h3 {
  margin: 0 0 8px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #fff7ed;
  color: #1b1008;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, -4px);
}

@media (max-width: 850px) {
  .hero,
  .result-panel,
  .profile-panel,
  .profile-row {
    grid-template-columns: 1fr;
  }

  .shopping-panel {
    position: static;
  }

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

  .search-row {
    grid-template-columns: 1fr;
  }
}

.notion-embed body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(244, 184, 96, 0.18), transparent 18rem),
    radial-gradient(circle at 92% 8%, rgba(229, 107, 46, 0.16), transparent 16rem),
    var(--bg);
}

.notion-embed .app-shell {
  width: 100%;
  padding: 8px;
}

.notion-embed .hero {
  display: block;
}

.notion-embed .hero-copy {
  min-height: 0;
  padding: 14px;
  border-radius: 24px;
  box-shadow: none;
}

.notion-embed .eyebrow {
  margin-bottom: 8px;
  font-size: 0.68rem;
}

.notion-embed h1 {
  max-width: 520px;
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 7.4vw, 2.45rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.notion-embed .hero-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 0;
  font-size: 0.84rem;
  line-height: 1.35;
}

.notion-embed .hero-actions {
  margin-top: 10px;
  gap: 8px;
}

.notion-embed .mode-panel {
  margin-top: 10px;
  padding-top: 10px;
}

.notion-embed .mode-heading {
  margin-bottom: 7px;
}

.notion-embed .mode-bar {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.notion-embed .mode-chip {
  min-width: auto;
  padding: 7px 9px;
  border-radius: 15px;
  font-size: 0.82rem;
}

.notion-embed .mode-chip small {
  display: none;
}

.notion-embed .primary-button,
.notion-embed .ghost-button,
.notion-embed .primary-link {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.84rem;
}

.notion-embed .random-tile {
  display: none;
}

.notion-embed .result-panel {
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.notion-embed .profile-panel {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
}

.notion-embed .profile-row {
  grid-template-columns: 1fr;
}

.notion-embed .profile-panel p {
  max-width: 64ch;
}

.notion-embed .recipe-card,
.notion-embed .shopping-panel {
  border-radius: 22px;
  box-shadow: none;
}

.notion-embed .recipe-hero {
  min-height: 185px;
  padding: 18px;
}

.notion-embed .recipe-hero h2 {
  font-size: clamp(1.75rem, 8vw, 2.65rem);
}

.notion-embed .recipe-body {
  padding: 18px;
  gap: 16px;
}

.notion-embed .recipe-body p,
.notion-embed .shopping-note {
  line-height: 1.45;
}

.notion-embed .ingredients-grid {
  grid-template-columns: 1fr;
}

.notion-embed .ratings-row {
  grid-template-columns: 1fr;
}

.notion-embed .shopping-panel {
  position: static;
  padding: 18px;
}

.notion-embed .toast {
  bottom: 10px;
  width: calc(100% - 24px);
  justify-content: center;
  text-align: center;
}
