﻿
/* =========================================
   THE HUMAN DILEMMA LAB
   LIQUID GLASS — DYNAMIC DILEMMA PAGE
========================================= */

.dynamic-dilemma-page {
    --page-bg: #e9e8df;
    --paper: rgba(255, 255, 255, 0.42);
    --paper-strong: rgba(255, 255, 255, 0.62);
    --ink: #292b24;
    --muted: #77796e;
    --olive: #626d4d;
    --olive-dark: #414b35;
    --line: rgba(65, 75, 53, 0.13);
    min-height: 100vh;
    margin: 0;
    padding: 35px 20px;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
    color: var(--ink);
    font-family: "DM Sans", sans-serif;
    background: radial-gradient(ellipse at 12% 10%, rgba(255,255,255,.85), transparent 38%), radial-gradient(ellipse at 90% 85%, rgba(177,184,151,.38), transparent 40%), linear-gradient(135deg, #f2f0e8, #e4e5d9 55%, #eeece3);
}

    /* =========================================
   BACKGROUND DECORATION
========================================= */

    .dynamic-dilemma-page .page-decoration {
        position: fixed;
        pointer-events: none;
        z-index: 0;
        border-radius: 50%;
        filter: blur(2px);
    }

    .dynamic-dilemma-page .page-decoration-one {
        width: 330px;
        height: 330px;
        top: -130px;
        right: -100px;
        background: rgba(255,255,255,.32);
    }

    .dynamic-dilemma-page .page-decoration-two {
        width: 260px;
        height: 260px;
        bottom: -100px;
        left: -100px;
        background: rgba(133,146,104,.13);
    }

    /* =========================================
   MAIN GLASS PANEL
========================================= */

    .dynamic-dilemma-page .dilemma-card {
        position: relative;
        z-index: 1;
        width: min(1120px, 100%);
        margin: 0 auto;
        padding: 24px 34px 20px;
        box-sizing: border-box;
        background: rgba(255,255,255,.38);
        border: 1px solid rgba(255,255,255,.75);
        border-radius: 25px;
        -webkit-backdrop-filter: blur(30px) saturate(155%);
        backdrop-filter: blur(30px) saturate(155%);
        box-shadow: 0 25px 70px rgba(48,54,39,.10), 0 5px 15px rgba(48,54,39,.04), inset 0 1px 1px rgba(255,255,255,.9);
        overflow: hidden;
    }

        .dynamic-dilemma-page .dilemma-card::before {
            content: "";
            position: absolute;
            inset: 0;
            pointer-events: none;
            border-radius: inherit;
            background: linear-gradient( 135deg, rgba(255,255,255,.32), transparent 35%, transparent 70%, rgba(255,255,255,.12) );
        }

    /* =========================================
   NAVIGATION
========================================= */

    .dynamic-dilemma-page .site-nav {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding-bottom: 17px;
        border-bottom: 1px solid var(--line);
    }

    .dynamic-dilemma-page .logo {
        color: var(--ink);
        font-family: "Playfair Display", serif;
        font-size: 17px;
        font-weight: 600;
        text-decoration: none;
        letter-spacing: -.3px;
    }

    .dynamic-dilemma-page .nav-link {
        color: var(--muted);
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
        transition: color .2s ease;
    }

        .dynamic-dilemma-page .nav-link:hover {
            color: var(--olive-dark);
        }

    /* =========================================
   MAIN CONTENT GRID
========================================= */

    .dynamic-dilemma-page .dilemma-detail-container {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
        grid-template-areas:
            "header header"
            "image response"
            "scenario response"
            "reflection reflection"
            "back back";
        column-gap: 42px;
        row-gap: 12px;
        align-items: start;
        padding-top: 23px;
    }

    /* =========================================
   HEADER
========================================= */

    .dynamic-dilemma-page .dilemma-detail-header {
        grid-area: header;
        max-width: 760px;
        margin-bottom: 5px;
    }

    .dynamic-dilemma-page .eyebrow {
        margin: 0 0 9px;
        color: var(--olive);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 2px;
        line-height: 1.5;
    }

    .dynamic-dilemma-page .eyebrow-mark {
        margin-right: 5px;
    }

    .dynamic-dilemma-page .dilemma-detail-header h1 {
        margin: 0;
        color: var(--ink);
        font-family: "Playfair Display", serif;
        font-size: clamp(27px, 3vw, 39px);
        font-weight: 500;
        line-height: 1.12;
        letter-spacing: -.8px;
    }

    .dynamic-dilemma-page .dilemma-detail-description {
        max-width: 680px;
        margin: 9px 0 0;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.7;
    }

    /* =========================================
   IMAGE
========================================= */

    .dynamic-dilemma-page .dilemma-detail-image-wrap {
        grid-area: image;
        position: relative;
        width: 100%;
        height: 185px;
        margin: 0;
        overflow: hidden;
        border-radius: 15px;
        background: #d9dbcf;
        border: 1px solid rgba(255,255,255,.7);
        box-shadow: 0 8px 24px rgba(41,43,36,.08);
    }

    .dynamic-dilemma-page .dilemma-detail-image {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .dynamic-dilemma-page .image-caption {
        position: absolute;
        bottom: 11px;
        left: 12px;
        padding: 6px 9px;
        color: white;
        background: rgba(30,34,27,.48);
        border: 1px solid rgba(255,255,255,.3);
        border-radius: 5px;
        font-size: 8px;
        font-weight: 700;
        letter-spacing: 1.4px;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

    /* =========================================
   SCENARIO
========================================= */

    .dynamic-dilemma-page .dilemma-scenario {
        grid-area: scenario;
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 15px;
        margin: 0;
        padding: 10px 0 0;
    }

    .dynamic-dilemma-page .scenario-label {
        padding-top: 3px;
    }

    .dynamic-dilemma-page .scenario-number {
        display: block;
        margin-bottom: 7px;
        color: rgba(98,109,77,.55);
        font-family: "Playfair Display", serif;
        font-size: 28px;
    }

    .dynamic-dilemma-page .scenario-label .eyebrow {
        font-size: 8px;
        letter-spacing: 1.2px;
    }

    .dynamic-dilemma-page .dilemma-scenario-text {
        color: #44473d;
        font-size: 12px;
        line-height: 1.85;
    }

        .dynamic-dilemma-page .dilemma-scenario-text p {
            margin: 0 0 9px;
        }

    /* =========================================
   RESPONSE SECTION
========================================= */

    .dynamic-dilemma-page .dilemma-response-section {
        grid-area: response;
        min-width: 0;
        margin: 0;
        padding: 19px 21px;
        background: rgba(255,255,255,.37);
        border: 1px solid rgba(255,255,255,.7);
        border-radius: 17px;
        box-shadow: inset 0 1px 1px rgba(255,255,255,.85), 0 8px 25px rgba(41,43,36,.035);
    }

    .dynamic-dilemma-page .response-heading {
        margin-bottom: 14px;
    }

        .dynamic-dilemma-page .response-heading h2 {
            margin: 0;
            color: var(--ink);
            font-family: "Playfair Display", serif;
            font-size: 25px;
            font-weight: 500;
            line-height: 1.2;
        }

    .dynamic-dilemma-page .response-intro {
        margin: 7px 0 0;
        color: var(--muted);
        font-size: 11px;
        line-height: 1.65;
    }

    /* =========================================
   RESPONSE FORM
========================================= */

    .dynamic-dilemma-page .dilemma-response-form {
        width: 100%;
    }

    .dynamic-dilemma-page .choice-fieldset {
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

        .dynamic-dilemma-page .choice-fieldset legend {
            margin-bottom: 9px;
            color: var(--ink);
            font-size: 10px;
            font-weight: 700;
        }

    .dynamic-dilemma-page .choice-option {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 39px;
        margin: 0 0 7px;
        padding: 8px 11px;
        box-sizing: border-box;
        color: #44473d;
        background: rgba(255,255,255,.42);
        border: 1px solid rgba(98,109,77,.14);
        border-radius: 9px;
        cursor: pointer;
        transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
    }

        .dynamic-dilemma-page .choice-option:hover {
            background: rgba(255,255,255,.78);
            border-color: rgba(98,109,77,.38);
            transform: translateY(-1px);
        }

        .dynamic-dilemma-page .choice-option:has(input:checked),
        .dynamic-dilemma-page .choice-option.is-selected {
            background: rgba(98,109,77,.11);
            border-color: var(--olive);
            box-shadow: 0 3px 12px rgba(65,75,53,.08);
        }

        .dynamic-dilemma-page .choice-option input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

    .dynamic-dilemma-page .choice-indicator {
        flex: 0 0 14px;
        width: 14px;
        height: 14px;
        border: 1.5px solid rgba(98,109,77,.5);
        border-radius: 50%;
        position: relative;
    }

    .dynamic-dilemma-page .choice-option input:checked + .choice-indicator::after {
        content: "";
        position: absolute;
        inset: 3px;
        background: var(--olive);
        border-radius: 50%;
    }

    .dynamic-dilemma-page .choice-text {
        flex: 1;
        font-size: 11px;
        line-height: 1.5;
    }

    .dynamic-dilemma-page .choice-arrow {
        color: var(--olive);
        font-size: 13px;
    }

    .dynamic-dilemma-page .no-choices {
        color: var(--muted);
        font-size: 11px;
    }

    /* =========================================
   REASONING TEXTAREA
========================================= */

    .dynamic-dilemma-page .reasoning-field {
        margin-top: 13px;
    }

        .dynamic-dilemma-page .reasoning-field label {
            display: block;
            margin-bottom: 7px;
            color: var(--ink);
            font-size: 10px;
            font-weight: 700;
        }

        .dynamic-dilemma-page .reasoning-field textarea {
            display: block;
            width: 100%;
            min-height: 75px;
            padding: 10px 12px;
            box-sizing: border-box;
            resize: vertical;
            color: var(--ink);
            background: rgba(255,255,255,.48);
            border: 1px solid rgba(98,109,77,.2);
            border-radius: 9px;
            outline: none;
            font-family: "DM Sans", sans-serif;
            font-size: 11px;
            line-height: 1.6;
            transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
        }

            .dynamic-dilemma-page .reasoning-field textarea::placeholder {
                color: #96988c;
            }

            .dynamic-dilemma-page .reasoning-field textarea:focus {
                background: rgba(255,255,255,.75);
                border-color: var(--olive);
                box-shadow: 0 0 0 3px rgba(98,109,77,.09);
            }

    .dynamic-dilemma-page .reasoning-footer {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        margin-top: 6px;
        color: var(--muted);
        font-size: 9px;
    }

    /* =========================================
   SUBMIT BUTTON
========================================= */

    .dynamic-dilemma-page .response-submit-button {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        width: 100%;
        min-height: 42px;
        margin-top: 13px;
        padding: 10px 15px;
        color: white;
        background: linear-gradient(135deg, #697653, #414b35);
        border: 1px solid rgba(255,255,255,.35);
        border-radius: 9px;
        font-family: "DM Sans", sans-serif;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 6px 16px rgba(65,75,53,.18);
        transition: transform .2s ease, box-shadow .2s ease;
    }

        .dynamic-dilemma-page .response-submit-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 9px 22px rgba(65,75,53,.25);
        }

    .dynamic-dilemma-page .submit-arrow {
        font-size: 16px;
    }

    /* =========================================
   CLOSING NOTE AND BACK LINK
========================================= */

    .dynamic-dilemma-page .reflection-note {
        grid-area: reflection;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        margin-top: 5px;
        padding: 12px 15px;
        background: rgba(255,255,255,.25);
        border: 1px solid rgba(255,255,255,.45);
        border-radius: 10px;
    }

        .dynamic-dilemma-page .reflection-note > span {
            color: var(--olive);
            font-size: 13px;
        }

        .dynamic-dilemma-page .reflection-note p {
            margin: 0;
            color: var(--muted);
            font-family: "Playfair Display", serif;
            font-size: 12px;
            font-style: italic;
            text-align: center;
        }

    .dynamic-dilemma-page .back-to-dilemmas {
        grid-area: back;
        text-align: center;
        margin-top: 2px;
    }

        .dynamic-dilemma-page .back-to-dilemmas a {
            color: var(--olive);
            font-size: 10px;
            font-weight: 700;
            text-decoration: none;
            transition: color .2s ease;
        }

            .dynamic-dilemma-page .back-to-dilemmas a:hover {
                color: var(--olive-dark);
            }

    /* =========================================
   FOOTER
========================================= */

    .dynamic-dilemma-page .footer {
        position: relative;
        z-index: 1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        width: min(1120px, 100%);
        margin: 15px auto 0;
        padding: 0 5px;
        color: var(--muted);
        font-size: 9px;
    }

        .dynamic-dilemma-page .footer p {
            margin: 0;
        }

        .dynamic-dilemma-page .footer span {
            font-size: 8px;
            font-weight: 700;
            letter-spacing: 1.3px;
        }

    /* =========================================
   ACCESSIBILITY WIDGET
========================================= */

    .dynamic-dilemma-page .accessibility-toggle {
        position: fixed;
        z-index: 1000;
        right: 20px;
        top: 45%;
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        background: var(--olive-dark);
        border: 2px solid rgba(255,255,255,.8);
        border-radius: 50%;
        box-shadow: 0 5px 18px rgba(0,0,0,.18);
        cursor: pointer;
    }

        .dynamic-dilemma-page .accessibility-toggle svg {
            width: 23px;
            height: 23px;
        }

    .dynamic-dilemma-page .accessibility-panel {
        position: fixed;
        z-index: 1001;
        top: 45%;
        right: 75px;
        width: min(280px, calc(100vw - 100px));
        padding: 18px;
        background: rgba(250,250,245,.94);
        border: 1px solid rgba(255,255,255,.85);
        border-radius: 15px;
        box-shadow: 0 12px 35px rgba(0,0,0,.17);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }

        .dynamic-dilemma-page .accessibility-panel[hidden] {
            display: none;
        }

    /* =========================================
   TALK IT THROUGH — AI REFLECTION ASSISTANT
========================================= */

    .dynamic-dilemma-page .ai-chat-widget {
        position: fixed;
        z-index: 1100;
        right: 28px;
        bottom: 25px;
        font-family: "DM Sans", sans-serif;
    }

    /* Floating launcher */

    .dynamic-dilemma-page .ai-chat-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-height: 52px;
        padding: 0 21px;
        color: #fffdf7;
        background: linear-gradient(135deg, #737f5c, #414c35);
        border: 1px solid rgba(255,255,255,.55);
        border-radius: 30px;
        font-family: inherit;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .2px;
        cursor: pointer;
        box-shadow: 0 8px 25px rgba(48,57,37,.23), inset 0 1px 1px rgba(255,255,255,.3);
        transition: transform .25s ease, box-shadow .25s ease;
    }

        .dynamic-dilemma-page .ai-chat-toggle:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 30px rgba(48,57,37,.28), inset 0 1px 1px rgba(255,255,255,.4);
        }

    .dynamic-dilemma-page .ai-chat-toggle-icon {
        font-size: 19px;
        line-height: 1;
    }

    /* Main chat window */

    .dynamic-dilemma-page .ai-chat-panel {
        position: absolute;
        right: 0;
        bottom: 67px;
        display: flex;
        flex-direction: column;
        width: 370px;
        height: 490px;
        max-width: calc(100vw - 30px);
        max-height: min(75vh, 620px);
        overflow: hidden;
        background: rgba(249,248,241,.88);
        border: 1px solid rgba(255,255,255,.85);
        border-radius: 21px;
        -webkit-backdrop-filter: blur(30px) saturate(150%);
        backdrop-filter: blur(30px) saturate(150%);
        box-shadow: 0 22px 65px rgba(37,42,31,.20), 0 4px 14px rgba(37,42,31,.07), inset 0 1px 1px rgba(255,255,255,.9);
        animation: talkThroughEnter .3s ease both;
    }

        .dynamic-dilemma-page .ai-chat-panel[hidden] {
            display: none;
        }

@keyframes talkThroughEnter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat header */

.dynamic-dilemma-page .ai-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 21px 21px 18px;
    background: linear-gradient( 135deg, rgba(105,119,81,.96), rgba(65,76,53,.98) );
    color: #fffdf7;
    border-bottom: 1px solid rgba(255,255,255,.2);
}

.dynamic-dilemma-page .ai-chat-eyebrow {
    margin: 0 0 8px;
    color: rgba(255,255,255,.72);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.dynamic-dilemma-page .ai-chat-header h2 {
    margin: 0;
    color: #fffdf7;
    font-family: "Playfair Display", serif;
    font-size: 23px;
    font-weight: 500;
    line-height: 1.2;
}

.dynamic-dilemma-page .ai-chat-subtitle {
    margin: 6px 0 0;
    color: rgba(255,255,255,.78);
    font-size: 10px;
    line-height: 1.5;
}

.dynamic-dilemma-page .ai-chat-close {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

    .dynamic-dilemma-page .ai-chat-close:hover {
        background: rgba(255,255,255,.25);
        transform: rotate(90deg);
    }

/* Conversation area */

.dynamic-dilemma-page .ai-chat-messages {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 13px;
    overflow-y: auto;
    padding: 20px 17px;
    background: radial-gradient( ellipse at top right, rgba(224,226,211,.3), transparent 60% ), rgba(249,248,241,.65);
    scrollbar-width: thin;
    scrollbar-color: rgba(98,109,77,.35) transparent;
}

    .dynamic-dilemma-page .ai-chat-messages::-webkit-scrollbar {
        width: 5px;
    }

    .dynamic-dilemma-page .ai-chat-messages::-webkit-scrollbar-thumb {
        background: rgba(98,109,77,.35);
        border-radius: 10px;
    }

/* Individual messages */

.dynamic-dilemma-page .ai-chat-message {
    max-width: 86%;
    padding: 12px 14px;
    font-size: 11px;
    line-height: 1.75;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.dynamic-dilemma-page .ai-chat-message-assistant {
    align-self: flex-start;
    color: #414438;
    background: rgba(255,255,255,.83);
    border: 1px solid rgba(255,255,255,.95);
    border-radius: 4px 15px 15px 15px;
    box-shadow: 0 3px 12px rgba(40,45,33,.045);
}

.dynamic-dilemma-page .ai-chat-message-user {
    align-self: flex-end;
    color: white;
    background: linear-gradient(135deg, #75815e, #525f40);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 15px 4px 15px 15px;
    box-shadow: 0 3px 12px rgba(40,45,33,.09);
}

/* Message input */

.dynamic-dilemma-page .ai-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 13px 15px 10px;
    background: rgba(255,255,255,.68);
    border-top: 1px solid rgba(98,109,77,.12);
}

.dynamic-dilemma-page .ai-chat-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.dynamic-dilemma-page .ai-chat-form textarea {
    flex: 1;
    min-width: 0;
    min-height: 43px;
    max-height: 100px;
    padding: 11px 12px;
    resize: vertical;
    color: #34372d;
    background: rgba(248,248,242,.9);
    border: 1px solid rgba(98,109,77,.2);
    border-radius: 11px;
    outline: none;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    line-height: 1.5;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .dynamic-dilemma-page .ai-chat-form textarea::placeholder {
        color: #929487;
    }

    .dynamic-dilemma-page .ai-chat-form textarea:focus {
        border-color: #697653;
        box-shadow: 0 0 0 3px rgba(98,109,77,.09);
    }

.dynamic-dilemma-page .ai-chat-send {
    min-height: 42px;
    padding: 0 16px;
    color: white;
    background: #4b583b;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

    .dynamic-dilemma-page .ai-chat-send:hover {
        background: #35412b;
        transform: translateY(-1px);
    }

    .dynamic-dilemma-page .ai-chat-send:disabled {
        opacity: .55;
        cursor: not-allowed;
        transform: none;
    }

/* Disclaimer */

.dynamic-dilemma-page .ai-chat-disclaimer {
    margin: 0;
    padding: 0 15px 13px;
    color: #858779;
    background: rgba(255,255,255,.68);
    font-size: 9px;
    line-height: 1.5;
    text-align: center;
}

/* Keyboard accessibility */

.dynamic-dilemma-page .ai-chat-widget button:focus-visible,
.dynamic-dilemma-page .ai-chat-widget textarea:focus-visible {
    outline: 3px solid rgba(105,118,83,.65);
    outline-offset: 3px;
}
/* =========================================
   AI CHAT — TALK IT THROUGH
   LIQUID GLASS DESIGN
========================================= */

.dynamic-dilemma-page #ai-chat-widget {
    position: fixed;
    z-index: 1100;
    right: 24px;
    bottom: 24px;
    font-family: "DM Sans", sans-serif;
}

/* Floating toggle button */

.dynamic-dilemma-page #ai-chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 145px;
    height: 48px;
    padding: 0 18px;
    color: white;
    background: linear-gradient(135deg, #788568, #414b35);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(41,43,36,.20);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}

.dynamic-dilemma-page #ai-chat-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(41,43,36,.25);
}

.dynamic-dilemma-page .ai-chat-toggle-icon {
    font-size: 17px;
}

/* Chat panel */

.dynamic-dilemma-page #ai-chat-panel {
    position: absolute;
    right: 0;
    bottom: 62px;
    display: flex;
    flex-direction: column;
    width: min(370px, calc(100vw - 30px));
    height: min(490px, 75vh);
    overflow: hidden;
    background: rgba(249,248,242,.88);
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 20px;
    box-shadow: 0 20px 55px rgba(41,43,36,.18),
                inset 0 1px 1px rgba(255,255,255,.9);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    backdrop-filter: blur(28px) saturate(160%);
}

.dynamic-dilemma-page #ai-chat-panel[hidden] {
    display: none;
}

/* Header */

/* Chat header */

.dynamic-dilemma-page .ai-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 21px 21px 18px;
    background: linear-gradient( 135deg, rgba(105,119,81,.98), rgba(65,76,53,1) );
    color: #fffdf7;
    border-bottom: 1px solid rgba(255,255,255,.2);
}

.dynamic-dilemma-page .ai-chat-eyebrow {
    margin: 0 0 8px;
    color: rgba(255,255,255,.75);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.dynamic-dilemma-page .ai-chat-header h2 {
    margin: 0;
    color: #fffdf7;
    font-family: "Playfair Display", serif;
    font-size: 23px;
    font-weight: 500;
    line-height: 1.2;
}

.dynamic-dilemma-page .ai-chat-subtitle {
    margin: 6px 0 0;
    color: rgba(255,255,255,.82);
    font-size: 10px;
    line-height: 1.5;
}

.dynamic-dilemma-page .ai-chat-close {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

    .dynamic-dilemma-page .ai-chat-close:hover {
        background: rgba(255,255,255,.25);
        transform: rotate(90deg);
    }
/* Messages area */

.dynamic-dilemma-page #ai-chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 11px;
    min-height: 0;
    overflow-y: auto;
    padding: 17px;
    scroll-behavior: smooth;
}

.dynamic-dilemma-page .ai-chat-message {
    max-width: 85%;
    padding: 11px 13px;
    border-radius: 13px;
    font-size: 11px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.dynamic-dilemma-page .ai-chat-message-assistant {
    align-self: flex-start;
    color: #414438;
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(98,109,77,.12);
    border-bottom-left-radius: 4px;
}

.dynamic-dilemma-page .ai-chat-message-user {
    align-self: flex-end;
    color: white;
    background: linear-gradient(135deg, #778465, #4b573e);
    border-bottom-right-radius: 4px;
}

/* Input form */

.dynamic-dilemma-page #ai-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 12px;
    background: rgba(255,255,255,.45);
    border-top: 1px solid var(--line);
}

.dynamic-dilemma-page #ai-chat-input {
    flex: 1;
    min-width: 0;
    min-height: 43px;
    max-height: 100px;
    padding: 11px 12px;
    resize: vertical;
    color: var(--ink);
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(98,109,77,.18);
    border-radius: 11px;
    outline: none;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    line-height: 1.5;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.dynamic-dilemma-page #ai-chat-input:focus {
    border-color: var(--olive);
    box-shadow: 0 0 0 3px rgba(98,109,77,.09);
}

.dynamic-dilemma-page #ai-chat-input::placeholder {
    color: #96988c;
}

/* SEND BUTTON */

.dynamic-dilemma-page #ai-chat-send {
    flex: 0 0 auto;
    min-width: 65px;
    height: 42px;
    padding: 0 15px;
    color: white;
    background: linear-gradient(135deg, #788568, #414b35);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 10px;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(65,75,53,.16);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.dynamic-dilemma-page #ai-chat-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 7px 17px rgba(65,75,53,.23);
}

.dynamic-dilemma-page #ai-chat-send:active:not(:disabled) {
    transform: translateY(0);
}

.dynamic-dilemma-page #ai-chat-send:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Disclaimer */

.dynamic-dilemma-page .ai-chat-disclaimer {
    margin: 0;
    padding: 0 12px 11px;
    color: var(--muted);
    background: rgba(255,255,255,.45);
    font-size: 8px;
    text-align: center;
}

/* Screen-reader-only label */

.dynamic-dilemma-page .ai-chat-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Mobile */

@media (max-width: 620px) {
    .dynamic-dilemma-page #ai-chat-widget {
        right: 12px;
        bottom: 12px;
    }

    .dynamic-dilemma-page #ai-chat-panel {
        width: min(350px, calc(100vw - 24px));
        height: min(460px, 72vh);
    }
}

/* =========================================
   HIGH CONTRAST ACCESSIBILITY
========================================= */

.dynamic-dilemma-page.accessibility-high-contrast {
    --ink: #111;
    --muted: #333;
    --olive: #34451e;
    --olive-dark: #263616;
    background: #fff;
}

    .dynamic-dilemma-page.accessibility-high-contrast .dilemma-card,
    .dynamic-dilemma-page.accessibility-high-contrast .dilemma-response-section {
        color: #111;
        background: #fff;
        border: 2px solid #222;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

/* =========================================
   RESPONSIVE — TABLETS
========================================= */

@media (max-width: 850px) {
    .dynamic-dilemma-page {
        padding: 22px 15px;
    }

        .dynamic-dilemma-page .dilemma-card {
            padding: 22px;
        }

        .dynamic-dilemma-page .dilemma-detail-container {
            column-gap: 23px;
        }

        .dynamic-dilemma-page .dilemma-scenario {
            grid-template-columns: 1fr;
            gap: 5px;
        }

        .dynamic-dilemma-page .scenario-number {
            display: inline-block;
            margin-right: 7px;
            font-size: 20px;
        }

        .dynamic-dilemma-page .scenario-label .eyebrow {
            display: inline-block;
        }
}

/* =========================================
   RESPONSIVE — MOBILE
========================================= */

@media (max-width: 620px) {
    .dynamic-dilemma-page {
        padding: 12px 10px 25px;
    }

        .dynamic-dilemma-page .dilemma-card {
            padding: 17px 16px;
            border-radius: 18px;
        }

        .dynamic-dilemma-page .site-nav {
            align-items: flex-start;
            padding-bottom: 13px;
        }

        .dynamic-dilemma-page .logo {
            max-width: 170px;
            font-size: 15px;
        }

        .dynamic-dilemma-page .nav-link {
            font-size: 10px;
            white-space: nowrap;
        }

        .dynamic-dilemma-page .dilemma-detail-container {
            grid-template-columns: minmax(0, 1fr);
            grid-template-areas:
                "header"
                "image"
                "scenario"
                "response"
                "reflection"
                "back";
            row-gap: 14px;
            padding-top: 19px;
        }

        .dynamic-dilemma-page .dilemma-detail-header h1 {
            font-size: 29px;
        }

        .dynamic-dilemma-page .dilemma-detail-description {
            font-size: 11px;
        }

        .dynamic-dilemma-page .dilemma-detail-image-wrap {
            height: 175px;
        }

        .dynamic-dilemma-page .dilemma-scenario {
            grid-template-columns: 75px minmax(0, 1fr);
            gap: 12px;
            padding-top: 3px;
        }

        .dynamic-dilemma-page .dilemma-scenario-text {
            font-size: 11px;
        }

        .dynamic-dilemma-page .dilemma-response-section {
            padding: 17px 14px;
        }

        .dynamic-dilemma-page .response-heading h2 {
            font-size: 23px;
        }

        .dynamic-dilemma-page .footer {
            flex-direction: column;
            gap: 5px;
            text-align: center;
        }

        .dynamic-dilemma-page .accessibility-toggle {
            right: 12px;
            width: 42px;
            height: 42px;
        }

        .dynamic-dilemma-page .ai-chat-widget {
            right: 13px;
            bottom: 13px;
        }

        .dynamic-dilemma-page .ai-chat-toggle {
            min-height: 47px;
            padding: 0 16px;
            font-size: 11px;
        }

        .dynamic-dilemma-page .ai-chat-panel {
            position: fixed;
            right: 10px;
            bottom: 72px;
            width: calc(100vw - 20px);
            height: min(490px, 72vh);
            max-width: none;
            border-radius: 17px;
        }

        .dynamic-dilemma-page .ai-chat-header {
            padding: 17px;
        }

            .dynamic-dilemma-page .ai-chat-header h2 {
                font-size: 21px;
            }
}

/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {
    .dynamic-dilemma-page *,
    .dynamic-dilemma-page *::before,
    .dynamic-dilemma-page *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
/* =========================================
   ACCESSIBILITY PANEL — LIQUID GLASS
========================================= */

.dynamic-dilemma-page .accessibility-panel {
    position: fixed;
    z-index: 1001;
    top: 45%;
    right: 75px;
    width: min(290px, calc(100vw - 100px));
    padding: 0;
    overflow: hidden;
    color: #292b24;
    background: rgba(249,248,241,.94);
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 17px;
    box-shadow: 0 18px 45px rgba(41,43,36,.17), inset 0 1px 1px rgba(255,255,255,.9);
    -webkit-backdrop-filter: blur(25px) saturate(150%);
    backdrop-filter: blur(25px) saturate(150%);
}

    .dynamic-dilemma-page .accessibility-panel[hidden] {
        display: none !important;
    }

    /* Panel heading */

    .dynamic-dilemma-page .accessibility-panel h2,
    .dynamic-dilemma-page .accessibility-panel h3 {
        margin: 0;
        padding: 17px 18px;
        color: #fffdf7;
        background: linear-gradient(135deg, #737f5c, #414c35);
        font-family: "Playfair Display", serif;
        font-size: 19px;
        font-weight: 500;
    }

    /* Panel content */

    .dynamic-dilemma-page .accessibility-panel p {
        margin: 0;
        padding: 12px 17px 5px;
        color: #77796e;
        font-size: 10px;
        line-height: 1.6;
    }

    .dynamic-dilemma-page .accessibility-panel label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 0 12px;
        padding: 12px 7px;
        color: #414438;
        border-bottom: 1px solid rgba(98,109,77,.12);
        font-size: 11px;
        cursor: pointer;
    }

        .dynamic-dilemma-page .accessibility-panel label:last-child {
            border-bottom: none;
        }

    /* Checkboxes */

    .dynamic-dilemma-page .accessibility-panel input[type="checkbox"] {
        width: 17px;
        height: 17px;
        accent-color: #626d4d;
        cursor: pointer;
    }

    /* Select controls */

    .dynamic-dilemma-page .accessibility-panel select {
        max-width: 125px;
        padding: 7px 9px;
        color: #414438;
        background: rgba(255,255,255,.8);
        border: 1px solid rgba(98,109,77,.22);
        border-radius: 7px;
        font-family: "DM Sans", sans-serif;
        font-size: 10px;
        outline: none;
    }

        .dynamic-dilemma-page .accessibility-panel select:focus {
            border-color: #626d4d;
            box-shadow: 0 0 0 3px rgba(98,109,77,.1);
        }

    /* Buttons */

    .dynamic-dilemma-page .accessibility-panel button {
        margin: 7px 12px;
        padding: 9px 12px;
        color: white;
        background: linear-gradient(135deg, #737f5c, #414c35);
        border: 0;
        border-radius: 8px;
        font-family: "DM Sans", sans-serif;
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: transform .2s ease, box-shadow .2s ease;
    }

        .dynamic-dilemma-page .accessibility-panel button:hover {
            transform: translateY(-1px);
            box-shadow: 0 5px 13px rgba(65,76,53,.2);
        }

/* Accessibility launcher */

.dynamic-dilemma-page .accessibility-toggle {
    color: white;
    background: linear-gradient(135deg, #737f5c, #414c35);
    border: 2px solid rgba(255,255,255,.85);
    box-shadow: 0 7px 20px rgba(41,43,36,.2);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .dynamic-dilemma-page .accessibility-toggle:hover {
        transform: scale(1.06);
        box-shadow: 0 10px 25px rgba(41,43,36,.25);
    }

/* Keyboard focus */

.dynamic-dilemma-page .accessibility-panel button:focus-visible,
.dynamic-dilemma-page .accessibility-panel select:focus-visible,
.dynamic-dilemma-page .accessibility-panel input:focus-visible {
    outline: 2px solid #626d4d;
    outline-offset: 3px;
}