.cooking-page[data-kind="recipe"] {
  container-type: inline-size;
  --rc-ink: #263b30;
  --rc-muted: #5d7065;
  --rc-accent: #36674c;
  --rc-line: #dbe6dd;
}
.rc-workspace, .rc-dialog { color: var(--rc-ink); }
.rc-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.rc-section-head h2 { margin: 0 0 7px; color: var(--rc-ink); font-size: 23px; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.rc-section-head p { margin: 0; color: var(--rc-muted); font-size: 14px; line-height: 1.65; }
.rc-section-head .rc-kicker { margin: 0 0 6px; color: var(--rc-accent); font-size: 12px; font-weight: 750; }
.rc-draft-state { flex-shrink: 0; padding: 4px 9px; border-radius: 20px; background: #fff2d5; color: #785b21; font-size: 12px; }
.rc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-toolbar button { min-height: 44px; padding: 9px 14px; background: #f5faf5; color: var(--rc-accent); font-size: 14px; }
.rc-summary-strip { display: flex; flex-wrap: wrap; column-gap: 18px; row-gap: 3px; margin: 11px 0 22px; }
.rc-summary-strip p { margin: 0; color: var(--rc-muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.rc-workspace button, .rc-workspace input, .rc-dialog button, .rc-dialog input, .rc-dialog select, .rc-dialog .ed-download { min-height: 44px; }
.rc-workspace .ed-field input, .rc-dialog .ed-field input, .rc-dialog .ed-field select, .rc-dialog .ed-field textarea { min-height: 46px; font-size: 16px; color: var(--rc-ink); background: #fcfefb; border-color: #cddbcf; }
.rc-workspace .ed-field label, .rc-dialog .ed-field label { font-size: 14px; }
.rc-basic-fields { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); align-items: end; gap: 14px; }
.rc-ingredients-section { margin-top: 25px; }
.rc-ingredients-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.rc-ingredients-head h3 { margin: 0 0 5px; font-size: 17px; line-height: 1.5; color: var(--rc-ink); }
.rc-ingredients-head p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--rc-muted); }
.rc-row-count { flex-shrink: 0; padding-top: 3px; color: var(--rc-muted); font-size: 12px; }
.rc-table-wrap { min-width: 0; overflow: hidden; border: 1px solid var(--rc-line); border-radius: 14px; background: #fff; }
.rc-ingredients { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.rc-ingredients th { padding: 12px 10px; background: #e9f1e6; color: #3d5946; text-align: left; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.rc-ingredients th:nth-child(1) { width: 18%; }
.rc-ingredients th:nth-child(2) { width: 21%; }
.rc-ingredients th:nth-child(3) { width: 18%; }
.rc-ingredients th:nth-child(4) { width: 15%; text-align: right; }
.rc-ingredients th:nth-child(5) { width: 28%; }
.rc-ingredients td { min-width: 0; padding: 13px 10px; border-top: 1px solid var(--rc-line); vertical-align: top; line-height: 1.6; overflow-wrap: anywhere; }
.rc-ingredients td:first-child { font-weight: 750; }
.rc-ingredients td:nth-child(4), .rc-money { text-align: right; font-variant-numeric: tabular-nums; }
.rc-ingredients .rc-money { color: #2f6442; font-weight: 800; }
.rc-row-note { display: block; margin-top: 4px; color: var(--rc-muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.rc-row-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: stretch; gap: 5px; }
.rc-row-actions button { display: inline-flex; grid-column: span 2; align-items: center; justify-content: center; min-width: 0; min-height: 44px; margin: 0; padding: 7px 6px; border-radius: 8px; font-size: 12px; line-height: 1.3; white-space: nowrap; }
.rc-row-actions button[data-rc-action="edit"], .rc-row-actions button[data-rc-action="duplicate"] { grid-column: span 3; }
.rc-row-actions button[data-rc-action="remove"] { color: #a04436; }
.rc-row-actions button:disabled { cursor: default; }
.rc-rows-empty { margin: 0; padding: 24px 18px; color: var(--rc-muted); font-size: 14px; text-align: center; line-height: 1.7; }
.rc-add-ingredient, .rc-add-step { width: 100%; min-height: 46px; margin-top: 12px; border-style: dashed !important; background: #f6faf3 !important; color: var(--rc-accent) !important; }
.rc-main-actions { margin-top: 22px; }
.rc-main-actions .ed-primary { min-width: 170px; }
.rc-workspace .ed-status { overflow-wrap: anywhere; }
.rc-empty { margin: 16px 0 0; padding: 15px 17px; border: 1px dashed #ccdccc; border-radius: 12px; background: #f8fbf5; color: var(--rc-muted); font-size: 14px; line-height: 1.7; }
.rc-workspace:has(#ck-result:not([hidden])) #rc-empty { display: none; }
.cooking-page .rc-result { margin-top: 20px; padding: 22px; border: 1px solid #d8e5d6; background: #f4f9f1; }
.rc-result .rc-section-head { align-items: center; }
.rc-result .rc-section-head h2 { font-size: 23px; color: var(--rc-ink); }
.rc-export-trigger { flex-shrink: 0; margin: 0 !important; color: #fff !important; background: var(--rc-accent) !important; border-color: var(--rc-accent) !important; }
.rc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.rc-metrics > dl { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--rc-line); border-radius: 13px; background: #fff; }
.rc-metrics dt { color: var(--rc-muted); font-size: 12px; line-height: 1.6; }
.rc-metrics dd { margin: 8px 0 0; color: #28543b; font-size: 22px; font-weight: 800; line-height: 1.35; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rc-metrics small { display: block; margin-top: 7px; color: var(--rc-muted); font-size: 12px; line-height: 1.6; }
.rc-breakdown-section { margin-top: 23px; padding: 18px; border: 1px solid var(--rc-line); border-radius: 13px; background: #fff; }
.rc-breakdown-section h3 { margin: 0 0 15px; color: var(--rc-ink); font-size: 16px; }
.rc-breakdown { display: grid; gap: 12px; min-width: 0; }
.rc-breakdown table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.rc-breakdown th { padding: 0 0 9px; border-bottom: 1px solid var(--rc-line); color: var(--rc-muted); text-align: left; vertical-align: bottom; font-size: 12px; font-weight: 500; }
.rc-breakdown th:first-child { width: 42%; }
.rc-breakdown th:nth-child(2) { width: 36%; }
.rc-breakdown th:nth-child(3) { width: 22%; }
.rc-breakdown td { padding: 11px 0; border-bottom: 1px solid #edf2e9; vertical-align: top; overflow-wrap: anywhere; }
.rc-breakdown th:not(:first-child), .rc-breakdown td:not(:first-child) { padding-left: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.rc-breakdown tr:last-child td { border-bottom: 0; }
.rc-breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 14px; font-size: 13px; }
.rc-breakdown-name { min-width: 0; overflow-wrap: anywhere; }
.rc-breakdown-cost, .rc-breakdown-share { text-align: right; font-variant-numeric: tabular-nums; }
.rc-breakdown-share { min-width: 4em; color: var(--rc-muted); font-size: 12px; }
.rc-breakdown-bar { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 99px; background: #edf3e9; }
.rc-breakdown-bar > span { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: #71967a; }
.rc-pricing-note { margin: 18px 0 0; color: #6d634b; font-size: 13px; line-height: 1.8; }
.rc-warning { margin: 15px 0 0; padding: 12px 15px; border: 1px solid #ecc9bd; border-radius: 11px; background: #fff4ed; color: #92442c; font-size: 14px; line-height: 1.7; }
.rc-workspace a[aria-disabled="true"], .rc-dialog a[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* Modal controls are separate from the recipe form and stay above ad rails. */
html.rc-modal-open { overflow: hidden; scrollbar-gutter: stable; }
body:has(.rc-dialog[open]) { overflow: hidden; }
.rc-dialog { width: min(700px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: 90vh; max-height: min(90dvh, 940px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #d4e1d5; border-radius: 22px; background: #fff; box-shadow: 0 28px 100px #132d2480; }
.rc-dialog[open] { display: flex; flex-direction: column; }
.rc-dialog::backdrop { background: rgb(18 37 28 / 52%); }
.rc-dialog-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 24px 18px; border-bottom: 1px solid var(--rc-line); background: #f7faf4; }
.rc-dialog-head h2 { margin: 0; font-size: 22px; line-height: 1.4; color: var(--rc-ink); word-break: keep-all; overflow-wrap: anywhere; }
.rc-dialog-head p { margin: 8px 0 0; font-size: 14px; line-height: 1.65; color: var(--rc-muted); }
.rc-dialog .rc-dialog-close { display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 12px; background: #fff; font-size: 25px; line-height: 1; }
.rc-dialog-body { min-height: 0; padding: 22px 24px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.rc-dialog-body .ed-note { margin-top: 13px; color: var(--rc-muted); font-size: 13px; line-height: 1.75; }
.rc-dialog-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 16px 24px; border-top: 1px solid var(--rc-line); background: #fff; }
.rc-dialog-footer button { word-break: keep-all; overflow-wrap: anywhere; }
.rc-dialog-form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; margin: 0; }
.rc-dialog .ed-actions { margin-top: 15px; }
.rc-dialog .ed-actions button { flex: 1 1 170px; }
.rc-dialog button:disabled { cursor: default; }
.rc-dialog-status { margin: 14px 0 0; color: #276144; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.rc-dialog-status:empty, .rc-row-error:empty { display: none; }
.rc-dialog-status[data-error="true"], .rc-row-error { color: #b42335; }
.rc-row-error { margin: 15px 0 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.rc-settings-grid, .rc-row-fields { gap: 18px 14px; }
.rc-settings-grid .ed-field label, .rc-row-fields .ed-field label { display: flex; align-items: flex-end; min-height: 2.8em; line-height: 1.4; }
.rc-target-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.rc-target-presets > span { width: 100%; color: var(--rc-muted); font-size: 13px; }
.rc-target-presets button { flex: 1 1 80px; padding: 8px 12px; }
.rc-row-name-field { margin-bottom: 16px; }
.rc-steps-list { margin: 0; padding-left: 25px; }
.rc-step-item { margin: 0 0 17px; padding-left: 3px; }
.rc-step-item textarea { min-height: 82px; margin: 0; padding: 11px 12px; font-size: 16px; line-height: 1.6; }
.rc-step-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.rc-step-actions button { min-width: 44px; min-height: 44px; padding: 8px 12px; font-size: 12px; }
.rc-storage-group h3 { margin: 0; color: var(--rc-ink); font-size: 16px; }
.rc-storage-group + .rc-storage-group { margin-top: 22px; padding-top: 21px; border-top: 1px solid var(--rc-line); }
.rc-saved-summary { margin: 9px 0 0; padding: 12px 14px; border-radius: 10px; background: #f2f7ed; font-size: 14px; line-height: 1.7; color: #49614e; overflow-wrap: anywhere; }
.rc-storage-delete { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--rc-line); }
.rc-storage-delete summary { min-height: 44px; color: #746953; font-size: 14px; cursor: pointer; }
.rc-storage-delete button { margin-top: 14px; color: #a04335; border-color: #e6cfc7; }
.rc-share-privacy { margin: 0 0 18px; padding: 13px 15px; border: 1px solid #eadbb4; border-radius: 12px; background: #fffaed; color: #73613b; font-size: 14px; line-height: 1.75; }
.rc-share-link-field { margin-top: 20px; }
.rc-share-link-field textarea { min-height: 100px; font-size: 13px !important; line-height: 1.6; overflow-wrap: anywhere; word-break: break-all; }
.rc-export-hint { margin: 0 0 16px; color: var(--rc-muted); font-size: 14px; line-height: 1.7; }
.rc-export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rc-export-grid > * { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 54px !important; margin: 0 !important; padding: 13px 14px; text-align: center; overflow-wrap: anywhere; }
.cooking-page[data-kind="recipe"] .rc-export-grid .ed-download { background: #fff; color: var(--rc-accent); border-color: #cddccc; }
.cooking-page[data-kind="recipe"] .rc-export-grid .ed-download:hover, .cooking-page[data-kind="recipe"] .rc-export-grid .ed-download:focus-visible { color: #244d36; background: #eef5e9; border-color: #97b59a; }
.rc-confirm-dialog { width: min(480px, calc(100vw - 32px)); }
.rc-confirm-dialog #rc-confirm-message { margin: 0; font-size: 15px; line-height: 1.8; color: #3e5143; overflow-wrap: anywhere; }

@container (max-width: 700px) {
  .rc-ingredients, .rc-ingredients tbody { display: block; width: 100%; }
  .rc-ingredients thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .rc-ingredients tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .rc-ingredients tr + tr { border-top: 7px solid #eef4e8; }
  .rc-ingredients td { display: block; width: 100%; min-width: 0; padding: 11px 12px; border-top: 0; }
  .rc-ingredients td::before { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 400; color: var(--rc-muted); content: attr(data-label); }
  .rc-ingredients td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .rc-ingredients td:nth-child(4) { grid-column: 2; grid-row: 1; }
  .rc-ingredients td:nth-child(2), .rc-ingredients td:nth-child(3) { border-top: 1px dashed #e0e8db; }
  .rc-ingredients td:nth-child(5) { grid-column: 1 / -1; padding-top: 0; }
  .rc-ingredients td:nth-child(5)::before { display: none; }
  .rc-row-actions { gap: 7px; }
  .rc-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .rc-metrics > dl { padding: 13px 11px; }
  .rc-metrics dd { font-size: 20px; }
  .rc-result .rc-section-head { flex-wrap: wrap; }
  .rc-result .rc-export-trigger { width: 100%; }
}
@media (max-width: 560px) {
  .cooking-page[data-kind="recipe"] { padding-left: 0; padding-right: 0; }
  .rc-workspace { padding: 20px 16px; }
  .rc-section-head { flex-wrap: wrap; gap: 9px; }
  .rc-section-head h2, .rc-result .rc-section-head h2 { font-size: 21px; }
  .rc-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-toolbar button { padding: 9px 8px; }
  .rc-summary-strip p { font-size: 12px; }
  .rc-basic-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
  .rc-basic-fields .ed-field label { display: flex; min-height: 2.8em; align-items: flex-end; line-height: 1.4; }
  .rc-ingredients-head { flex-wrap: wrap; gap: 5px; }
  .rc-row-count { padding: 0; }
  .rc-main-actions > button { flex: 1 1 130px; }
  .cooking-page .rc-result { padding: 14px; }
  .rc-metrics > dl { padding: 12px 9px; }
  .rc-metrics dd { font-size: 18px; }
  .rc-breakdown-section { padding: 15px 12px; }
  .rc-breakdown-row { column-gap: 8px; }
  .rc-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
  .rc-dialog-head { gap: 10px; padding: 18px 16px 15px; }
  .rc-dialog-head h2 { font-size: 20px; }
  .rc-dialog-body { padding: 18px 16px; }
  .rc-dialog-footer { padding: 14px 16px; }
  .rc-dialog-footer button { flex: 1 1 110px; }
  .rc-dialog .ed-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-dialog .rc-settings-grid { grid-template-columns: 1fr; }
  .rc-settings-grid .ed-field label { min-height: 0; }
  .rc-export-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .rc-metrics { grid-template-columns: minmax(0, 1fr); }
  .rc-breakdown th:first-child { width: 30%; }
  .rc-breakdown th:nth-child(2) { width: 38%; }
  .rc-breakdown th:nth-child(3) { width: 32%; }
  .rc-dialog .rc-row-fields { grid-template-columns: 1fr; }
  .rc-row-fields .ed-field label { min-height: 0; }
  .rc-breakdown-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rc-breakdown-name { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .rc-workspace *, .rc-dialog * { scroll-behavior: auto !important; }
}
