#test-movie-chat {
    background:
        radial-gradient(circle at 16% 10%, rgba(210, 159, 92, 0.18), transparent 32%),
        radial-gradient(circle at 84% 18%, rgba(89, 121, 166, 0.16), transparent 34%),
        linear-gradient(180deg, #090806 0%, #11100d 46%, #070706 100%);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

#test-movie-chat .tmc-shell {
    min-height: 100%;
    padding: 28px;
}

.tmc-stage {
    width: min(100%, 1180px);
    min-height: calc(100vh - 132px);
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto auto minmax(520px, 1fr);
    gap: 20px;
}

.tmc-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    padding: 26px;
    border: 1px solid rgba(238, 206, 151, 0.16);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(32, 28, 21, 0.94), rgba(18, 19, 21, 0.9)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 92px);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tmc-hero::before {
    content: '';
    position: absolute;
    inset: auto -18% -56% 22%;
    height: 220px;
    background: radial-gradient(ellipse, rgba(214, 161, 86, 0.22), transparent 68%);
    pointer-events: none;
}

.tmc-hero-copy {
    position: relative;
    z-index: 1;
}

.tmc-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(240, 205, 145, 0.2);
    border-radius: 999px;
    background: rgba(240, 205, 145, 0.08);
    color: #f3dba9;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tmc-hero h2 {
    margin: 18px 0 12px;
    color: #fff7e7;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 0.98;
    letter-spacing: -0.055em;
    font-weight: 900;
}

.tmc-hero p {
    max-width: 720px;
    margin: 0;
    color: rgba(242, 229, 203, 0.76);
    font-size: 15px;
    line-height: 1.85;
}

.tmc-hero-card {
    position: relative;
    align-self: stretch;
    min-height: 160px;
    padding: 20px;
    border: 1px solid rgba(255, 247, 231, 0.12);
    border-radius: 24px;
    background:
        linear-gradient(160deg, rgba(242, 221, 184, 0.12), rgba(255, 255, 255, 0.02)),
        #14120e;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tmc-slate-line {
    height: 16px;
    margin-bottom: 26px;
    border-radius: 999px;
    background: repeating-linear-gradient(135deg, #f2d7a1 0 14px, #17130d 14px 28px);
    opacity: 0.9;
}

.tmc-slate-title {
    color: #fff7e7;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.tmc-slate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tmc-slate-meta span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255, 247, 231, 0.07);
    color: rgba(242, 229, 203, 0.72);
    font-size: 11px;
    font-weight: 700;
}

.tmc-import-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px dashed rgba(240, 205, 145, 0.24);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 247, 231, 0.075), rgba(255, 247, 231, 0.025)),
        rgba(10, 10, 9, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tmc-import-card::after {
    content: '';
    position: absolute;
    inset: -40% auto auto 8%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(240, 200, 120, 0.12), transparent 68%);
    pointer-events: none;
}

.tmc-import-card.is-dragover {
    transform: translateY(-1px);
    border-color: rgba(240, 205, 145, 0.58);
    background:
        linear-gradient(135deg, rgba(240, 205, 145, 0.12), rgba(119, 156, 214, 0.06)),
        rgba(10, 10, 9, 0.88);
}

.tmc-import-visual {
    position: relative;
    z-index: 1;
    height: 92px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    background:
        repeating-linear-gradient(90deg, rgba(20, 18, 14, 0.9) 0 10px, rgba(242, 215, 161, 0.82) 10px 18px),
        #17130d;
    color: #17130d;
    box-shadow: inset 0 0 0 1px rgba(255, 247, 231, 0.1);
}

.tmc-import-visual i {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7e7;
    color: #17130d;
    font-size: 17px;
}

.tmc-import-visual span {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(23, 19, 13, 0.82);
    color: #f2d7a1;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.tmc-import-copy {
    position: relative;
    z-index: 1;
}

.tmc-import-label {
    color: #f3dba9;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tmc-import-copy h3 {
    margin: 7px 0 6px;
    color: #fff7e7;
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.tmc-import-copy p {
    margin: 0;
    color: rgba(242, 229, 203, 0.62);
    font-size: 13px;
    line-height: 1.65;
}

.tmc-import-meta {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 247, 231, 0.06);
    color: rgba(242, 229, 203, 0.72);
    font-size: 12px;
    font-weight: 700;
}

.tmc-import-actions {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    min-width: 174px;
}

.tmc-import-btn,
.tmc-analyze-btn,
.tmc-clear-btn {
    min-height: 42px;
    border-radius: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 900;
    transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tmc-import-btn {
    border: 1px solid rgba(240, 205, 145, 0.22);
    background: rgba(255, 247, 231, 0.07);
    color: #fff7e7;
}

.tmc-analyze-btn {
    border: 0;
    background: linear-gradient(135deg, #f0c878, #c88942);
    color: #1c1308;
}

.tmc-clear-btn {
    border: 1px solid rgba(255, 247, 231, 0.12);
    background: transparent;
    color: rgba(242, 229, 203, 0.66);
}

.tmc-import-btn:hover,
.tmc-analyze-btn:hover,
.tmc-clear-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.tmc-analyze-btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
    filter: none;
}

.tmc-chat-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    gap: 14px;
    min-height: 0;
    max-height: min(760px, calc(100vh - 168px));
    padding: 18px;
    border: 1px solid rgba(238, 206, 151, 0.14);
    border-radius: 30px;
    background:
        radial-gradient(circle at 8% 0%, rgba(235, 180, 103, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(18, 17, 15, 0.96), rgba(10, 10, 9, 0.98));
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tmc-message-list {
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 4px;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(240, 205, 145, 0.45) rgba(255, 247, 231, 0.06);
    -webkit-overflow-scrolling: touch;
}

.tmc-message-list::-webkit-scrollbar,
#test-movie-chat::-webkit-scrollbar {
    width: 10px;
}

.tmc-message-list::-webkit-scrollbar-track,
#test-movie-chat::-webkit-scrollbar-track {
    background: rgba(255, 247, 231, 0.045);
    border-radius: 999px;
}

.tmc-message-list::-webkit-scrollbar-thumb,
#test-movie-chat::-webkit-scrollbar-thumb {
    min-height: 52px;
    border: 2px solid rgba(10, 10, 9, 0.82);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(240, 205, 145, 0.68), rgba(200, 137, 66, 0.58));
}

.tmc-message-list::-webkit-scrollbar-thumb:hover,
#test-movie-chat::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 224, 166, 0.82), rgba(218, 154, 78, 0.78));
}

.tmc-message {
    display: flex;
    gap: 12px;
    margin: 0 0 16px;
    animation: tmcFadeUp 220ms ease-out both;
}

.tmc-message.user {
    justify-content: flex-end;
}

.tmc-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(240, 205, 145, 0.12);
    color: #f3dba9;
    border: 1px solid rgba(240, 205, 145, 0.16);
}

.tmc-message.user .tmc-avatar {
    order: 2;
    background: rgba(119, 156, 214, 0.14);
    color: #c6dcff;
    border-color: rgba(119, 156, 214, 0.2);
}

.tmc-bubble {
    max-width: min(760px, 78%);
    padding: 14px 16px;
    border-radius: 18px;
    color: rgba(255, 249, 236, 0.9);
    background: rgba(255, 247, 231, 0.07);
    border: 1px solid rgba(255, 247, 231, 0.09);
    line-height: 1.78;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tmc-message.user .tmc-bubble {
    color: #f7fbff;
    background: linear-gradient(135deg, rgba(68, 111, 174, 0.92), rgba(44, 77, 128, 0.92));
    border-color: rgba(161, 196, 255, 0.18);
    box-shadow: 0 12px 26px rgba(36, 76, 140, 0.2);
}

.tmc-message.streaming .tmc-bubble::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -2px;
    border-radius: 999px;
    background: #f3dba9;
    animation: tmcCaret 760ms steps(2, jump-none) infinite;
}

.tmc-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tmc-quick-chip {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(240, 205, 145, 0.16);
    border-radius: 999px;
    background: rgba(255, 247, 231, 0.055);
    color: rgba(242, 229, 203, 0.82);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.tmc-quick-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(240, 205, 145, 0.34);
    background: rgba(240, 205, 145, 0.1);
    color: #fff7e7;
}

.tmc-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid rgba(255, 247, 231, 0.1);
    border-radius: 24px;
    background: rgba(4, 5, 6, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tmc-input {
    width: 100%;
    max-height: 180px;
    min-height: 48px;
    resize: none;
    border: 0;
    outline: none;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(255, 247, 231, 0.055);
    color: #fff9ec;
    font-size: 14px;
    line-height: 1.6;
}

.tmc-input::placeholder {
    color: rgba(242, 229, 203, 0.42);
}

.tmc-input:focus {
    box-shadow: 0 0 0 2px rgba(240, 205, 145, 0.18);
}

.tmc-send-btn {
    min-width: 118px;
    min-height: 52px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #f0c878, #c88942);
    color: #1c1308;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 16px 28px rgba(200, 137, 66, 0.24);
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.tmc-send-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 18px 34px rgba(200, 137, 66, 0.3);
}

.tmc-send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.tmc-disclaimer {
    color: rgba(242, 229, 203, 0.48);
    font-size: 12px;
    line-height: 1.6;
    padding: 0 4px 2px;
}

@keyframes tmcFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tmcCaret {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tmc-message,
    .tmc-message.streaming .tmc-bubble::after {
        animation: none;
    }

    .tmc-quick-chip,
    .tmc-send-btn {
        transition: none;
    }
}

@media (max-width: 860px) {
    #test-movie-chat .tmc-shell {
        padding: 18px 14px 28px;
    }

    .tmc-stage {
        min-height: calc(100vh - 100px);
        grid-template-rows: auto minmax(500px, 1fr);
    }

    .tmc-hero {
        grid-template-columns: 1fr;
        padding: 20px;
        border-radius: 24px;
    }

    .tmc-import-card {
        grid-template-columns: 1fr;
    }

    .tmc-import-visual {
        height: 78px;
    }

    .tmc-import-actions {
        min-width: 0;
    }

    .tmc-hero-card {
        min-height: 132px;
    }

    .tmc-chat-card {
        max-height: min(720px, calc(100vh - 132px));
        border-radius: 24px;
        padding: 14px;
    }

    .tmc-bubble {
        max-width: 86%;
    }

    .tmc-composer {
        grid-template-columns: 1fr;
    }

    .tmc-send-btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .tmc-hero h2 {
        font-size: 34px;
    }

    .tmc-quick-row {
        flex-direction: column;
    }

    .tmc-quick-chip {
        width: 100%;
    }

    .tmc-avatar {
        display: none;
    }

    .tmc-bubble {
        max-width: 92%;
    }
}
