:root {
  /* Greens and warm whites keep the cookbook calm, readable, and brand-led. */
  --background: #f6f1e4;
  --surface: #fffaf0;
  --surface-strong: #fffdf6;
  --ink: #1f2b1d;
  --muted: #6f6a56;
  --line: #ded5bf;
  --cream-deep: #ece0c6;
  --leaf: #617a55;
  --leaf-dark: #2f4f32;
  --leaf-soft: #dce7d2;
  --moss: #8b9a73;
  --shadow: 0 18px 44px rgb(47 79 50 / 12%);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 0.75fr);
  gap: 32px;
  min-height: 100vh;
  padding: 32px;
}

.landing-copy,
.auth-panel {
  min-width: 0;
}

.landing-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.auth-brand {
  color: var(--ink);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.brand-logo-main {
  width: min(260px, 58vw);
  aspect-ratio: 1 / 1.34;
  padding: 10px;
  background: var(--surface-strong);
  box-shadow: 0 12px 34px rgb(47 79 50 / 10%);
}

.brand-logo-wide {
  width: min(460px, 100%);
  height: 124px;
  background: var(--surface-strong);
  box-shadow: 0 12px 34px rgb(47 79 50 / 10%);
  object-position: left center;
}

.landing-copy h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 5.6rem);
  line-height: 1;
}

.landing-copy p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.landing-image {
  width: min(760px, 100%);
  height: clamp(260px, 32vw, 430px);
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 16px;
}

.auth-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.8rem;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.auth-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface-strong);
  color: var(--ink);
}

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

.social-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 900;
}

.social-button:hover {
  border-color: var(--leaf);
  color: var(--leaf-dark);
}

.auth-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.form-note,
.form-error {
  margin: 0;
  line-height: 1.5;
}

.form-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-error {
  min-height: 1.35em;
  color: #8f3f21;
  font-weight: 800;
}

.app-shell {
  /* Desktop uses an app layout with persistent navigation and a working surface. */
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 28px 22px;
  background: #2f4f32;
  color: #fffaf0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.avatar {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-logo-sidebar {
  width: 220px;
  max-width: 100%;
  height: 78px;
  padding: 4px;
  background: #fffaf0;
  border: 1px solid rgb(255 250 240 / 55%);
}

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

.nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: #efe6d7;
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  background: rgb(255 255 255 / 10%);
  color: white;
}

.family-panel {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 8px;
  background: rgb(255 255 255 / 7%);
}

.family-panel h2,
.section-heading h2 {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

.family-panel p {
  margin: 10px 0 16px;
  color: #eee6d6;
  line-height: 1.5;
}

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

.invite-row input {
  min-width: 0;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 8px;
  padding: 0 10px;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-heading,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(620px, 100%);
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-field span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.search-field input,
.field-label input,
.ingredient-row input,
.ingredient-row select,
.ingredient-search textarea,
.step-row textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.ingredient-row select {
  appearance: auto;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--leaf-soft);
  color: var(--leaf-dark);
}

.hero-band {
  /* The hero band is still product UI: cookbook context plus a useful action. */
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  gap: 26px;
  align-items: center;
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fffaf0 0%, #f3ead6 100%);
  box-shadow: var(--shadow);
}

.hero-band h1 {
  max-width: 640px;
  margin: 8px 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 1.02;
}

.hero-band p {
  max-width: 56ch;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.65;
}

.hero-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-stamp {
  width: clamp(62px, 8vw, 92px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgb(47 79 50 / 12%);
}

.hero-image {
  width: 100%;
  height: clamp(260px, 30vw, 420px);
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.eyebrow {
  color: var(--leaf-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  border: 0;
  background: var(--leaf-dark);
  color: white;
}

.primary-button:hover {
  background: #243f28;
}

.secondary-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.icon-button {
  width: 42px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 1.25rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 24px;
  align-items: start;
}

.content-grid > * {
  min-width: 0;
}

.recipe-results,
.editor-panel,
.ingredient-search {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.recipe-results,
.editor-panel {
  padding: 20px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

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

.recipe-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
}

.recipe-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
}

.text-button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--leaf-dark);
  font-weight: 900;
}

.text-button:hover {
  color: var(--leaf);
}

.recipe-card.selected {
  border-color: var(--leaf);
  box-shadow: 0 12px 28px rgb(97 122 85 / 18%);
}

.recipe-card h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

.recipe-card p,
.match-row p,
.upload-zone p,
.save-strip {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.visibility,
.time-chip {
  width: fit-content;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.visibility {
  padding: 5px 9px;
  background: var(--leaf-soft);
  color: var(--leaf-dark);
}

.visibility.public {
  background: #efe5c8;
  color: #4d5f2c;
}

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

.ingredient-search {
  margin-top: 18px;
  padding: 18px;
}

.ingredient-search textarea,
.step-row textarea {
  min-height: 84px;
  resize: vertical;
}

.ingredient-search textarea,
.field-label,
.ingredient-row,
.step-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.ingredient-search textarea {
  padding: 14px;
}

.match-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.match-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: #f2ecd9;
}

.match-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.match-row span {
  color: var(--muted);
}

.editor-panel {
  position: sticky;
  top: 24px;
}

.share-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field-label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.compact-field {
  margin: 0;
}

.field-label input {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
}

.compact-field input {
  font-size: 1rem;
  font-weight: 700;
}

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

.editor-section {
  margin-top: 20px;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 70px 90px minmax(0, 1fr);
  gap: 10px;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 10px;
}

.ingredient-row > * + * {
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.step-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
}

.step-row span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--leaf-soft);
  color: var(--leaf-dark);
  font-weight: 800;
}

.upload-zone {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  border: 1px dashed #b8aa87;
  border-radius: 8px;
  background: #f6efd9;
}

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

.media-preview img,
.media-preview video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.publish-message {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--leaf-dark);
  font-weight: 800;
  line-height: 1.45;
}

.save-strip {
  margin-top: 18px;
  color: var(--leaf-dark);
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px dashed #b8aa87;
  border-radius: 8px;
  background: #f6efd9;
}

.empty-state h2,
.empty-state h3 {
  margin: 0;
  font-family: Georgia, serif;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.recipe-empty {
  min-height: 190px;
  align-content: center;
}

.published-shell {
  min-height: 100vh;
  padding: 28px;
  background: #ece2ca;
}

.published-page {
  max-width: 1100px;
  margin: 0 auto;
}

.published-header {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

.recipe-book-page {
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid #cfc2a7;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(47 79 50 / 14%);
}

.book-brand {
  width: min(220px, 58vw);
  margin-bottom: 18px;
}

.book-brand img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.34;
  object-fit: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.recipe-book-page h1 {
  max-width: 880px;
  margin: 10px 0;
  font-family: Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.98;
}

.published-meta,
.published-footer {
  color: var(--muted);
  line-height: 1.5;
}

.published-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.published-media img,
.published-media video {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.published-columns {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  gap: clamp(24px, 5vw, 64px);
  margin-top: 34px;
}

.published-columns h2 {
  margin: 0 0 16px;
  font-family: Georgia, serif;
  font-size: 1.55rem;
}

.published-ingredients,
.published-directions {
  margin: 0;
  padding-left: 1.2rem;
}

.published-ingredients {
  display: grid;
  gap: 12px;
  list-style: none;
  padding-left: 0;
}

.published-ingredients li {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.published-ingredients span {
  color: var(--leaf-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

.published-directions {
  display: grid;
  gap: 14px;
}

.published-directions li {
  padding-left: 8px;
  line-height: 1.7;
}

.published-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 44px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.published-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.published-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 1100px) {
  /* Tablet and phone layouts stack panels to preserve readable forms. */
  .auth-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .hero-band,
  .content-grid,
  .published-columns,
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .auth-shell {
    padding: 16px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .profile,
  .section-heading,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-band {
    padding: 18px;
  }

  .recipe-grid,
  .ingredient-row,
  .social-login-grid,
  .media-preview,
  .published-nav {
    grid-template-columns: 1fr;
  }

  .recipe-results,
  .editor-panel {
    width: 100%;
    min-width: 0;
  }

  .ingredient-row > * + * {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 10px;
  }
}

@media print {
  body {
    background: white;
  }

  .auth-shell,
  .app-shell,
  .print-hidden {
    display: none !important;
  }

  .published-shell {
    display: block !important;
    min-height: auto;
    padding: 0;
    background: white;
  }

  .published-page {
    max-width: none;
    margin: 0;
  }

  .recipe-book-page {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .recipe-book-page h1 {
    font-size: 38pt;
  }

  .published-columns {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 32pt;
  }

  .published-media img,
  .published-media video {
    max-height: 220pt;
  }
}
