        html,
        body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            overscroll-behavior: none;
        }

        @keyframes fadeUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes flow {
            from {
                background-position: 0% 50%;
            }

            to {
                background-position: 100% 50%;
            }
        }

        @keyframes fadeInLogoImage {
            from {
                opacity: 0;
                transform: translateY(12px);
            }

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

        @keyframes fadeInTitleText {
            from {
                opacity: 0;
                transform: translateY(12px);
            }

            to {
                opacity: 1;
                transform: none;
                filter: none;
            }
        }

        @keyframes fadeInContent {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

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

        #opening-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(-45deg, #1a0525, #6c3483, #8e44ad, #c15ee2);
            background-size: 300% 300%;
            animation: flow 4s ease-out forwards;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 1s ease;

        }

        #opening-screen::before {
            content: '';
            position: absolute;
            width: 300px;
            height: 300px;
            background: rgba(168, 85, 247, 0.4);
            filter: blur(100px);
            top: 20%;
            left: 50%;
            transform: translateX(-50%);
        }

        .main-logo-image {
            width: 145px;
            height: 145px;
            object-fit: contain;
            margin-bottom: 1px;
            opacity: 0;
            animation: fadeInLogoImage 1s 0.2s ease-out forwards;
            filter: none;
        }

        .opening-title-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            transform: none;
            filter: none;
        }


        .top-logo-wrap {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .top-logo-icon {
            width: 22px;
            height: 22px;
            object-fit: contain;
        }

        .top-logo-text {
            font-weight: 800;
            font-size: 19px;
            letter-spacing: -0.8px;
            color: #000;
        }

        .main-logo-style {
            font-family: 'Pretendard', sans-serif;
            font-size: 60px;
            font-weight: 900;
            color: #fff;
            letter-spacing: -3.2px;
            line-height: 0.95;
            margin: 0;
            padding: 0;
            margin-top: 10px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
            opacity: 0;
            transform: translateY(12px);
            filter: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            animation: fadeInTitleText 0.9s 0.35s ease-out forwards;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        #setup-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            height: 100dvh;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: linear-gradient(-45deg, #1a0525, #6c3483, #8e44ad, #c15ee2);
            background-size: 300% 300%;
            transition: opacity 1s ease;
        }

        #send-btn {
            background: linear-gradient(135deg, #a855f7, #7c3aed);
            position: relative;
            z-index: 3;
        }

        #msg-input {
            position: relative;
            z-index: 2;
        }

        .btn-group {
            position: relative;
        }

        .input-area {
            touch-action: manipulation;
        }

        .site-footer {
            width: 100%;
            max-width: 500px;
            margin: 40px auto 20px;
            text-align: center;
            font-size: 13px;
            color: rgba(255, 255, 255, 0.7);
        }

        .footer-links {
            margin-bottom: 10px;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.9);
            text-decoration: none;
            font-weight: 600;
            margin: 0 6px;
            transition: all 0.2s ease;
        }

        .footer-links a:hover {
            color: #fff;
            text-decoration: underline;
        }

        .footer-copy {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.5);
        }

        .setup-content-wrapper {
            width: 100%;
            max-width: 380px;
            display: flex;
            flex-direction: column;
            align-items: center;
            opacity: 1;
            padding: 28px 22px;
            padding-top: max(28px, calc(12px + env(safe-area-inset-top, 0px)));
            border-radius: 28px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(10px);
            box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
            position: relative;
        }

        .setup-top-bar {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            margin-bottom: 8px;
            min-height: 44px;
        }

        .setup-back-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-width: 44px;
            min-height: 44px;
            padding: 8px 12px 8px 8px;
            margin-left: max(0px, env(safe-area-inset-left, 0px));
            border: none;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.14);
            color: #fff;
            font-size: 15px;
            font-weight: 700;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
            touch-action: manipulation;
        }

        .setup-back-btn__icon {
            font-size: 20px;
            line-height: 1;
        }

        .setup-back-btn__label {
            letter-spacing: -0.3px;
        }

        :root {
            --primary: #8E44AD;
            --error: #FF3B30;
            --bg-gradient: linear-gradient(135deg, #2c0a3d 0%, #8e44ad 50%, #c15ee2 100%);
            --card: rgba(255, 255, 255, 0.95);
            --male: #007AFF;
            --female: #FF2D55;

        }

        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
            outline: none;
        }

        button {
            transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
            -webkit-tap-highlight-color: transparent;
        }

        button:active {
            transform: scale(0.94);
            opacity: 0.85;
        }

        html {
            background: var(--bg-gradient) no-repeat center center fixed;
            background-size: cover;
            min-height: 100%;
        }

        body {
            font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: transparent;
            display: flex;
            justify-content: center;
            flex-direction: column;
            min-height: 100dvh;
            overflow: hidden;
            width: 100%;
            color: #fff;
        }

        .container {
            max-width: 760px;
            width: 100%;
        }

        .top-bar button {
            padding: 6px 10px;
            border-radius: 8px;
        }

        .top-bar button:active {
            background: rgba(0, 0, 0, 0.05);
        }

        .stats-bar {
            position: fixed;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 500px;
            background: rgba(0, 0, 0, 0.5);
            color: rgba(255, 255, 255, 0.95);
            font-size: 11px;
            padding: 7px 15px;
            display: none;
            justify-content: space-between;
            z-index: 2002;
            backdrop-filter: blur(8px);
            font-weight: 500;
        }

        .swipe-transition {
            transition: transform 0.55s cubic-bezier(0.19, 1, 0.22, 1),
                opacity 0.4s ease-out !important;
        }

        .top-bar {
            position: fixed;
            top: 31px;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 500px;
            height: 52px;
            background: rgba(255, 255, 255, 0.88);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border-bottom: 1px solid rgba(60, 60, 67, 0.18);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2001;
            color: #000;
        }

        #setup-screen {
            padding: 36px 24px;
            flex: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        #setup-screen h1 {
            text-align: center;
            margin-bottom: 20px;
            font-size: 36px;
            font-weight: 900;
            color: #fff;
            text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        }

        .step-container {
            display: none;
            width: 100%;
            max-width: 360px;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }

        .step-container.active {
            display: flex;
        }

        .step-title {
            font-size: 31px;
            font-weight: 800;
            margin-bottom: 24px;
            text-align: center;
            line-height: 1.32;
            letter-spacing: -1.35px;
            color: #fff;
            text-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
        }

        .modern-input::placeholder {
            color: #7c7c82;
            font-weight: 600;
            letter-spacing: -0.2px;
        }



        .modern-input {
            width: 100%;
            height: 62px;
            border-radius: 22px;
            background: rgba(255, 255, 255, 0.92);
            border: 1px solid rgba(255, 255, 255, 0.35);
            padding: 0 22px;
            font-size: 18px;
            font-weight: 600;
            text-align: center;
            outline: none;
            margin-bottom: 18px;
            color: #111;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
        }

        .modern-input:focus {
            transform: translateY(-1px);
            border-color: rgba(255, 255, 255, 0.85);
            box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
        }

        .option-btn {
            width: 100%;
            padding: 19px 20px;
            margin: 8px 0;
            border-radius: 22px;
            border: 1px solid rgba(255, 255, 255, 0.22);
            background: rgba(255, 255, 255, 0.94);
            font-size: 18px;
            font-weight: 700;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 12px;
            color: #111;
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
            transition: transform 0.16s ease, box-shadow 0.16s ease;
        }

        .option-btn:active {
            transform: scale(0.985);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
        }

        .option-btn.option-btn--selected {
            border-color: rgba(142, 68, 173, 0.85);
            box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 12px 28px rgba(0, 0, 0, 0.08);
        }

        .btn-next-circle {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background: #fff;
            color: var(--primary);
            border: none;
            font-size: 28px;
            font-weight: 900;
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
            transition: transform 0.16s ease, box-shadow 0.16s ease;
        }

        .btn-next-circle:active {
            transform: scale(0.96);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
        }

        #chat-screen {
            display: none;
            flex-direction: column;
            height: 100dvh;
            min-height: 100dvh;
            width: 100%;
            max-width: 500px;
            margin: 0 auto;
            background: linear-gradient(180deg, #6a0dad 0%, #8e44ad 100%);
            position: relative;
            top: auto;
            left: auto;
            transform: none;
            z-index: 1000;
            overflow: hidden;
            border-radius: 0;
            box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
            overscroll-behavior: none;
        }

        #chat-box {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            padding: 99px 14px 12px;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            overscroll-behavior-y: contain;
            background:
                radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 30%),
                linear-gradient(180deg, #2b1538 0%, #4b2563 100%);
        }

        .top-title {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            font-size: 18px;
            font-weight: 900;
            letter-spacing: -0.8px;
            color: #111;
            white-space: nowrap;
        }

        .top-exit-btn {
            position: absolute;
            right: 12px;
            color: #6b7280;
            background: none;
            border: none;
            font-weight: 700;
            font-size: 14px;
        }

        .msg-line {
            display: flex;
            flex-direction: column;
            width: 100%;
            margin-top: 8px;
        }

        .msg-line.me {
            align-items: flex-end;
        }

        .msg-line.partner {
            align-items: flex-start;
        }

        .bubble {
            max-width: 75%;
            padding: 10px 14px;
            border-radius: 16px;
            font-size: 14px;
        }

        /* 내 메시지: 더 진하고 선명하게 */
        .msg-line.me .bubble {
            background: linear-gradient(135deg, #7c3aed, #5b21b6);
            color: #fff;
            border-bottom-right-radius: 6px;
        }

        .msg-line.me.msg-pending .bubble {
            opacity: 0.78;
        }

        .msg-line.me.msg-confirmed .bubble {
            opacity: 1;
        }

        /* 상대 메시지: 아예 밝은 톤으로 분리 */
        .msg-line.partner .bubble {
            background: linear-gradient(135deg, #4c1d95, #1e3a8a);
            color: #fff;
            border-bottom-left-radius: 6px;
        }

        .input-area {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border-top: 1px solid rgba(60, 60, 67, 0.15);
            /* 하단: 기본 여백 + 노치·홈 인디케이터만 한 번 적용 (키보드 열림 시 iOS는 보통 inset≈0) */
            padding: 10px;
            padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
            flex-shrink: 0;
            position: relative;
            z-index: 50;
        }

        .btn-group {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        #msg-input {
            flex: 1;
            height: 42px;
            padding: 0 16px;
            border: 1px solid rgba(60, 60, 67, 0.12);
            border-radius: 21px;
            outline: none;
            background: #fff;
            font-size: 16px;
            color: #111;
        }

        .system {
            align-self: center;
            margin: 8px auto;
            font-size: 12px;
            color: #6e6e73;
            background: rgba(255, 255, 255, 0.82);
            border: 1px solid rgba(60, 60, 67, 0.08);
            padding: 8px 12px;
            border-radius: 14px;
            width: fit-content;
            text-align: center;
            line-height: 1.35;
            word-break: keep-all;
            backdrop-filter: blur(10px);
        }

        .gender-tag {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            color: white;
            font-weight: bold;
            margin-right: 4px;
            vertical-align: middle;
        }

        .typing-bubble {
            display: flex;
            gap: 5px;
            padding: 12px 18px !important;
            background: linear-gradient(135deg, #d9d3f0, #cfc7ea) !important;
        }

        .dot {
            width: 7px;
            height: 7px;
            background: #6d28d9;
            border-radius: 50%;
            animation: bounce 1.4s infinite ease-in-out;
            opacity: 0.95;
        }

        .dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        .swipe-transition {
            transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.4s ease-out !important;
        }

        @keyframes bounce {

            0%,
            80%,
            100% {
                transform: translateY(0);
            }

            40% {
                transform: translateY(-8px);
            }
        }

        .opening-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            max-width: 360px;
            padding: 24px;
            text-align: center;
            transform: none;
            filter: none;
        }

        @media (max-width: 768px) {
            .opening-title-wrap,
            .main-logo-style {
                filter: none !important;
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
                text-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
                -webkit-font-smoothing: antialiased;
                -moz-osx-font-smoothing: grayscale;
            }

            .main-logo-image {
                filter: none !important;
            }
        }

        .opening-subtext {
            font-family: 'Pretendard', sans-serif;
            font-size: 22px;
            color: rgba(255, 255, 255, 0.9);
            margin: 16px 0 28px;
            letter-spacing: -0.4px;
            font-weight: 700;
            opacity: 0;
            transform: translateY(20px);
            animation: fadeInContent 0.8s 0.3s ease forwards;
        }

        .opening-btn-row {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 16px;
            margin-top: 18px;
            animation: fadeInContent 0.9s 1.1s ease-out forwards;
            opacity: 0;
        }

        .opening-btn-primary,
        .opening-btn-secondary {
            width: 88%;
            height: 60px;
            margin: 0 auto;
            border-radius: 28px;
            padding: 0 20px;
            font-size: 18px;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            cursor: pointer;
        }

        .opening-btn-primary {
            border: none;
            font-weight: 900;
            color: #ffffff;
            background: linear-gradient(135deg, #a855f7, #7c3aed);
            box-shadow:
                0 16px 34px rgba(124, 58, 237, 0.38),
                0 8px 18px rgba(0, 0, 0, 0.18);
        }

        .opening-btn-secondary {
            font-weight: 700;
            color: rgba(255, 255, 255, 0.92);
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.18);
            backdrop-filter: blur(10px);
            box-shadow: none;
        }

        .opening-btn-primary:active {
            transform: scale(0.96);
            box-shadow:
                0 8px 18px rgba(0, 0, 0, 0.2),
                inset 0 2px 6px rgba(0, 0, 0, 0.1);
        }

        .opening-btn-secondary:active {
            transform: scale(0.985);
        }

        /* 랜딩페이지 */
        #landing-page {
            display: none;
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            max-width: none;
            transform: none;
            z-index: 9998;
            background:
                radial-gradient(circle at top, rgba(193, 94, 226, 0.22), transparent 35%),
                linear-gradient(180deg, #16051f 0%, #2c0a3d 45%, #4d1f67 100%);
            color: #fff;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 40px;
        }

        .landing-hero {
            padding: 72px 24px 28px;
            text-align: left;
        }

        .landing-hero,
        .landing-section,
        .site-footer {
            width: 100%;
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }

        .landing-badge {
            display: inline-block;
            padding: 8px 12px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.12);
            font-size: 13px;
            font-weight: 700;
            margin-bottom: 16px;
        }

        .landing-title {
            font-size: 34px;
            line-height: 1.15;
            font-weight: 900;
            letter-spacing: -1.2px;
            margin: 0 0 14px;
        }

        .landing-desc {
            font-size: 16px;
            line-height: 1.7;
            color: rgba(255, 255, 255, 0.9);
            margin: 0 0 24px;
        }

        .landing-cta-row {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .landing-btn-primary,
        .landing-btn-secondary {
            border-radius: 16px;
            padding: 15px 18px;
            font-size: 15px;
            font-weight: 800;
            cursor: pointer;
        }

        .landing-btn-primary {
            background: #fff;
            color: #6c3483;
            border: none;
        }

        .landing-btn-secondary {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.18);
        }

        .landing-section {
            padding: 0 24px;
            margin-top: 18px;
        }

        .landing-card {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 22px;
            padding: 20px;
            backdrop-filter: blur(8px);
        }

        .landing-section h2 {
            font-size: 22px;
            font-weight: 900;
            margin: 0 0 14px;
            letter-spacing: -0.6px;
        }

        .landing-section p,
        .landing-section li {
            font-size: 15px;
            line-height: 1.8;
            color: rgba(255, 255, 255, 0.92);
        }

        .landing-list {
            padding-left: 18px;
            margin: 0;
        }


        .site-footer {
            width: 100%;
            max-width: 500px;
            margin: 40px auto 20px;
            text-align: center;
            font-size: 13px;
            color: rgba(255, 255, 255, 0.7);
            padding: 0 16px;
        }

        .footer-links {
            margin-bottom: 10px;
            line-height: 1.8;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.92);
            text-decoration: none;
            font-weight: 600;
            margin: 0 6px;
            transition: all 0.2s ease;
        }

        .footer-links a:hover {
            color: #fff;
            text-decoration: underline;
        }

        .footer-copy {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.5);
        }

        .option-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 34px;
            height: 34px;
            padding: 0 10px;
            border-radius: 999px;
            font-size: 13px;
            font-weight: 800;
            letter-spacing: -0.3px;
            color: #fff;
            box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
        }

        .male-pill {
            background: linear-gradient(135deg, #60a5fa, #2563eb);
        }

        .female-pill {
            background: linear-gradient(135deg, #f472b6, #db2777);
        }

        .all-pill {
            background: linear-gradient(135deg, #a855f7, #7c3aed);
        }

        @media (max-width: 767px) {

            html,
            body {
                margin: 0;
                padding: 0;
                width: 100%;
                height: 100%;
                overflow: hidden;
                position: static;
            }

            /* 높이·top: 기본은 동적 뷰포트. iOS Safari에서 JS가 visualViewport 기준으로 덮어씀 */
            #chat-screen {
                display: none;
                flex-direction: column;
                position: fixed;
                top: 0;
                left: 0;
                transform: none;
                width: 100%;
                max-width: none;
                height: 100svh;
                height: 100dvh;
                min-height: 100dvh;
                margin: 0;
                overflow: hidden;
                border-radius: 0;
            }

            .stats-bar {
                position: relative;
                top: auto;
                left: auto;
                transform: none;
                width: 100%;
                max-width: none;
                flex-shrink: 0;
                z-index: 30;
            }

            .top-bar {
                position: relative;
                top: auto;
                left: auto;
                transform: none;
                width: 100%;
                max-width: none;
                flex-shrink: 0;
                z-index: 31;
            }

            #chat-box {
                position: relative;
                top: auto;
                left: auto;
                right: auto;
                bottom: auto;
                flex: 1;
                min-height: 0;
                overflow-y: auto;
                overflow-x: hidden;
                padding: 16px 14px 12px;
                display: flex;
                flex-direction: column;
                justify-content: flex-end;
                -webkit-overflow-scrolling: touch;
            }

            .input-area {
                position: relative;
                left: auto;
                bottom: auto;
                transform: none;
                width: 100%;
                max-width: none;
                flex-shrink: 0;
                z-index: 50;
            }
        }

        @media (min-width: 768px) {

            .stats-bar {
                position: absolute;
                top: 0;
                left: 0;
                transform: none;
                width: 100%;
                max-width: none;
                height: 30px;
                padding: 0 16px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                font-size: 12px;
                color: rgba(255, 255, 255, 0.95);
                background: rgba(0, 0, 0, 0.75);
                backdrop-filter: blur(8px);
                z-index: 30;
            }

            .top-bar {
                position: absolute;
                top: 30px;
                left: 0;
                transform: none;
                width: 100%;
                max-width: none;
                height: 52px;
                padding: 0 14px;
                background: rgba(255, 255, 255, 0.92);
                backdrop-filter: blur(18px);
                -webkit-backdrop-filter: blur(18px);
                border-bottom: 1px solid rgba(60, 60, 67, 0.18);
                display: flex;
                align-items: center;
                justify-content: center;
                z-index: 31;
                color: #000;
            }

            #chat-screen {
                width: 390px;
                height: calc(100dvh - 8px);
                margin: 0 auto;
                padding-top: 82px;
                border-radius: 38px;
                border: 10px solid #1c1c1e;
                background: #000;
                position: fixed;
                top: 4px;
                left: 50%;
                transform: translateX(-50%);
                overflow: hidden;
                box-shadow:
                    0 30px 80px rgba(0, 0, 0, 0.4),
                    0 10px 30px rgba(0, 0, 0, 0.2);
            }

            #chat-screen::before {
                content: '';
                position: absolute;
                top: 8px;
                left: 50%;
                transform: translateX(-50%);
                width: 120px;
                height: 26px;
                background: #000;
                border-radius: 0 0 20px 20px;
                z-index: 10;
            }

            #chat-screen::after {
                content: '';
                position: absolute;
                top: 16px;
                left: 50%;
                transform: translateX(-50%);
                width: 50px;
                height: 5px;
                background: rgba(255, 255, 255, 0.2);
                border-radius: 10px;
                z-index: 11;
            }


        }

        .nana-chat-toast {
            position: fixed;
            left: 50%;
            bottom: max(28px, calc(16px + env(safe-area-inset-bottom, 0px)));
            transform: translateX(-50%);
            max-width: min(92vw, 360px);
            padding: 12px 18px;
            border-radius: 12px;
            background: rgba(30, 22, 45, 0.96);
            border: 1px solid rgba(168, 85, 247, 0.35);
            color: #ede9fe;
            font-size: 14px;
            font-weight: 600;
            text-align: center;
            z-index: 3005;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.22s ease;
        }

        .nana-chat-toast.nana-chat-toast--visible {
            opacity: 1;
        }

        .nana-chat-confirm {
            position: fixed;
            inset: 0;
            z-index: 3010;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            padding: 16px;
            padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
            box-sizing: border-box;
        }

        .nana-chat-confirm[hidden] {
            display: none !important;
        }

        .nana-chat-confirm__backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.45);
        }

        .nana-chat-confirm__sheet {
            position: relative;
            width: 100%;
            max-width: 380px;
            padding: 22px 18px 18px;
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.98);
            color: #111;
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
        }

        .nana-chat-confirm__title {
            margin: 0 0 8px;
            font-size: 18px;
            font-weight: 800;
            letter-spacing: -0.4px;
        }

        .nana-chat-confirm__message {
            margin: 0 0 18px;
            font-size: 14px;
            line-height: 1.45;
            color: #4b5563;
            white-space: pre-line;
        }

        .nana-chat-confirm__actions {
            display: flex;
            gap: 10px;
        }

        .nana-chat-confirm__btn {
            flex: 1;
            min-height: 46px;
            border-radius: 14px;
            border: none;
            font-size: 15px;
            font-weight: 700;
            touch-action: manipulation;
        }

        .nana-chat-confirm__btn--cancel {
            background: #f2f2f7;
            color: #374151;
        }

        .nana-chat-confirm__btn--ok {
            background: linear-gradient(135deg, #a855f7, #7c3aed);
            color: #fff;
        }

        .nana-chat-confirm__btn--danger {
            background: #ff453a;
            color: #fff;
        }