:root {
            --bg-card: rgba(255, 248, 243, 0.94);
            --bg-card-soft: rgba(255, 248, 243, 0.84);
            --text-dark: #32251d;
            --text-soft: rgba(255, 247, 241, 0.92);
            --shadow-soft: 0 14px 26px rgba(171, 64, 18, 0.18);
            --shadow-bubble: 0 10px 20px rgba(124, 35, 7, 0.1);
            --mini-tabbar-offset: 0px;
            --mini-bottom-safe: calc(var(--mini-tabbar-offset) + env(safe-area-inset-bottom));
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html,
        body {
            min-height: 100%;
        }

        body {
            font-family: var(--h5-font-family-base);
            color: #fff;
            background:
                radial-gradient(circle at 18% 0%, rgba(255, 234, 188, 0.44), transparent 24%),
                url("../../../chatButlerImg/page-background.png") center top / cover no-repeat;
            overflow-x: hidden;
        }

        .page {
            width: min(100%, 31.25rem);
            min-height: 100vh;
            margin: 0 auto;
            padding: max(0.85rem, env(safe-area-inset-top)) 1rem calc(1.55rem + var(--mini-bottom-safe));
            position: relative;
        }

        .quick-row,
        .message-row,
        .input-wrap {
            display: flex;
            align-items: center;
        }

        .quick-row {
            flex-direction: column;
            align-items: flex-start;
            gap: 2rem;
            justify-content: flex-start;
        }

        .quick-chip {
            appearance: none;
            flex: 0 0 auto;
            width: min(16rem, calc(100% - 5rem));
            min-height: 3.9rem;
            padding: 0.95rem 1rem;
            border: 1px solid rgba(255, 255, 255, 0.32);
            border-radius: 0.72rem;
            background: var(--bg-card);
            color: var(--text-dark);
            font-size: var(--h5-text-chip);
            font-weight: 700;
            line-height: 1.45;
            box-shadow: var(--shadow-soft);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            text-align: left;
            white-space: normal;
            backdrop-filter: blur(3px);
        }

        .quick-chip .chip-icon {
            width: 1.45rem;
            height: 1.45rem;
            border-radius: 50%;
            background: linear-gradient(180deg, #ffe58f, #f7c35f);
            color: #31456b;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: var(--h5-text-body-soft);
            flex: 0 0 auto;
        }

        .chat-stage {
            position: relative;
            min-height: calc(100vh - 8.2rem - var(--mini-bottom-safe));
            padding-top: 3.8rem;
            padding-bottom: calc(15.5rem + var(--mini-bottom-safe));
        }

        .conversation-thread {
            display: flex;
            flex-direction: column;
            gap: 1.15rem;
            margin-top: 1.4rem;
            padding-bottom: 0.4rem;
        }

        .conversation-thread:empty {
            min-height: 12rem;
        }

        .message-row {
            gap: 0.8rem;
            margin-top: 0;
        }

        .message-row.user {
            justify-content: flex-end;
        }

        .message-row.butler {
            justify-content: flex-start;
        }

        .avatar {
            width: 2.275rem;
            height: 2.275rem;
            flex: 0 0 auto;
            border-radius: 50%;
            box-shadow: 0 10px 18px rgba(116, 30, 5, 0.14);
        }

        .avatar.user {
            position: relative;
            overflow: hidden;
            background:
                radial-gradient(circle at 42% 28%, #ffe3d9 0 18%, transparent 19%),
                radial-gradient(circle at 58% 28%, #ffe3d9 0 18%, transparent 19%),
                radial-gradient(circle at 50% 42%, #f3c1ab 0 28%, transparent 29%),
                linear-gradient(180deg, #2b2f46 0 32%, #f6d0bb 33% 100%);
        }

        .avatar.user::before {
            content: "";
            position: absolute;
            left: 0.375rem;
            right: 0.375rem;
            bottom: -0.25rem;
            height: 1.25rem;
            border-radius: 0.7rem 0.7rem 0 0;
            background: linear-gradient(180deg, #151824, #25283b);
        }

        .avatar.user.has-avatar {
            background: rgba(255, 255, 255, 0.86);
        }

        .avatar.user.has-avatar::before {
            display: none;
        }

        .avatar-image {
            width: 100%;
            height: 100%;
            display: none;
            object-fit: cover;
            border-radius: 50%;
        }

        .avatar.user.has-avatar .avatar-image {
            display: block;
        }

        .avatar.butler {
            width: 2.4rem;
            height: 2.4rem;
            object-fit: cover;
            object-position: center top;
        }

        .bubble {
            position: relative;
            max-width: calc(100% - 6rem);
            min-height: 3rem;
            padding: 0.85rem 1.1rem;
            border-radius: 0.78rem;
            background: var(--bg-card);
            color: var(--text-dark);
            font-size: var(--h5-text-bubble);
            line-height: 1.45;
            box-shadow: var(--shadow-bubble);
            overflow-wrap: anywhere;
        }

        .bubble-status {
            display: inline-flex;
            align-items: center;
            margin-bottom: 0.45rem;
            padding: 0.18rem 0.58rem;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.86);
            color: #b65b1f;
            font-size: var(--h5-text-caption);
            font-weight: 800;
            line-height: 1;
            box-shadow: 0 6px 14px rgba(132, 29, 0, 0.08);
        }

        .bubble-status[hidden] {
            display: none;
        }

        .bubble-content:empty {
            display: none;
        }

        .bubble-content p {
            margin: 0;
        }

        .bubble-content p + p {
            margin-top: 0.52rem;
        }

        .bubble.butler::before {
            content: "";
            position: absolute;
            left: -0.55rem;
            top: 1rem;
            width: 1rem;
            height: 1rem;
            background: inherit;
            clip-path: polygon(100% 0, 0 50%, 100% 100%);
        }

        .bubble.user::after {
            content: "";
            position: absolute;
            right: -0.55rem;
            top: 1rem;
            width: 1rem;
            height: 1rem;
            background: inherit;
            clip-path: polygon(0 0, 100% 50%, 0 100%);
        }

        .footer-zone {
            position: fixed;
            left: 50%;
            transform: translateX(-50%);
            width: min(calc(100% - 2rem), 29.25rem);
            bottom: calc(0.95rem + var(--mini-bottom-safe));
            z-index: 5;
        }

        .butler-copy {
            position: relative;
            z-index: 2;
            margin-bottom: 0.65rem;
            color: var(--text-soft);
            opacity: 0.52;
            font-weight: 700;
            line-height: 1.55;
            text-shadow: 0 4px 10px rgba(130, 31, 0, 0.1);
        }

        .butler-copy strong {
            display: block;
            font-size: 1.1rem;
        }

        .butler-copy span {
            display: block;
            margin-top: 0.2rem;
            font-size: 1rem;
        }

        .input-wrap {
            position: relative;
            z-index: 3;
            gap: 0.6rem;
            min-height: 4.25rem;
            padding: 0 1rem;
            border-radius: 1rem;
            background: rgba(231, 178, 182, 0.6);
            border: 2px solid rgba(233, 213, 33, 0.88);
            box-shadow: 0 12px 24px rgba(130, 30, 0, 0.1);
            backdrop-filter: blur(8px);
        }

        .input-wrap input {
            flex: 1;
            width: auto;
            min-width: 0;
            border: none;
            outline: none;
            background: transparent;
            color: #fff;
            font-size: 1rem;
            font-weight: 600;
        }

        .input-wrap input::placeholder {
            color: rgba(255, 255, 255, 0.9);
        }

        .send-btn {
            flex: 0 0 auto;
            width: 2rem;
            height: 2rem;
            border: none;
            background: transparent;
            padding: 0;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .send-btn[disabled] {
            opacity: 0.4;
            cursor: default;
        }

        .send-btn img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
        }

        .butler-photo {
            position: absolute;
            right: 1.25rem;
            bottom: 3rem;
            width: 7.9rem;
            z-index: 0;
            opacity: 0.52;
            pointer-events: none;
            filter: drop-shadow(0 16px 20px rgba(108, 29, 0, 0.16));
        }

        @media (min-width: 768px) {
            .page {
                width: min(100%, 42rem);
                padding-left: 1.2rem;
                padding-right: 1.2rem;
            }
            .quick-row,
            .chat-stage {
                max-width: 38rem;
                margin-left: auto;
                margin-right: auto;
            }
            .quick-row { gap: 2rem; }
            .quick-chip {
                width: min(17rem, calc(100% - 6rem));
                font-size: 1rem;
                padding: 1rem 1.05rem;
            }
            .bubble { max-width: min(24rem, calc(100% - 8rem)); }
            .footer-zone { width: min(calc(100% - 2.4rem), 39.5rem); }
            .butler-photo {
                width: 8.5rem;
                right: 1.45rem;
            }
        }

        @media (min-width: 1024px) {
            .page {
                width: min(100%, 46rem);
                padding-left: 1.4rem;
                padding-right: 1.4rem;
            }
            .quick-row,
            .chat-stage {
                max-width: 41rem;
            }
            .bubble { max-width: min(25.5rem, calc(100% - 8.5rem)); }
            .footer-zone { width: min(calc(100% - 2.8rem), 42.2rem); }
            .butler-photo { width: 8.9rem; }
        }

        @media (max-width: 390px) {
            .page {
                padding-left: 0.8rem;
                padding-right: 0.8rem;
            }

            .quick-row {
                gap: 1.5rem;
            }

            .quick-chip {
                width: min(15rem, calc(100% - 4rem));
                font-size: 0.9rem;
                min-height: 3.7rem;
                padding: 0.86rem 0.95rem;
            }

            .chat-stage {
                min-height: calc(100vh - 7.8rem - var(--mini-bottom-safe));
                padding-top: 3rem;
                padding-bottom: calc(14.8rem + var(--mini-bottom-safe));
            }

            .butler-photo {
                width: 7.1rem;
                right: 1rem;
            }
        }