/* ===== Large recipe summary modal ===== */
.diy-summary-modal {
    position: fixed;
    inset: 0;
    /* Above app chrome; lives on body so fixed = true viewport center */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.diy-summary-modal.hidden {
    display: none !important;
}

.diy-summary-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 16, 0.48);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    animation: diySummaryFade 0.25s ease both;
}

/* Liquid glass panel — translucency + blur (both themes) */
.diy-summary-sheet {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    max-height: min(88dvh, 760px);
    overflow: hidden;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background:
        linear-gradient(165deg, rgba(255, 126, 103, 0.12) 0%, transparent 42%),
        rgba(28, 28, 40, 0.52);
    backdrop-filter: blur(28px) saturate(1.45);
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.12),
        0 24px 56px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    padding: 32px 28px 26px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: diySummaryPop 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Light: frosted white glass (was solid #fff — no glass) */
:root:not(.theme-dark) .diy-summary-backdrop,
.theme-light .diy-summary-backdrop {
    background: rgba(40, 42, 58, 0.28);
    backdrop-filter: blur(12px) saturate(1.15);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

:root:not(.theme-dark) .diy-summary-sheet,
.theme-light .diy-summary-sheet {
    border-color: rgba(255, 255, 255, 0.72);
    background:
        linear-gradient(165deg, rgba(255, 126, 103, 0.1) 0%, transparent 42%),
        rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(28px) saturate(1.5);
    -webkit-backdrop-filter: blur(28px) saturate(1.5);
    box-shadow:
        0 4px 16px rgba(15, 15, 30, 0.06),
        0 24px 56px rgba(15, 15, 30, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.theme-dark .diy-summary-sheet {
    border-color: rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(165deg, rgba(255, 126, 103, 0.14) 0%, transparent 40%),
        rgba(22, 22, 33, 0.55);
}

/* Default (portrait / narrow): single column body, scroll inside sheet */
.diy-summary-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.diy-summary-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.diy-summary-col-side {
    min-height: 0;
}

.diy-summary-ingredients-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.diy-summary-ingredients-section .diy-ingredient-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(42vh, 360px);
    overflow-y: auto;
}

@keyframes diySummaryFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes diySummaryPop {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.diy-summary-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    z-index: 2;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}

.diy-summary-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.theme-dark .diy-summary-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Continuous header — image + title + meta as one reading block */
.diy-summary-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-right: 28px;
}

.diy-summary-hero-img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.04);
}

.diy-summary-kicker {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--primary-color);
}

.diy-summary-hero-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 2px;
}

.diy-summary-hero-text h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    line-height: 1.22;
}

/* Config meta only — quiet secondary line */
.diy-summary-meta {
    margin: 8px 0 0;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-secondary);
}

.diy-summary-weight {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Unified section labels — quiet, same rhythm */
.diy-summary-section {
    margin: 0;
}

.diy-summary-section h3 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: none;
    color: var(--text-secondary);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.diy-summary-ing-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

.diy-summary-dough-section {
    padding-top: 2px;
}

.diy-summary-dough-section h3 {
    margin-bottom: 14px;
}

.diy-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Soft display chips (legacy / hidden fallback) */
.diy-summary-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(120, 120, 140, 0.08);
    border: 1px solid rgba(120, 120, 140, 0.12);
    box-shadow: none;
    line-height: 1.3;
}

.diy-summary-tag span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.diy-summary-tag.is-classic {
    background: rgba(120, 120, 140, 0.06);
    border-color: transparent;
    color: var(--text-secondary);
    font-weight: 500;
}

:root:not(.theme-dark) .diy-summary-tag,
.theme-light .diy-summary-tag {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

:root:not(.theme-dark) .diy-summary-tag span:last-child,
.theme-light .diy-summary-tag span:last-child {
    color: var(--text-primary);
}

.theme-dark .diy-summary-tag {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Continuous table list — hairlines, no per-row pill islands */
.diy-ingredient-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: none;
    border-radius: 0;
    overflow-y: auto;
    background: transparent;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.diy-ingredient-list::-webkit-scrollbar {
    display: none;
}

/* Continuous list surface — one soft panel, not N islands */
.diy-ingredient-list--table {
    border-top: none;
    margin: 0 -4px;
    padding: 4px 12px;
    border-radius: 16px;
    background: rgba(120, 120, 140, 0.045);
}

:root:not(.theme-dark) .diy-ingredient-list--table,
.theme-light .diy-ingredient-list--table {
    /* Frosted inset panel on the glass sheet */
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.theme-dark .diy-ingredient-list--table {
    background: rgba(255, 255, 255, 0.04);
}

.diy-ingredient-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 4px;
    border: none;
    border-bottom: none;
    border-radius: 0;
    font-size: 14px;
    background: transparent;
}

.diy-ingredient-list li:last-child {
    border-bottom: none;
}

.diy-ing-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 600;
    color: var(--text-primary);
}

/* Inline emoji — no mini tile */
.diy-ing-emoji {
    width: auto;
    height: auto;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    background: transparent;
    border: none;
}

.theme-dark .diy-ing-emoji {
    background: transparent;
    border: none;
}

.diy-ing-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.diy-ing-weight {
    position: relative;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.25px;
    min-width: 3.4em;
    height: 1.35em;
    text-align: right;
    color: var(--primary-color);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    perspective: 280px;
    overflow: hidden;
    /* Isolate 3D flip */
    transform-style: preserve-3d;
}

.diy-ing-weight-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Calendar / flip-clock board */
.diy-flip {
    position: relative;
    display: block;
    width: 100%;
    height: 1.35em;
    transform-style: preserve-3d;
}

.diy-flip-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-origin: center center;
    color: var(--primary-color);
    will-change: transform, opacity;
}

.diy-flip-from {
    z-index: 2;
    transform: rotateX(0deg);
}

.diy-flip-to {
    z-index: 1;
    opacity: 0;
}

/* Going up (weight increased): old flips up, new comes from below */
.diy-ing-weight.is-flip-up.is-flipping .diy-flip-from {
    animation: diyFlipOutUp var(--flip-ms, 340ms) cubic-bezier(0.4, 0, 0.2, 1) var(--flip-delay, 0ms) both;
}
.diy-ing-weight.is-flip-up.is-flipping .diy-flip-to {
    animation: diyFlipInUp var(--flip-ms, 340ms) cubic-bezier(0.4, 0, 0.2, 1) var(--flip-delay, 0ms) both;
}

/* Going down: reverse direction */
.diy-ing-weight.is-flip-down.is-flipping .diy-flip-from {
    animation: diyFlipOutDown var(--flip-ms, 340ms) cubic-bezier(0.4, 0, 0.2, 1) var(--flip-delay, 0ms) both;
}
.diy-ing-weight.is-flip-down.is-flipping .diy-flip-to {
    animation: diyFlipInDown var(--flip-ms, 340ms) cubic-bezier(0.4, 0, 0.2, 1) var(--flip-delay, 0ms) both;
}

@keyframes diyFlipOutUp {
    0% { transform: rotateX(0deg); opacity: 1; }
    100% { transform: rotateX(-90deg); opacity: 0.25; }
}
@keyframes diyFlipInUp {
    0% { transform: rotateX(90deg); opacity: 0.25; }
    100% { transform: rotateX(0deg); opacity: 1; }
}
@keyframes diyFlipOutDown {
    0% { transform: rotateX(0deg); opacity: 1; }
    100% { transform: rotateX(90deg); opacity: 0.25; }
}
@keyframes diyFlipInDown {
    0% { transform: rotateX(-90deg); opacity: 0.25; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .diy-ing-weight.is-flipping .diy-flip-from,
    .diy-ing-weight.is-flipping .diy-flip-to {
        animation: none !important;
    }
}

.diy-ing-unit {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.65;
    margin-left: 1px;
}

:root:not(.theme-dark) .diy-ingredient-list li,
.theme-light .diy-ingredient-list li {
    background: transparent;
}

:root:not(.theme-dark) .diy-ing-emoji,
.theme-light .diy-ing-emoji {
    background: transparent;
    border: none;
}

/* Dough chips: quieter selected state on flat paper */
.diy-dough-flat .diy-dough-chip {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    font-size: 13px;
    padding: 8px 14px;
}

.diy-dough-flat .diy-dough-chip.is-active {
    background: rgba(255, 126, 103, 0.1);
    border-color: rgba(255, 126, 103, 0.35);
    color: var(--primary-color);
    box-shadow: none;
}

.theme-dark .diy-dough-flat .diy-dough-chip {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.14);
}

.diy-dough-flat .diy-dough-step-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    font-size: 24px;
}

.theme-dark .diy-dough-flat .diy-dough-step-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

.diy-dough-flat .diy-dough-number {
    font-size: 36px;
    letter-spacing: -0.8px;
}

.diy-dough-flat .diy-dough-hint {
    font-size: 12.5px;
}

.diy-summary-warn {
    font-size: 12px;
    font-weight: 700;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
}

.diy-summary-warn.hidden {
    display: none !important;
}

/* Fixed bottom deck — padding not driven by content height */
.diy-summary-footer {
    display: flex;
    gap: 12px;
    margin-top: 0;
    flex-shrink: 0;
    padding: 18px 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.theme-dark .diy-summary-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.diy-summary-footer .btn {
    flex: 1;
    min-height: 50px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
}

/* Tactile bottom edge comes from .btn-primary — no extra glow */
.diy-summary-footer .btn-primary,
.diy-summary-footer .diy-cta {
    flex: 1.25;
    box-shadow: none;
}

.diy-summary-footer .btn-primary:hover,
.diy-summary-footer .diy-cta:hover {
    transform: none;
    box-shadow: none;
}

.diy-summary-footer .btn-primary:active,
.diy-summary-footer .diy-cta:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
    box-shadow: none;
}

.diy-summary-footer .btn-secondary {
    box-shadow: none !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
}

.diy-summary-footer .btn-secondary:hover {
    transform: none;
    border-color: rgba(255, 126, 103, 0.4);
    background: rgba(255, 126, 103, 0.05);
}

.diy-summary-footer .btn-secondary:active {
    transform: scale(0.98);
    box-shadow: none !important;
}

.theme-dark .diy-summary-footer .btn-secondary {
    border-color: rgba(255, 255, 255, 0.14);
}

/* ingredient list rows styled above — continuous panel */

@media (prefers-reduced-motion: reduce) {
    .diy-summary-backdrop,
    .diy-summary-sheet {
        animation: none !important;
    }
}

.diy-cta {
    min-height: 44px;
    padding: 10px 18px;
    font-weight: 700;
    box-shadow: none;
}

.diy-cta:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
    box-shadow: none;
}

.diy-drawer-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.diy-drawer-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.diy-stat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.diy-stat-head .level-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Keep panel utility for matcher etc. */
.panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.group-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.theme-light .preset-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
}

.theme-dark .preset-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Wide / landscape: two-column — content height, no forced frame, dough under config */
@media (min-width: 860px) {
    .diy-summary-modal {
        padding: 20px 24px;
    }

    .diy-summary-sheet {
        width: min(800px, 94vw);
        height: auto;
        min-height: 0;
        max-height: min(90dvh, 680px);
        padding: 32px 32px 26px;
        gap: 22px;
    }

    .diy-summary-body {
        display: grid;
        grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.12fr);
        gap: 8px 32px;
        align-items: start; /* columns hug content — no stretch empty */
        overflow: hidden;
        flex: 1 1 auto;
        min-height: 0;
    }

    .diy-summary-col-main {
        display: flex;
        flex-direction: column;
        gap: 24px;
        height: auto;
        min-height: 0;
        overflow: visible;
        padding-right: 4px;
    }

    /* Dough stays under config — never pin to bottom */
    .diy-summary-col-main .diy-summary-dough-section {
        margin-top: 0;
    }

    .diy-summary-col-side {
        min-height: 0;
        height: auto;
        display: flex;
        flex-direction: column;
        border-left: 1px solid rgba(0, 0, 0, 0.06);
        padding-left: 28px;
    }

    .theme-dark .diy-summary-col-side {
        border-left-color: rgba(255, 255, 255, 0.1);
    }

    .diy-summary-ingredients-section {
        flex: 0 1 auto;
        min-height: 0;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    /* Compact list; only scroll when tall — don't flex-fill empty space */
    .diy-summary-ingredients-section .diy-ingredient-list {
        flex: 0 1 auto;
        min-height: 0;
        max-height: min(54vh, 440px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .diy-summary-hero {
        padding-right: 12px;
        flex-shrink: 0;
    }

    .diy-summary-hero-img {
        width: 76px;
        height: 76px;
        border-radius: 20px;
    }

    .diy-summary-hero-text h2 {
        font-size: 24px;
    }

    .diy-summary-footer {
        padding: 18px 0 0;
        margin-top: 0;
    }

    .diy-summary-footer .btn {
        min-height: 52px;
    }

    .diy-dough-flat .diy-dough-number {
        font-size: 40px;
    }

    .diy-dough-flat .diy-dough-step-btn {
        width: 50px;
        height: 50px;
    }
}

/* Short landscape windows: prefer side-by-side even a bit earlier */
@media (min-width: 780px) and (max-height: 720px) and (orientation: landscape) {
    .diy-summary-sheet {
        width: min(760px, 95vw);
        height: auto;
        min-height: 0;
        max-height: min(92dvh, 580px);
        padding: 22px 24px 20px;
        gap: 14px;
    }

    .diy-summary-body {
        display: grid;
        grid-template-columns: 1fr 1.15fr;
        gap: 10px 20px;
        overflow: hidden;
        flex: 1 1 auto;
        min-height: 0;
        align-items: start;
    }

    .diy-summary-col-main {
        display: flex;
        flex-direction: column;
        gap: 12px;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .diy-summary-col-main .diy-summary-dough-section {
        margin-top: 0;
    }

    .diy-summary-col-side {
        border-left: 1px solid var(--border-color);
        padding-left: 18px;
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .diy-summary-ingredients-section {
        flex: 0 1 auto;
        min-height: 0;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .diy-summary-ingredients-section .diy-ingredient-list {
        flex: 0 1 auto;
        min-height: 0;
        max-height: min(48vh, 320px);
        overflow-y: auto;
    }

    .diy-summary-footer {
        margin-top: 0;
        padding: 12px 0 0;
    }

    .diy-summary-kicker {
        margin-bottom: 2px;
    }

    .diy-summary-hero-img {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .diy-summary-hero-text h2 {
        font-size: 18px;
    }

    .diy-dough-panel {
        padding: 10px 8px;
        gap: 8px;
    }

    .diy-dough-number {
        font-size: 24px;
    }

    .diy-dough-hint {
        display: none; /* save vertical space in short landscape */
    }
}

@media (max-width: 640px) {
    .diy-preset-row {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 10px;
    }

    .diy-confirm-btn {
        width: min(100%, 280px);
    }

    .diy-summary-sheet {
        width: 88%;
        max-width: 400px;
        max-height: 85dvh;
        border-radius: 20px;
        padding: 16px 16px 12px;
        overflow-y: auto;
    }

    .diy-summary-body {
        overflow: visible;
    }

    .diy-summary-footer {
        flex-direction: row;
        gap: 8px;
    }
    
    .diy-summary-hero {
        gap: 12px;
        margin-bottom: 0;
    }
    
    .diy-summary-hero-img {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }
    
    .diy-summary-hero-text h2 {
        font-size: 16px;
    }
    
    .diy-summary-meta,
    .diy-summary-weight {
        font-size: 12px;
        margin-top: 4px;
    }
    
    .diy-summary-section h3 {
        margin: 0 0 8px;
    }
    
    .diy-summary-dough-section {
        padding-top: 0;
    }
    
    .diy-summary-dough-section h3 {
        margin-bottom: 8px;
    }
    
    .diy-dough-panel {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .diy-dough-number {
        font-size: 20px;
    }
    
    .diy-summary-footer .btn {
        padding: 10px 16px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
    }
    
    .scaling-group {
        padding-top: 12px;
        margin-bottom: 12px;
    }
    
    .diy-summary-tags {
        gap: 6px;
    }
    
    .preset-weight-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Scaling Weight Input */
.scaling-group {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    margin-bottom: 24px;
}

.scaling-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 10px;
}

.scale-input-wrapper {
    display: flex;
    gap: 12px;
}

.scale-input-wrapper input {
    flex-grow: 1;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    font-family: var(--font-heading);
    transition: var(--transition-smooth);
}

.scale-input-wrapper input:focus {
    border-color: var(--primary-color);
}

/* Buttons — clay press same language as category / preset cards */
.btn {
    background: none;
    border: none;
    outline: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.12s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.12s ease,
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    /* Duolingo "Pushable": flat face, 4px same-hue darker edge */
    border-bottom: 4px solid #cf4d36;
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.btn-primary:hover:not(:disabled) {
    /* Duo hover brightens — no lift */
    filter: brightness(1.08);
    transform: none;
    box-shadow: none;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom-width: 2px;
    box-shadow: none;
}

.btn-primary:disabled {
    border-bottom-color: rgba(0, 0, 0, 0.10);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.theme-light .btn-secondary,
:root:not(.theme-dark) .btn-secondary {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-card);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-card);
}

.theme-light .btn-secondary:hover:not(:disabled),
:root:not(.theme-dark) .btn-secondary:hover:not(:disabled) {
    background-color: #ffffff;
    box-shadow: var(--shadow-card);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: var(--shadow-card);
}

.theme-light .btn-secondary:active:not(:disabled),
:root:not(.theme-dark) .btn-secondary:active:not(:disabled) {
    box-shadow: var(--shadow-card);
}

.btn:disabled {
    cursor: not-allowed;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-text:hover {
    color: #ff5d42;
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

.panel-actions {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Lab Outputs Styles */
.ratio-badge {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-heading);
}

/* Warnings Box */
.warnings-box {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.12), rgba(255, 71, 87, 0.02));
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    animation: pulseBorder 2s infinite alternate;
}

.warnings-title {
    color: var(--danger-color);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.warnings-box ul {
    list-style-type: none;
}

.warnings-box li {
    font-size: 12px;
    color: #ffa0b0;
    line-height: 1.5;
    position: relative;
    padding-left: 14px;
    margin-bottom: 4px;
}

.warnings-box li::before {
    content: '•';
    color: var(--danger-color);
    position: absolute;
    left: 0;
    font-size: 14px;
}

@keyframes pulseBorder {
    from { border-color: rgba(255, 71, 87, 0.25); }
    to { border-color: rgba(255, 71, 87, 0.5); }
}

/* Recipe Table Styles */
.recipe-table-wrapper {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    font-variant-numeric: tabular-nums;
}

.recipe-table {
    width: 100%;
    border-collapse: collapse;
}

.recipe-table th, .recipe-table td {
    padding: 14px 20px;
    text-align: left;
}

.recipe-table th {
    background-color: rgba(255, 255, 255, 0.01);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.recipe-table td {
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.recipe-table tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right !important;
}

/* Stats Progress Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: auto;
}

.stat-card {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
}

.stat-title {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.progress-bar-wrapper {
    background-color: rgba(255, 255, 255, 0.05);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

/* ── Pantry Matcher: two-step wizard ── */
