body {
    font-family: Arial, sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
    color: #111827;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

h1 {
    margin-top: 0;
}

h2 {
    margin-top: 0;
    font-size: 22px;
}

form {
    margin-top: 25px;
}

.recipe-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    padding: 22px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
}

textarea {
    min-height: 95px;
    resize: vertical;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.checkbox-grid label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-grid input {
    margin: 0;
}

button,
.button-link {
    display: inline-block;
    align-self: flex-start;
    background: #2f6fed;
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
}

button:hover,
.button-link:hover {
    background: #245bd1;
}

.recipe-box {
    background: #f2f2f2;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
}

pre {
    white-space: pre-wrap;
    font-family: Arial, sans-serif;
}

.error {
    background: #ffe5e5;
    color: #9b0000;
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
}

.loader {
    border: 6px solid #f2f2f2;
    border-top: 6px solid #2f6fed;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    animation: spin 1s linear infinite;
    margin: 25px 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 700px) {
    .container {
        margin: 20px;
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.recipe-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
}

.form-section {
    padding: 22px !important;
    background: #f8fafc !important;
    border-radius: 14px !important;
    border: 1px solid #e5e7eb !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

.form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
}

.form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.full-width {
    grid-column: 1 / -1 !important;
}

.checkbox-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
}

.checkbox-grid label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 400 !important;
}

button {
    width: fit-content !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: #071127;
  background: #ffffff;
}

.landing-page {
  min-height: 100vh;
  padding: 42px 56px 64px;
  background:
    radial-gradient(circle at 78% 42%, rgba(112, 88, 255, 0.13), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #ffffff 72%, #fafbff 100%);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 80px;
}

.brand img {
  height: 58px;
  width: auto;
}

.recipe-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border: 1px solid #d9deea;
  border-radius: 999px;
  color: #071127;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 30px rgba(18, 32, 74, 0.06);
}

.recipe-button:hover {
  border-color: #6b5cff;
  box-shadow: 0 12px 36px rgba(83, 81, 255, 0.15);
}

.hero {
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  align-items: center;
  gap: 36px;
}

.hero-text h1 {
  margin: 0 0 32px;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 800;
}

.hero-text h1 span {
  background: linear-gradient(90deg, #7446ff, #31a8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text p {
  max-width: 560px;
  margin: 0;
  font-size: 26px;
  line-height: 1.75;
  color: #64708a;
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  display: block;
  border-radius: 30px;
  object-fit: cover;
  mask-image: linear-gradient(to left, black 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, black 72%, transparent 100%);
}

.feature-cards {
  max-width: 960px;
  margin: 80px auto 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.feature-card {
  min-height: 240px;
  padding: 44px 48px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #edf0f7;
  box-shadow: 0 20px 60px rgba(18, 32, 74, 0.08);
  text-align: center;
}

.feature-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  border-radius: 50%;
  font-size: 34px;
}

.feature-icon.purple {
  background: #efe7ff;
}

.feature-icon.green {
  background: #e5f8f0;
}

.feature-card h2 {
  margin: 0 0 16px;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.feature-card p {
  margin: 0;
  color: #64708a;
  font-size: 20px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .landing-page {
    padding: 28px 22px 48px;
  }

  .site-header {
    margin-bottom: 48px;
  }

  .brand img {
    height: 44px;
  }

  .recipe-button {
    padding: 12px 18px;
    font-size: 15px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-text p {
    font-size: 20px;
  }

  .hero-image img {
    mask-image: none;
    -webkit-mask-image: none;
  }

  .feature-cards {
    grid-template-columns: 1fr;
    margin-top: 48px;
  }
}

.recipe-page {
  min-height: 100vh;
  padding: 36px 24px 56px;
  background:
    radial-gradient(circle at 85% 15%, rgba(112, 88, 255, 0.13), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  color: #071127;
}

.recipe-header {
  max-width: 860px;
  margin: 0 auto 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recipe-logo img {
  height: 54px;
  width: auto;
}

.home-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border: 1px solid #dbe1ee;
  border-radius: 999px;
  color: #071127;
  text-decoration: none;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(18, 32, 74, 0.06);
}

.recipe-hero {
  max-width: 860px;
  margin: 0 auto 28px;
}

.recipe-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 8vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 900;
}

.recipe-hero h1 span {
  background: linear-gradient(90deg, #7446ff, #31a8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.recipe-hero p {
  max-width: 650px;
  margin: 0;
  font-size: 22px;
  line-height: 1.55;
  color: #64708a;
}

.recipe-form {
  max-width: 860px;
  margin: 0 auto;
}

.recipe-card {
  margin-bottom: 18px;
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e7ebf3;
  box-shadow: 0 18px 50px rgba(18, 32, 74, 0.07);
}

.recipe-card h2 {
  margin: 0 0 20px;
  font-size: 28px;
  letter-spacing: -0.035em;
}

.recipe-input-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -4px 0 14px;
  color: #7d869b;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.recipe-input-separator::before,
.recipe-input-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #dfe4ee;
}

.recipe-input-separator span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #dfe4ee;
  border-radius: 50%;
  background: #ffffff;
}

.recipe-request-help {
  margin: -8px 0 20px;
  color: #64708a;
  font-size: 16px;
  line-height: 1.6;
}

.recipe-request-label {
  display: block;
  margin-bottom: 8px;
  color: #26324a;
  font-weight: 800;
}

.recipe-card .recipe-request-input {
  min-height: 140px;
  line-height: 1.55;
}

.recipe-input-error {
  margin: -4px 0 4px;
  padding: 14px 16px;
  color: #932b25;
  background: #fff0ef;
  border: 1px solid #efb8b3;
  border-radius: 14px;
  font-weight: 700;
}

.upload-box {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 230px;
  padding: 32px 24px;
  border: 2px dashed #cdbdff;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #fbf9ff);
  text-align: center;
  cursor: pointer;
}

.upload-box input {
  display: none;
}

.upload-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efe7ff;
  font-size: 34px;
}

.upload-box strong {
  font-size: 24px;
}

.upload-box span {
  color: #64708a;
  font-size: 18px;
}

.recipe-card .form-control {
  width: 100%;
  border: 1px solid #d6deeb;
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 17px;
  font-family: inherit;
  background: #ffffff;
  color: #071127;
}

.recipe-card textarea {
  min-height: 110px;
  resize: vertical;
}

.preferences-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preferences-card summary::-webkit-details-marker {
  display: none;
}

.preferences-card summary::after {
  content: "⌄";
  font-size: 28px;
  font-weight: 800;
}

.preferences-card[open] summary::after {
  content: "⌃";
}

.preferences-card summary h2 {
  margin-bottom: 6px;
}

.preferences-card summary p {
  margin: 0;
  color: #64708a;
  font-size: 17px;
}

.preferences-grid,
.textarea-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.preferences-grid label,
.textarea-grid label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.checkbox-section {
  margin-top: 26px;
}

.checkbox-section h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

.checkbox-grid label {
  color: #26324a;
  font-size: 17px;
}

.checkbox-grid input {
  margin-right: 8px;
}

.generate-button {
  width: 100%;
  margin: 22px 0 36px;
  padding: 24px 28px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(90deg, #743cff, #2fa8ff);
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 18px 48px rgba(70, 96, 255, 0.28);
}

.generate-button:hover {
  transform: translateY(-2px);
}

.recipe-submit-row {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  margin: 22px 0 36px;
}

.recipe-submit-row .generate-button {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  margin: 0;
}

.recipe-email-option {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  color: #26324a;
  font-size: 17px;
  white-space: nowrap;
  cursor: pointer;
}

.recipe-email-option input {
  margin: 0;
  flex: 0 0 auto;
}

.auth-code-form {
  max-width: 560px;
}

.recipe-card .verification-code-input {
  margin-top: 10px;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}

.auth-message {
  padding: 12px 14px;
  border-radius: 12px;
  background: #eaf8ef;
  color: #17643a;
}

.auth-secondary-form,
.auth-restart-link {
  text-align: center;
}

.auth-link-button {
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.auth-restart-link {
  margin-top: 22px;
}

.legacy-login-fallback {
  margin-top: -12px;
  text-align: center;
  color: #64708a;
}

.legacy-login-fallback summary {
  cursor: pointer;
}

.legacy-login-fallback .auth-link-button {
  margin-top: 12px;
}

.coming-soon {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.coming-soon h2 {
  margin: 0 0 24px;
  color: #64708a;
  font-size: 22px;
}

.coming-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.coming-grid div {
  padding: 24px 18px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #edf0f7;
  box-shadow: 0 14px 40px rgba(18, 32, 74, 0.06);
}

.coming-grid span {
  display: block;
  font-size: 34px;
  margin-bottom: 14px;
}

.coming-grid strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.coming-grid p {
  margin: 0;
  color: #64708a;
}

@media (max-width: 700px) {
  .recipe-page {
    padding: 28px 18px 48px;
  }

  .recipe-header {
    margin-bottom: 36px;
  }

  .recipe-logo img {
    height: 42px;
  }

  .home-button {
    padding: 11px 18px;
    font-size: 15px;
  }

  .recipe-hero h1 {
    font-size: 48px;
  }

  .recipe-hero p {
    font-size: 20px;
  }

  .recipe-card {
    padding: 22px;
    border-radius: 24px;
  }

  .recipe-card h2 {
    font-size: 24px;
  }

  .preferences-grid,
  .textarea-grid,
  .coming-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .recipe-form .checkbox-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .recipe-form .checkbox-grid > label {
    min-width: 0;
  }

  .upload-box {
    min-height: 210px;
  }

  .generate-button {
    margin-top: 20px;
    font-size: 22px;
    padding: 22px;
  }

  .recipe-submit-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 20px;
  }

  .recipe-email-option {
    align-self: flex-start;
  }

  .recipe-submit-row .generate-button {
    width: 100% !important;
    margin: 0;
  }
}

.mode-intro {
  margin: 0 0 14px;
  color: #64708a;
  font-size: 16px;
}

.upload-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e1e7f2;
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  cursor: pointer;
}

.mode-option:hover {
  border-color: #8b7cff;
  background: #faf9ff;
}

.mode-option:focus-within {
  outline: 3px solid rgba(98, 82, 255, 0.18);
  outline-offset: 2px;
}

.mode-option input[type="radio"] {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: #7446ff;
}

.mode-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.mode-content strong {
  color: #17213a;
  font-size: 16px;
  line-height: 1.25;
}

.mode-content span {
  color: #64708a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.mode-option:has(input[type="radio"]:checked) {
  border-color: #7446ff;
  box-shadow: 0 6px 18px rgba(116, 70, 255, 0.11);
  background: linear-gradient(180deg, #ffffff, #f8f5ff);
}

.mode-option:has(input[type="radio"]:checked) .mode-content strong {
  color: #5840cf;
}

.upload-section {
  margin-top: 16px;
}

.media-limit {
  margin: 0 0 10px;
  color: #64708a;
  font-size: 14px;
  font-weight: 700;
}

.media-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.recipe-form .media-action-control {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #d8dff0;
  border-radius: 15px;
  background: #ffffff;
  text-align: left;
}

.recipe-form .media-action-control input[type="file"] {
  position: absolute;
  display: block;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.recipe-form .media-action-control:hover {
  border-color: #8b7cff;
  background: #faf9ff;
}

.recipe-form .media-action-control:focus-within {
  outline: 3px solid rgba(98, 82, 255, 0.18);
  outline-offset: 2px;
}

.recipe-form .media-action-control .upload-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: #efeaff;
  font-size: 20px;
}

.media-action-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.recipe-form .media-action-copy strong {
  color: #17213a;
  font-size: 15px;
  line-height: 1.25;
}

.media-action-copy small {
  color: #68738a;
  font-size: 12px;
  font-weight: 600;
}

.upload-status {
  margin: 12px 0 0;
  color: #64708a;
  font-size: 14px;
  line-height: 1.45;
}

.upload-box.selected {
  border-color: #22c55e !important;
  background: linear-gradient(180deg, #f0fdf4, #ffffff) !important;
}

.upload-box.selected .upload-icon {
  background: #dcfce7;
}

.upload-box.selected strong {
  color: #15803d;
}

/* Sprint 12.1 unified multimodal Generate composer. */

.generate-composer {
  position: relative;
  min-width: 0;
  margin-bottom: 0;
  padding: 18px;
  border: 1px solid rgba(11, 78, 162, 0.2);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(18, 32, 74, 0.08);
}

.generate-composer:focus-within {
  border-color: rgba(11, 78, 162, 0.52);
  box-shadow: 0 16px 42px rgba(18, 32, 74, 0.08),
    0 0 0 3px rgba(11, 78, 162, 0.1);
}

.generate-composer-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  max-height: 180px;
  padding: 3px 2px 10px;
  overflow-x: hidden;
  overflow-y: hidden;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #071127;
  font: inherit;
  font-size: 18px;
  line-height: 1.5;
}

.generate-composer-input::placeholder {
  color: #718096;
  opacity: 1;
}

.generate-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.generate-attachments {
  margin: 4px 0 12px;
}

.photo-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.photo-attachment {
  position: relative;
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  overflow: hidden;
  border: 1px solid #d9e2ef;
  border-radius: 14px;
  background: #eef3f9;
}

.photo-attachment img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-attachment {
  display: flex;
  width: min(100%, 340px);
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 14px;
  background: #f5f8fc;
}

.video-attachment[hidden],
.generate-attachments[hidden] {
  display: none;
}

.video-attachment-icon {
  flex: 0 0 auto;
  font-size: 1.25rem;
}

.video-attachment-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #26324a;
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  border: 1px solid #ccd6e4;
  border-radius: 50%;
  background: #ffffff;
  color: #25334d;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.photo-attachment .attachment-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(14, 27, 52, 0.82);
  color: #ffffff;
}

.attachment-remove:focus-visible,
.generate-composer-action:focus-visible,
.generate-media-menu button:focus-visible {
  outline: 3px solid rgba(11, 78, 162, 0.25);
  outline-offset: 2px;
}

.generate-composer-status {
  margin: 2px 0 10px;
  color: #64708a;
  font-size: 0.86rem;
  line-height: 1.4;
}

.generate-composer-status:empty {
  display: none;
}

.generate-composer-actions {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.generate-media-menu-wrap {
  position: relative;
}

.generate-composer-action,
.generate-composer .generate-composer-voice.voice-input-button {
  display: inline-flex;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d3deec;
  border-radius: 50%;
  background: #f4f7fb;
  color: #0b4ea2;
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

.generate-composer .generate-composer-voice.voice-input-button {
  flex-direction: row;
  gap: 0;
  font-size: 1rem;
}

.generate-composer .generate-composer-voice.voice-input-button > span:first-child {
  font-size: 1.15rem;
}

.generate-composer-action:hover:not(:disabled),
.generate-composer .generate-composer-voice.voice-input-button:hover:not(:disabled) {
  border-color: rgba(11, 78, 162, 0.48);
  background: #e8f1fc;
  color: #0b4ea2;
}

.generate-composer .generate-composer-voice.voice-input-button[data-voice-state="speaking_review"] {
  color: #ffffff;
  background: #0b4ea2;
}

.generate-composer .generate-composer-voice.voice-input-button::after {
  inset: -4px;
  border-radius: 50%;
}

.generate-media-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  bottom: calc(100% + 10px);
  display: grid;
  width: 210px;
  max-width: calc(100vw - 52px);
  padding: 7px;
  border: 1px solid #dce4ef;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(18, 32, 74, 0.16);
}

.generate-media-menu.hidden {
  display: none;
}

.generate-media-menu button {
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #17213a;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.generate-media-menu button:hover {
  background: #eef5fd;
}

.generate-voice-status:empty {
  display: none;
}

.generate-composer-group {
  min-width: 0;
}

.generate-composer-group > .generate-voice-status {
  min-height: 0;
  margin: 10px 2px 0;
  color: #64708a;
  font-size: 0.86rem;
  line-height: 1.4;
}

.preferences-card > summary > h2 {
  margin: 0;
  font-size: 1.2rem;
}

.hidden {
  display: none;
}

@media (max-width: 340px) {
  .upload-mode-toggle,
  .media-action-row {
    grid-template-columns: 1fr;
  }
}

/* Interactive recipe split-screen override */

.recipe-page {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 1.25rem !important;
}

.recipe-hero {
  max-width: 700px !important;
  margin: 1rem auto 2rem auto !important;
}

.recipe-hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem) !important;
  line-height: 1.05 !important;
}

.recipe-hero h1 span {
  font-size: clamp(1.8rem, 3.5vw, 3rem) !important;
}

.interactive-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr) !important;
  gap: 1.5rem !important;
  align-items: start !important;
}

.interactive-layout .recipe-card {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}

.recipe-card pre {
  font-family: inherit !important;
  font-size: 1rem !important;
  line-height: 1.7 !important;
  white-space: pre-wrap !important;
  overflow-wrap: break-word !important;
}

@media (max-width: 900px) {
  .interactive-layout {
    grid-template-columns: 1fr !important;
  }
}

/* Interactive recipe split-screen final override */

.interactive-layout {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 24px !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  align-items: start !important;
}

.interactive-layout > .recipe-card {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.interactive-layout pre {
  white-space: pre-wrap !important;
  overflow-wrap: break-word !important;
  font-size: 1rem !important;
  line-height: 1.7 !important;
  font-family: inherit !important;
}

@media (max-width: 900px) {
  .interactive-layout {
    grid-template-columns: 1fr !important;
  }
}

.recipe-card:last-child {
    position: sticky;
    top: 20px;
    box-shadow: 0 8px 24px rgba(91,108,255,0.15);
}
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {

    .quick-actions {
        gap: 12px;
        margin-bottom: 24px;
    }

    .quick-action {
        min-height: 52px;
        padding: 12px 18px;
    }

}

#recipeAnswerText {
    line-height: 1.8;
    white-space: pre-wrap;
}

.loading-card {
    max-width: 640px;
    margin: 80px auto;
    text-align: center;
}

@media (max-width: 390px) {
  .generate-composer {
    padding: 15px;
    border-radius: 20px;
  }

  .generate-composer-input {
    font-size: 16px;
  }

  .photo-attachment {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .generate-media-menu {
    max-width: calc(100vw - 48px);
  }
}

/* Sprint 13.4 compact recipe browsing shelves and title actions. */
.recipe-browse-shell,
.recipe-cards-shell {
    width: min(1180px, calc(100% - 32px));
}

.recipe-browse-heading > p:last-child,
.recipe-cards-heading > p:last-child {
    max-width: 680px;
    color: var(--da-muted);
    line-height: 1.55;
}

.recipe-search {
    margin: 0 0 32px;
}

.recipe-search > label {
    display: block;
    margin-bottom: 8px;
    color: var(--da-text);
    font-weight: 800;
}

.recipe-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 680px;
}

.recipe-search-row .form-control {
    min-width: 0;
}

.recipe-search-clear {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--da-primary);
    font-weight: 750;
}

.recipe-time-groups {
    display: grid;
    gap: 34px;
}

.recipe-shelf-section {
    min-width: 0;
}

.recipe-shelf-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 14px;
}

.recipe-shelf-heading h2 {
    margin: 0;
    color: var(--da-text);
    font-size: clamp(1.25rem, 2.3vw, 1.65rem);
}

.recipe-shelf-heading p {
    margin: 0;
    color: var(--da-muted);
    font-size: 0.85rem;
}

.recipe-shelf {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(225px, 255px);
    gap: 16px;
    padding: 3px 3px 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
}

.recipe-shelf:focus-visible {
    outline: 3px solid rgb(15 75 142 / 22%);
    outline-offset: 3px;
    border-radius: 8px;
}

.recipe-tile {
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid var(--da-border);
    border-radius: 16px;
    background: var(--da-surface);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 7px 20px rgb(40 51 91 / 7%);
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.recipe-tile:hover {
    color: inherit;
    border-color: #c7d3e1;
    box-shadow: 0 10px 24px rgb(40 51 91 / 11%);
    transform: translateY(-2px);
}

.recipe-tile:focus-visible {
    outline: 3px solid rgb(15 75 142 / 28%);
    outline-offset: 2px;
}

.recipe-tile-image {
    display: grid;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    place-items: center;
    background: var(--da-primary-light);
}

.recipe-tile-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Working and Cookbook tiles share one visual treatment on every Home shelf. */
.recipe-tile-image > .recipe-thumbnail {
    height: 100%;
    aspect-ratio: inherit;
    border-radius: 0;
    background: transparent;
}

.recipe-tile-image > .recipe-thumbnail .recipe-thumbnail-placeholder {
    background: linear-gradient(145deg, #fff4eb, var(--da-primary-light));
    color: var(--da-primary);
}

.account-notifications {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.account-notifications h2 {
    margin-top: 0;
}

.account-notification-status {
    margin-bottom: 0;
    color: var(--da-muted);
}

.account-notification-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.account-notification-actions [hidden] {
    display: none !important;
}

.account-reminders {
    display: block;
}

.account-reminder-heading,
.account-reminder-summary,
.account-reminder-actions,
.account-reminder-schedule-fields,
.account-timezone-form {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.account-reminder-heading {
    justify-content: space-between;
}

.account-reminder-add {
    flex: 0 0 auto;
}

.account-reminder-add > summary,
.account-reminder-actions summary {
    cursor: pointer;
    list-style: none;
}

.account-reminder-form {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.8rem;
    min-width: min(34rem, 82vw);
}

.account-reminder-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(2.5rem, 1fr));
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.account-reminder-days legend {
    grid-column: 1 / -1;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.account-reminder-days label {
    display: grid;
    place-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.15rem;
    border: 1px solid #ded5cf;
    border-radius: 10px;
    font-size: 0.78rem;
}

.account-reminder-schedule-fields > label {
    flex: 1 1 0;
}

.account-reminder-enabled {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-reminder-list {
    margin-top: 1rem;
    border-top: 1px solid #eadfd7;
}

.account-reminder-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eadfd7;
}

.account-reminder-summary {
    justify-content: space-between;
}

.account-reminder-summary h3,
.account-reminder-summary p,
.account-reminder-message {
    margin: 0 0 0.25rem;
}

.account-reminder-summary p,
.account-reminder-message,
.account-timezone-form small {
    color: var(--da-muted);
}

.account-reminder-state {
    padding: 0.25rem 0.55rem;
    color: #1d6845;
    background: #e9f6ef;
    border-radius: 999px;
    font-weight: 700;
}

.account-reminder-state.is-paused {
    color: #6e6259;
    background: #f1eeeb;
}

.account-reminder-actions {
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.account-reminder-actions form {
    margin: 0;
}

.account-reminder-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    box-sizing: border-box;
    padding: 0.35rem 0.7rem;
    color: #173b5f;
    background: #f7f5f3;
    border: 1px solid #ded7d2;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.account-reminder-control:hover {
    background: #f0ece9;
}

.account-reminder-control:focus-visible {
    outline: 3px solid rgba(47, 159, 248, 0.3);
    outline-offset: 2px;
}

.account-reminder-control--danger {
    color: #9a2f25;
    background: #fff5f3;
    border-color: #e8c5c0;
}

.account-reminder-control--danger:hover {
    background: #ffebe8;
}

.account-reminder-editor[open] {
    flex: 1 1 100%;
}

.account-reminder-actions:has(.account-reminder-editor[open]) {
    flex-wrap: wrap;
}

.account-reminder-empty {
    margin: 1rem 0;
    padding: 0.8rem;
    background: #fbf7f4;
    border-radius: 12px;
}

.account-timezone-form {
    align-items: end;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.account-timezone-form small {
    flex-basis: 100%;
}

@media (max-width: 720px) {
    .account-notifications {
        flex-direction: column;
    }

    .account-reminder-heading,
    .account-reminder-schedule-fields,
    .account-timezone-form {
        flex-direction: column;
        align-items: stretch;
    }

    .account-reminder-add,
    .account-reminder-add > summary {
        width: 100%;
    }

    .account-reminder-form {
        min-width: 0;
    }
}

.recipe-tile-image--empty {
    background: linear-gradient(145deg, #fff4eb, var(--da-primary-light));
}

.recipe-tile-placeholder {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    background: var(--da-primary);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 850;
}

.recipe-tile-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 13px 14px 14px;
}

.recipe-tile-title {
    color: var(--da-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.recipe-tile-origin {
    color: var(--da-primary);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.recipe-tile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    color: var(--da-muted);
    font-size: 0.78rem;
}

.recipe-tile-rating {
    color: #986112;
    font-weight: 800;
}

.recipe-card-collection > .recipe-tile {
    min-width: 0;
}

.recipe-search-empty {
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--da-border);
    border-radius: 18px;
    background: var(--da-surface);
    text-align: center;
}

.recipe-search-empty h2 {
    margin-top: 0;
}

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

.recipe-title-actions,
.cookbook-title-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}

.recipe-title-actions form,
.cookbook-title-actions form {
    margin: 0;
}

.recipe-title-action {
    display: grid;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--da-primary);
    font: inherit;
    font-size: 1.65rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.recipe-title-action:hover,
.recipe-title-action:focus-visible {
    background: var(--da-primary-light);
    color: var(--da-primary);
}

.recipe-title-action:focus-visible {
    outline: 3px solid rgb(15 75 142 / 24%);
    outline-offset: 1px;
}

.recipe-title-action svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.recipe-title-action--danger,
.recipe-card-share-trigger.recipe-title-action--danger {
    color: #9a3030;
}

.recipe-title-action--danger:hover,
.recipe-title-action--danger:focus-visible {
    background: #fff0ef;
    color: #8b2525;
}

.recipe-card-eyebrow-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recipe-card-share-menu {
    position: relative;
    top: auto;
    left: auto;
    margin-top: 0;
}

.recipe-card-share-trigger {
    width: 44px;
    height: 44px;
}

.recipe-card-share-popover {
    right: 0;
    left: auto;
}

@media (max-width: 720px) {
    .recipe-browse-shell,
    .recipe-cards-shell {
        width: min(100% - 24px, 1180px);
    }

    .recipe-shelf {
        grid-auto-columns: minmax(220px, 76vw);
        margin-right: -12px;
    }

    .recipe-title-row {
        gap: 8px;
    }

    .recipe-title-actions {
        margin-top: -6px;
    }
}

@media (max-width: 520px) {
    .recipe-search-row {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .recipe-search-row .form-control {
        flex-basis: 100%;
    }

    .recipe-search-clear {
        padding: 0 8px;
    }

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

    .recipe-card-collection .recipe-tile-copy {
        padding: 10px;
    }

    .recipe-card-collection .recipe-tile-meta {
        align-items: flex-start;
        flex-direction: column;
    }
}

.loading-card h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.loading-subtitle {
    font-size: 1.05rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
}

.loading-status {
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
}

.loading-note {
    margin-top: 1.25rem;
    color: #6b7280;
}

.loader {
    margin: 1.5rem auto;
}

.home-button.disabled-button {
    background: #e9edf5 !important;
    color: #7a879c !important;
    border: 1px solid #d6deeb !important;
    pointer-events: none;
    cursor: not-allowed;
    box-shadow: none !important;
}

.loader-hidden {
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-greeting {
  font-weight: 700;
  color: #071127;
}

.logout-form {
  margin: 0;
}

.logout-form .home-button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.recipe-list {
    display: grid;
    gap: 18px;
}

.saved-recipe-card {
    border: 1px solid rgba(120, 72, 35, 0.18);
    border-radius: 18px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.saved-recipe-card h2 {
    margin-top: 0;
}

.recipe-date {
    margin-bottom: 16px;
    opacity: 0.75;
}

/* ======================================================================
   Saved recipe page header
   ====================================================================== */

.recipe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.recipe-logo {
    display: block;
    flex-shrink: 0;
}

.recipe-logo img {
    display: block;
    width: min(310px, 36vw);
    height: auto;
}

.welcome-user {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    color: #14203a;
}

.header-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.logout-form {
    display: contents;
}

.header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 10px 16px;

    border: 1px solid rgba(30, 43, 73, 0.14);
    border-radius: 999px;

    background: #ffffff;
    color: #14203a;

    font: inherit;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;
    box-shadow: 0 6px 18px rgba(40, 51, 91, 0.07);
}

.header-button:hover {
    transform: translateY(-1px);
}

.header-button-primary {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(
        135deg,
        #6958ff,
        #2f9ff8
    );
}


/* ======================================================================
   Recipe heading
   ====================================================================== */

.recipe-hero {
    margin: 42px 0 24px;
}

.recipe-eyebrow,
.chat-eyebrow {
    margin: 0 0 8px;
    color: #6c7487;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.recipe-hero h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    line-height: 1.02;

    background: linear-gradient(
        90deg,
        #6d50ff,
        #2ea9f8
    );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.recipe-metadata-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 38px;
    margin-top: 18px;
    color: #68738a;
    font-size: 0.94rem;
}

.recipe-created-date {
    margin: 0;
}

.recipe-metadata-separator {
    color: #9aa2b2;
}

.recipe-rating-label-compact {
    color: #4b5870;
    font-weight: 750;
}

.recipe-image-panel {
    width: 100%;
    margin: 0 0 28px;
}

.recipe-nutrition-card {
    width: 100%;
    margin: -12px 0 28px;
    padding: 14px clamp(10px, 3vw, 18px) 13px;
    border: 1px solid #dfe6ef;
    border-radius: 16px;
    background: #f8fafc;
    color: #25344c;
}

.recipe-nutrition-card[hidden] {
    display: none;
}

.recipe-nutrition-action-state {
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    gap: 12px;
    margin: -12px 0 28px;
    padding: 8px 12px;
    border-radius: 16px;
    background: #f4f7fb;
}

.recipe-nutrition-action-state[hidden] {
    display: none;
}

.recipe-nutrition-action {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(11, 78, 162, 0.22);
    border-radius: 999px;
    background: #ffffff;
    color: #0b4ea2;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.recipe-nutrition-action:disabled {
    cursor: wait;
    opacity: 0.68;
}

.recipe-nutrition-action:disabled:hover,
.recipe-nutrition-action[aria-busy="true"] {
    border-color: rgba(11, 78, 162, 0.22);
    background: #ffffff;
    color: #0b4ea2;
}

.recipe-nutrition-action-status {
    margin: 0;
    color: #52627a;
    font-size: 0.86rem;
    line-height: 1.3;
}

.recipe-nutrition-card h2 {
    margin: 0 0 10px;
    color: #43516a;
    font-size: clamp(0.82rem, 3.6vw, 0.95rem);
    font-weight: 750;
    line-height: 1.25;
}

.recipe-nutrition-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.recipe-nutrition-metrics > div {
    min-width: 0;
    padding: 0 clamp(3px, 1.5vw, 10px);
    text-align: center;
}

.recipe-nutrition-metrics > div + div {
    border-left: 1px solid #e1e7ef;
}

.recipe-nutrition-metrics dt,
.recipe-nutrition-metrics dd {
    margin: 0;
    white-space: nowrap;
}

.recipe-nutrition-metrics dt {
    color: #68758a;
    font-size: clamp(0.65rem, 2.8vw, 0.78rem);
    line-height: 1.2;
}

.recipe-nutrition-metrics dd {
    margin-top: 3px;
    color: #18263b;
    font-size: clamp(0.75rem, 3.2vw, 0.94rem);
    font-weight: 800;
    line-height: 1.2;
}

.recipe-image-panel [hidden] {
    display: none !important;
}

.recipe-generated-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 24px;
    background: #edf3fb;
}

.recipe-generated-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-image-signature {
    position: absolute;
    z-index: 2;
    right: clamp(12px, 1.5vw, 18px);
    bottom: clamp(12px, 1.5vw, 18px);
    width: clamp(38px, 4.2vw, 50px);
    height: clamp(38px, 4.2vw, 50px);
    pointer-events: none;
}

.recipe-image-signature::before,
.recipe-image-signature::after {
    content: "";
    position: absolute;
    inset: 0;
    -webkit-mask: url("/static/daddys-ai-signature-mask.png") center / contain no-repeat;
    mask: url("/static/daddys-ai-signature-mask.png") center / contain no-repeat;
}

.recipe-image-signature::before {
    background-color: rgba(0, 0, 0, 0.82);
    mix-blend-mode: multiply;
    opacity: 0.46;
    transform: translate(1px, 1px);
}

.recipe-image-signature::after {
    background-color: rgba(255, 255, 255, 0.94);
    mix-blend-mode: screen;
    opacity: 0.42;
    transform: translate(-1px, -1px);
}

.recipe-image-placeholder {
    display: flex;
    min-height: clamp(150px, 28vw, 280px);
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, #edf5ff, #f6f8fc);
    color: #30476b;
    text-align: center;
}

.recipe-image-placeholder p,
.recipe-image-action-state p {
    margin: 0;
}

.recipe-image-spinner {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 2px solid rgba(11, 78, 162, 0.2);
    border-top-color: #0b4ea2;
    border-radius: 50%;
    animation: recipe-image-spin 0.9s linear infinite;
}

.recipe-image-action-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px 16px;
    border-radius: 18px;
    background: #f4f7fb;
    color: #52627a;
}

.recipe-image-action {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(11, 78, 162, 0.22);
    border-radius: 999px;
    background: #ffffff;
    color: #0b4ea2;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.recipe-image-action:disabled {
    cursor: wait;
    opacity: 0.62;
}

.recipe-image-action:disabled:hover,
.recipe-image-action[aria-busy="true"] {
    border-color: rgba(11, 78, 162, 0.22);
    background: #ffffff;
    color: #0b4ea2;
}

.recipe-image-action-status {
    min-height: 1.2em;
    font-size: 0.9rem;
}

.recipe-image-revision-state {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    padding: 5px 4px 0;
    color: #637087;
    font-size: 0.86rem;
}

.recipe-image-update-action {
    min-height: 36px;
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #0b4ea2;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.recipe-image-update-action:hover {
    background: #edf3fb;
}

.recipe-image-update-action:focus-visible {
    outline: 3px solid rgba(11, 78, 162, 0.28);
    outline-offset: 2px;
}

@keyframes recipe-image-spin {
    to { transform: rotate(360deg); }
}

/* Shared list thumbnail. The delivery endpoint remains the original image. */
.recipe-thumbnail {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 14px;
    background: #edf3fb;
}

.recipe-thumbnail img,
.recipe-thumbnail-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.recipe-thumbnail img {
    position: absolute;
    z-index: 1;
    inset: 0;
    object-fit: cover;
    object-position: center;
}

.recipe-thumbnail img[hidden] {
    display: none;
}

.recipe-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9f2fd, #f5f7fb);
    color: #8aa0bd;
}

.recipe-thumbnail-placeholder-mark {
    font-size: 1.35rem;
    line-height: 1;
}

.recipe-thumbnail--pending .recipe-thumbnail-placeholder-mark,
.recipe-thumbnail--generating .recipe-thumbnail-placeholder-mark {
    color: #4b78ad;
    animation: recipe-thumbnail-pulse 1.8s ease-in-out infinite;
}

.recipe-thumbnail--failed .recipe-thumbnail-placeholder-mark {
    color: #9aa4b2;
}

@keyframes recipe-thumbnail-pulse {
    50% { opacity: 0.42; }
}

@media (max-width: 480px) {
    .recipe-generated-image-wrap,
    .recipe-image-placeholder {
        border-radius: 18px;
    }

    .recipe-image-signature {
        right: 12px;
        bottom: 12px;
        width: 34px;
        height: 34px;
    }

    .recipe-image-action-state {
        align-items: flex-start;
        flex-direction: column;
    }

    .recipe-image-action {
        width: 100%;
    }
}

/* Compact recipe metadata rating control. */

.rating-info-wrap {
    position: relative;
    display: inline-flex;
}

.rating-info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #52627a;
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
}

.rating-info-button:hover {
    background: #edf3fb;
}

.rating-info-button:focus-visible,
.rating-star:focus-visible {
    outline: 3px solid rgba(47, 159, 248, 0.38);
    outline-offset: 2px;
}

.rating-info-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: 260px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    background: #14203a;
    box-shadow: 0 10px 24px rgba(20, 32, 58, 0.2);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    transform: translateX(var(--rating-popover-shift, 0px));
}

.rating-info-popover[hidden] {
    display: none;
}

.rating-status {
    min-width: 58px;
    min-height: 20px;
    color: #4f46d8;
    font-size: 0.82rem;
    font-weight: 750;
    white-space: nowrap;
}

.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.rating-star {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;

    color: #cbd0dc;
    font-size: 1.55rem;
    line-height: 1;

    cursor: pointer;
    transition:
        transform 0.15s ease,
        color 0.15s ease;
}

.rating-star:hover,
.rating-star.selected {
    color: #ffc43d;
}

.rating-star:hover {
    transform: scale(1.1);
}

.rating-star:disabled {
    cursor: wait;
    opacity: 0.7;
}

/* ======================================================================
   Recipe and chat layout
   ====================================================================== */

.interactive-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
    align-items: start;
    gap: 28px;
}

.recipe-card {
    min-width: 0;
    padding: 30px;

    border: 1px solid rgba(38, 50, 86, 0.08);
    border-radius: 28px;

    background: #ffffff;
    box-shadow: 0 18px 44px rgba(55, 54, 110, 0.07);
}

.recipe-card h2 {
    margin-top: 0;
    color: #101a31;
}

.recipe-content-flow {
    margin: 0;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.recipe-content-line,
.recipe-content-spacer {
    display: block;
    white-space: pre-wrap;
}

.recipe-content-spacer {
    min-height: 0.8em;
}

.recipe-section-heading {
    margin: 1.25rem 0 0.35rem;
    color: #182641;
    font-family: inherit;
    font-size: clamp(1.05rem, 2.4vw, 1.18rem);
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.recipe-content-flow > .recipe-section-heading:first-child {
    margin-top: 0;
}


/* ======================================================================
   Daddy's AI chat
   ====================================================================== */

.recipe-card.recipe-chat-card {
    position: sticky;
    top: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.chat-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.chat-card-heading h2 {
    margin-bottom: 0;
}

.chat-status-dot {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #25bf77;
    box-shadow: 0 0 0 5px rgba(37, 191, 119, 0.12);
}

.chat-introduction {
    margin: 12px 0 18px;
    color: #68738a;
    line-height: 1.55;
}

.recipe-chat-card > .chat-card-heading,
.recipe-chat-card > .chat-introduction,
.recipe-chat-card > .chat-history,
.recipe-chat-card > .chat-input-area {
    box-sizing: border-box;
    width: 100%;
    max-width: 780px;
    margin-right: auto;
    margin-left: auto;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.quick-action {
    padding: 9px 12px;
    border: 1px solid rgba(93, 78, 235, 0.15);
    border-radius: 999px;

    background: #f5f3ff;
    color: #3c347e;

    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;

    cursor: pointer;
}

.quick-action:hover {
    background: #ece8ff;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 12px;

    min-height: 0;
    max-height: 420px;
    padding: 0 2px;
    margin-bottom: 8px;

    overflow-y: auto;

    border: 0;
    border-radius: 0;
    background: transparent;
}

.chat-message {
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 16px;
}

.chat-message strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
}

.chat-message pre,
.chat-message p {
    margin: 0;
    font-family: inherit;
    font-size: 0.94rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-message {
    align-self: flex-start;
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid rgba(66, 51, 173, 0.1);
}

.user-message {
    align-self: flex-end;
    width: auto;
    max-width: 76%;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #6554f5,
        #2d99ed
    );
}

.proposal-status {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 8px;
    color: #6757b7;
    background: #f0edff;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

.proposal-response {
    margin-top: 10px;
}

.proposal-recipe {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
    padding: 12px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.proposal-recipe-heading {
    display: block;
    margin-bottom: 10px;
    color: #51439f;
    font-size: 0.86rem;
    font-weight: 800;
}

.recipe-card .proposal-recipe-text {
    width: 100%;
    max-width: 100%;
    margin: 0;
    color: #202a42;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
}

.proposal-fallback {
    margin: 12px 0 0;
    padding: 11px 12px;
    border: 1px solid #e2d7f5;
    border-radius: 12px;
    color: #5d5276;
    background: #faf7ff;
    font-size: 0.86rem;
    line-height: 1.45;
}

.proposal-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.proposal-action-button {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.proposal-action-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.proposal-accept-button {
    border: 0;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #6756f5,
        #299df3
    );
}

.proposal-reject-button {
    border: 1px solid rgba(66, 51, 173, 0.3);
    color: #3c347e;
    background: #ffffff;
}

.proposal-action-button:focus-visible {
    outline: 3px solid rgba(98, 82, 255, 0.22);
    outline-offset: 2px;
}

.proposal-progress,
.proposal-error {
    display: block;
    margin-top: 8px;
    font-size: 0.82rem;
}

.proposal-progress {
    color: #68738a;
}

.proposal-error {
    color: #b42318;
}

.chat-input-area {
    display: grid;
    gap: 6px;
}

.recipe-chat-composer {
    display: grid;
    grid-template-rows: auto auto;
    min-height: 136px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: visible;
    border: 1px solid rgba(34, 47, 80, 0.2);
    border-radius: 18px;
    background: #ffffff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.recipe-chat-composer:focus-within {
    border-color: var(--da-primary, #0b4ea2);
    box-shadow: 0 0 0 3px rgba(11, 78, 162, 0.12);
}

#recipeQuestion.recipe-chat-composer-input {
    display: block;
    width: 100%;
    min-height: 72px;
    max-height: 124px;
    box-sizing: border-box;
    resize: none;
    overflow-y: hidden;
    padding: 10px 13px 6px;
    border: 0;
    border-radius: 18px 18px 0 0;
    color: #202a42;
    background: transparent;
    font: inherit;
    line-height: 1.45;
}

#recipeQuestion.recipe-chat-composer-input:focus {
    outline: 0;
}

.recipe-chat-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    height: 64px;
    padding: 0 12px 12px;
    gap: 12px;
}

.recipe-chat-voice-button.voice-input-button,
.recipe-chat-send-button {
    display: flex;
    flex: 0 0 52px;
    align-self: auto;
    align-items: center;
    justify-content: center;
    width: 52px !important;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    font: inherit;
    cursor: pointer;
}

.recipe-chat-voice-button.voice-input-button {
    border-color: rgba(11, 78, 162, 0.32);
}

.recipe-chat-voice-button.voice-input-button > span:first-child {
    display: block;
    line-height: 1;
}

.recipe-chat-voice-button.voice-input-button::after {
    border-radius: 50%;
}

.recipe-chat-send-button {
    border: 0;
    color: #ffffff;
    background: var(--da-primary, #0b4ea2);
    font-size: 1.3rem;
    line-height: 1;
}

.recipe-chat-send-icon {
    display: block;
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.recipe-chat-send-button:hover:not(:disabled) {
    background: var(--da-primary-hover, #0a428a);
}

.recipe-chat-send-button:focus-visible {
    outline: 3px solid rgba(11, 78, 162, 0.24);
    outline-offset: 2px;
}

.recipe-chat-send-button:disabled {
    cursor: not-allowed;
    color: #718096;
    background: #e4e9f0;
    opacity: 1;
}

.recipe-chat-send-button[aria-busy="true"] {
    cursor: wait;
}

.recipe-chat-voice-status {
    margin-top: 2px;
}

.ai-content-disclaimer {
    margin: 20px 0 0;
    padding: 12px 14px;
    border: 1px solid #d9e3f2;
    border-radius: 12px;
    background: #f5f8fc;
    color: #47566f;
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.ai-content-disclaimer--landing {
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 920px;
    margin: 32px auto;
    text-align: center;
}

.processing-cancel-action {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    min-height: 76px;
    margin-top: 1rem;
}

.processing-cancel-button {
    min-width: 156px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--da-primary, #174f91);
    border-radius: 999px;
    background: transparent;
    color: var(--da-navy, #071127);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.processing-cancel-button:hover:not(:disabled),
.processing-cancel-button:focus-visible {
    background: var(--da-primary-light, #dcebff);
}

.processing-cancel-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.processing-cancel-error {
    min-height: 1.25rem;
    margin: 0;
    color: #9b1c1c;
    font-size: 0.9rem;
    font-weight: 700;
}


/* Browser voice input is shared by the recipe request and saved-recipe chat. */

.voice-input-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
}

.voice-input-control .form-control {
    min-width: 0;
}

.voice-input-button {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 124px;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--da-primary, #0b4ea2);
    border-radius: 15px;
    color: var(--da-primary, #0b4ea2);
    background: var(--da-primary-light, #dcebff);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.voice-input-button > span:first-child {
    font-size: 1.15rem;
    line-height: 1;
}

.voice-input-button:hover:not(:disabled) {
    color: #ffffff;
    background: var(--da-primary-hover, #0a428a);
}

.voice-input-button:focus-visible {
    outline: 3px solid rgba(11, 78, 162, 0.24);
    outline-offset: 2px;
}

.voice-input-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.voice-input-button[data-voice-state="listening_request"],
.voice-input-button[data-voice-state="listening_confirmation"][data-voice-phase="active"] {
    border-style: dashed;
    box-shadow: 0 0 0 4px rgba(11, 78, 162, 0.14);
}

.voice-input-button[data-voice-state="listening_request"]::after,
.voice-input-button[data-voice-state="listening_confirmation"][data-voice-phase="active"]::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 2px solid rgba(11, 78, 162, 0.34);
    border-radius: 19px;
    pointer-events: none;
    animation: voice-listening-pulse 1.8s ease-in-out infinite;
}

.voice-input-button[data-voice-state="listening_request"][data-voice-phase="pause"]::after {
    animation-duration: 2.4s;
}

.voice-input-button[data-voice-state="speaking_review"] {
    border-style: solid;
    color: #ffffff;
    background: var(--da-primary, #0b4ea2);
    box-shadow: 0 0 0 3px rgba(11, 78, 162, 0.12);
}

@keyframes voice-listening-pulse {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.985);
    }
    50% {
        opacity: 1;
        transform: scale(1.025);
    }
}

.voice-activity {
    font-size: 0.76rem;
    font-weight: 700;
}

.voice-input-status {
    min-height: 1.35em;
    margin: 7px 0 0;
    color: var(--da-muted, #64708a);
    font-size: 0.86rem;
    line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
    .recipe-chat-composer,
    .voice-input-button {
        transition: none;
    }

    .voice-input-button[data-voice-state="listening_request"]::after,
    .voice-input-button[data-voice-state="listening_confirmation"][data-voice-phase="active"]::after {
        animation: none;
        opacity: 0.8;
        transform: none;
    }

    .recipe-image-spinner {
        animation: none;
        border-top-color: rgba(11, 78, 162, 0.2);
        background: #0b4ea2;
    }
}


/* Hide labels visually while keeping them available to screen readers. */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ======================================================================
   Mobile layout
   ====================================================================== */

@media (max-width: 820px) {

    .recipe-page {
        padding-left: 18px;
        padding-right: 18px;
    }

    .recipe-header {
        align-items: flex-start;
        gap: 14px;
        padding: 18px 0;
    }

    .header-brand {
        display: block;
        flex: 1;
    }

    .recipe-logo img {
        width: 190px;
        max-width: 100%;
    }

    .welcome-user {
        margin-top: 7px;
        font-size: 0.88rem;
    }

    .header-buttons {
        display: grid;
        grid-template-columns: repeat(2, auto);
        gap: 7px;
    }

    .header-button {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 0.78rem;
    }

    .logout-form {
        display: block;
        grid-column: 2;
    }

    .logout-form .header-button {
        width: 100%;
    }

    .recipe-hero {
        margin: 38px 0 26px;
    }

    .interactive-layout {
        grid-template-columns: 1fr;
    }

    .recipe-card.recipe-chat-card {
        position: static;
        width: auto;
        margin-right: -8px;
        margin-left: -8px;
    }

    .recipe-card {
        padding: 22px;
        border-radius: 22px;
    }

}


@media (max-width: 520px) {

    .voice-input-control {
        grid-template-columns: 1fr;
    }

    .voice-input-button {
        width: 100%;
        min-height: 52px;
    }

    .recipe-header {
        display: block;
    }

    .header-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .welcome-user {
        margin-top: 0;
        text-align: right;
    }

    .header-buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        margin-top: 14px;
    }

    .header-button {
        width: 100%;
        height: 100%;
        padding: 9px 6px;
        font-size: 0.74rem;
    }

    .logout-form {
        display: block;
        grid-column: auto;
    }

    .header-button span:first-child {
        display: none;
    }

    .rating-status {
        min-width: 0;
    }

    .star-rating {
        gap: 0;
    }

    .recipe-card {
        padding: 18px;
    }

    .recipe-metadata-row {
        gap: 5px;
    }

    .rating-star {
        width: 32px;
        height: 32px;
        font-size: 1.42rem;
    }

}

/* ======================================================================
   My Recipes page
   ====================================================================== */

.my-recipes-introduction {
    max-width: 650px;
    margin: 18px 0 0;
    color: #68738a;
    font-size: 1.05rem;
    line-height: 1.6;
}

.my-recipes-container {
    padding: 26px;
}

.recipe-list {
    display: grid;
    gap: 16px;
}

.saved-recipe-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;

    padding: 12px;

    border: 1px solid rgba(34, 47, 80, 0.12);
    border-radius: 20px;

    background: #ffffff;
}

.saved-recipe-details {
    min-width: 0;
}

.saved-recipe-card > .recipe-thumbnail {
    width: 180px;
}

.saved-recipe-card h2 {
    margin: 0;
    color: #101a31;
    font-size: 1.2rem;
    line-height: 1.35;
}

.recipe-date {
    margin: 10px 0 0;
    color: #68738a;
    font-size: 0.88rem;
}

.saved-recipe-actions {
    flex-shrink: 0;
}

.recipe-delete-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
    padding: 22px 24px;
    border: 1px solid rgba(172, 45, 45, 0.18);
    border-radius: 20px;
    background: rgba(255, 250, 250, 0.82);
}

.recipe-delete-section h2 {
    margin: 0 0 6px;
    color: #6f2525;
    font-size: 1.05rem;
}

.recipe-delete-section p {
    margin: 0;
    color: #7b6b6b;
}

.recipe-delete-section form {
    flex-shrink: 0;
}

.delete-recipe-button {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #bd4a4a;
    border-radius: 999px;
    background: transparent;
    color: #a52f2f;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    box-shadow: none;
}

.delete-recipe-button:hover {
    background: #fff0f0;
    transform: none;
}

.recipe-success-message {
    margin: 0 0 18px;
    padding: 12px 16px;
    border: 1px solid #b9dfc4;
    border-radius: 14px;
    background: #f1fbf4;
    color: #236638;
    font-weight: 700;
}


/* Rating shown on My Recipes cards */

.recipe-list-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.small-star-rating {
    display: inline-flex;
    gap: 2px;
}

.small-rating-star {
    color: #d1d5df;
    font-size: 1.25rem;
    line-height: 1;
}

.small-rating-star.selected {
    color: #ffc43d;
}

.recipe-rating-label {
    color: #68738a;
    font-size: 0.88rem;
    font-weight: 700;
}

.unrated-recipe {
    color: #8a91a2;
    font-size: 0.9rem;
    font-weight: 650;
}

.empty-recipes {
    padding: 26px 6px;
}


/* Mobile My Recipes cards */

@media (max-width: 680px) {

    .my-recipes-container {
        padding: 18px;
    }

    .saved-recipe-card {
        grid-template-columns: 108px minmax(0, 1fr);
        gap: 14px;
        padding: 12px;
    }

    .saved-recipe-card > .recipe-thumbnail {
        width: 108px;
    }

    .saved-recipe-actions {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .saved-recipe-actions .header-button {
        width: 100%;
    }

    .recipe-delete-section {
        display: block;
        padding: 18px;
    }

    .recipe-delete-section form {
        margin-top: 16px;
    }

    .delete-recipe-button {
        width: 100%;
    }

}

/* PWA offline fallback page */
.offline-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.offline-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(35, 27, 20, 0.08);
}

.offline-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.offline-card h1 {
    margin-bottom: 0.75rem;
}

.offline-card p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Sprint 7.3 authenticated app shell */
.app-viewport-shell {
    display: flex;
    box-sizing: border-box;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.app-viewport-shell > .app-header {
    flex: 0 0 auto;
}

.app-header {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto 28px;
    padding: 18px 0;
    align-items: center;
    border-bottom: 1px solid rgba(30, 43, 73, 0.1);
}

.app-header .recipe-logo img {
    width: min(230px, 30vw);
}

.family-header-control {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 5px 10px;
    color: #554b78;
    background: #f0edff;
    border: 1px solid #ddd7ef;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.family-header-control:hover { color: #40376a; background: #e9e4ff; }

.family-page { width: min(920px, 100%); margin: 0 auto; color: #14203a; }
.family-hero { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 22px; padding: 24px; background: #fff8f3; border: 1px solid #f0d7c9; border-radius: 22px; }
.family-hero h1 { margin: 3px 0 6px; font-size: clamp(28px, 5vw, 42px); }
.family-hero p, .family-card p { color: #667188; }
.family-eyebrow { color: #6958ff; font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.family-card { margin-bottom: 18px; padding: 22px; background: white; border: 1px solid #e3e5ec; border-radius: 18px; }
.family-card h2 { margin-top: 0; }
.family-card form { display: grid; gap: 12px; }
.family-card label { display: grid; gap: 6px; font-weight: 700; }
.family-card input, .family-card textarea { box-sizing: border-box; width: 100%; padding: 11px; border: 1px solid #cfd4df; border-radius: 10px; font: inherit; }
.family-card button, .family-button { width: fit-content; padding: 9px 13px; color: #fff; background: #0b4ea2; border: 0; border-radius: 10px; font-weight: 750; text-decoration: none; }
.family-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.family-list article, .family-pending { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #edf0f5; }
.family-list small { display: block; margin-top: 3px; color: #667188; }
.family-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.family-actions form, .family-pending form { display: block; }
.family-check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.family-check input { width: auto; }
.family-message { padding: 12px 16px; background: #eef8f3; border-radius: 12px; overflow-wrap: anywhere; }
.family-error { background: #fff1f1; }
.family-danger { display: flex; justify-content: flex-end; gap: 10px; margin: 20px 0; }
.family-invitation { max-width: 560px; margin: 40px auto; text-align: center; }
.family-invitation form { display: inline-block; margin: 6px; }
.family-diner-picker { margin-bottom: 18px; padding: 18px; }
.family-diner-picker h2 { margin: 0 0 5px; font-size: 1.1rem; }
.family-diner-picker p { margin: 0 0 12px; color: #667188; }
.family-diner-options { display: flex; flex-wrap: wrap; gap: 8px; }
.family-diner-options label { cursor: pointer; }
.family-diner-options input { position: absolute; opacity: 0; }
.family-diner-options span { display: block; padding: 8px 12px; background: #f6f4ff; border: 1px solid #ddd7ef; border-radius: 999px; font-weight: 700; }
.family-diner-options input:checked + span { color: #fff; background: #6958ff; border-color: #6958ff; }
@media (max-width: 700px) { .family-grid { grid-template-columns: 1fr; } .family-hero { padding: 18px; } .family-header-control { margin-left: auto; } .app-header .family-header-control + .app-navigation { margin-left: 0; } }

.app-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.app-nav-item {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 10px;
    color: #14203a;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.app-nav-item:hover {
    color: #6958ff;
    background: rgba(105, 88, 255, 0.06);
}

.app-nav-item.active {
    color: #6958ff;
    background: rgba(105, 88, 255, 0.1);
    border-color: rgba(105, 88, 255, 0.16);
}

.app-nav-item:focus-visible {
    outline: 3px solid rgba(47, 159, 248, 0.3);
    outline-offset: 2px;
}

.app-nav-icon {
    position: relative;
    display: inline-flex;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    overflow: hidden;
    color: currentColor;
}

.app-nav-icon-home::before {
    content: "";
    position: absolute;
    left: 4px;
    bottom: 2px;
    width: 10px;
    height: 9px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 1px;
}

.app-nav-icon-home::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 5px;
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(45deg);
}

.app-nav-icon-recipes::before {
    content: "";
    position: absolute;
    inset: 2px 2px 1px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.app-nav-icon-recipes::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 3px;
    left: 9px;
    width: 2px;
    background: currentColor;
}

.app-nav-icon-cards::before,
.app-nav-icon-cards::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background: #fff;
}

.app-nav-icon-cards::before {
    top: 1px;
    left: 1px;
}

.app-nav-icon-cards::after {
    right: 1px;
    bottom: 1px;
}

.app-nav-icon-create::before,
.app-nav-icon-create::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 3px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.app-nav-icon-create::after {
    transform: rotate(90deg);
}

.app-nav-create {
    color: #14203a;
}

.app-nav-avatar,
.account-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 800;
    border-radius: 50%;
}

.app-nav-avatar {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    color: #6958ff;
    background: rgba(105, 88, 255, 0.12);
    font-size: 11px;
}

.account-avatar {
    color: #8c3f20;
    background: #ffd8c2;
}

.app-nav-avatar img,
.account-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-home-page .recipe-page {
    width: 100%;
    max-width: 1200px !important;
    padding: 1rem 2rem 3rem !important;
}

.app-home-page .recipe-header {
    max-width: 1120px;
    margin: 0 auto 1.25rem;
    padding: 0.75rem 0;
}

.app-home-page .recipe-logo img {
    width: min(250px, 29vw);
}

.app-home-hero,
.app-home-page .home-section {
    width: 100%;
    max-width: 1120px;
    margin-right: auto;
    margin-left: auto;
}

.app-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    margin-top: 0;
    margin-bottom: 2.5rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    color: #14203a;
    background: #fff8f3;
    border: 1px solid #f2d9ca;
    border-radius: 24px;
}

.app-home-hero h1,
.account-hero h1 {
    margin: 0 0 0.5rem;
    overflow-wrap: anywhere;
}

.app-home-hero h1 {
    max-width: 650px;
    font-size: clamp(1.8rem, 3.3vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.home-question {
    margin: 0;
    color: #657088;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.5;
}

.home-create-action {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 82px;
    padding: 1rem 1.1rem;
    color: #fff;
    background: #e86636;
    border: 1px solid #d95a2c;
    border-radius: 17px;
    box-shadow: 0 7px 16px rgba(161, 69, 35, 0.14);
    text-decoration: none;
    transition: transform 150ms ease, background-color 150ms ease;
}

.home-create-action:hover {
    color: #fff;
    background: #d95a2c;
    transform: translateY(-1px);
}

.home-create-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    color: #d95a2c;
    background: #fff;
    border-radius: 50%;
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1;
}

.home-create-copy {
    display: grid;
    flex: 1;
    gap: 0.15rem;
    font-size: 1rem;
    line-height: 1.25;
}

.home-create-copy strong {
    font-size: 1.05rem;
    font-weight: 800;
}

.home-create-action small {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
}

.home-action-arrow {
    flex: 0 0 auto;
    font-size: 1.25rem;
}

.home-section {
    margin-top: 0;
    margin-bottom: 2.5rem;
}

.home-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.home-section-heading h2,
.home-section-heading p,
.home-recipe-card h3,
.home-empty-state h3,
.account-card h2,
.account-card p {
    margin-top: 0;
}

.home-section-heading h2 {
    margin-bottom: 0.25rem;
    color: #14203a;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    letter-spacing: -0.02em;
}

.home-section-heading p {
    margin-bottom: 0;
    color: #748096;
    font-size: 0.92rem;
}

.home-view-all,
.home-empty-state a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #b64b25;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.home-view-all {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0.45rem 0.75rem;
    background: #fff7f2;
    border: 1px solid #f0d9cb;
    border-radius: 999px;
}

.home-recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.home-recipe-card,
.home-empty-state,
.account-card,
.account-message {
    background: #fff;
    border: 1px solid #eadfd7;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(65, 41, 27, 0.06);
}

.home-recipe-card {
    display: flex;
    flex-direction: column;
    min-height: 180px;
    padding: 1.25rem;
    color: #14203a;
    text-decoration: none;
    overflow: hidden;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.home-recipe-card:hover {
    transform: translateY(-2px);
    border-color: #dfcfc5;
    box-shadow: 0 10px 22px rgba(65, 41, 27, 0.09);
}

.home-card-date,
.home-card-unrated {
    color: #81766f;
    font-size: 0.82rem;
}

.home-recipe-card h3 {
    margin: 0.65rem 0 1.25rem;
    font-size: 1.08rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.home-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 28px;
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid #eee5df;
}

.home-card-open {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    color: #a34726;
    font-size: 0.82rem;
    font-weight: 750;
}

.home-card-rating {
    color: #c7bdb4;
    font-size: 0.9rem;
    letter-spacing: 0.04rem;
    white-space: nowrap;
}

.home-card-rating .filled {
    color: #f3a72f;
}

.favourite-card {
    border-color: #ecd9b2;
    background: #fffcf6;
}

.favourite-card .home-card-footer {
    border-top-color: #eee1c7;
}

.favourite-rating {
    display: inline-flex;
    align-items: baseline;
    gap: 0.1rem;
    color: #9a6213;
}

.favourite-rating strong {
    font-size: 1.25rem;
    line-height: 1;
}

.favourite-rating span {
    font-size: 0.75rem;
    font-weight: 750;
}

.home-empty-state {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 112px;
    padding: 1.25rem 1.4rem;
    box-shadow: none;
}

.home-empty-state h3 {
    margin-bottom: 0.25rem;
    color: #14203a;
}

.home-empty-state p {
    margin: 0;
    color: #748096;
}

.home-empty-state > a {
    flex: 0 0 auto;
    margin-left: auto;
}

.home-empty-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    color: #c55228;
    background: #fff0e8;
    border-radius: 50%;
    font-size: 1.4rem;
}

.home-empty-star {
    color: #a46b16;
    background: #fff5d9;
    font-size: 1rem;
}

.account-hero {
    margin: 1.25rem 0;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 1.4rem;
}

.account-avatar {
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    font-size: 2rem;
}

.account-photo-form,
.account-details form,
.account-preferences form {
    display: grid;
    gap: 0.55rem;
    width: 100%;
}

.account-photo-form small {
    color: #746b65;
}

.recipe-card-flash {
    transition: opacity 220ms ease, transform 220ms ease;
}

.recipe-card-flash--hiding {
    opacity: 0;
    transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
    .recipe-card-flash {
        transition: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .recipe-thumbnail--pending .recipe-thumbnail-placeholder-mark,
    .recipe-thumbnail--generating .recipe-thumbnail-placeholder-mark {
        animation: none;
    }
}

.account-preferences {
    align-items: stretch;
}

.account-choice-group {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.account-choice-group legend {
    margin-bottom: 0.7rem;
    color: #173b5f;
    font-size: 1rem;
    font-weight: 800;
}

.account-choice-help {
    margin: -0.35rem 0 0;
    color: #5f6f7e;
    font-size: 0.9rem;
    line-height: 1.45;
}

.account-dietary-options,
.account-ingredient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-dietary-options label {
    cursor: pointer;
}

.account-dietary-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.account-dietary-options span,
.account-ingredient-chip {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #d5deea;
    border-radius: 999px;
    background: #ffffff;
    color: #34445e;
    font-weight: 700;
}

.account-dietary-options input:checked + span {
    border-color: #0b4ea2;
    background: #eaf3ff;
    color: #0b4ea2;
}

.account-dietary-options input:focus-visible + span {
    outline: 3px solid rgba(11, 78, 162, 0.2);
    outline-offset: 2px;
}

.account-ingredient-chips:empty {
    display: none;
}

.account-ingredient-chip button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #52627a;
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.account-ingredient-entry {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.account-ingredient-entry .form-control {
    min-width: 0;
}

@media (max-width: 420px) {
    .account-ingredient-entry {
        align-items: stretch;
    }

    .account-ingredient-entry .header-button {
        flex: 0 0 auto;
    }
}

.account-number-options {
    display: grid;
    grid-template-columns: repeat(6, minmax(40px, 1fr));
    gap: 0.5rem;
}

.account-number-options--four {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
}

.account-number-options label {
    position: relative;
    cursor: pointer;
}

.account-number-options input {
    position: absolute;
    opacity: 0;
}

.account-number-options span {
    display: grid;
    min-height: 44px;
    place-items: center;
    border: 1px solid #c9d8e6;
    border-radius: 10px;
    color: #173b5f;
    background: #fff;
    font-weight: 800;
}

.account-number-options input:checked + span {
    border-color: #1d5f91;
    color: #fff;
    background: #1d5f91;
}

.account-number-options input:focus-visible + span {
    outline: 3px solid rgba(29, 95, 145, 0.25);
    outline-offset: 2px;
}

@media (max-width: 390px) {
    .account-number-options {
        grid-template-columns: repeat(3, minmax(44px, 1fr));
    }

    .account-number-options--four {
        grid-template-columns: repeat(4, minmax(40px, 1fr));
    }
}

.account-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem;
    border: 1px solid #d9e4ee;
    border-radius: 12px;
    cursor: pointer;
}

.account-choice:has(input:checked) {
    border-color: #3777aa;
    background: #f2f7fb;
}

.account-choice input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0.15rem 0 0;
    accent-color: #1d5f91;
}

.account-choice span,
.account-choice small {
    display: block;
}

.account-choice small {
    margin-top: 0.3rem;
    color: #5f6f7e;
    line-height: 1.45;
}

.account-recommended {
    color: #4d667d;
    font-weight: 650;
}

.ingredient-review {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--da-border, #d6deeb);
    border-radius: 16px;
    background: var(--da-surface, #ffffff);
    text-align: left;
}

.ingredient-review-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

.ingredient-review-heading h2,
.ingredient-review-heading p {
    margin: 0;
}

.ingredient-review-heading h2 {
    font-size: 1.2rem;
}

.ingredient-review-heading p {
    margin-top: 0.25rem;
    color: var(--da-muted, #6b7280);
}

.ingredient-save-status {
    flex: 0 0 auto;
    color: var(--da-primary, #0b4ea2);
    font-size: 0.875rem;
    font-weight: 700;
}

.ingredient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    min-width: 0;
}

.ingredient-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--da-primary, #0b4ea2);
    border-radius: 999px;
    background: var(--da-primary-light, #dcebff);
    overflow: hidden;
}

.ingredient-chip-input {
    width: auto;
    min-width: 4rem;
    max-width: 13rem;
    padding: 0.55rem 0.25rem 0.55rem 0.8rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--da-text, #071127);
    font: inherit;
    font-weight: 700;
}

.ingredient-chip-input:focus {
    box-shadow: inset 0 0 0 2px var(--da-primary, #0b4ea2);
}

.ingredient-chip-remove {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--da-primary, #0b4ea2);
    font-size: 1.4rem;
    cursor: pointer;
}

.add-ingredient-form {
    margin-top: 1rem;
}

.add-ingredient-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.add-ingredient-row {
    display: flex;
    align-items: stretch;
    gap: 0.625rem;
    min-width: 0;
}

.add-ingredient-row .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.add-ingredient-row .secondary-button,
.recipe-regeneration .secondary-button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--da-primary, #0b4ea2);
    border-radius: 10px;
    background: #ffffff;
    color: var(--da-primary, #0b4ea2);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.recipe-regeneration {
    margin-top: 1rem;
    padding: 0.875rem;
    border: 1px solid var(--da-primary, #0b4ea2);
    border-radius: 12px;
    background: var(--da-primary-light, #dcebff);
}

.recipe-regeneration p {
    margin: 0 0 0.75rem;
    color: var(--da-text, #071127);
}

.recipe-regeneration .secondary-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.ingredient-review-error {
    margin: 0.75rem 0 0;
    color: #9b1c1c;
    font-weight: 700;
}

@media (max-width: 480px) {
    .loading-card {
        margin: 24px auto;
    }

    .ingredient-review-heading {
        display: block;
    }

    .ingredient-save-status {
        display: block;
        margin-top: 0.5rem;
    }

    .ingredient-chip {
        width: 100%;
    }

    .ingredient-chip-input {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .recipe-regeneration .secondary-button {
        width: 100%;
    }
}

.account-photo-form input[type="file"] {
    min-width: 0;
    max-width: 100%;
}

.account-photo-form .header-button {
    justify-self: start;
}

.account-details {
    display: grid;
    gap: 1.3rem;
}

.account-inline-form {
    display: flex;
    gap: 0.65rem;
}

.account-inline-form input {
    flex: 1;
    min-width: 0;
}

.account-field {
    display: grid;
    gap: 0.35rem;
}

.account-field span,
.account-details label {
    color: #746b65;
    font-size: 0.9rem;
    font-weight: 750;
}

.account-recipe-cards-link {
    min-height: 76px;
    color: #14203a;
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.account-recipe-cards-link:hover {
    color: #14203a;
    border-color: rgba(105, 88, 255, 0.3);
    box-shadow: 0 8px 22px rgba(61, 49, 130, 0.09);
    transform: translateY(-1px);
}

.account-recipe-cards-link:focus-visible {
    outline: 3px solid rgba(47, 159, 248, 0.3);
    outline-offset: 2px;
}

.account-recipe-cards-icon {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #6958ff;
    background: rgba(105, 88, 255, 0.1);
    border-radius: 12px;
}

.account-recipe-cards-copy {
    display: grid;
    flex: 1;
    gap: 0.25rem;
}

.account-recipe-cards-copy strong {
    font-size: 1.05rem;
}

.account-recipe-cards-copy small {
    color: #746b65;
    line-height: 1.4;
}

.account-link-arrow {
    color: #6958ff;
    font-size: 1.8rem;
    line-height: 1;
}

.account-signout {
    justify-content: space-between;
}

.account-signout h2 {
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.account-signout p {
    margin-bottom: 0;
    color: #746b65;
}

.account-logout-button {
    color: #a43028;
    border-color: #e8aaa5;
}

.account-message {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    color: #35653f;
    background: #eef8ef;
    border-color: #bbdabe;
}

.account-error {
    color: #932b25;
    background: #fff0ef;
    border-color: #efb8b3;
}

@media (max-width: 820px) {
    .app-shell-page,
    body:has(.app-navigation) {
        padding-bottom: calc(var(--app-bottom-nav-height) + env(safe-area-inset-bottom));
    }

    .app-header {
        display: flex;
        margin-bottom: 18px;
        padding: 12px 0;
        border-bottom: 0;
    }

    .app-header .recipe-logo img {
        width: 190px;
        max-width: 68vw;
    }

    .app-navigation {
        position: fixed;
        z-index: 1000;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100vw;
        height: calc(var(--app-bottom-nav-height) + env(safe-area-inset-bottom));
        box-sizing: border-box;
        justify-content: space-around;
        gap: 0;
        padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.97);
        border: 0;
        border-top: 1px solid #e9ded7;
        border-radius: 0;
        box-shadow: 0 -5px 20px rgba(55, 36, 25, 0.08);
    }

    .app-nav-item {
        box-sizing: border-box;
        flex: 1 1 0;
        width: 25%;
        min-width: 0;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        min-height: 54px;
        padding: 6px 2px;
        color: #14203a;
        background: transparent;
        border-color: transparent;
        border-radius: 10px;
        font-size: 11px;
        text-align: center;
    }

    .app-nav-item:hover {
        color: #6958ff;
        background: transparent;
    }

    .app-nav-item.active {
        color: #6958ff;
        background: rgba(105, 88, 255, 0.1);
        border-color: transparent;
    }

    .app-nav-create .app-nav-icon {
        flex-basis: 20px;
        width: 20px;
        height: 20px;
        color: currentColor;
        background: transparent;
        border-radius: 0;
    }

    .app-home-page .recipe-page {
        padding: 0.75rem 1.1rem calc(2rem + env(safe-area-inset-bottom)) !important;
    }

    .app-home-page .recipe-header {
        margin-bottom: 0.85rem;
        padding: 0.55rem 0;
    }

    .app-home-page .recipe-logo img {
        width: 190px;
        max-width: 68vw;
    }

    .app-home-hero {
        grid-template-columns: 1fr;
        gap: 1.15rem;
        margin-bottom: 2rem;
        padding: 1.35rem;
        border-radius: 20px;
    }

    .app-home-hero h1 {
        font-size: clamp(1.65rem, 6vw, 2.2rem);
    }

    .home-create-action {
        min-height: 76px;
    }

    .home-recipe-grid {
        grid-template-columns: 1fr;
    }

    .home-recipe-card {
        min-height: 158px;
    }

    .account-card {
        align-items: flex-start;
    }

    .account-signout {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .proposal-actions {
        flex-direction: column;
    }

    .proposal-action-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .home-section-heading {
        align-items: flex-start;
    }

    .home-view-all {
        min-height: 36px;
        padding: 0.35rem 0.55rem;
        font-size: 0.78rem;
    }

    .home-section-heading p {
        max-width: 220px;
    }

    .home-empty-state {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .home-empty-state > div {
        flex: 1;
        min-width: 0;
    }

    .home-empty-state > a {
        width: 100%;
        margin-left: 3.6rem;
    }

    .favourite-card-footer {
        gap: 0.5rem;
    }

    .favourite-card-footer .home-card-rating {
        font-size: 0.82rem;
    }

    .account-card:not(.account-signout):not(.account-recipe-cards-link) {
        flex-direction: column;
    }

    .account-inline-form,
    .account-signout {
        align-items: stretch;
        flex-direction: column;
    }

    .account-inline-form .header-button,
    .account-signout .header-button {
        justify-content: center;
        width: 100%;
    }
}

/* Browser-controlled PWA installation promotion */
.pwa-install-promotion {
    position: fixed;
    z-index: 1000;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(390px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 14px 42px 14px 14px;
    color: #14203a;
    background: #ffffff;
    border: 1px solid rgba(20, 32, 58, 0.1);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(20, 32, 58, 0.18);
}

.pwa-install-promotion[hidden] {
    display: none;
}

.pwa-install-button[hidden],
.pwa-install-copy [hidden] {
    display: none;
}

.pwa-install-icon {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 13px;
}

.pwa-install-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    line-height: 1.25;
}

.pwa-install-copy strong {
    font-size: 0.98rem;
    font-weight: 800;
}

.pwa-install-copy span {
    color: #667085;
    font-size: 0.82rem;
}

.pwa-install-button,
.pwa-install-dismiss {
    margin: 0;
    border: 0;
    cursor: pointer;
}

.pwa-install-button {
    align-self: center;
    min-height: 40px;
    padding: 9px 15px;
    color: #ffffff;
    background: #2f6fed;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 800;
}

.pwa-install-button:hover {
    background: #245bd1;
}

.pwa-install-button:disabled {
    cursor: default;
    opacity: 0.65;
}

.pwa-install-dismiss {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: #667085;
    background: transparent;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
}

.pwa-install-dismiss:hover {
    color: #14203a;
    background: rgba(20, 32, 58, 0.06);
}

.pwa-install-button:focus-visible,
.pwa-install-dismiss:focus-visible {
    outline: 3px solid rgba(47, 111, 237, 0.3);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .pwa-install-promotion {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        left: 16px;
        width: auto;
    }

    .pwa-install-promotion-above-nav {
        bottom: calc(88px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 380px) {
    .pwa-install-promotion {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .pwa-install-button {
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
    }
}

:root {
    --app-bottom-nav-height: 76px;
    --da-primary: #0B4EA2;
    --da-primary-hover: #0A428A;
    --da-primary-light: #DCEBFF;
    --da-surface: #FFFFFF;
    --da-background: #F7F7F7;
    --da-border: #DDE5EF;
    --da-text: #14203A;
    --da-muted: #68738A;
}

/* ======================================================================
   Sprint 13.1 Recipe Cards
   ====================================================================== */

.saved-recipe-actions {
    display: grid;
    gap: 10px;
}

.saved-recipe-actions form {
    margin: 0;
}

.saved-recipe-actions .header-button {
    width: 100%;
    box-sizing: border-box;
}

.recipe-card-create-button:disabled,
.recipe-card-update-notice button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.recipe-card-shell {
    width: min(1180px, calc(100% - 32px));
}

.published-recipe-card {
    display: grid;
    gap: clamp(20px, 3vw, 32px);
    margin: 18px 0 44px;
    color: var(--da-text);
}

.recipe-card-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
    padding: clamp(24px, 4.5vw, 52px);
    border: 1px solid var(--da-border);
    border-radius: 28px;
    background: linear-gradient(145deg, #fff8f3, var(--da-surface));
    box-shadow: 0 18px 48px rgba(40, 51, 91, 0.09);
}

.recipe-card-hero--image-free {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
    text-align: center;
}

.recipe-card-hero-copy {
    min-width: 0;
}

.recipe-card-hero h1 {
    margin: 0;
    color: var(--da-text);
    font-size: clamp(2rem, 3.5vw, 3.15rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.recipe-card-description {
    max-width: 620px;
    margin: 20px 0 0;
    color: var(--da-muted);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.65;
}

.recipe-card-hero--image-free .recipe-card-description {
    margin-right: auto;
    margin-left: auto;
}

.recipe-card-hero-image {
    position: relative;
    min-width: 0;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 22px;
    background: var(--da-primary-light);
    box-shadow: 0 14px 35px rgba(30, 43, 73, 0.16);
}

.recipe-card-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-card-update-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    border: 1px solid #c7d9ed;
    border-radius: 18px;
    background: #f2f7fb;
}

.recipe-card-update-notice h2 {
    margin: 0;
    color: var(--da-text);
    font-size: 1rem;
}

.recipe-card-update-notice p {
    margin: 5px 0 0;
    color: var(--da-muted);
    line-height: 1.45;
}

.recipe-card-update-notice form {
    flex: 0 0 auto;
    margin: 0;
}

.shared-recipe-card-cta h2 {
    margin: 0;
    color: var(--da-text);
    font-size: 1.05rem;
}

.shared-recipe-card-cta p {
    margin: 5px 0 0;
    color: var(--da-muted);
    line-height: 1.45;
}

.recipe-card-eyebrow-row {
    position: relative;
    width: max-content;
    max-width: 100%;
}

.recipe-card-share-menu {
    position: absolute;
    top: 50%;
    left: calc(100% + 3px);
    z-index: 30;
    margin-top: -20px;
}

.recipe-card-share-menu [hidden] {
    display: none !important;
}

.recipe-card-share-trigger {
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--da-muted);
    cursor: pointer;
}

.recipe-card-share-trigger:hover,
.recipe-card-share-trigger[aria-expanded="true"] {
    background: rgb(15 75 142 / 8%);
    color: var(--da-primary);
}

.recipe-card-share-trigger:focus-visible {
    outline: 3px solid rgb(15 75 142 / 25%);
    outline-offset: 1px;
}

.recipe-card-share-trigger svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.recipe-card-share-backdrop {
    display: none;
}

.recipe-card-share-popover {
    position: absolute;
    top: 46px;
    left: 0;
    width: 238px;
    box-sizing: border-box;
    padding: 7px;
    border: 1px solid var(--da-border);
    border-radius: 14px;
    background: var(--da-surface);
    box-shadow: 0 14px 36px rgb(22 34 55 / 18%);
}

.recipe-card-share-option {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--da-text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.recipe-card-share-option:hover,
.recipe-card-share-option:focus-visible {
    background: #f1f5fa;
    outline: none;
}

.recipe-card-stop-sharing-section {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--da-border);
}

.recipe-card-stop-sharing-section form {
    margin: 0;
}

.recipe-card-stop-sharing {
    color: #9a3030;
}

.recipe-card-share-status {
    margin: 2px 12px 4px !important;
    color: var(--da-primary) !important;
    font-size: 0.85rem;
    font-weight: 750;
    line-height: 1.35;
}

.recipe-card-information {
    display: grid;
    grid-template-columns: minmax(120px, 0.55fr) minmax(120px, 0.55fr) minmax(0, 2fr);
    border: 1px solid var(--da-border);
    border-radius: 20px;
    background: var(--da-surface);
    overflow: hidden;
}

.recipe-card-information > div {
    min-width: 0;
    padding: 18px clamp(16px, 2.5vw, 26px);
}

.recipe-card-information > div + div {
    border-left: 1px solid var(--da-border);
}

.recipe-card-information span,
.recipe-card-information-nutrition > p,
.recipe-card-information-nutrition dt {
    display: block;
    color: var(--da-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.recipe-card-information span {
    margin-bottom: 5px;
}

.recipe-card-information strong {
    font-size: 1rem;
    overflow-wrap: anywhere;
}

/* Prep, Cook and other protected timing details remain compact rows within
   the one existing Time cell; they never become information-panel columns. */
.recipe-card-timing-rows {
    display: grid;
    gap: 3px;
    margin: 0;
}

.recipe-card-timing-row {
    display: grid;
    grid-template-columns: minmax(48px, auto) minmax(0, 1fr);
    align-items: baseline;
    gap: 3px 7px;
    min-width: 0;
}

.recipe-card-timing-row dt,
.recipe-card-timing-row dd {
    margin: 0;
}

.recipe-card-timing-label {
    color: var(--da-muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.recipe-card-timing-row strong,
.recipe-card-timing-total strong {
    display: block;
    line-height: 1.15;
    overflow-wrap: normal;
}

.recipe-card-timing-row strong + strong,
.recipe-card-timing-total strong + strong {
    margin-top: 2px;
}

.recipe-card-information-nutrition > p {
    margin: 0 0 10px;
}

.recipe-card-information-nutrition-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
}

.recipe-card-information-nutrition-values > div {
    min-width: 0;
    padding: 0 clamp(8px, 1.4vw, 16px);
}

.recipe-card-information-nutrition-values > div:first-child {
    padding-left: 0;
}

.recipe-card-information-nutrition-values > div + div {
    border-left: 1px solid var(--da-border);
}

.recipe-card-information-nutrition-values dt,
.recipe-card-information-nutrition-values dd {
    margin: 0;
}

.recipe-card-information-nutrition-values dt {
    margin-bottom: 4px;
    font-size: 0.7rem;
}

.recipe-card-information-nutrition-values dd {
    color: var(--da-text);
    font-size: 0.94rem;
    font-weight: 800;
    white-space: nowrap;
}

.recipe-card-dietary-fact ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.recipe-card-information .recipe-card-dietary-fact {
    grid-column: 1 / -1;
    border-top: 1px solid var(--da-border);
    border-left: 0;
}

.recipe-card-dietary-fact li {
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--da-primary-light);
    color: var(--da-primary);
    font-size: 0.82rem;
    font-weight: 750;
}

.recipe-card-content-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(340px, 1.35fr) minmax(220px, 0.8fr);
    align-items: start;
    gap: clamp(16px, 2.5vw, 28px);
}

.recipe-card-section {
    min-width: 0;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--da-border);
    border-radius: 22px;
    background: var(--da-surface);
}

.recipe-card-section h2 {
    margin: 0 0 20px;
    color: var(--da-text);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.recipe-card-section ul,
.recipe-card-section ol {
    display: grid;
    gap: 13px;
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.55;
}

.recipe-card-notes h3 {
    margin: 22px 0 10px;
    color: var(--da-text);
    font-size: 1rem;
    line-height: 1.4;
}

.recipe-card-notes h3:first-of-type {
    margin-top: 0;
}

.recipe-card-notes ul + h3,
.recipe-card-notes ol + h3 {
    margin-top: 24px;
}

.recipe-card-method ol {
    gap: 18px;
    padding-left: 2rem;
}

.recipe-card-method li {
    padding-left: 7px;
}

.recipe-card-method li::marker {
    color: var(--da-primary);
    font-weight: 800;
}

.recipe-card-sidebar {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.recipe-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding-top: 6px;
}

.recipe-card-footer .ai-recipe-disclaimer {
    max-width: 760px;
    margin: 0;
}

.shared-recipe-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 20px 22px;
    border: 1px solid var(--da-border);
    border-radius: 18px;
    background: #fff8f3;
}

.shared-recipe-card-cta form {
    flex: 0 0 auto;
    margin: 0;
}

.shared-recipe-card-pending {
    color: var(--da-primary) !important;
    font-weight: 750;
}

/* Sprint 13.3 personal Recipe Card collection. */
.recipe-cards-shell {
    width: min(1180px, calc(100% - 32px));
}

.recipe-cards-heading > p:last-child {
    max-width: 700px;
    color: var(--da-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.recipe-card-collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: clamp(16px, 2.5vw, 26px);
    margin-bottom: 44px;
}

.recipe-card-preview {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--da-border);
    border-radius: 20px;
    background: var(--da-surface);
    box-shadow: 0 10px 30px rgb(40 51 91 / 8%);
}

.recipe-card-preview-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.recipe-card-preview-link:focus-visible {
    outline: 3px solid rgb(15 75 142 / 28%);
    outline-offset: -3px;
}

.recipe-card-preview-image {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--da-primary-light);
}

.recipe-card-preview-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.recipe-card-preview-link:hover .recipe-card-preview-image img {
    transform: scale(1.025);
}

.recipe-card-preview-image--empty {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #fff4eb, var(--da-primary-light));
}

.recipe-card-preview-placeholder {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 50%;
    background: var(--da-primary);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 850;
}

.recipe-card-preview-copy {
    padding: 18px 19px 20px;
}

.recipe-card-preview-copy h2 {
    margin: 5px 0 12px;
    color: var(--da-text);
    font-size: 1.18rem;
    line-height: 1.25;
}

.recipe-card-origin-label {
    color: var(--da-primary);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.recipe-card-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--da-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.recipe-cards-empty {
    padding: clamp(28px, 5vw, 50px);
    text-align: center;
}

.recipe-cards-empty h2 {
    margin-top: 0;
}

.recipe-cards-empty .header-button {
    margin-top: 10px;
}

.shared-recipe-card-unavailable {
    width: min(680px, 100%);
    box-sizing: border-box;
    margin: 42px auto;
    padding: clamp(28px, 6vw, 56px);
    border: 1px solid var(--da-border);
    border-radius: 24px;
    background: var(--da-surface);
    text-align: center;
}

.shared-recipe-card-unavailable h1 {
    margin: 0;
    color: var(--da-text);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
}

.shared-recipe-card-unavailable > p:not(.recipe-eyebrow) {
    margin: 16px 0 24px;
    color: var(--da-muted);
    line-height: 1.6;
}

@media (max-width: 960px) {
    .recipe-card-hero {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
    }

    .recipe-card-content-grid {
        grid-template-columns: minmax(210px, 0.72fr) minmax(0, 1.28fr);
    }

    .recipe-card-sidebar {
        grid-column: 1 / -1;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 720px) {
    .recipe-cards-shell {
        width: min(100% - 24px, 1180px);
    }

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

    .recipe-card-shell {
        width: min(100% - 24px, 1180px);
    }

    .recipe-card-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
        padding: 22px;
        border-radius: 22px;
    }

    .recipe-card-hero-copy {
        order: 1;
    }

    .recipe-card-hero-image {
        order: 2;
        border-radius: 18px;
    }

    .recipe-card-update-notice,
    .recipe-card-footer,
    .shared-recipe-card-cta {
        align-items: stretch;
        flex-direction: column;
    }

    .shared-recipe-card-cta .header-button {
        width: 100%;
        box-sizing: border-box;
    }

    .recipe-card-share-backdrop {
        position: fixed;
        z-index: 1100;
        inset: 0;
        display: block;
        background: rgb(9 22 40 / 32%);
    }

    .recipe-card-share-popover {
        position: fixed;
        z-index: 1101;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        top: auto;
        width: auto;
        max-height: calc(100vh - 24px - env(safe-area-inset-bottom));
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
        padding: 10px;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 18px;
        box-shadow: 0 18px 48px rgb(9 22 40 / 30%);
    }

    .recipe-card-update-notice .header-button,
    .recipe-card-footer .header-button {
        width: 100%;
        box-sizing: border-box;
    }

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

    .recipe-card-information > div + div {
        border-left: 1px solid var(--da-border);
    }

    .recipe-card-information-nutrition {
        grid-column: 1 / -1;
        border-top: 1px solid var(--da-border);
        border-left: 0 !important;
    }

    .recipe-card-information .recipe-card-dietary-fact {
        border-left: 0;
    }

    .recipe-card-content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .recipe-card-sidebar {
        grid-column: auto;
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .recipe-card-collection {
        grid-template-columns: minmax(0, 1fr);
    }

    .recipe-card-information-nutrition-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recipe-card-information-nutrition-values > div {
        padding: 10px 8px;
    }

    .recipe-card-information-nutrition-values > div:first-child {
        padding-left: 8px;
    }

    .recipe-card-information-nutrition-values > div:nth-child(3),
    .recipe-card-information-nutrition-values > div:nth-child(4) {
        border-top: 1px solid var(--da-border);
    }

    .recipe-card-information-nutrition-values > div:nth-child(3) {
        border-left: 0;
    }
}

@media (max-width: 390px) {
    .recipe-card-shell {
        width: min(100% - 20px, 1180px);
    }

    .recipe-card-hero,
    .recipe-card-section {
        padding: 18px;
    }

    .recipe-card-information > div {
        padding: 15px 12px;
    }
}

/* Keep the compact Cookbook title actions above the earlier card rules. */
.recipe-card-eyebrow-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recipe-card-share-menu {
    position: relative;
    top: auto;
    left: auto;
    margin-top: 0;
}

.recipe-card-share-trigger {
    width: 44px;
    height: 44px;
}

.recipe-card-share-popover {
    right: 0;
    left: auto;
}
