.chef-assistant {
    position: fixed;
    display: block;
    right: 24px;
    bottom: 22px;
    z-index: 90;
    pointer-events: none;
}

.chef-assistant__launcher,
.chef-assistant__panel {
    pointer-events: auto;
}

.chef-assistant__launcher {
    position: relative;
    display: block;
    width: 162px;
    height: 224px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.chef-assistant__launcher:focus-visible,
.chef-assistant__close:focus-visible,
.chef-assistant__actions button:focus-visible,
.chef-assistant__ingredient-form input:focus-visible,
.chef-assistant__ingredient-form button:focus-visible,
.chef-assistant__recipe-link:focus-visible,
.chef-assistant__blog-link:focus-visible {
    outline: 3px solid rgba(237, 105, 51, 0.45);
    outline-offset: 4px;
}

.chef-assistant__pose {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 360ms ease, transform 360ms ease;
}

.chef-assistant__pose.is-active {
    opacity: 1;
    transform: translateY(0);
}

.chef-assistant__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% - 16px);
    width: min(370px, calc(100vw - 48px));
    max-height: min(680px, calc(100vh - 36px));
    overflow: auto;
    padding: 22px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.chef-assistant__panel[hidden] {
    display: none;
}

.chef-assistant__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.chef-assistant__title,
.chef-assistant__message,
.chef-assistant__status {
    margin: 0;
}

.chef-assistant__halloween {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-top: 14px;
    padding: 10px 12px;
    border-left: 4px solid var(--orange);
    border-radius: 8px;
    background: rgba(237, 105, 51, 0.1);
}
.chef-assistant__halloween[hidden] { display: none; }
.chef-assistant__halloween p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.chef-assistant__halloween a {
    display: inline-block;
    margin-top: 4px;
    color: #000;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}
.chef-assistant__halloween a:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
.chef-assistant__pumpkin {
    display: block;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    font-size: 24px;
    line-height: 1.25;
    width: 28px;
    text-align: center;
}

.chef-assistant__blog {
    margin-top: 14px;
    border: 1px solid #dedede;
    border-radius: 8px;
    overflow: hidden;
}

.chef-assistant__panel.is-blog { max-height: min(680px, calc(100dvh - 318px)); }

.chef-assistant__blog[hidden],
.chef-assistant__blog img[hidden] { display: none; }
.chef-assistant__blog img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
}
.chef-assistant__blog > div { padding: 12px; }
.chef-assistant__blog-kicker { font-weight: 700; color: #675326; }
.chef-assistant__blog h3,
.chef-assistant__blog p { margin: 6px 0 0; overflow-wrap: anywhere; }
.chef-assistant__blog p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.chef-assistant__blog-link { display: inline-block; margin-top: 10px; color: #000; }

.chef-assistant__message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(237, 105, 51, 0.1);
    border-left: 4px solid var(--orange);
}

.chef-assistant__close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #000000;
    cursor: pointer;
}

.chef-assistant__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.chef-assistant__actions button,
.chef-assistant__ingredient-form button {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--orange);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.chef-assistant__ingredient-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 14px;
}

.chef-assistant__ingredient-form[hidden] {
    display: none;
}

.chef-assistant__ingredient-form input {
    min-width: 0;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.chef-assistant__recipe {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    margin-top: 18px;
    padding: 12px;
    border-radius: 8px;
    background: #fff7ee;
}

.chef-assistant__recipe[hidden] {
    display: none;
}

.chef-assistant__recipe img {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.06);
}

.chef-assistant__recipe-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--orange);
    font-weight: 700;
}

.chef-assistant__recipe h3,
.chef-assistant__recipe p {
    margin: 0;
}

.chef-assistant__recipe p {
    display: -webkit-box;
    margin-top: 6px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.chef-assistant__recipe-link {
    display: inline-block;
    margin-top: 10px;
    color: #000000;
    text-decoration: none;
}

.chef-assistant__status {
    min-height: 1.2em;
    margin-top: 12px;
    color: rgba(0, 0, 0, 0.65);
}

@media (hover: hover) {
    .chef-assistant__launcher:hover .chef-assistant__pose.is-active {
        transform: translateY(-3px);
    }

    .chef-assistant__actions button:hover,
    .chef-assistant__ingredient-form button:hover,
    .chef-assistant__close:hover {
        filter: brightness(0.96);
    }
}

@media (max-width: 680px) {
    .chef-assistant {
        position: relative;
        right: auto;
        bottom: auto;
        display: flex;
        justify-content: flex-end;
        margin: 16px 12px;
    }

    body.tr-consent-visible .chef-assistant {
        bottom: auto;
        max-height: none;
    }

    .chef-assistant__launcher {
        width: 106px;
        height: 148px;
    }

    .chef-assistant__panel {
        position: fixed;
        z-index: 1;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        box-sizing: border-box;
        width: min(360px, calc(100vw - 24px));
        max-height: min(620px, calc(100vh - 28px));
        padding: 18px;
    }

    .chef-assistant__actions {
        grid-template-columns: 1fr;
    }

    .chef-assistant__panel.is-blog { max-height: min(620px, calc(100dvh - 28px - env(safe-area-inset-bottom))); }

    body.tr-consent-visible .chef-assistant__panel {
        bottom: calc(var(--tr-consent-height, 240px) + 12px);
        max-height: max(120px, calc(100dvh - var(--tr-consent-height, 240px) - 24px));
    }

    .chef-assistant__recipe {
        grid-template-columns: 82px 1fr;
    }

    .chef-assistant__recipe img {
        width: 82px;
        height: 82px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chef-assistant__pose {
        transition: none;
    }
}
