/* Ablenkungsfreies Layout */
body, html {
    margin: 0; padding: 0; height: 100%;
    background-color: #f8fafc;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

nav.navbar, footer, .ai-bot-fab, #headerpicture, #headerdiscover { display: none !important; }

.cook-mode-container {
    display: flex; flex-direction: column; height: 100dvh; width: 100vw; overflow: hidden;
}

.cook-mode-container.is-hidden {
    display: none;
}

/* NEU: Kompakterer Header (weniger Padding) */
.cook-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    z-index: 10;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem !important;
}

.cook-header-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.cook-header-title {
    max-width: 100%;
    font-size: 1.05rem;
}

.cook-header .btn {
    padding: 0.34rem 0.65rem !important;
    font-size: 0.86rem;
}

.wake-lock-toggle {
    white-space: nowrap;
    min-width: 44px;
}

.wake-lock-toggle.is-active {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.wake-lock-toggle.is-unavailable {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

.gesture-toggle {
    white-space: nowrap;
    min-width: 44px;
}

.gesture-toggle.is-active {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

.gesture-toggle.is-unavailable {
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #be123c !important;
}

.voice-toggle {
    white-space: nowrap;
    min-width: 44px;
}

.voice-toggle.is-active {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #6d28d9 !important;
}

.voice-toggle.is-unavailable {
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #be123c !important;
}

.gesture-video,
.gesture-canvas {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dirty-hands-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: calc(72px + 1rem) 1rem 1rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.dirty-hands-overlay.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dirty-hands-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: min(620px, 100%);
    color: #0f172a;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 1rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    padding: 0.95rem 3rem 0.95rem 1rem;
    backdrop-filter: blur(14px);
}

.dirty-hands-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    color: #047857;
    background: #dcfce7;
    border-radius: 999px;
    font-size: 1.35rem;
}

.dirty-hands-copy {
    min-width: 0;
}

.dirty-hands-kicker {
    color: #059669;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dirty-hands-copy h3 {
    margin: 0.1rem 0 0.25rem;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 900;
}

.dirty-hands-copy p {
    margin: 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.35;
}

.dirty-hands-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.dirty-hands-actions span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.dirty-hands-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
}

.dirty-hands-close:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.cook-slider {
    flex-grow: 1; position: relative; overflow: hidden;
}

/* NEU: Weniger vertikaler Freiraum in den Slides */
.cook-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease-in-out;
    overflow-y: auto; overflow-x: hidden; padding: 1rem 1.5rem;
}
.cook-slide.active { opacity: 1; pointer-events: auto; }

@media (min-width: 992px) {
    .cook-slide { padding: 1.5rem 3rem; }
}

.step-number-badge {
    width: 45px; height: 45px; font-size: 1.2rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cook-text { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.3rem); line-height: 1.5; color: #1e293b; }

@media (min-width: 768px) {
    .dirty-hands-overlay {
        padding-top: calc(92px + 1rem);
    }

    .step-number-badge { width: 50px; height: 50px; font-size: 1.4rem; }
    .cook-text { font-size: clamp(1.12rem, 1rem + 0.45vw, 1.3rem); line-height: 1.5; }
}

.cook-card { background: #fff; border-radius: 1rem; box-shadow: 0 5px 15px rgba(0,0,0,0.03); border: 1px solid #f1f5f9; }

.step-slide {
    overflow: hidden;
}

.step-timers {
    flex: 0 0 auto;
}

.step-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.step-content > [class*="col-"] {
    display: flex;
    min-height: 0;
}

.step-media-col,
.step-main-col {
    flex-direction: column;
}

.step-media-col .step-image {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    max-height: none;
    margin-bottom: 0 !important;
}

.step-main-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    container: cook-step / inline-size;
    --step-card-padding: clamp(0.55rem, 1.6cqw, 0.85rem);
    --step-list-font-size: clamp(0.78rem, 1.9cqw, 0.92rem);
    --step-list-line-height: 1.18;
    --step-list-padding-y: clamp(0.22rem, 0.85cqw, 0.35rem);
    --step-support-title-margin: clamp(0.3rem, 1.1cqw, 0.55rem);
}

.step-heading {
    flex: 0 0 auto;
    margin-bottom: clamp(0.5rem, 2cqw, 1rem) !important;
}

.step-description {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-right: 0.2rem;
    font-size: clamp(1rem, 2.8cqw, 1.3rem);
    line-height: 1.45;
}

.step-description.fs-5 {
    font-size: clamp(0.95rem, 2.35cqw, 1.15rem) !important;
    line-height: 1.34;
}

.step-support-stack {
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
}

.step-support-stack .cook-card {
    padding: var(--step-card-padding, 0.75rem) !important;
    margin-top: 0.75rem !important;
}

.step-support-stack .list-group {
    font-size: var(--step-list-font-size, 0.92rem);
    line-height: var(--step-list-line-height, 1.2);
}

.step-support-stack .list-group-item {
    padding-top: var(--step-list-padding-y, 0.35rem) !important;
    padding-bottom: var(--step-list-padding-y, 0.35rem) !important;
}

.step-support-stack h6 {
    margin-bottom: var(--step-support-title-margin, 0.55rem) !important;
}

.step-slide.is-content-dense .step-main-panel {
    --step-card-padding: 0.45rem;
    --step-list-font-size: 0.78rem;
    --step-list-line-height: 1.12;
    --step-list-padding-y: 0.2rem;
    --step-support-title-margin: 0.28rem;
}

.step-slide.is-content-dense .step-heading {
    margin-bottom: 0.45rem !important;
}

.step-slide.is-content-dense .step-description {
    font-size: clamp(0.92rem, 2.25cqw, 1.08rem);
    line-height: 1.32;
    overflow-y: auto;
}

.step-slide.is-content-dense .step-support-stack {
    overflow-y: auto;
}

@container cook-step (max-width: 520px) {
    .step-description {
        font-size: clamp(0.98rem, 3.4cqw, 1.12rem);
        line-height: 1.38;
    }

    .step-support-stack .list-group {
        font-size: clamp(0.76rem, 2.8cqw, 0.85rem);
    }
}

.utensil-card {
    padding: 0.75rem;
    margin-top: 0.75rem;
}
.utensil-card-title {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.utensil-chip-list {
    gap: 0.35rem;
}
.utensil-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-radius: 999px;
    padding: 0.28rem 0.5rem;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.1;
}
.utensil-chip i {
    font-size: 0.78rem;
}

.mise-slide {
    box-sizing: border-box;
    max-height: 100%;
    overflow: hidden;
}

.mise-layout {
    height: 100%;
    min-height: 0;
}

.mise-header {
    flex: 0 0 auto;
}

.mise-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.mise-content > [class*="col-"] {
    display: flex;
    min-height: 0;
}

.mise-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.mise-card-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.mise-tools-col,
.mise-tools-card {
    align-self: flex-start;
    flex: 0 0 auto;
}

.mise-tools-card .mise-card-scroll {
    flex: 0 1 auto;
    max-height: 34dvh;
}

.mise-ingredients-col {
    flex: 1 1 auto;
}

.mise-ingredients-card {
    flex: 1 1 auto;
    height: 100%;
}

.mise-ingredients-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 auto;
    font-size: 0.82rem;
    line-height: 1.15;
    min-height: 0;
}

.mise-ingredients-list strong {
    width: 78px;
}

.mise-ingredients-list .list-group-item {
    padding-top: 0.26rem !important;
    padding-bottom: 0.26rem !important;
    break-inside: avoid;
}

.mise-step-tools:last-child {
    border-bottom: 0 !important;
}

@media (max-width: 991.98px) {
    .step-content {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .step-content > [class*="col-"] {
        width: 100%;
        max-width: 100%;
    }

    .step-media-col {
        flex: 0 0 min(26dvh, 180px);
    }

    .step-main-col {
        flex: 1 1 auto;
    }

    .mise-content {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .mise-content > [class*="col-"] {
        width: 100%;
        max-width: 100%;
    }
}

@media (min-width: 768px) {
    .cook-header {
        padding: 0.65rem 1rem !important;
    }

    .cook-header-title {
        font-size: 1.15rem;
    }

    .cook-header .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.92rem;
    }

    .mise-ingredients-list {
        font-size: 0.88rem;
    }

    .mise-ingredients-list strong {
        width: 86px;
    }

    .utensil-card {
        padding: 1rem 1.25rem;
        margin-top: 1rem;
    }
    .utensil-card-title {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    .utensil-chip-list {
        gap: 0.5rem;
    }
    .utensil-chip {
        gap: 0.45rem;
        padding: 0.45rem 0.75rem;
        font-size: 0.9rem;
    }
    .utensil-chip i {
        font-size: 0.9rem;
    }
}
.step-image { width: 100%; object-fit: cover; border-radius: 1rem; max-height: 250px; }
@media (min-width: 992px) { .step-image { max-height: 350px; border-radius: 1.5rem; } }

/* NEU: Flacheres Timer Styling mit Full-Height Buttons */
.timer-box {
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 0.75rem;
    min-width: 250px; flex: 1; overflow: hidden; /* Wichtig für die Buttons */
}
.timer-display { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.8rem; color: #166534; letter-spacing: -1px; }
@media (min-width: 768px) { .timer-display { font-size: 2.2rem; } }

.global-timer-dock {
    position: fixed;
    top: 76px;
    right: 0.75rem;
    left: 0.75rem;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: min(45dvh, 360px);
    overflow-y: auto;
    pointer-events: none;
}

.global-timer-dock.is-positioned {
    right: auto;
    width: min(420px, calc(100vw - 20px));
}

.global-timer-dock.is-dragging {
    user-select: none;
}

.global-timer-card {
    align-self: stretch;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    overflow: hidden;
    background: rgba(240, 253, 244, 0.97);
    border: 1px solid #86efac;
    border-radius: 0.9rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

.global-timer-dock.is-dragging .global-timer-card {
    cursor: grabbing;
}

.global-timer-meta {
    min-width: 0;
    padding: 0.55rem 0.7rem;
}

.global-timer-label {
    max-width: 52vw;
    font-size: 0.74rem;
    line-height: 1.1;
}

.global-timer-time {
    color: #166534;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.global-timer-card.is-paused {
    background: rgba(255, 251, 235, 0.97);
    border-color: #fde68a;
}

.global-timer-card.is-finished {
    background: rgba(254, 242, 242, 0.97);
    border-color: #fecaca;
}

.global-timer-card.is-finished .global-timer-time {
    color: #b91c1c;
}

.global-timer-actions {
    display: flex;
    flex-shrink: 0;
    cursor: default;
    touch-action: auto;
}

.global-timer-actions .btn {
    border-radius: 0;
    min-width: 42px;
}

@media (min-width: 768px) {
    .global-timer-dock {
        top: 92px;
        right: 1.25rem;
        left: auto;
        width: min(420px, 42vw);
    }

    .global-timer-label {
        max-width: 260px;
        font-size: 0.8rem;
    }
}

/* Bottom Control Bar */
.cook-controls {
    background: #fff; border-top: 1px solid #e2e8f0; padding: 0.45rem 0.75rem !important; z-index: 10;
}
.progress-container { height: 4px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-bottom: 0.45rem; }
.progress-bar-fill { height: 100%; background: #00B74A; width: 0%; transition: width 0.3s ease; }

/* NEU: Kompaktere Buttons für Handys */
.btn-cook-nav { font-size: 0.82rem; padding: 0.38rem 0.85rem; border-radius: 50rem; font-weight: 700; white-space: nowrap; }
.step-indicator-text { font-size: 0.9rem; font-weight: bold; color: #64748b; white-space: nowrap; margin: 0 0.5rem; }
#stepIndicator { font-size: 0.95rem !important; }

@media (min-width: 768px) {
    .cook-controls { padding: 0.6rem 1rem !important; }
    .progress-container { height: 5px; margin-bottom: 0.55rem; }
    .btn-cook-nav { font-size: 0.98rem; padding: 0.45rem 1.4rem; }
    .step-indicator-text { font-size: 1.05rem; margin: 0 0.75rem; }
    #stepIndicator { font-size: 1.05rem !important; }
}
/* Sous-Chef Aktionsmenue */
.sous-chef-widget {
    position: fixed;
    right: 20px;
    bottom: 92px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sous-chef-widget.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.sous-chef-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.sous-chef-widget.is-open .sous-chef-actions {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.sous-chef-action {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: min(280px, calc(100vw - 40px));
    padding: 0.65rem 0.8rem;
    color: #334155;
    text-align: left;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 0.9rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
}

.sous-chef-action:hover,
.sous-chef-action:focus-visible {
    color: #166534;
    border-color: #bbf7d0;
    background: #f8fffb;
    outline: none;
}

.sous-chef-action.is-active {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
}

.sous-chef-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
}

.sous-chef-action-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.1;
}

.sous-chef-action small {
    display: block;
    margin-top: 0.16rem;
    color: #64748b;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.15;
}

.sous-chef-fab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sous-chef-fab:hover,
.sous-chef-fab:focus-visible {
    transform: translateY(-1px);
    border-color: #bbf7d0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.2);
    outline: none;
}

.sous-chef-fab img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
    transform: scale(1.16);
    z-index: 1;
}

.sous-chef-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #166534;
    background: #f0fdf4;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.sous-chef-fab img[src] {
    background: #fff;
}

.sous-chef-fab img[src] + .sous-chef-fallback {
    display: none;
}

.next-up-teaser {
    position: fixed;
    left: 50%;
    bottom: 76px;
    z-index: 1040;
    width: min(760px, calc(100vw - 112px));
    padding: 0.45rem 0.9rem;
    color: rgba(71, 85, 105, 0.74);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.62);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.next-up-teaser.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.next-up-teaser span {
    color: rgba(22, 101, 52, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
}

@media (min-width: 768px) {
    .sous-chef-widget {
        right: 40px;
        bottom: 104px;
    }

    .sous-chef-fab {
        width: 58px;
        height: 58px;
    }

    .next-up-teaser {
        bottom: 86px;
        width: min(760px, calc(100vw - 260px));
        font-size: 0.9rem;
    }
}

#finishSlide { padding: 0.75rem !important; overflow: hidden !important; }
#finishSlide .container-xxl { margin: 0 !important; padding: 0 !important; width: 100%; max-width: 100%; }
#finishSlide .card { box-shadow: none !important; background: transparent !important; border: none !important; }
#finishSlide .card-body { padding: 0 !important; }
#finishSlide hr { margin: 1rem 0 !important; }
#finishSlide .mb-4 > .border.rounded-4 { display: none !important; }
#finishSlide .mb-4 > p.text-center { display: none !important; }

.finish-wrapper {
height: 100%;
min-height: 0;
overflow: hidden;
}

.finish-left {
padding: 0.75rem 1rem !important;
flex: 0 0 auto;
min-height: clamp(120px, 25%, 170px);
background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.finish-right {
padding: 0.75rem 1rem !important;
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}

.finish-right > .w-100 {
max-height: 100%;
overflow: hidden;
}

.finish-celebration-icon {
font-size: clamp(2.5rem, 5vh, 4rem);
line-height: 1;
}

.finish-title {
color: #166534;
font-size: clamp(1.4rem, 4vw, 2.5rem);
}

.finish-copy {
color: #15803d;
}

.finish-rating-wrap {
max-width: 500px;
}

@media (min-width: 992px) {
#finishSlide { padding: 1.5rem 3rem !important; align-items: center; justify-content: center; }
.finish-left, .finish-right { flex: 1 1 50%; height: 100%; overflow-y: auto; padding: 3rem !important; }
}

/* Dimmer Mode (Anti-Burn-in) */
.cook-mode-dimmed {
    background-color: #000 !important;
}

.cook-mode-dimmed * {
    color: #666 !important;
    border-color: #333 !important;
    background-color: #000 !important;
    box-shadow: none !important;
}

.cook-mode-dimmed img,
.cook-mode-dimmed video,
.cook-mode-dimmed canvas {
    opacity: 0.1 !important;
}

.cook-mode-dimmed .dimmer-toggle {
    background-color: #222 !important;
    color: #888 !important;
    border-color: #444 !important;
}
