/* color-scheme объявлена в base.css. Здесь не дублируем. */

@layer detail-tokens {
  .detail-page {
    --detail-radius-xs: 8px;
    --detail-radius-sm: 14px;
    --detail-radius-md: 16px;
    --detail-radius-base: 22px;
    --detail-radius-lg: calc(var(--detail-radius-base) + 2px);
    --detail-radius-xl: calc(var(--detail-radius-base) + 6px);
    --detail-radius-pill: 999px;

    --detail-border-soft: rgb(20 33 43 / 0.08);
    --detail-border-faint: rgb(20 33 43 / 0.06);
    --detail-border-strong: rgb(20 33 43 / 0.12);

    --detail-shadow-soft: 0 8px 20px rgb(20 33 43 / 0.04);
    --detail-shadow-card-hover: 0 12px 24px rgb(20 33 43 / 0.12);
    --detail-shadow-button: 0 14px 28px rgb(15 79 54 / 0.18);
    --detail-shadow-button-hover: 0 16px 32px rgb(15 79 54 / 0.22);

    --detail-green-1: #166645;
    --detail-green-2: #0f4f36;
    --detail-green-3: #0b3f2b;

    --detail-text-main: #24313a;
    --detail-text-secondary: #223038;
    --detail-text-muted: rgb(247 242 234 / 0.82);
    --detail-text-muted-2: rgb(247 242 234 / 0.76);

    --detail-header-radius: 32px;
    --detail-header-radius-mobile: 28px;
    --detail-gallery-transition: 520ms cubic-bezier(0.22, 0.61, 0.36, 1);

    --detail-space-3xs: 0.25rem;
    --detail-space-2xs: 0.45rem;
    --detail-space-xs: 0.65rem;
    --detail-space-sm: 0.85rem;
    --detail-space-md: 0.95rem;
    --detail-space-stack: 0.9rem;
    --detail-space-lg: 1rem;
    --detail-space-lg-tight: 1.05rem;
    --detail-space-xl: 1.15rem;
    --detail-space-content-pad: 1.2rem;
    --detail-space-layout: 1.25rem;
    --detail-space-grid: 1.35rem;
    --detail-space-header-top: 1.55rem;
    --detail-space-2xl: 1.6rem;
    --detail-space-3xl: 1.85rem;

    --detail-space-card-inline: 1.05rem;

    --detail-topbar-pill-min-height: 34px;
    --detail-topbar-pill-padding-block: 0.52rem;

    --detail-focus-outline-width: 2px;
    --detail-focus-outline-color: rgb(22 102 69 / 0.45);
    --detail-focus-outline-offset: 2px;
    --detail-focus-ring: 0 0 0 4px rgb(22 102 69 / 0.1);
  }
}

@layer detail-page {
  .detail-page {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin-inline: auto;
    container-type: inline-size;
    container-name: detail-page;
  }

  .site-messages {
    padding-block-start: var(--detail-space-lg);
  }

.site-message {
    margin-block-end: 0.75rem;
    padding-block: 1rem;
    padding-inline: clamp(1rem, 2.4vw, 1.5rem);
    border-radius: 18px;
    border: 1px solid var(--detail-border-soft);
    background: var(--surface-soft);
    color: var(--ink);
    box-shadow: var(--detail-shadow-soft);
    line-height: 1.45;
  }

  .site-message--success {
    border-color: rgb(22 102 69 / 0.18);
    border-inline-start-width: 4px;
    background:
      linear-gradient(135deg, rgb(22 102 69 / 0.14), rgb(22 102 69 / 0.07));
    box-shadow:
      0 12px 24px rgb(22 102 69 / 0.08),
      inset 0 1px 0 rgb(255 255 255 / 0.35);
  }

  .site-message--warning {
    border-color: rgb(185 117 20 / 0.18);
    background: rgb(185 117 20 / 0.08);
  }

  .site-message--error {
    border-color: rgb(160 49 49 / 0.18);
    background: rgb(160 49 49 / 0.08);
  }

  .detail-page__breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    inline-size: 100%;
    max-inline-size: 980px;
    margin-inline: auto;
    margin-block-start: -1.25rem;
    margin-block-end: 0.75rem;
    padding-block: 0.75rem;
    padding-inline: var(--detail-space-2xl);
  }

  .detail-page__breadcrumb-list {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    list-style: none;
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    font-size: 0.84rem;
    color: var(--ink-soft);
  }

  .detail-page__breadcrumb-item + .detail-page__breadcrumb-item::before {
    content: "/";
    margin-inline-end: 0.5rem;
    color: var(--ink-soft);
    opacity: 0.5;
  }

  .detail-page__breadcrumb-item a {
    color: var(--ink-soft);
    text-decoration: none;
  }

  .detail-page__breadcrumb-item a:hover,
  .detail-page__breadcrumb-item a:focus-visible {
    color: var(--brand);
    text-decoration: none;
  }

  .detail-page__breadcrumb-item--current {
    color: var(--ink);
    font-weight: 600;
  }

  .detail-page__breadcrumb-date {
    flex: 0 0 auto;
    font-size: 0.84rem;
    color: var(--ink-soft);
    white-space: nowrap;
  }

  .detail-page__header {
    position: relative;
    overflow: hidden;
    color: #f7f2ea;
    border-radius: var(--detail-header-radius) var(--detail-header-radius) 0 0;
    background:
      linear-gradient(90deg, rgb(11 24 18 / 0.72) 0%, rgb(11 24 18 / 0.48) 36%, rgb(11 24 18 / 0.24) 58%, rgb(11 24 18 / 0.44) 100%),
      linear-gradient(180deg, rgb(11 24 18 / 0.24) 0%, rgb(11 24 18 / 0.42) 100%),
      url("../images/hero.jpg") center / cover no-repeat;
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.08),
      0 22px 46px rgb(11 45 32 / 0.16);
  }

  .detail-page__header::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgb(255 255 255 / 0.04), transparent 24%),
      linear-gradient(0deg, rgb(11 24 18 / 0.16), transparent 38%);
    pointer-events: none;
  }

  .detail-page__header-inner {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin-inline: auto;
    padding-block-start: var(--detail-space-header-top);
    padding-block-end: var(--detail-space-3xl);
    padding-inline: var(--detail-space-lg);
  }

  .detail-page__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--detail-space-sm);
    margin-block-end: var(--detail-space-layout);
  }

  .detail-page__taxonomy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
  }

  .detail-page__taxonomy-chip {
    display: inline-flex;
    align-items: center;
    min-height: var(--detail-topbar-pill-min-height);
    padding-block: var(--detail-topbar-pill-padding-block);
    padding-inline: 0.82rem;
    border-radius: var(--detail-radius-pill);
    border: 1px solid rgb(255 255 255 / 0.16);
    background: rgb(247 242 234 / 0.03);
    color: rgb(255 250 245 / 0.97);
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    white-space: nowrap;
  }

  .detail-page__taxonomy-chip--muted {
    color: rgb(255 250 245 / 0.92);
  }

  .detail-page__taxonomy-divider {
    color: rgb(255 250 245 / 0.62);
    font-size: 0.95rem;
    line-height: 1;
  }

  :where(.detail-page__timing-pill, .detail-page__action-pill),
  :where(.detail-page__action-pill:visited) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: var(--detail-topbar-pill-min-height);
    padding-block: var(--detail-topbar-pill-padding-block);
    padding-inline: var(--detail-space-lg);
    border-radius: var(--detail-radius-pill);
    border: 1px solid rgb(255 255 255 / 0.16);
    background: rgb(247 242 234 / 0.03);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    color: #ffffff;
  }

  .detail-page__action-pill,
  .detail-page__action-pill:visited {
    text-decoration: none;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
  }

  .detail-page__timing-item {
    display: inline-flex;
    align-items: center;
    gap: var(--detail-space-2xs);
  }

  .detail-page__timing-label {
    color: var(--detail-text-muted);
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 500;
  }

  .detail-page__action-label {
    color: var(--detail-text-muted);
    font-size: 0.9rem;
    line-height: 1;
    font-weight: 500;
  }

  .detail-page__timing-value {
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 700;
  }

  .detail-page__action-value {
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 700;
  }

  .detail-page__timing-dot {
    color: rgb(247 242 234 / 0.5);
    font-size: 0.82rem;
    line-height: 1;
  }

  .detail-page__action-pill:hover,
  .detail-page__action-pill:focus-visible {
    background: rgb(247 242 234 / 0.16);
    border-color: rgb(255 255 255 / 0.24);
    color: #ffffff;
    text-decoration: none;
  }

  .detail-page__action-pill:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.06),
      var(--detail-focus-ring);
  }

  .detail-page__hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-page__header--recipe .detail-page__hero-copy {
    inline-size: 100%;
    max-inline-size: 100%;
  }

  .detail-page__header h1 {
    max-width: 12ch;
    margin-block-end: 0.9rem;
    color: #fffdf9;
    font-size: clamp(2.65rem, 4.7vw, 5.05rem);
    line-height: 0.93;
    letter-spacing: -0.05em;
    text-wrap: balance;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 12px rgb(8 35 24 / 0.22);
  }

  .detail-page--article .detail-page__header h1 {
    max-width: 18ch;
    width: auto;
    white-space: normal;
    text-wrap: balance;
  }

  .detail-page__header .eyebrow {
    color: rgb(247 242 234 / 0.9);
    margin-block-end: var(--detail-space-xs);
  }

  .detail-page__meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--detail-space-2xs);
    margin-block-end: 0.9rem;
    padding-block: 0.55rem;
    padding-inline: 0.9rem;
    background: rgb(247 242 234 / 0.03);
    border: 1px solid rgb(247 242 234 / 0.14);
    border-radius: var(--detail-radius-pill);
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgb(247 242 234 / 0.96);
  }

  .detail-page__intro {
    max-width: 58ch;
    margin-inline: auto;
    margin-block-end: 1.05rem;
    font-size: 1.08rem;
    line-height: 1.72;
    color: rgb(255 248 240 / 0.94);
    text-wrap: pretty;
    overflow-wrap: anywhere;
  }

  .detail-page__header--recipe .detail-page__intro {
    inline-size: 100%;
    max-inline-size: 100%;
  }

  .detail-page__author {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0.18rem 0;
    border-radius: var(--detail-radius-pill);
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .detail-page__author-label {
    font-size: 0.86rem;
    line-height: 1;
    color: var(--ink-soft);
  }

  .detail-page__author-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
  }

  .detail-page__author-link:hover,
  .detail-page__author-link:focus-visible {
    color: var(--brand);
    text-decoration: none;
  }

  .detail-page__author-link:focus-visible {
    outline-color: rgb(22 102 69 / 0.32);
    outline-offset: 3px;
    border-radius: 999px;
  }

  .detail-page__author-avatar {
    display: block;
    inline-size: 40px;
    block-size: 40px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 50%;
  }

  .detail-page__author-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgb(247 242 234 / 0.12);
    color: #ffffff;
    font-size: 0.88rem;
    line-height: 1;
    font-weight: 700;
  }

  .detail-page__author-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.96rem;
    line-height: 1.2;
    font-weight: 700;
    color: currentColor;
  }

  .detail-page__header .detail-page__author-label,
  .detail-page__header .detail-page__author-link {
    color: #fff8ee;
  }

  .detail-page__header .detail-page__author {
    min-height: 36px;
    padding: 0.42rem 0.82rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 999px;
    background: rgb(247 242 234 / 0.1);
    box-shadow: 0 8px 18px rgb(0 0 0 / 0.1);
    backdrop-filter: blur(6px);
    transition:
      background-color 0.32s ease,
      color 0.32s ease,
      box-shadow 0.32s ease;
  }

  .detail-page__header .detail-page__author:hover,
  .detail-page__header .detail-page__author:focus-within {
    background: rgb(247 242 234 / 0.26);
    border-color: rgb(255 255 255 / 0.24);
    box-shadow: 0 10px 22px rgb(0 0 0 / 0.12);
  }

  .detail-page__header .detail-page__author-link:hover,
  .detail-page__header .detail-page__author-link:focus-visible {
    color: #ffffff;
  }

  .recipe-gallery {
    --gallery-stage-height: clamp(250px, 28vw, 420px);
    --gallery-main-width: min(46%, 560px);
    --gallery-side-width: min(38%, 460px);
    /* tuned for balanced side-image peek without overpowering the main slide */
    --gallery-side-shift: 28%;
    --gallery-side-scale: 0.92;
    --gallery-arrow-size: 56px;
    --gallery-side-center-offset: var(--gallery-side-shift);

    background: var(--surface);
    padding-block: var(--detail-space-lg) 0;
    padding-inline: var(--detail-space-lg);
    border-inline: 1px solid var(--line);
    border-radius: 0;
    overflow: hidden;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
  }

  .recipe-gallery:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    box-shadow:
      inset 0 0 0 2px rgb(22 102 69 / 0.24),
      var(--detail-focus-ring);
  }

  .recipe-gallery__viewport {
    position: relative;
    width: 100%;
    height: var(--gallery-stage-height);
  }

  .recipe-gallery__stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .recipe-gallery__item {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    width: var(--gallery-main-width);
    margin: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transform-origin: center center;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition:
      transform var(--detail-gallery-transition),
      opacity var(--detail-gallery-transition),
      width var(--detail-gallery-transition),
      filter var(--detail-gallery-transition);
  }

  .recipe-gallery__item.is-current,
  .recipe-gallery__item.is-prev,
  .recipe-gallery__item.is-next {
    will-change: transform, opacity;
  }

  .recipe-gallery__image-shell {
    overflow: hidden;
    border-radius: var(--detail-radius-lg);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    box-shadow: var(--shadow-sm);
  }

  .recipe-gallery__media {
    display: block;
    width: 100%;
    height: var(--gallery-stage-height);
    object-fit: cover;
    background: #000;
  }

  .recipe-gallery__item.is-current {
    width: var(--gallery-main-width);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
    filter: none;
  }

  .recipe-gallery__item.is-prev {
    width: var(--gallery-side-width);
    transform: translate(calc(-50% - var(--gallery-side-shift)), -50%) scale(var(--gallery-side-scale));
    opacity: 0.5;
    pointer-events: auto;
    z-index: 2;
    cursor: pointer;
  }

  .recipe-gallery__item.is-next {
    width: var(--gallery-side-width);
    transform: translate(calc(-50% + var(--gallery-side-shift)), -50%) scale(var(--gallery-side-scale));
    opacity: 0.5;
    pointer-events: auto;
    z-index: 2;
    cursor: pointer;
  }

  .recipe-gallery__item.is-hidden,
  .recipe-gallery__item.is-far-prev,
  .recipe-gallery__item.is-far-next {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
  }

  .recipe-gallery__item.is-far-prev {
    transform: translate(calc(-50% - 54%), -50%) scale(0.84);
  }

  .recipe-gallery__item.is-far-next {
    transform: translate(calc(-50% + 54%), -50%) scale(0.84);
  }

  .recipe-gallery__item.is-prev:hover,
  .recipe-gallery__item.is-next:hover {
    opacity: 0.62;
  }

  .recipe-gallery__item.is-prev:focus-visible,
  .recipe-gallery__item.is-next:focus-visible {
    opacity: 0.7;
    outline: var(--detail-focus-outline-width) solid var(--detail-focus-outline-color);
    outline-offset: 4px;
  }

  .recipe-gallery__arrow {
    position: absolute;
    inset-block-start: 50%;
    width: var(--gallery-arrow-size);
    height: var(--gallery-arrow-size);
    border: 1px solid var(--line);
    border-radius: var(--detail-radius-pill);
    background: rgb(247 242 234 / 0.98);
    color: var(--brand);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    z-index: 5;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    transition:
      transform 180ms ease,
      background-color 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease,
      opacity 180ms ease;
  }

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

  .recipe-gallery__arrow[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.45;
  }

  .recipe-gallery__arrow--prev {
    inset-inline-start: calc(50% - var(--gallery-side-center-offset) - (var(--gallery-arrow-size) / 2));
    transform: translateY(-50%);
  }

  .recipe-gallery__arrow--next {
    inset-inline-start: calc(50% + var(--gallery-side-center-offset) - (var(--gallery-arrow-size) / 2));
    transform: translateY(-50%);
  }

  .recipe-gallery__arrow:hover {
    background: #ffffff;
    border-color: var(--line-strong);
    box-shadow: var(--detail-shadow-card-hover);
  }

  .recipe-gallery__arrow--prev:hover,
  .recipe-gallery__arrow--next:hover {
    transform: translateY(-50%) scale(1.04);
  }

  .recipe-gallery__arrow:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    box-shadow:
      var(--detail-shadow-card-hover),
      var(--detail-focus-ring);
  }

  .recipe-gallery__caption {
    min-height: 2rem;
    padding-block: 0.9rem var(--detail-space-lg);
    padding-inline: var(--detail-space-3xs);
    text-align: center;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--ink-soft);
  }

  .recipe-gallery--single .recipe-gallery__viewport {
    height: var(--gallery-stage-height);
  }

  .recipe-gallery--single .recipe-gallery__item {
    width: min(860px, 100%);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .recipe-gallery--single .recipe-gallery__caption {
    text-align: center;
  }

  .detail-page__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-block: 0.75rem;
    padding-inline: var(--detail-space-xl);
    border-radius: 0;
    background: var(--surface);
    border-inline: 1px solid var(--line);
  }

  .detail-page__share {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  :where(.detail-page__action-btn, .detail-page__copy-btn),
  :where(.detail-page__action-btn, .detail-page__copy-btn):visited {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-block: 0.45rem;
    padding-inline: 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
    cursor: pointer;
  }

  :where(.detail-page__action-btn, .detail-page__copy-btn):hover,
  :where(.detail-page__action-btn, .detail-page__copy-btn):focus-visible {
    color: var(--brand);
    border-color: var(--brand);
    text-decoration: none;
  }

  .detail-page__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.92fr);
    row-gap: var(--detail-space-grid);
    column-gap: var(--detail-space-xl);
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-block-start: none;
    border-radius: 0;
    padding-block: var(--detail-space-md) var(--detail-space-xl);
    padding-inline: var(--detail-space-xl);
  }

  .detail-page__actions + .detail-page__grid {
    padding-block-start: 0;
  }

  .detail-page__grid--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-page__grid--article {
    grid-template-columns: minmax(0, 1.72fr) minmax(250px, 0.78fr);
    gap: var(--detail-space-2xl);
    padding: var(--detail-space-xl);
  }

  :where(.detail-page__main, .detail-page__sidebar) {
    min-width: 0;
  }

  .detail-page__main,
  .detail-page__sidebar,
  .comments-forms,
  .comments-list,
  .recipe-form {
    display: flex;
    flex-direction: column;
    gap: var(--detail-space-stack);
  }

  .detail-page__section h2 {
    margin: 0;
    font-size: clamp(1.2rem, 1.6vw, 1.4rem);
    line-height: 1.05;
    text-align: center;
  }

  .detail-page__section + .detail-page__section {
    margin-block-start: 0.05rem;
  }

  .detail-page__section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.45rem;
    margin-block-end: 0.45rem;
    text-align: center;
  }

  .detail-page__section-head > h2 {
    flex: 1 1 100%;
  }

  .detail-page__section-head:not(:has(.detail-page__section-note)) {
    justify-content: center;
    text-align: center;
  }

  .detail-page__section-note {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink-soft);
    text-align: center;
  }

  .recipe-summary {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0.55rem;
    box-shadow: var(--detail-shadow-soft);
  }

  .recipe-summary__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .recipe-summary__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    min-block-size: 54px;
    padding-block: 0.5rem;
    padding-inline: 0.62rem;
    border-radius: var(--detail-radius-sm);
    background: #ffffff;
    border: 1px solid var(--detail-border-faint);
    text-align: center;
  }

  .recipe-summary__item--rating {
    grid-column: span 2;
  }

  .recipe-summary__label {
    font-size: 0.76rem;
    line-height: 1.15;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 700;
    text-align: center;
  }

  .recipe-summary__value {
    font-size: 1.08rem;
    line-height: 1.15;
    color: var(--ink);
    font-weight: 700;
    text-align: center;
  }

  .rating-overview {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.22rem 0.4rem;
    margin-block-start: 0.06rem;
  }

  .rating-overview__stars {
    position: relative;
    display: inline-block;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.1em;
  }

  .rating-overview__stars-base {
    color: rgb(20 33 43 / 0.18);
  }

  .rating-overview__stars-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--rating-fill, 0%);
    overflow: hidden;
    white-space: nowrap;
    color: #d89b2b;
  }

  .rating-overview__count {
    font-size: 0.7rem;
    color: var(--ink-soft);
    text-align: center;
  }

  .ingredients-panel {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0;
    box-shadow: var(--detail-shadow-soft);
    overflow: hidden;
  }

  .ingredients-panel__head,
  .method-panel__head {
    padding: 0.75rem 1rem 0.7rem;
    border-bottom: 1px solid var(--detail-border-soft);
    text-align: center;
  }

  .ingredients-panel__head h2,
  .method-panel__head h2 {
    margin: 0;
  }

  .ingredients-panel__scroll {
    height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--detail-border-strong) transparent;
  }

  .ingredients-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ingredients-list__item + .ingredients-list__item {
    border-block-start: 1px solid rgb(20 33 43 / 0.07);
  }

  .ingredient-check {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 0.6rem;
    padding-block: 0.72rem;
    padding-inline: 0.75rem;
    cursor: pointer;
  }

  .ingredient-check__input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Fixed decorative square controls intentionally keep width/height
     for readability; logical sizing is reserved for accessibility utilities. */
  .ingredient-check__box {
    position: relative;
    width: 18px;
    height: 18px;
    margin-block-start: 0.12rem;
    border-radius: var(--detail-radius-xs);
    border: 1px solid rgb(20 33 43 / 0.16);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7);
    transition:
      border-color 160ms ease,
      background-color 160ms ease,
      box-shadow 160ms ease,
      transform 160ms ease;
  }

  .ingredient-check__box::after {
    content: "";
    position: absolute;
    inset: 2px 5px 4px 5px;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg);
    opacity: 0;
    transition:
      opacity 160ms ease,
      border-color 160ms ease;
  }

  .ingredient-check__input:focus-visible + .ingredient-check__box {
    outline: var(--detail-focus-outline-width) solid var(--detail-focus-outline-color);
    outline-offset: var(--detail-focus-outline-offset);
    box-shadow: var(--detail-focus-ring);
  }

  .ingredient-check__input:checked + .ingredient-check__box {
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    border-color: var(--detail-green-1);
    box-shadow: 0 6px 14px rgb(15 79 54 / 0.16);
  }

  .ingredient-check__input:checked + .ingredient-check__box::after {
    border-color: #ffffff;
    opacity: 1;
  }

  .ingredient-check__text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--ink);
    text-wrap: pretty;
  }

  .ingredient-check__name {
    color: var(--ink);
    font-weight: 700;
  }

  .ingredient-check__name::after {
    content: ":";
  }

  .ingredient-check__detail {
    color: var(--detail-text-secondary);
  }

  .method-panel {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0;
    box-shadow: var(--detail-shadow-soft);
    overflow: hidden;
  }

  .method-panel__scroll {
    height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--detail-border-strong) transparent;
  }

  .method-steps {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .method-steps__item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding-block: 0.72rem;
    padding-inline: 0.75rem;
    border-block-start: 1px solid rgb(20 33 43 / 0.07);
  }

  .method-steps__item:first-child {
    border-block-start: none;
  }

  /* Fixed decorative square controls intentionally keep width/height
     for readability; logical sizing is reserved for accessibility utilities. */
  .method-steps__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 6px 12px rgb(15 79 54 / 0.14);
  }

  .method-steps__body {
    display: flex;
    align-items: center;
    min-height: 22px;
  }

  .method-steps__body p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.62;
    color: var(--detail-text-main);
    text-wrap: pretty;
  }

  .comments-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    inline-size: 100%;
    max-inline-size: 900px;
    margin-inline: auto;
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0.35rem;
    box-shadow: var(--detail-shadow-soft);
  }

  .comments-panel .comments-list {
    gap: 0.5rem;
  }

  .comments-panel__form {
    background: #ffffff;
    border: 1px solid var(--detail-border-faint);
    border-radius: var(--detail-radius-base);
    padding-block: 0.95rem;
    padding-inline: 1rem;
  }

  .comments-panel__form h3 {
    margin-block-end: 0.65rem;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
  }

  .comments-panel__commenter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-block-end: 0.85rem;
    padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    background: #ffffff;
    border: 1px solid var(--detail-border-faint);
    border-radius: var(--detail-radius-pill);
    align-self: center;
  }


  .comments-panel__commenter-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--detail-border-soft);
  }

  .comments-panel__commenter-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--detail-green-1), var(--detail-green-2));
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    border: none;
  }

  .comments-panel__commenter-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
  }

  .comments-panel__login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.5rem;
    padding: 0;
    text-align: center;
    font-size: 0.98rem;
    color: var(--ink-soft);
  }

  .comments-panel__login-prompt a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
  }

  .comments-panel__login-prompt a:hover {
    text-decoration: underline;
  }

  .comments-panel__form .recipe-form,
  .detail-page__sidebar .detail-page__card--form .recipe-form {
    align-items: center;
  }

  .comments-panel__form .recipe-form > :not(.detail-button),
  .detail-page__sidebar .detail-page__card--form .recipe-form > :not(.detail-button) {
    inline-size: 100%;
  }

  .comments-panel__form .detail-button,
  .detail-page__sidebar .detail-page__card--form .detail-button {
    align-self: center;
  }

  :where(.comment-card, .empty-state-card, .detail-page__card) {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-base);
    padding-inline: var(--detail-space-card-inline);
    box-shadow: var(--detail-shadow-soft);
  }

  .comment-card,
  .empty-state-card {
    padding-block: var(--detail-space-lg);
  }

  .empty-state-card {
    text-align: center;
    color: var(--ink-soft);
  }

  .comment-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-block-end: 0.6rem;
  }

  .comment-card__name {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.3;
  }

  .comment-card__date {
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .comment-card__body {
    color: var(--detail-text-main);
    line-height: 1.7;
  }

  .comment-card__body p {
    margin-block-end: 0.7rem;
  }

  .comment-card__body p:last-child {
    margin-block-end: 0;
  }

  .detail-page__card {
    padding-block: var(--detail-space-md) var(--detail-space-lg);
  }

  .detail-page__card--form {
    padding-block: var(--detail-space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .detail-page__card--form .recipe-form {
    align-items: center;
    width: 100%;
  }

  .detail-page__card--form .detail-button {
    align-self: center;
  }

  .detail-page__card--meta {
    min-height: 96px;
  }

  .detail-page__card h2 {
    margin-block-end: 0.55rem;
    font-size: clamp(1.2rem, 1.6vw, 1.4rem);
    line-height: 1.15;
  }

  .detail-page__sidebar .detail-page__card h2 {
    text-align: center;
  }

  .detail-page__card h3 {
    margin-block-end: 0.45rem;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 700;
  }

  .detail-page__card p {
    margin-block-end: 0.8rem;
    line-height: 1.62;
    color: var(--detail-text-secondary);
  }

  .detail-page__card-copy {
    display: grid;
    gap: 0.72rem;
  }

  .detail-page__card--context,
  .detail-page__card--tips,
  .detail-page__card--author-commentary {
    overflow: hidden;
  }

  .detail-page__card--context .detail-page__card-copy,
  .detail-page__card--tips .detail-page__card-copy,
  .detail-page__card--author-commentary .detail-page__card-copy {
    height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--detail-border-strong) transparent;
  }

  .detail-page__card-copy p {
    margin: 0;
    text-wrap: pretty;
  }

  .detail-page__source-list {
    display: grid;
    gap: 0.75rem;
  }

  .detail-page__source-item {
    display: grid;
    gap: 0.28rem;
    padding-block: 0.7rem;
    padding-inline: 0.85rem;
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-sm);
    background: rgb(255 255 255 / 0.62);
    text-align: center;
  }

  .detail-page__source-label {
    color: var(--ink-soft);
    font-size: 0.76rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .detail-page__source-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
  }

  .detail-page__source-value {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.45;
    font-weight: 600;
    text-wrap: pretty;
  }

  .detail-page__source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: fit-content;
    min-inline-size: 0;
    margin-inline: auto;
    padding-block: 0.45rem;
    padding-inline: 0.8rem;
    border: 1px solid var(--detail-border-soft);
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand);
    font-size: 0.9rem;
    line-height: 1.2;
    font-weight: 700;
    text-decoration: none;
  }

  .detail-page__source-link:hover,
  .detail-page__source-link:focus-visible {
    border-color: rgb(22 102 69 / 0.24);
    background: rgb(22 102 69 / 0.06);
    text-decoration: none;
  }

  .allergen-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .allergen-list__item {
    margin: 0;
  }

  .allergen-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem 0.3rem 0.5rem;
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-pill);
    background: rgb(255 255 255 / 0.62);
    white-space: nowrap;
  }

  .allergen-check--present {
    border-color: rgb(22 102 69 / 0.18);
    background: rgb(22 102 69 / 0.08);
  }

  .allergen-check__box {
    position: relative;
    inline-size: 16px;
    block-size: 16px;
    flex: 0 0 auto;
    margin-block-start: 0;
    border-radius: var(--detail-radius-xs);
    border: 1px solid rgb(20 33 43 / 0.16);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7);
  }

  .allergen-check--present .allergen-check__box {
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    border-color: var(--detail-green-1);
    box-shadow: 0 6px 14px rgb(15 79 54 / 0.16);
  }

  .allergen-check--present .allergen-check__box::after {
    content: "";
    position: absolute;
    inset: 2px 5px 4px 5px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
  }

  .allergen-check__text {
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 600;
    text-align: center;
    text-wrap: pretty;
  }

  .allergen-check--absent .allergen-check__text {
    color: var(--detail-text-secondary);
    font-weight: 500;
  }

  .detail-page__card p:last-child {
    margin-block-end: 0;
  }

  .detail-page__card a {
    color: var(--brand);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .detail-page__card strong {
    color: var(--ink);
  }

  .detail-page__content-card {
    background: var(--surface);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-base);
    padding-block: var(--detail-space-xl) var(--detail-space-content-pad);
    padding-inline: var(--detail-space-content-pad);
    box-shadow: var(--detail-shadow-soft);
  }

  .detail-page__content-card .rich-text > *:first-child {
    margin-block-start: 0;
  }

  .detail-page__content-card .rich-text > *:last-child {
    margin-block-end: 0;
  }

  .recipe-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
  }

  .recipe-form__field label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
  }

  .recipe-form__field input,
  .recipe-form__field textarea {
    width: 100%;
    border: 1px solid var(--detail-border-strong);
    border-radius: var(--detail-radius-md);
    padding-block: var(--detail-space-sm);
    padding-inline: 0.95rem;
    font: inherit;
    line-height: 1.5;
    color: var(--ink);
    background: #ffffff;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    transition:
      border-color 160ms ease,
      box-shadow 160ms ease,
      background-color 160ms ease,
      outline-color 160ms ease;
  }

  .recipe-form__field textarea {
    block-size: 100px;
    min-block-size: 100px;
  }

  .recipe-form__field input:focus-visible,
  .recipe-form__field textarea:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    border-color: rgb(22 102 69 / 0.44);
    box-shadow: var(--detail-focus-ring);
  }

  .recipe-form__field--hidden {
    display: none;
  }

  .detail-button {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    inline-size: fit-content;
    min-height: 46px;
    padding-block: 0.8rem;
    padding-inline: 1.1rem;
    border: none;
    border-radius: var(--detail-radius-pill);
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    box-shadow: var(--detail-shadow-button);
    transition:
      transform 180ms ease,
      box-shadow 180ms ease,
      filter 180ms ease,
      outline-color 180ms ease;
  }

  .detail-button:hover,
  .detail-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--detail-shadow-button-hover);
    filter: brightness(1.02);
  }

  .detail-button:focus-visible {
    outline-color: var(--detail-focus-outline-color);
  }

  .detail-button--secondary {
    background: transparent;
    color: var(--detail-green-1);
    border: 1px solid var(--detail-green-1);
    box-shadow: none;
  }

  .detail-button--secondary:hover,
  .detail-button--secondary:focus-visible {
    background: rgb(22 102 69 / 0.06);
    box-shadow: none;
    filter: none;
  }

  .rating-form {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.6rem;
  }

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

  .rating-form__option input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .rating-form__option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--detail-border-strong);
    background: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink-soft);
    cursor: pointer;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    transition:
      border-color 160ms ease,
      background-color 160ms ease,
      color 160ms ease,
      transform 160ms ease,
      box-shadow 160ms ease,
      outline-color 160ms ease;
  }

  .rating-form__option input:checked + span {
    border-color: var(--detail-green-1);
    background: linear-gradient(135deg, var(--detail-green-1), var(--detail-green-2));
    color: #ffffff;
    box-shadow: 0 6px 16px rgb(22 102 69 / 0.28);
    transform: translateY(-2px);
  }

  .rating-form__option span:hover {
    border-color: var(--detail-green-1);
    background: rgb(22 102 69 / 0.07);
    color: var(--detail-green-1);
    transform: translateY(-1px);
  }

  .rating-form__option input:focus-visible + span {
    outline-color: var(--detail-focus-outline-color);
    box-shadow: var(--detail-focus-ring);
  }

  .rich-text {
    color: var(--detail-text-main);
  }

  .rich-text p {
    margin-block-end: 1.1rem;
    font-size: 1.04rem;
    line-height: 1.86;
  }

  .rich-text p:last-child {
    margin-block-end: 0;
  }

  .rich-text h2,
  .rich-text h3 {
    color: var(--ink);
    letter-spacing: -0.02em;
  }

  .rich-text ul,
  .rich-text ol {
    margin-block-end: 1.15rem;
    margin-inline-start: 1.2rem;
    color: var(--detail-text-main);
  }

  .rich-text li {
    margin-block-end: 0.45rem;
    line-height: 1.75;
  }

  @media (forced-colors: active) {
    .recipe-form__field input:focus-visible,
    .recipe-form__field textarea:focus-visible,
    .ingredient-check__input:focus-visible + .ingredient-check__box,
    .rating-form__option input:focus-visible + span,
    .detail-button:focus-visible,
    .detail-page__action-pill:focus-visible,
    .recipe-gallery:focus-visible,
    .recipe-gallery__arrow:focus-visible {
      outline-color: Highlight;
      border-color: Highlight;
      box-shadow: none;
    }

    .ingredient-check__input:checked + .ingredient-check__box {
      background: Highlight;
      border-color: Highlight;
      box-shadow: none;
    }

    .ingredient-check__input:checked + .ingredient-check__box::after {
      border-color: HighlightText;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .recipe-gallery__item,
    .recipe-gallery__arrow,
    .detail-button,
    .ingredient-check__box,
    .ingredient-check__box::after,
    .rating-form__option span,
    .recipe-form__field input,
    .recipe-form__field textarea,
    .detail-page__action-pill {
      transition: none;
    }

    .recipe-gallery__item.is-current,
    .recipe-gallery__item.is-prev,
    .recipe-gallery__item.is-next {
      will-change: auto;
    }

    .recipe-gallery__arrow:hover,
    .recipe-gallery__arrow--prev:hover,
    .recipe-gallery__arrow--next:hover,
    .detail-button:hover,
    .detail-button:focus-visible,
    .rating-form__option span:hover,
    .rating-form__option input:checked + span {
      transform: none;
    }
  }

  @container detail-page (max-width: 1100px) {
    .recipe-gallery {
      --gallery-main-width: min(54%, 540px);
      --gallery-side-width: min(40%, 380px);
      --gallery-side-shift: 29%;
    }

    .detail-page__grid,
    .comments-layout,
    .detail-page__grid--article {
      grid-template-columns: 1fr;
    }
  }

  @container detail-page (max-width: 820px) {
    .detail-page__header {
      border-radius: var(--detail-header-radius-mobile) var(--detail-header-radius-mobile) 0 0;
    }

    .detail-page__breadcrumb {
      padding-inline: var(--detail-space-lg);
    }

    .detail-page__header-inner {
      padding-block: 1.2rem 1.45rem;
      padding-inline: var(--detail-space-lg);
    }

    .detail-page__topbar {
      flex-direction: column;
      align-items: stretch;
    }

    .detail-page__taxonomy,
    .detail-page__timing-pill,
    .detail-page__action-pill {
      width: 100%;
      justify-content: center;
    }

    .detail-page__header h1 {
      max-width: 100%;
      font-size: clamp(2.2rem, 9vw, 3.35rem);
      line-height: 0.98;
    }

    .detail-page__intro {
      font-size: 1rem;
      line-height: 1.68;
    }

    .recipe-gallery {
      --gallery-stage-height: clamp(220px, 66vw, 330px);
      --gallery-main-width: min(74%, 460px);
      --gallery-side-width: min(46%, 240px);
      --gallery-side-shift: 30%;
      --gallery-arrow-size: 48px;
    }

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

    .recipe-summary__item--rating {
      grid-column: span 2;
    }

    .detail-page__grid,
    .detail-page__grid--article {
      padding: 0.9rem;
    }

    .detail-page__content-card {
      padding: var(--detail-space-lg);
    }

    .method-steps__item {
      grid-template-columns: 24px minmax(0, 1fr);
      gap: 0.65rem;
      padding-block: 0.66rem;
      padding-inline: 0.65rem;
    }

    .method-steps__number {
      width: 22px;
      height: 22px;
      border-radius: 999px;
      font-size: 0.72rem;
    }
  }

  @container detail-page (max-width: 560px) {
    .recipe-gallery {
      --gallery-stage-height: clamp(210px, 64vw, 280px);
      --gallery-main-width: min(84%, 380px);
      --gallery-side-width: min(52%, 190px);
      --gallery-side-shift: 31%;
    }

    .recipe-gallery__caption {
      font-size: 0.92rem;
    }

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

    .recipe-summary__item,
    .recipe-summary__item--rating {
      grid-column: span 1;
      min-block-size: auto;
    }

    .rating-form {
      gap: 0.35rem;
    }

    .rating-form__option span {
      width: 36px;
      height: 36px;
      font-size: 0.88rem;
    }

    .rich-text p,
    .method-steps__body p,
    .ingredient-check__text {
      font-size: 1rem;
      line-height: 1.74;
    }
  }

  @media (max-width: 640px) {
    .detail-page__actions {
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
    }

    .detail-page__share {
      flex-wrap: wrap;
      justify-content: center;
    }

    .detail-page__breadcrumb {
      justify-content: center;
      margin-block-start: -1.25rem;
    }

    .detail-page__breadcrumb-date {
      display: none;
    }

    .detail-page__breadcrumb-list {
      justify-content: center;
      flex-wrap: nowrap;
      max-inline-size: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .detail-page__breadcrumb-item {
      flex: 0 1 auto;
      min-width: 0;
    }

    .detail-page__breadcrumb-item:not(:first-child):not(.detail-page__breadcrumb-item--current) {
      flex-shrink: 2;
      display: none;
    }

    .detail-page__breadcrumb-item a {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .detail-page__breadcrumb-item--current {
      flex-shrink: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .detail-page--article .detail-page__action-pill {
      flex-wrap: wrap;
      white-space: normal;
      text-align: center;
    }

    .detail-page--article .detail-page__action-value {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .detail-page--article .recipe-gallery {
      --gallery-stage-height: clamp(210px, 62vw, 280px);
      --gallery-main-width: 100%;
      --gallery-side-width: 0;
      --gallery-side-shift: 0;
      --gallery-arrow-size: 44px;
      padding-inline: 0.65rem;
    }

    .detail-page--article .recipe-gallery__item.is-current {
      width: 100%;
    }

    .detail-page--article .recipe-gallery__item.is-prev,
    .detail-page--article .recipe-gallery__item.is-next {
      opacity: 0;
      pointer-events: none;
    }

    .detail-page--article .recipe-gallery__arrow--prev {
      inset-inline-start: 0.85rem;
    }

    .detail-page--article .recipe-gallery__arrow--next {
      inset-inline-start: auto;
      inset-inline-end: 0.85rem;
    }
  }
}

/* ==== Recipe rebuilt layout ==== */

.recipe-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  background: var(--surface-soft);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.recipe-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 60px;
  padding: 0.35rem 0.65rem;
  background: #ffffff;
  border: 1px solid var(--detail-border-faint);
  border-radius: var(--detail-radius-sm);
  text-align: center;
}

.recipe-stat--rating {
  min-width: 120px;
}

.recipe-stat__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.2;
}

.recipe-stat__value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.recipe-stat__value--inline {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.recipe-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.recipe-body__col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.recipe-extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.recipe-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.recipe-comments {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--detail-radius-base) var(--detail-radius-base);
}

.recipe-comments .detail-page__section-head {
  margin-block-end: 0.75rem;
}

@container detail-page (max-width: 720px) {
  .recipe-body,
  .recipe-extras,
  .recipe-footer {
    grid-template-columns: 1fr;
  }
}

/* ==== Recipe detail hero ==== */

.detail-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: rgb(247 242 234 / 0.7);
  margin-block-end: 0.6rem;
}

.detail-hero__breadcrumb a {
  color: rgb(247 242 234 / 0.7);
  text-decoration: none;
}

.detail-hero__breadcrumb a:hover {
  color: #fff;
}

.detail-hero__meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.detail-hero__timing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgb(247 242 234 / 0.9);
}

.detail-hero__author {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: rgb(247 242 234 / 0.9);
  text-decoration: none;
}

.detail-hero__author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgb(255 255 255 / 0.25);
}

.detail-hero__author:hover {
  color: #fff;
}

/* ── Comments form & login prompt centering (unlayered — overrides layer) ── */
.comments-panel__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.comments-panel__form .recipe-form {
  width: 100%;
}

.comments-panel__login-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  margin: 0;
  padding: 0;
  text-align: center;
}

.empty-state-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  text-align: center;
}

.empty-state-card p {
  margin: 0;
}
