        * {
            scrollbar-width: none;
            -ms-overflow-style: none;
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        *::-webkit-scrollbar {
            display: none;
            width: 0;
        }
        html {
            max-width: 100vw;
        }

        :root {
            --primary-bg: #f9f9f9;
            --secondary-bg: #ffffff;
            --text-primary: #1a1a1a;
            --text-secondary: #7a7a7a;
            --border-color: #ebebeb;
            --message-sent-bg: var(--accent-color);
            --message-sent-text: #ffffff;
            --message-received-bg: #f0f0f0;
            --message-received-text: #1a1a1a; 
            --header-bg: #ffffff;
            --input-area-bg: #ffffff; 
            --send-btn-bg: var(--accent-color);
            --shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
            --radius: 18px;
            --radius-sm: 14px;
            --radius-xs: 10px;
            --font-family: 'Noto Serif SC', serif;
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            --font-size: 16px;
            --favorite-color: #ffc107;
            --toolbar-btn-bg: var(--message-received-bg);
            --toolbar-btn-color: var(--text-secondary);
            --timestamp-color: var(--text-secondary);
            --primary-bg-rgb: 249, 249, 249;
            --secondary-bg-rgb: 255, 255, 255;
            --bubble-style: 'standard';
            --message-font-family: 'Noto Serif SC', serif;
            --message-font-weight: 400;
            --message-line-height: 1.5;
            --in-chat-avatar-size: 36px;
            /* ---- UX enhancements ---- */
            --focus-ring-width: 3px;
            --focus-ring-color: rgba(var(--accent-color-rgb,197,164,126), 0.38);
            --placeholder-opacity: 0.65;
            --surface-border: rgba(var(--accent-color-rgb,197,164,126), 0.18);
        }

        :root[data-color-theme="gold"] {
            --accent-color: #c5a47e;
            --accent-color-dark: #d4af37;
            --accent-color-rgb: 197, 164, 126;
        }
        :root[data-color-theme="blue"] {
            --accent-color: #7FA6CD;
            --accent-color-dark: #7FA6CD;
            --accent-color-rgb: 127, 166, 205;
        }
        :root[data-color-theme="purple"] {
            --accent-color: #BB9EC7;
            --accent-color-dark: #BB9EC7;
            --accent-color-rgb: 187, 158, 199;
        }
        :root[data-color-theme="green"] {
            --accent-color: #7BC8A4;
            --accent-color-dark: #7BC8A4;
            --accent-color-rgb: 123, 200, 164;
        }
        :root[data-color-theme="pink"] {
            --accent-color: #F4A6B3;
            --accent-color-dark: #F4A6B3;
            --accent-color-rgb: 244, 166, 179;
        }
        :root[data-color-theme="black-white"] {
            --accent-color: #333333;
            --accent-color-dark: #D6D6D6;
            --accent-color-rgb: 51, 51, 51;
            --message-sent-text: #f5f5f5; 
        }
        :root[data-color-theme="pastel"] {
            --accent-color: #A8D8EA;
            --accent-color-dark: #AA96DA;
            --accent-color-rgb: 168, 216, 234;
        }
        :root[data-color-theme="sunset"] {
            --accent-color: #FF9A8B;
            --accent-color-dark: #FF6B6B;
            --accent-color-rgb: 255, 154, 139;
        }
        :root[data-color-theme="forest"] {
            --accent-color: #7BA05B;
            --accent-color-dark: #556B2F;
            --accent-color-rgb: 123, 160, 91;
        }
        :root[data-color-theme="ocean"] {
            --accent-color: #4A90E2;
            --accent-color-dark: #2E5B9A;
            --accent-color-rgb: 74, 144, 226;
        }


        html[data-theme="dark"] {
            --primary-bg: #121212;
            --secondary-bg: #1e1e1e;
            --text-primary: #e5e5e5;
            --text-secondary: #8c8c8c;
            --border-color: #2f2f2f;
            --message-sent-bg: var(--accent-color);
            --message-sent-text: #ffffff;
            --message-received-bg: #2a2a2a;
            --message-received-text: #e5e5e5;
            --header-bg: #1e1e1e;
            --input-area-bg: #1e1e1e;
            --send-btn-bg: var(--accent-color);
            --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            --favorite-color: #ffd700;
            --primary-bg-rgb: 18, 18, 18;
            --secondary-bg-rgb: 30, 30, 30;
        }


        html[data-theme="dark"][data-color-theme="black-white"] {
            --accent-color: #d0d0d0;
            --accent-color-dark: #d0d0d0;
            --accent-color-rgb: 208, 208, 208;
            --message-sent-text: #1a1a1a;
        }
        html[data-theme="dark"][data-color-theme="pastel"] {
            --message-sent-text: #1a2a30;
        }
        html[data-theme="dark"][data-color-theme="sunset"] {
            --message-sent-text: #2a0a00;
        }
        html[data-theme="dark"][data-color-theme="pink"] {
            --message-sent-text: #2a0a10;
        }




        /* ---- Global UX layer (safe overrides) ---- */
        ::selection {
            background: rgba(var(--accent-color-rgb,197,164,126), 0.22);
            color: var(--text-primary);
        }

        html { color-scheme: light dark; }
        html[data-theme="dark"] { color-scheme: dark; }
        html[data-theme="light"] { color-scheme: light; }

        :focus-visible {
            outline: var(--focus-ring-width) solid var(--focus-ring-color) !important;
            outline-offset: 2px;
        }

        input::placeholder,
        textarea::placeholder {
            color: var(--text-secondary);
            opacity: var(--placeholder-opacity);
        }

        small {
            font-size: 12px;
            color: var(--text-secondary);
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.001ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.001ms !important;
                scroll-behavior: auto !important;
            }
        }

        #splash-declaration {
            position: fixed;
            inset: 0;
            z-index: 999999;
            background: #06060e;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-family: 'Noto Serif SC', serif;
            overflow: hidden;
            transition: opacity 0.9s ease;
        }
        #splash-declaration.splash-fade-out {
            opacity: 0 !important;
            pointer-events: none;
        }
        .splash-bg-stars {
            position: absolute;
            inset: 0;
            pointer-events: none;
        }
        .splash-bg-stars span {
            position: absolute;
            border-radius: 50%;
            background: #fff;
            animation: splashTwinkle 3s infinite alternate;
        }
        @keyframes splashTwinkle {
            from { opacity: 0.15; }
            to   { opacity: 0.85; }
        }
        .splash-glow-1 {
            position: absolute;
            width: 500px; height: 500px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(var(--accent-color-rgb,197,164,126), 0.1) 0%, transparent 65%);
            top: 20%; left: 50%;
            transform: translateX(-50%);
            pointer-events: none;
            animation: splashGlowPulse 6s ease-in-out infinite;
        }
        .splash-glow-2 {
            position: absolute;
            width: 300px; height: 300px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(120,100,200, 0.07) 0%, transparent 65%);
            bottom: 15%; right: 10%;
            pointer-events: none;
            animation: splashGlowPulse 8s ease-in-out infinite reverse;
        }
        @keyframes splashGlowPulse {
            0%,100%{ opacity: 0.7; transform: translateX(-50%) scale(1); }
            50%    { opacity: 1;   transform: translateX(-50%) scale(1.15); }
        }
        .splash-inner {
            position: relative;
            z-index: 2;
            width: min(500px, 93vw);
            display: flex;
            flex-direction: column;
            align-items: center;
            animation: splashInnerIn 0.7s cubic-bezier(0.22,1,0.36,1) both;
        }
        @keyframes splashInnerIn {
            from { opacity:0; transform:translateY(24px); }
            to   { opacity:1; transform:translateY(0); }
        }
        .splash-badge {
            display: flex;
            align-items: center;
            gap: 7px;
            background: rgba(var(--accent-color-rgb,197,164,126), 0.1);
            border: 1px solid rgba(var(--accent-color-rgb,197,164,126), 0.22);
            border-radius: 50px;
            padding: 6px 16px;
            margin-bottom: 20px;
            font-size: 11px;
            letter-spacing: 2px;
            color: rgba(var(--accent-color-rgb,197,164,126), 0.8);
        }
        .splash-badge i { font-size: 10px; }
        .splash-dots {
            display: flex;
            gap: 7px;
            margin-bottom: 20px;
        }
        .splash-dot {
            width: 5px; height: 5px;
            border-radius: 50%;
            background: rgba(255,255,255,0.15);
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
        }
        .splash-dot.active {
            background: rgba(var(--accent-color-rgb,197,164,126), 0.85);
            width: 20px;
            border-radius: 3px;
        }
        .splash-dot.done {
            background: rgba(var(--accent-color-rgb,197,164,126), 0.35);
        }
        .splash-card {
            width: 100%;
            background: linear-gradient(145deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.02) 100%);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 24px;
            padding: 0;
            backdrop-filter: blur(30px);
            -webkit-backdrop-filter: blur(30px);
            box-shadow: 0 24px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.07);
            overflow: hidden;
        }
        .splash-card-top-line {
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, rgba(var(--accent-color-rgb,197,164,126),0.6) 40%, rgba(var(--accent-color-rgb,197,164,126),0.6) 60%, transparent 100%);
        }
        .splash-card-body {
            padding: 28px 30px 26px;
        }
        .splash-slides {
            position: relative;
            overflow: hidden;
            min-height: 200px;
        }
        .splash-slide {
            position: absolute;
            inset: 0;
            opacity: 0;
            transform: translateX(28px);
            transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4,0,0.2,1);
            pointer-events: none;
            display: flex;
            flex-direction: column;
        }
        .splash-slide.active {
            opacity: 1;
            transform: translateX(0);
            pointer-events: all;
            position: relative;
        }
        .splash-slide.exit-left {
            opacity: 0;
            transform: translateX(-28px);
            position: absolute;
        }
        .splash-slide-tag {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 10px;
            letter-spacing: 2.5px;
            color: rgba(var(--accent-color-rgb,197,164,126), 0.65);
            margin-bottom: 10px;
        }
        .splash-slide-tag::before {
            content: '';
            display: inline-block;
            width: 16px; height: 1px;
            background: rgba(var(--accent-color-rgb,197,164,126), 0.5);
        }
        .splash-slide-title {
            font-size: 20px;
            font-weight: 600;
            color: rgba(255,255,255,0.92);
            margin-bottom: 18px;
            line-height: 1.35;
        }
        .splash-slide-body {
            font-size: 13.5px;
            line-height: 2;
            color: rgba(255,255,255,0.5);
        }
        .splash-slide-body em {
            color: rgba(var(--accent-color-rgb,197,164,126), 0.85);
            font-style: normal;
        }
        .splash-slide-body strong {
            color: rgba(255,255,255,0.78);
            font-weight: 600;
        }
        .splash-slide-body .splash-highlight-box {
            margin-top: 14px;
            padding: 12px 16px;
            background: rgba(var(--accent-color-rgb,197,164,126), 0.07);
            border-left: 2px solid rgba(var(--accent-color-rgb,197,164,126), 0.45);
            border-radius: 0 8px 8px 0;
            font-size: 12.5px;
            color: rgba(255,255,255,0.55);
            line-height: 1.8;
        }
        .splash-pledge-desc {
            font-size: 12.5px;
            color: rgba(255,255,255,0.4);
            margin-bottom: 16px;
            line-height: 1.8;
        }
        .splash-pledge-required {
            width: 100%;
            background: rgba(var(--accent-color-rgb,197,164,126), 0.08);
            border: 1px dashed rgba(var(--accent-color-rgb,197,164,126), 0.4);
            border-radius: 10px;
            padding: 12px 16px;
            font-size: 14px;
            font-family: 'Noto Serif SC', serif;
            color: rgba(var(--accent-color-rgb,197,164,126), 0.85);
            text-align: center;
            margin-bottom: 14px;
            line-height: 1.7;
            cursor: text;
            user-select: all;
            -webkit-user-select: all;
        }
        .splash-pledge-input {
            width: 100%;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 10px;
            padding: 13px 16px;
            font-size: 14px;
            color: rgba(255,255,255,0.85);
            font-family: 'Noto Serif SC', serif;
            outline: none;
            transition: border-color 0.3s, box-shadow 0.3s;
            text-align: center;
            caret-color: rgba(var(--accent-color-rgb,197,164,126), 0.9);
            box-sizing: border-box;
        }
        .splash-pledge-input:focus {
            border-color: rgba(var(--accent-color-rgb,197,164,126), 0.5);
            box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb,197,164,126), 0.08);
        }
        .splash-pledge-input.correct {
            border-color: rgba(100,200,120,0.6);
            box-shadow: 0 0 0 3px rgba(100,200,120,0.08);
            color: #a5d6a7;
        }
        @keyframes splashShake {
            0%,100%{transform:translateX(0)}
            20%{transform:translateX(-7px)}
            60%{transform:translateX(7px)}
            80%{transform:translateX(-4px)}
        }
        .splash-pledge-hint {
            font-size: 11.5px;
            color: rgba(255,255,255,0.36);
            text-align: center;
            margin-top: 10px;
            min-height: 17px;
            transition: color 0.3s;
            letter-spacing: 0.5px;
        }
        .splash-pledge-hint.ok { color: rgba(120,210,140,0.8); }
        .splash-divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
            margin: 22px 0;
        }
        .splash-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 30px 24px;
        }
        .splash-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 10px 22px;
            border-radius: 50px;
            cursor: pointer;
            font-family: 'Noto Serif SC', serif;
            font-size: 13px;
            font-weight: 400;
            transition: all 0.25s ease;
            white-space: nowrap;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }
        .splash-btn i { font-size: 10px; }
        .splash-btn-ghost {
            background: transparent;
            color: rgba(255,255,255,0.3);
            border: 1px solid rgba(255,255,255,0.09);
        }
        .splash-btn-ghost:hover, .splash-btn-ghost:active {
            color: rgba(255,255,255,0.6);
            border-color: rgba(255,255,255,0.18);
            background: rgba(255,255,255,0.04);
        }
        .splash-btn-ghost:disabled {
            opacity: 0.25;
            cursor: default;
            pointer-events: none;
        }
        .splash-btn-next {
            background: rgba(var(--accent-color-rgb,197,164,126), 0.12);
            color: rgba(var(--accent-color-rgb,197,164,126), 0.9);
            border: 1px solid rgba(var(--accent-color-rgb,197,164,126), 0.28);
        }
        .splash-btn-next:hover, .splash-btn-next:active {
            background: rgba(var(--accent-color-rgb,197,164,126), 0.22);
        }
        .splash-btn-enter {
            background: rgba(var(--accent-color-rgb,197,164,126), 0.18);
            color: rgba(var(--accent-color-rgb,197,164,126), 0.5);
            border: 1px solid rgba(var(--accent-color-rgb,197,164,126), 0.2);
            cursor: default;
            transition: all 0.4s ease;
        }
        .splash-btn-enter.ready {
            background: rgba(var(--accent-color-rgb,197,164,126), 0.9);
            color: #fff;
            border-color: transparent;
            cursor: pointer;
            box-shadow: 0 4px 20px rgba(var(--accent-color-rgb,197,164,126), 0.35);
        }
        .splash-btn-enter.ready:hover, .splash-btn-enter.ready:active {
            background: rgba(var(--accent-color-rgb,197,164,126), 1);
            box-shadow: 0 6px 28px rgba(var(--accent-color-rgb,197,164,126), 0.5);
        }
        .splash-page-num {
            font-size: 11px;
            color: rgba(255,255,255,0.2);
            letter-spacing: 1.5px;
            min-width: 36px;
            text-align: center;
        }
        .message.rounded {
            border-radius: var(--radius);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        .message.rounded-large {
            border-radius: 28px;
            box-shadow: 0 3px 12px rgba(0,0,0,0.1);
        }
        .message.square {
            border-radius: 8px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        }
        .message.rounded-sent {
            border-radius: var(--radius) var(--radius) 6px var(--radius);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        .message.rounded-received {
            border-radius: var(--radius) var(--radius) var(--radius) 6px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        .message-sent { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
        .message-received { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }

        html, body {
            width: 100vw;
            max-width: 100vw;
            overflow-x: hidden !important;
            overscroll-behavior-x: none;
            margin: 0;
            padding: 0;
        }

        
        body {
            background-color: var(--primary-bg);
            color: var(--text-primary);
            transition: background-color 0.5s ease, color 0.5s ease;
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden; 
            font-family: var(--font-family);
            font-weight: 400;
            position: absolute; 
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            font-size: var(--font-size);
            line-height: 1.65;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            opacity: 0;
            animation: delayedShow 0.8s ease 0.2s forwards;
        }
        @keyframes delayedShow {
            to {
                opacity: 1;
            }
        }
        body::before {
            content: "";
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            pointer-events: none;
            background-color: var(--primary-bg);
            background-image:
                radial-gradient(700px 360px at 15% 0%, rgba(var(--accent-color-rgb,197,164,126), 0.06) 0%, transparent 60%),
                radial-gradient(650px 340px at 90% 10%, rgba(var(--accent-color-rgb,197,164,126), 0.05) 0%, transparent 62%),
                linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0) 48%, rgba(0,0,0,0.03) 100%),
                var(--chat-bg-image, linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0)));
            background-size: cover;
            background-position: center center;
            background-repeat: no-repeat;
            transition: background-color 0.5s ease;
            will-change: transform;
        }

        .header {
            padding: 0;
            padding-top: env(safe-area-inset-top, 0px);
            border-bottom: 1px solid var(--border-color);
            background-color: var(--header-bg);
            opacity: 0.82;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            box-shadow: 0 1px 0 rgba(0,0,0,0.06);
            z-index: 10;
            flex-shrink: 0;
            position: relative;
            display: flex;
            flex-direction: column;
            transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, opacity 0.3s ease;
        }
        .header:hover {
            opacity: 1;
        }

        body.immersive-mode .header {
            transform: translateY(-110%);
            opacity: 0;
            pointer-events: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.4s ease;
        }
        body.immersive-mode .chat-container {
            padding-top: calc(12px + env(safe-area-inset-top, 0px));
        }
        #immersive-exit-btn {
            display: none;
            position: fixed;
            bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
            right: 20px;
            left: auto;
            top: auto;
            transform: none;
            z-index: 9999;
            background: rgba(var(--accent-color-rgb), 0.12);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(var(--accent-color-rgb), 0.22);
            border-radius: 14px;
            width: 34px;
            height: 34px;
            padding: 0;
            font-size: 15px;
            color: var(--accent-color);
            cursor: grab;
            letter-spacing: 0;
            opacity: 0.38;
            transition: background 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
            font-family: var(--font-family);
            align-items: center;
            justify-content: center;
            box-shadow: 0 3px 10px rgba(0,0,0,0.12);
            touch-action: none;
        }
        #immersive-exit-btn:hover {
            background: rgba(var(--accent-color-rgb), 0.26);
            opacity: 0.95;
            box-shadow: 0 8px 24px rgba(0,0,0,0.18);
            transform: translateY(-1px);
        }
        #immersive-exit-btn.dragging {
            cursor: grabbing;
            box-shadow: 0 8px 24px rgba(0,0,0,0.25);
            transition: none;
        }
        body.immersive-mode #immersive-exit-btn {
            display: flex;
        }

        .header-inner {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 560px;
            margin: 0 auto;
            padding: 4px 10px 4px;
            width: 100%;
            gap: 4px;
        }

        .avatar {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            cursor: pointer;
            background-color: var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            border: 2px solid transparent;
            transition: var(--transition);
            order: 2;
        }
      .header-motto {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 2px 24px 4px;
        margin: 0 auto;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 10px;
        font-family: 'Inter', 'Noto Serif SC', 'Cormorant Garamond', serif, -apple-system, BlinkMacSystemFont, sans-serif;
        font-weight: 350;
        letter-spacing: 3px;
        font-style: normal;
        text-transform: uppercase;
        color: var(--accent-color);
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        transition: all 0.6s cubic-bezier(0.25, 0.1, 0.15, 1);
        gap: 14px;
        opacity: 0.7;
        mix-blend-mode: normal;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        animation: mottoFadeIn 1.2s ease 0.6s both;
        z-index: 1;
        }
        @keyframes mottoFadeIn {
    from { opacity: 0; letter-spacing: 6px; }
    to { opacity: 0.8; letter-spacing: 3px; }
        }

        .header-motto::before,
        .header-motto::after {
        content: "";
        width: 28px;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
        opacity: 0.4;
        transition: all 0.6s cubic-bezier(0.25, 0.1, 0.15, 1);
        }

        .header-motto:hover {
        letter-spacing: 4.5px;
        opacity: 1;
        cursor: default;
        transform: scale(1.01);
        }

        .header-motto:hover::before,
        .header-motto:hover::after {
        width: 48px;
        opacity: 0.75;
        }

        html[data-theme="dark"] .header-motto {
        color: var(--accent-color);
        opacity: 0.88;
        text-shadow: 0 0 18px rgba(var(--accent-color-rgb), 0.25);
        font-weight: 300;
        }

        html[data-theme="dark"] .header-motto::before,
        html[data-theme="dark"] .header-motto::after {
        background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
        opacity: 0.28;
        }

        html[data-theme="dark"] .header-motto:hover {
        text-shadow: 0 0 32px rgba(var(--accent-color-rgb), 0.5);
        }

        @media (max-width: 480px) {
        .header-motto {
        padding: 2px 14px 4px;
        font-size: 10.5px;
        letter-spacing: 2.5px;
        gap: 10px;
        }
        .header-motto::before,
        .header-motto::after {
    width: 16px;
        }
        }
        

        .user-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            min-width: 52px;
        }

        .avatar:hover {
            border-color: var(--accent-color);
            transform: scale(1.05);
        }
        html[data-theme="dark"] .avatar:hover {
            border-color: var(--accent-color-dark);
        }
        .avatar > img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        .username {
            font-weight: 600;
            font-size: 11.5px;
            cursor: pointer;
            transition: var(--transition);
            order: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 64px;
            visibility: visible !important;
            opacity: 1 !important;
            color: var(--text-primary);
            text-align: center;
            letter-spacing: 0.2px;
        }
        .username:hover {
            color: var(--accent-color);
        }
        html[data-theme="dark"] .username:hover {
            color: var(--accent-color-dark);
        }
        .status {
            font-size: 10px;
            font-weight: 500;
            color: var(--text-secondary);
            cursor: pointer;
            order: 3;
            padding: 1px 5px;
            border-radius: 6px;
            transition: background-color 0.3s ease;
            white-space: nowrap;
        }
        .status:hover {
            background-color: var(--message-received-bg);
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 2px;
            flex: 1;
            justify-content: center;
        }
        .action-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            transition: var(--transition);
        }
        .action-btn:hover {
            background-color: var(--message-received-bg);
            color: var(--text-primary);
            transform: translateY(-1px) scale(1.07);
        }

        .main-chat-area {
            flex: 1;
            position: relative;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            overflow-x: hidden;
            padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        }
        .chat-container {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 25px 15px;
            display: flex;
            flex-direction: column;
            gap: 2px;
            transition: background-color 0.5s ease;
            background-color: transparent;
            scrollbar-width: none;
            -ms-overflow-style: none;
            scroll-behavior: smooth;
            width: 100%;
            box-sizing: border-box;
            will-change: scroll-position;
            -webkit-overflow-scrolling: touch;
        }
        .chat-container::-webkit-scrollbar {
            display: none;
            width: 0;
        }

        
        .message-wrapper {
            display: flex;
            max-width: 85%;
            margin-bottom: 12px;
            animation: messageAppear 0.4s ease-out forwards;
            opacity: 0;
            position: relative;
            gap: 10px;
            align-items: var(--avatar-align, flex-end);
            flex-shrink: 0;
        }
        .message-avatar {
            width: var(--in-chat-avatar-size);
            height: var(--in-chat-avatar-size);
            border-radius: 50%;
            flex-shrink: 0;
            background-color: var(--border-color);
            transition: all 0.3s ease;
        }
        .message-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        .message-avatar.hidden {
            visibility: hidden;
        }
        body.always-show-avatar .message-avatar.hidden {
            visibility: visible;
        }
        .message-content-wrapper {
            display: flex;
            flex-direction: column;
            max-width: 100%;
        }

        @keyframes messageAppear {
            from {
                opacity: 0;
                transform: translateY(8px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .message-wrapper.sent {
            align-self: flex-end;
            flex-direction: row-reverse;
        }
        .message-wrapper.sent .message-content-wrapper {
            align-items: flex-end;
        }
        .message-wrapper.received {
            align-self: flex-start;
            flex-direction: row;
        }
        .message-wrapper.received .message-content-wrapper {
            align-items: flex-start;
        }

        .message {
            padding: 12px 18px;
            border-radius: var(--radius);
            word-wrap: break-word;
            line-height: var(--message-line-height);
            box-shadow: var(--shadow);
            transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
            position: relative;
            overflow: hidden;
            min-width: 50px;
            font-family: var(--message-font-family);
            font-weight: var(--message-font-weight);
        }

        .message-sent {
            background-color: var(--message-sent-bg, var(--accent-color));
            color: var(--message-sent-text, #ffffff);
            border-bottom-right-radius: 6px;
        }
        html[data-theme="dark"] .message-sent {
            background-color: var(--message-sent-bg, var(--accent-color-dark));
        }

        .message-received {
            background-color: var(--message-received-bg);
            color: var(--message-received-text, var(--text-primary));
            border-bottom-left-radius: 6px;
        }

        .message-image-bubble-none {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0 !important;
            border-radius: 0 !important;
        }
        .message-image-bubble-none::before,
        .message-image-bubble-none::after {
            display: none !important;
        }
        .message-image-only {
            display: block;
            border-radius: 12px !important;
        }

        .message-meta {
            display: flex;
            align-items: center; 
            gap: 8px;
            margin: 6px 10px 0 10px;
            opacity: 0.7;
            font-size: 11px;
            color: var(--text-secondary);
            position: relative;
            height: 20px; 
        }
        .message-meta-actions {
            position: absolute;
            top: -12px;
            background-color: var(--secondary-bg);
            border-radius: 20px;
            box-shadow: var(--shadow);
            display: flex;
            padding: 4px 6px;
            opacity: 0;
            transform: translateY(5px);
            transition: var(--transition);
            z-index: 2;
        }
        .message-content-wrapper:hover .message-meta-actions {
            opacity: 1;
            transform: translateY(0);
        }
        .message-wrapper.sent .message-meta-actions {
            left: 0;
        }
        .message-wrapper.received .message-meta-actions {
            right: 0;
        }

        .meta-action-btn {
            font-size: 13px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
            padding: 6px 8px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none; 
            border: none;   
        }
        
        .meta-action-btn:hover {
            transform: scale(1.2);
            color: var(--text-primary);
            background-color: var(--border-color);
        }
        .meta-action-btn.delete-btn:hover {
    color: #ff4757 !important; 
    background-color: rgba(255, 71, 87, 0.1);
        }

        .meta-action-btn.favorited {
            color: #ffc107 !important; 
        }
        

        .timestamp {
            font-weight: 500;
            text-shadow: 0 1px 1px rgba(0,0,0,0.1);
        }
        .read-receipt {
            font-size: 12px;
        }
        .read-receipt.read {
            color: var(--accent-color);
        }
        html[data-theme="dark"] .read-receipt.read {
            color: var(--accent-color-dark);
        }

        .input-area-wrapper {
            flex-shrink: 0;
            background-color: var(--input-area-bg);
            transition: background-color 0.5s ease;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 50;
            padding-bottom: env(safe-area-inset-bottom, 0px);
            padding-left: env(safe-area-inset-left, 0px);
            padding-right: env(safe-area-inset-right, 0px);
        }

        body.immersive-mode .input-area-wrapper {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
        }
        body.immersive-mode .main-chat-area {
            padding-bottom: 80px;
        }
        .input-area {
            display: flex;
            padding: 12px 15px;
            gap: 10px;
            border-top: 1px solid var(--border-color);
            align-items: flex-end;
            transition: border-color 0.5s ease;
        }
        .message-input {
            flex: 1;
            border: 1px solid transparent;
            border-radius: 28px;
            padding: 12px 18px;
            background-color: var(--primary-bg);
            color: var(--text-primary);
            resize: none;
            outline: none;
            max-height: 120px;
            min-height: 46px;
            transition: var(--transition);
            font-weight: 500;
            font-family: var(--font-family);
            font-size: inherit;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .message-input:focus {
            border-color: var(--accent-color);
            background-color: var(--primary-bg);
            box-shadow: none;
            transform: none;
            outline: none !important;
        }
        .message-input:focus-visible {
            outline: none !important;
        }
        html[data-theme="dark"] .message-input:focus {
            border-color: var(--accent-color-dark);
        }

        .input-buttons {
            display: flex;
            gap: 8px;
            position: relative;
        }
        .input-btn {
            border: none;
            border-radius: 50%;
            width: 46px;
            height: 46px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition);
            flex-shrink: 0;
        }
        .input-btn:hover {
            transform: translateY(-1px) scale(1.07);
            filter: brightness(1.06);
        }

        .send-btn, .batch-btn.active {
            background-color: var(--send-btn-bg, var(--accent-color));
            color: var(--send-btn-icon-color, #fff);
        }
        html[data-theme="dark"] .send-btn, html[data-theme="dark"] .batch-btn.active {
            background-color: var(--send-btn-bg, var(--accent-color-dark));
        }

        .coin-btn, .batch-btn, .continue-btn, .attachment-btn, .poke-btn, .combo-btn {
            background-color: var(--toolbar-btn-bg, var(--message-received-bg));
            color: var(--toolbar-btn-color, var(--text-secondary));
        }
        .attachment-btn:hover, .continue-btn:hover, .batch-btn:hover, .coin-btn:hover, .poke-btn:hover, .combo-btn:hover {
            color: var(--text-primary);
        }

        #reply-preview-container {
            padding: 0 15px;
        }
        .reply-preview {
            background-color: rgba(var(--primary-bg-rgb), 0.9);
            border-left: 3px solid var(--accent-color);
            padding: 6px 12px 6px 10px;
            margin-top: 6px;
            border-radius: 0 8px 8px 0;
            font-size: 13px;
            color: var(--text-secondary);
            display: flex;
            justify-content: space-between;
            align-items: center;
            animation: fadeIn 0.2s ease;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        }
        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .reply-preview-content {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-right: 10px;
        }

        .reply-preview-remove {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 14px;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: var(--transition);
        }
        .reply-preview-remove:hover {
            background-color: var(--border-color);
            color: var(--text-primary);
            transform: scale(1.1);
        }

        .reply-indicator {
            display: flex;
            flex-direction: column;
            border-left: 3px solid var(--accent-color);
            padding: 5px 10px 5px 9px;
            margin-bottom: 7px;
            background-color: rgba(var(--primary-bg-rgb), 0.55);
            border-radius: 0 8px 8px 0;
            cursor: pointer;
            overflow: hidden;
            max-width: 100%;
            transition: background 0.18s, opacity 0.18s;
            user-select: none;
            -webkit-user-select: none;
        }
        .reply-indicator:hover {
            background-color: rgba(var(--accent-color-rgb), 0.13);
            opacity: 0.92;
        }
        .reply-indicator-sender {
            font-size: 11px;
            font-weight: 600;
            color: var(--accent-color);
            opacity: 1;
            margin-bottom: 2px;
            letter-spacing: 0.3px;
        }
        .reply-indicator-text {
            font-size: 12px;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-style: italic;
            opacity: 0.85;
            max-width: 200px;
        }

        .message-wrapper.sent .reply-indicator {
            background-color: rgba(255, 255, 255, 0.18);
            border-left-color: rgba(255, 255, 255, 0.7);
        }
        .message-wrapper.sent .reply-indicator-sender {
            color: var(--message-sent-text, rgba(255, 255, 255, 0.9));
            opacity: 0.9;
        }
        .message-wrapper.sent .reply-indicator-text {
            color: var(--message-sent-text, rgba(255, 255, 255, 0.75));
            opacity: 0.75;
        }
        .message-wrapper.reply-jump-flash .message {
            animation: replyJumpFlash 1s ease;
        }
        @keyframes replyJumpFlash {
            0%   { box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb),0.55); }
            60%  { box-shadow: 0 0 0 7px rgba(var(--accent-color-rgb),0); }
            100% { box-shadow: none; }
        }
        html[data-theme="dark"] .message-wrapper.sent .reply-indicator {
            background-color: rgba(0, 0, 0, 0.18);
            border-left-color: rgba(255,255,255,0.35);
        }
        .time-fmt-opt.active {
            border: 1.5px solid var(--accent-color) !important;
            background: rgba(var(--accent-color-rgb), 0.08);
            color: var(--accent-color);
        }
        .time-fmt-opt.active i, .time-fmt-opt.active span { color: var(--accent-color); }
        .modal-btn.active {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
        }

        .modal {
            z-index: 2000 !important;
        }

        .modal-content {
            z-index: 2001 !important;
        }

        .group-sender-name {
            font-size: 11px;
            font-weight: 600;
            color: var(--accent-color);
            margin-bottom: 2px;
            opacity: 0.85;
            padding: 0 2px;
        }

        .message-note {
            background-color: rgba(var(--accent-color-rgb), 0.1);
            border-left: 3px solid var(--accent-color);
            padding: 10px 14px;
            font-size: 13px;
            color: var(--text-primary);
            margin-top: 10px;
            border-radius: var(--radius);
            font-style: italic;
            opacity: 0.9;
        }
        html[data-theme="dark"] .message-note {
            color: var(--text-primary);
        }

        .system-message {
            align-self: center;
            background: transparent;
            color: var(--text-secondary);
            font-size: 12px;
            padding: 5px 20px;
            border-radius: 0;
            margin: 12px auto;
            box-shadow: none;
            border: none;
            letter-spacing: 1.5px;
            max-width: 80%;
            text-align: center;
            animation: systemMsgPop 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
            opacity: 0;
            transform: scale(0.88) translateY(6px);
            position: relative;
        }
        .system-message::before,
        .system-message::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 24px;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(var(--accent-color-rgb),0.35));
        }
        .system-message::before { right: 100%; transform: translateX(8px); }
        .system-message::after { left: 100%; transform: translateX(-8px) scaleX(-1); }
        @keyframes systemMsgPop {
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        .call-event-message {
            display: flex;
            justify-content: center;
            padding: 4px 16px;
            margin: 4px 0;
        }
        .call-event-pill {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            border-radius: 20px;
            padding: 6px 13px 6px 10px;
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 0.2px;
            border: 1px solid;
            position: relative;
            animation: systemMsgPop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
            opacity: 0;
            transform: scale(0.9) translateY(4px);
        }
        .call-event-pill--ended {
            background: rgba(var(--accent-color-rgb, 180,140,100), 0.06);
            border-color: rgba(var(--accent-color-rgb, 180,140,100), 0.18);
            color: var(--text-secondary);
        }
        .call-event-pill--rejected {
            background: rgba(255, 80, 80, 0.06);
            border-color: rgba(255, 80, 80, 0.2);
            color: rgba(255, 80, 80, 0.75);
        }
        .call-event-icon {
            font-size: 11px;
            opacity: 0.75;
            flex-shrink: 0;
        }
        .call-event-label {
            max-width: 180px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .call-event-detail {
            font-variant-numeric: tabular-nums;
            opacity: 0.65;
            font-size: 11px;
            flex-shrink: 0;
        }
        .call-event-detail::before { content: '·'; margin-right: 4px; }
        .call-event-delete {
            background: none;
            border: none;
            padding: 0 0 0 4px;
            cursor: pointer;
            color: inherit;
            opacity: 0;
            font-size: 10px;
            transition: opacity 0.15s;
            flex-shrink: 0;
        }
        .call-event-pill:hover .call-event-delete { opacity: 0.5; }
        .call-event-delete:hover { opacity: 1 !important; }

        .dm-danger-cards-row {
            display: flex;
            gap: 10px;
        }
        .dm-danger-card-half {
            flex: 1;
            min-width: 0;
        }
        .dm-danger-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 14px 10px;
            border-radius: 14px;
            border: 1.5px solid;
            cursor: pointer;
            text-align: center;
            transition: all 0.18s;
            background: none;
        }
        .dm-danger-card:active { transform: scale(0.96); }
        .dm-danger-card-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            flex-shrink: 0;
        }
        .dm-danger-card-body { display: flex; flex-direction: column; gap: 2px; }
        .dm-danger-card-title { font-size: 13px; font-weight: 700; }
        .dm-danger-card-desc { font-size: 11px; opacity: 0.65; line-height: 1.3; }
        .dm-danger-card-orange {
            border-color: rgba(255,140,40,0.28);
            color: #e07830;
        }
        .dm-danger-card-orange .dm-danger-card-icon {
            background: rgba(255,140,40,0.1);
            color: #e07830;
        }
        .dm-danger-card-orange:hover { background: rgba(255,140,40,0.07); border-color: rgba(255,140,40,0.45); }
        .dm-danger-card-red {
            border-color: rgba(220,50,50,0.28);
            color: #d03030;
        }
        .dm-danger-card-red .dm-danger-card-icon {
            background: rgba(220,50,50,0.1);
            color: #d03030;
        }
        .dm-danger-card-red:hover { background: rgba(220,50,50,0.07); border-color: rgba(220,50,50,0.45); }

        .setting-pill-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 11px 14px;
            background: var(--primary-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            cursor: pointer;
            transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
            user-select: none;
        }
        .setting-pill-row:hover {
            border-color: var(--accent-color);
            box-shadow: 0 2px 10px rgba(var(--accent-color-rgb),0.12);
        }
        .setting-pill-row:active { transform: scale(0.98); }
        .setting-pill-icon {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            background: rgba(var(--accent-color-rgb), 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent-color);
            font-size: 13px;
            flex-shrink: 0;
            transition: background 0.2s;
        }
        .setting-pill-row.active .setting-pill-icon {
            background: rgba(var(--accent-color-rgb), 0.2);
        }
        .setting-pill-label {
            flex: 1;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .setting-pill-switch {
            width: 42px;
            height: 23px;
            border-radius: 23px;
            background: var(--border-color);
            position: relative;
            flex-shrink: 0;
            transition: background 0.25s cubic-bezier(0.4,0,0.2,1);
        }
        .setting-pill-row.active .setting-pill-switch {
            background: var(--accent-color);
        }
        .setting-pill-knob {
            position: absolute;
            width: 17px;
            height: 17px;
            border-radius: 50%;
            background: #fff;
            top: 3px;
            left: 3px;
            transition: left 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s;
            box-shadow: 0 1px 4px rgba(0,0,0,0.2);
        }
        .setting-pill-row.active .setting-pill-knob {
            left: 22px;
        }

        body.with-background .header,
        body.with-background .input-area-wrapper {
            background-color: rgba(var(--secondary-bg-rgb), 0.3);
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
        }
        body.with-background .input-area {
            border-top-color: transparent;
        }
        body.with-background .message-received {
            background-color: rgba(var(--secondary-bg-rgb), 0.95);
        }
        body.with-background .message-input {
            background-color: rgba(var(--primary-bg-rgb), 0.8);
        }
        body.with-background .message-input:focus {
            background-color: rgba(var(--primary-bg-rgb), 0.8);
        }
        body.with-background .batch-preview {
            background-color: rgba(var(--secondary-bg-rgb), 0.9);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }
        body.with-background .message-meta {
            text-shadow: 0 1px 2px rgba(0,0,0,0.2);
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
            animation: modalBgFadeIn 0.3s ease;
        }
        @keyframes modalBgFadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }
        .modal-content {
            background-color: var(--secondary-bg);
            border-radius: var(--radius);
            padding: 24px 24px 0;
            width: 90%;
            max-width: 400px;
            max-height: 80vh;
            overflow-y: auto;
            border: 1px solid var(--surface-border);
            box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24), 0 2px 10px rgba(0, 0, 0, 0.10);
            animation: modalContentSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            transition: background-color 0.5s ease;
            scrollbar-width: none;
            -ms-overflow-style: none;
            transform: translateY(20px) scale(0.95);
            opacity: 0;
            display: flex;
            flex-direction: column;
        }
        .modal-content::-webkit-scrollbar {
            display: none;
            width: 0;
        }
        @keyframes modalContentSlideIn {
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }
        .modal-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: color 0.5s ease;
            flex-shrink: 0;
        }
        .modal-title i {
            color: var(--accent-color);
        }
        html[data-theme="dark"] .modal-title i {
            color: var(--accent-color-dark);
        }
        .modal-input, .modal-textarea {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background-color: var(--primary-bg);
            color: var(--text-primary);
            margin-bottom: 16px;
            transition: var(--transition);
            font-family: var(--font-family);
        }
        .modal-textarea {
            resize: vertical;
            min-height: 80px;
        }
        .modal-input:focus, .modal-textarea:focus {
            border-color: var(--accent-color);
            transform: none;
            box-shadow: none;
            outline: none !important;
        }
        .modal-input:focus-visible, .modal-textarea:focus-visible {
            outline: none !important;
        }
        html[data-theme="dark"] .modal-input:focus, html[data-theme="dark"] .modal-textarea:focus {
            border-color: var(--accent-color-dark);
        }
        .modal-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 16px;
            flex-shrink: 0;
        }
        .modal-btn {
            padding: 10px 20px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-weight: 600;
            transition: var(--transition);
            font-family: var(--font-family);
        }
        .modal-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .modal-btn-primary {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
        }
        html[data-theme="dark"] .modal-btn-primary {
            background-color: var(--accent-color-dark);
        }
        .modal-btn-primary:hover:not(:disabled) {
            filter: brightness(1.1);
            transform: translateY(-1px);
        }
        .modal-btn-secondary {
            background-color: var(--message-received-bg);
            color: var(--text-primary);
        }
        .modal-btn-secondary:hover:not(:disabled) {
            background-color: var(--border-color);
            transform: translateY(-1px);
        }

        .notif-toggle-slider {
            position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
            background: var(--border-color); border-radius: 24px; transition: 0.3s;
        }
        .notif-toggle-slider::before {
            content: ''; position: absolute; height: 18px; width: 18px;
            left: 3px; bottom: 3px; background: white; border-radius: 50%;
            transition: 0.3s; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
        }
        #notif-permission-toggle:checked + .notif-toggle-slider,
        input[type="checkbox"]:checked + .notif-toggle-slider {
            background: var(--accent-color);
        }
        #notif-permission-toggle:checked + .notif-toggle-slider::before,
        input[type="checkbox"]:checked + .notif-toggle-slider::before {
            transform: translateX(20px);
        }

        #daily-greeting-modal {
            position: fixed; inset: 0; z-index: 9998;
            background: rgba(0,0,0,0.78);
            backdrop-filter: blur(28px) saturate(1.6);
            -webkit-backdrop-filter: blur(28px) saturate(1.6);
            display: flex; align-items: center; justify-content: center;
            animation: dgOverlayIn 0.5s cubic-bezier(0.22,1,0.36,1);
            background-size: cover; background-position: center; background-repeat: no-repeat;
        }
        @keyframes dgOverlayIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        #daily-greeting-modal.hidden { display: none; }

        @keyframes dgCardIn {
            from { opacity:0; transform: translateY(50px) scale(0.86); filter: blur(12px); }
            to { opacity:1; transform: translateY(0) scale(1); filter: blur(0); }
        }

        .dg-header-band {
            background: linear-gradient(150deg,
                rgba(var(--accent-color-rgb), 1) 0%,
                rgba(var(--accent-color-rgb), 0.78) 50%,
                rgba(var(--accent-color-rgb), 0.55) 100%
            );
            padding: 24px 24px 22px;
            position: relative;
            overflow: hidden;
            border-radius: 36px 36px 0 0;
            min-height: 126px;
            display: flex; flex-direction: column; justify-content: flex-end;
            z-index: 2;
        }
        .dg-header-band::before {
            content: '';
            position: absolute; inset: 0; z-index: 0;
            background:
                radial-gradient(ellipse at 85% 8%, rgba(255,255,255,0.28) 0%, transparent 48%),
                radial-gradient(ellipse at 10% 95%, rgba(0,0,0,0.2) 0%, transparent 42%),
                radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.05) 0%, transparent 65%);
        }
        .dg-header-band::after {
            content: '✦  DAILY  BULLETIN  ✦';
            position: absolute; top: 17px; left: 0; right: 0;
            text-align: center;
            font-size: 7.5px; letter-spacing: 5px; opacity: 0.3;
            color: #fff; font-weight: 700; text-transform: uppercase;
            font-family: monospace;
            animation: bulletinFade 4s ease-in-out infinite;
        }
        @keyframes bulletinFade {
            0%,100% { opacity:0.25; }
            50% { opacity:0.45; }
        }

        .dg-header-band-shimmer {
            position: absolute; inset: 0; z-index: 1;
            background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,0.18) 50%, transparent 75%);
            animation: shimmerSlide 4s ease-in-out infinite;
        }
        @keyframes shimmerSlide {
            0% { transform: translateX(-160%); }
            55%, 100% { transform: translateX(200%); }
        }

        .dg-header-band-shimmer::after {
            content: '';
            position: absolute; top: 0; right: 0;
            width: 80px; height: 80px;
            border-radius: 0 36px 0 80px;
            background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15), transparent 65%);
        }

        .dg-header-band-wave {
            position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
            height: 72px;
            background: linear-gradient(
                to bottom,
                transparent 0%,
                rgba(var(--secondary-bg-rgb, 255,255,255), 0.15) 30%,
                rgba(var(--secondary-bg-rgb, 255,255,255), 0.55) 60%,
                rgba(var(--secondary-bg-rgb, 255,255,255), 0.9) 85%,
                var(--secondary-bg) 100%
            );
            pointer-events: none;
        }
        .daily-greeting-card.has-card-bg .dg-header-band-wave {
            background: linear-gradient(
                to bottom,
                transparent 0%,
                rgba(0,0,0,0.04) 40%,
                rgba(0,0,0,0.1) 100%
            );
        }

        .dg-header-top {
            display: flex; align-items: flex-end; gap: 20px;
            position: relative; z-index: 3;
        }
        .dg-emoji-circle {
            width: 56px; height: 56px;
            border-radius: 20px;
            background: rgba(255,255,255,0.15);
            display: flex; align-items: center; justify-content: center;
            font-size: 26px; flex-shrink: 0;
            border: 1.5px solid rgba(255,255,255,0.42);
            box-shadow:
                0 8px 24px rgba(0,0,0,0.2),
                inset 0 1.5px 0 rgba(255,255,255,0.4),
                inset 0 -1px 0 rgba(0,0,0,0.12);
            animation: floatEmoji 3.6s ease-in-out infinite;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        @keyframes floatEmoji {
            0%,100% { transform: translateY(0) rotate(-4deg) scale(1); }
            50% { transform: translateY(-8px) rotate(4deg) scale(1.05); }
        }
        .dg-header-text { flex: 1; }
        .dg-festival-label {
            font-size: 9px; letter-spacing: 4px; text-transform: uppercase;
            color: rgba(255,255,255,0.72); margin-bottom: 6px;
            font-family: monospace;
        }
        .dg-main-title {
            font-size: 28px; font-weight: 700; color: #fff;
            text-shadow: 0 3px 18px rgba(0,0,0,0.3);
            letter-spacing: 2px; line-height: 1.1;
        }

        .dg-date-stamp {
            position: relative; z-index: 3;
            margin-top: 10px; font-size: 10px;
            color: rgba(255,255,255,0.5); letter-spacing: 2px;
            display: flex; align-items: center; gap: 10px;
            font-family: monospace;
        }
        .dg-date-stamp::before, .dg-date-stamp::after {
            content: '';
            flex: 1; height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28));
        }
        .dg-date-stamp::after {
            background: linear-gradient(270deg, transparent, rgba(255,255,255,0.28));
        }

        .dg-body {
            padding: 18px 18px 18px;
            display: flex; flex-direction: column; gap: 0;
            position: relative; z-index: 2;
        }

        .dg-section-label {
            font-size: 9px; letter-spacing: 3.5px; text-transform: uppercase;
            color: var(--accent-color); font-weight: 700;
            margin-bottom: 12px; opacity: 0.85;
            display: flex; align-items: center; gap: 10px;
        }
        .dg-section-label::before {
            content: '';
            width: 4px; height: 4px;
            border-radius: 50%;
            background: var(--accent-color);
            flex-shrink: 0;
        }
        .dg-section-label::after {
            content: ''; flex: 1; height: 1px;
            background: linear-gradient(90deg, rgba(var(--accent-color-rgb),0.4), transparent);
        }

        .dg-mood-panel {
            background: linear-gradient(140deg,
                rgba(var(--accent-color-rgb),0.09) 0%,
                rgba(var(--accent-color-rgb),0.03) 100%
            );
            border-radius: var(--radius); padding: 14px 18px;
            border: 1px solid rgba(var(--accent-color-rgb),0.13);
            margin-bottom: 10px;
            display: flex; align-items: center; gap: 14px;
            transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s ease;
            position: relative; overflow: hidden;
        }
        .dg-mood-panel::before {
            content: '';
            position: absolute; left: 0; top: 8px; bottom: 8px;
            width: 3px;
            background: linear-gradient(180deg, var(--accent-color), rgba(var(--accent-color-rgb),0.25));
            border-radius: 0 3px 3px 0;
        }
        .dg-mood-panel::after {
            content: '';
            position: absolute; top: 0; right: 0;
            width: 60px; height: 60px;
            background: radial-gradient(circle, rgba(var(--accent-color-rgb),0.1), transparent 70%);
            border-radius: 0 22px 0 60px;
        }
        .dg-mood-panel:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 32px rgba(var(--accent-color-rgb), 0.16);
        }
        .dg-mood-icon-big {
            font-size: 34px;
            filter: drop-shadow(0 2px 6px rgba(var(--accent-color-rgb),0.3));
        }
        .dg-mood-info { flex: 1; }
        .dg-mood-name { font-size: 14px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.3px; }
        .dg-mood-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }

        .dg-info-grid {
            display: grid; grid-template-columns: 1fr 1fr;
            gap: 8px; margin-bottom: 10px;
        }
        .dg-info-cell {
            background: linear-gradient(150deg,
                var(--primary-bg) 0%,
                rgba(var(--accent-color-rgb),0.06) 100%
            );
            border-radius: var(--radius); padding: 14px 14px;
            border: 1px solid rgba(var(--accent-color-rgb),0.1);
            transition: transform 0.26s cubic-bezier(0.4,0,0.2,1), box-shadow 0.26s ease;
            position: relative; overflow: hidden;
        }
        .dg-info-cell::before {
            content: '';
            position: absolute; top: 0; right: 0;
            width: 50px; height: 50px;
            background: radial-gradient(circle, rgba(var(--accent-color-rgb),0.1), transparent 70%);
            border-radius: 0 20px 0 50px;
        }
        .dg-info-cell::after {
            content: '';
            position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
            background: linear-gradient(90deg, transparent, rgba(var(--accent-color-rgb),0.2), transparent);
        }
        .dg-info-cell:hover {
            transform: translateY(-4px) scale(1.015);
            box-shadow: 0 12px 30px rgba(var(--accent-color-rgb), 0.16);
        }
        .dg-info-cell-icon { font-size: 0; margin-bottom: 0; height: 28px; display: flex; align-items: center; }
        .dg-info-cell-icon svg { display: block; }
        .dg-info-cell-label {
            font-size: 9px; color: var(--text-secondary);
            margin-bottom: 4px; margin-top: 8px;
            letter-spacing: 1px; text-transform: uppercase;
        }
        .dg-info-cell-val {
            font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.4px;
        }

        .dg-note-box {
            font-size: 13px; color: var(--text-secondary); line-height: 1.8;
            padding: 16px 20px 14px;
            border-radius: var(--radius);
            margin-bottom: 12px;
            position: relative; overflow: hidden;
            background: linear-gradient(145deg,
                rgba(var(--accent-color-rgb),0.07) 0%,
                rgba(var(--accent-color-rgb),0.02) 100%
            );
            border: 1px solid rgba(var(--accent-color-rgb),0.12);
        }
        .dg-note-box::before {
            content: '\201C';
            position: absolute; top: -6px; left: 14px;
            font-size: 60px; color: var(--accent-color); opacity: 0.13;
            font-family: Georgia, 'Times New Roman', serif; line-height: 1;
            font-weight: 900;
        }
        .dg-note-box::after {
            content: '\201D';
            position: absolute; bottom: -18px; right: 14px;
            font-size: 60px; color: var(--accent-color); opacity: 0.13;
            font-family: Georgia, 'Times New Roman', serif; line-height: 1;
            font-weight: 900;
        }
        .dg-note-inner {
            position: relative; z-index: 1;
            text-align: center; letter-spacing: 0.5px;
        }
        .dg-note-weather-badge {
            display: inline-flex; align-items: center; gap: 6px;
            background: rgba(var(--accent-color-rgb),0.12);
            border-radius: 30px; padding: 5px 14px;
            font-size: 11px; color: var(--accent-color);
            font-weight: 600; margin-bottom: 12px;
            letter-spacing: 0.5px;
            border: 1px solid rgba(var(--accent-color-rgb),0.22);
        }

        .dg-footer { display: flex; gap: 10px; }
        .daily-greeting-close-btn {
            flex: 1; padding: 13px;
            background: linear-gradient(140deg,
                rgba(var(--accent-color-rgb), 1) 0%,
                rgba(var(--accent-color-rgb), 0.8) 100%
            );
            color: white; border: none; border-radius: 20px; font-size: 13px;
            font-weight: 600; font-family: var(--font-family);
            cursor: pointer; transition: all 0.32s cubic-bezier(0.4,0,0.2,1);
            letter-spacing: 2.5px;
            box-shadow:
                0 8px 20px rgba(var(--accent-color-rgb),0.4),
                inset 0 1px 0 rgba(255,255,255,0.22),
                inset 0 -1px 0 rgba(0,0,0,0.1);
            position: relative; overflow: hidden;
        }
        .daily-greeting-close-btn::before {
            content: '';
            position: absolute; inset: 0;
            background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, transparent 55%);
        }
        .daily-greeting-close-btn::after {
            content: '';
            position: absolute; inset: 0;
            background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,0.12) 50%, transparent 75%);
            animation: btnShimmer 3s ease-in-out infinite 1.5s;
        }
        @keyframes btnShimmer {
            0% { transform: translateX(-200%); }
            50%, 100% { transform: translateX(200%); }
        }
        .daily-greeting-close-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 18px 42px rgba(var(--accent-color-rgb),0.48);
        }
        .daily-greeting-close-btn:active { transform: translateY(1px); }

        .dg-card-bg-layer {
            position: absolute; inset: 0; z-index: 0;
            background-size: cover; background-position: center; background-repeat: no-repeat;
            border-radius: inherit;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        .daily-greeting-card { position: relative; overflow: hidden; }

        .dg-header-band-bg {
            position: absolute; inset: 0;
            background-size: cover; background-position: center;
            background-repeat: no-repeat;
            z-index: 0;
        }
        .dg-header-band-overlay {
            position: absolute; inset: 0;
            background: linear-gradient(145deg, var(--accent-color) 0%, rgba(var(--accent-color-rgb),0.72) 100%);
            z-index: 1;
            transition: opacity 0.3s;
        }
        .dg-header-band-bg.has-img + .dg-header-band-overlay {
            opacity: 0.06;
        }

        @keyframes dgBodyItemIn {
            from { opacity:0; transform: translateY(14px); filter: blur(4px); }
            to { opacity:1; transform: translateY(0); filter: blur(0); }
        }
        #daily-greeting-modal:not(.hidden) .dg-section-label {
            animation: dgBodyItemIn 0.5s cubic-bezier(0.22,1,0.36,1) 0.3s both;
        }
        #daily-greeting-modal:not(.hidden) .dg-mood-panel {
            animation: dgBodyItemIn 0.5s cubic-bezier(0.22,1,0.36,1) 0.42s both;
        }
        #daily-greeting-modal:not(.hidden) .dg-info-grid {
            animation: dgBodyItemIn 0.5s cubic-bezier(0.22,1,0.36,1) 0.54s both;
        }
        #daily-greeting-modal:not(.hidden) .dg-note-box {
            animation: dgBodyItemIn 0.5s cubic-bezier(0.22,1,0.36,1) 0.66s both;
        }
        #daily-greeting-modal:not(.hidden) .dg-footer {
            animation: dgBodyItemIn 0.5s cubic-bezier(0.22,1,0.36,1) 0.78s both;
        }
        .daily-greeting-card.has-card-bg {
            background-color: transparent !important;
        }
        .daily-greeting-card.has-card-bg .dg-header-band {
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        .daily-greeting-card.has-card-bg .dg-header-band-overlay {
            opacity: 0 !important;
        }
        .daily-greeting-card.has-card-bg .dg-body {
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        .daily-greeting-card.has-card-bg .dg-mood-panel {
            background: rgba(255,255,255,0.22) !important;
            border-color: rgba(255,255,255,0.3) !important;
            backdrop-filter: blur(6px) !important;
            -webkit-backdrop-filter: blur(6px) !important;
        }
        html[data-theme="dark"] .daily-greeting-card.has-card-bg .dg-mood-panel {
            background: rgba(0,0,0,0.3) !important;
            border-color: rgba(255,255,255,0.12) !important;
        }
        .daily-greeting-card.has-card-bg .dg-info-cell {
            background: rgba(255,255,255,0.22) !important;
            border-color: rgba(255,255,255,0.3) !important;
            backdrop-filter: blur(6px) !important;
            -webkit-backdrop-filter: blur(6px) !important;
        }
        html[data-theme="dark"] .daily-greeting-card.has-card-bg .dg-info-cell {
            background: rgba(0,0,0,0.28) !important;
            border-color: rgba(255,255,255,0.1) !important;
        }
        .daily-greeting-card.has-card-bg .dg-note-box {
            background: rgba(255,255,255,0.2) !important;
            border-color: rgba(255,255,255,0.28) !important;
            backdrop-filter: blur(6px) !important;
            -webkit-backdrop-filter: blur(6px) !important;
        }
        html[data-theme="dark"] .daily-greeting-card.has-card-bg .dg-note-box {
            background: rgba(0,0,0,0.26) !important;
            border-color: rgba(255,255,255,0.1) !important;
        }
        .daily-greeting-card.has-card-bg .dg-section-label,
        .daily-greeting-card.has-card-bg .dg-mood-name,
        .daily-greeting-card.has-card-bg .dg-info-cell-val,
        .daily-greeting-card.has-card-bg .dg-main-title,
        .daily-greeting-card.has-card-bg .dg-festival-label,
        .daily-greeting-card.has-card-bg .dg-date-stamp,
        .daily-greeting-card.has-card-bg #dg-note-text {
            text-shadow: 0 1px 6px rgba(0,0,0,0.45), 0 2px 12px rgba(0,0,0,0.25);
            color: #fff !important;
        }
        .dg-card-tint-overlay {
            position: absolute; inset: 0; z-index: 1;
            background: rgba(0,0,0,0);
            border-radius: inherit;
            pointer-events: none;
            transition: background 0.3s ease;
        }

        .daily-greeting-card {
            background: var(--secondary-bg);
            border-radius: 36px;
            max-width: 390px; width: 93%;
            box-shadow:
                0 60px 140px rgba(0,0,0,0.55),
                0 0 0 1px rgba(var(--accent-color-rgb),0.2),
                0 0 0 0.5px rgba(255,255,255,0.08),
                0 0 100px rgba(var(--accent-color-rgb),0.08),
                inset 0 1px 0 rgba(255,255,255,0.12);
            position: relative;
            animation: dgCardIn 0.65s cubic-bezier(0.34, 1.38, 0.64, 1);
            overflow: hidden;
        }

        .action-btn, .input-btn, .modal-btn {
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        }
        .action-btn:active, .input-btn:active {
            transform: scale(0.92) !important;
        }
        .modal-btn:active { transform: scale(0.96) !important; }
        .poke-quick-item:active { transform: scale(0.97) !important; }
        .settings-item:active { transform: scale(0.98) !important; }
        .sidebar-btn:active { transform: scale(0.95) !important; }

        .message {
            transition: box-shadow 0.2s ease, transform 0.2s ease;
        }
        .message:hover {
            box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
        }
        .modal-content {
            animation: modalSlideUp 0.32s cubic-bezier(0.34, 1.3, 0.64, 1) !important;
        }
        @keyframes modalSlideUp {
            from { opacity: 0; transform: translateY(24px) scale(0.96); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .ann-item-card, .env-letter-item, .dg-info-cell, .dg-mood-panel {
            transition: transform 0.26s cubic-bezier(0.4,0,0.2,1), box-shadow 0.26s ease !important;
        }
        .dg-info-cell:hover {
            transform: translateY(-4px) scale(1.015) !important;
            box-shadow: 0 12px 30px rgba(var(--accent-color-rgb), 0.16) !important;
        }
        .calendar-day:not(.empty) {
            transition: all 0.2s cubic-bezier(0.4,0,0.2,1) !important;
        }
        .calendar-day:not(.empty):hover {
            transform: scale(1.06) !important;
            z-index: 2;
        }
        .mood-selector-card {
            border-radius: 22px !important;
            box-shadow: 0 16px 48px rgba(0,0,0,0.22) !important;
        }
        .message-input:focus {
            box-shadow: none !important;
            outline: none !important;
        }
        .setting-pill-row {
            border-radius: 14px !important;
        }
        .notification-toast {
            border-radius: 14px !important;
            backdrop-filter: blur(12px) !important;
        }

        .ann-item-card {
            padding: 12px 14px 12px 16px !important;
        }
        .ann-item-name {
            font-size: 14px !important;
            letter-spacing: 0.2px;
        }
        .ann-item-days {
            font-size: 28px !important;
        }

        .stats-card {
            border-radius: 18px !important;
            border: none !important;
            background: linear-gradient(135deg, var(--secondary-bg), rgba(var(--accent-color-rgb),0.03)) !important;
            box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
            padding: 18px !important;
        }
        .overview-item {
            border-radius: 14px !important;
            background: var(--primary-bg) !important;
            border: 1px solid rgba(var(--accent-color-rgb),0.1) !important;
            transition: transform 0.2s ease, box-shadow 0.2s ease !important;
        }
        .overview-item:hover {
            transform: translateY(-2px) !important;
            box-shadow: 0 4px 14px rgba(var(--accent-color-rgb),0.1) !important;
        }
        .overview-value {
            font-size: 24px !important;
            background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .stats-toggle-btn {
            border-radius: 12px !important;
        }
        .rank-item {
            border-radius: var(--radius-xs) !important;
        }
        .rank-item:hover {
            background: rgba(var(--accent-color-rgb), 0.04) !important;
        }
        .stats-card-title {
            font-size: 12px !important;
            letter-spacing: 1.5px;
            text-transform: uppercase;
        }

        #envelope-modal .modal-content {
            padding: 0 !important;
            overflow: hidden !important;
            border-radius: 20px;
            background: transparent !important;
        }
        .env-wrapper {
            background: var(--secondary-bg);
            border-radius: var(--radius);
            overflow: hidden;
            display: flex; flex-direction: column;
            max-height: 88vh;
        }
        .env-header-flap {
            position: relative;
            background: var(--accent-color);
            padding: 22px 24px 42px;
            clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
            text-align: center; color: white;
        }
        .env-header-flap::before {
            content: '';
            position: absolute; inset: 0;
            background: linear-gradient(160deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.04) 55%, transparent 100%);
            pointer-events: none;
        }
        .env-header-flap::after {
            content: '';
            position: absolute;
            bottom: 38px; left: 0; right: 0;
            height: 1px;
            background: rgba(255,255,255,0.2);
            pointer-events: none;
        }
        .env-header-icon {
            display: block; margin: 0 auto 8px;
            opacity: 0.95;
        }
        .env-header-title {
            font-size: 15px; font-weight: 700; letter-spacing: 3px;
            text-shadow: 0 1px 6px rgba(0,0,0,0.25);
        }
        .env-header-subtitle {
            font-size: 10px; opacity: 0.7; letter-spacing: 2px; margin-top: 3px;
            text-transform: uppercase; font-style: italic;
        }
        .env-body {
            padding: 14px 18px 4px;
            flex: 1; overflow-y: auto;
            min-height: 0;
        }
        .env-tab-bar {
            display: flex; gap: 6px; margin-bottom: 14px;
        }
        .env-tab-btn {
            flex: 1; padding: 9px 6px;
            background: var(--primary-bg);
            border: 1.5px solid var(--border-color);
            border-radius: 8px; cursor: pointer;
            font-size: 12px; font-family: var(--font-family);
            color: var(--text-secondary); position: relative;
            transition: all 0.25s; letter-spacing: 0.5px;
        }
        .env-tab-btn.active {
            background: rgba(var(--accent-color-rgb), 0.08);
            border: 1.5px solid var(--accent-color);
            color: var(--accent-color); font-weight: 600;
        }
        .env-badge {
            position: absolute; top: -6px; right: -6px;
            background: #ff4757; color: #fff; border-radius: 8px;
            font-size: 10px; padding: 1px 5px; min-width: 16px; text-align: center;
            border: 2px solid var(--secondary-bg);
        }
        .env-letter-item {
            background: var(--primary-bg);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-color);
            margin-bottom: 10px; cursor: pointer;
            transition: all 0.25s cubic-bezier(0.25,0.8,0.25,1);
            position: relative; overflow: hidden;
        }
        .env-letter-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(var(--accent-color-rgb), 0.12);
            border-color: rgba(var(--accent-color-rgb), 0.35);
        }
        .env-letter-item.env-letter-new {
            border-color: rgba(var(--accent-color-rgb), 0.4);
        }
        .env-letter-header {
            background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-color-rgb), 0.7));
            padding: 8px 12px 7px;
            display: flex; align-items: center; justify-content: space-between;
        }
        .env-letter-header-from {
            font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.95);
            letter-spacing: 0.5px;
        }
        .env-letter-header-date {
            font-size: 10px; color: rgba(255,255,255,0.75);
        }
        .env-stamp {
            width: 32px; height: 38px;
            border: 2px solid rgba(255,255,255,0.7);
            border-radius: 3px;
            background: rgba(255,255,255,0.15);
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
            position: relative;
            box-shadow:
              0 0 0 3px rgba(255,255,255,0.12),
              2px 2px 0 3px rgba(255,255,255,0.12),
              -2px 2px 0 3px rgba(255,255,255,0.12),
              2px -2px 0 3px rgba(255,255,255,0.12),
              -2px -2px 0 3px rgba(255,255,255,0.12);
        }
        .env-letter-body {
            padding: 10px 12px 10px;
        }
        .env-letter-meta { font-size: 10px; color: var(--text-secondary); margin-bottom: 5px; display:flex; justify-content:space-between; }
        .env-letter-preview { font-size: 13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width: 86%; font-style: italic; color: var(--text-primary); }
        .env-letter-status { font-size: 10px; color: var(--accent-color); margin-top: 5px; display: flex; align-items: center; gap: 4px; }
        .env-letter-delete-btn {
            position: absolute; bottom: 10px; right: 10px;
            background: none; border: none; color: var(--text-secondary);
            cursor: pointer; font-size: 12px; opacity: 0.35;
            padding: 4px; border-radius: 4px; transition: all 0.2s;
        }
        .env-letter-delete-btn:hover { color: #ff4757; opacity: 1; }
        .env-letter-item.reply .env-letter-status::before {
            content: '已回信';
            font-size: 9px; color: #6BCB77; border: 1px solid #6BCB77;
            border-radius: 4px; padding: 1px 5px; letter-spacing: 0.5px;
            margin-right: 4px;
        }
        .env-compose-paper {
            background: var(--primary-bg);
            border-radius: var(--radius-sm);
            border: 1px solid rgba(var(--accent-color-rgb), 0.2);
            padding: 16px 16px 12px;
            margin-bottom: 10px;
            position: relative; overflow: hidden;
        }
        .env-compose-paper::before {
            content: '';
            position: absolute; left: 38px; top: 0; bottom: 0;
            width: 1px; background: rgba(220, 80, 80, 0.25);
            pointer-events: none;
        }
        .env-compose-paper::after {
            content: '';
            position: absolute; inset: 0;
            background: repeating-linear-gradient(
                transparent,
                transparent 28px,
                rgba(var(--accent-color-rgb), 0.07) 28px,
                rgba(var(--accent-color-rgb), 0.07) 29px
            );
            pointer-events: none; border-radius: 12px;
        }
        .env-compose-heading {
            font-size: 11px; color: var(--accent-color); letter-spacing: 2px;
            text-transform: uppercase; margin-bottom: 10px; opacity: 0.8;
            position: relative; z-index: 1;
            display: flex; align-items: center; gap: 6px;
        }
        #envelope-input {
            background: transparent !important;
            border: none !important;
            outline: none !important;
            font-family: var(--font-family) !important;
            font-size: 14px !important;
            line-height: 2 !important;
            color: var(--text-primary) !important;
            width: 100%; resize: none;
            padding-left: 16px;
            min-height: 160px;
            position: relative; z-index: 1;
        }
        .env-letter-paper {
            background: var(--primary-bg);
            background-image:
                repeating-linear-gradient(
                    transparent,
                    transparent 30px,
                    rgba(var(--accent-color-rgb), 0.07) 30px,
                    rgba(var(--accent-color-rgb), 0.07) 31px
                );
            border-radius: 10px;
            padding: 16px 20px 16px 52px;
            font-size: 14px; line-height: 31px;
            white-space: pre-wrap; word-break: break-word;
            min-height: 120px; position: relative;
            border: 1px solid var(--border-color);
        }
        .env-letter-paper::before {
            content: '';
            position: absolute; left: 40px; top: 0; bottom: 0;
            width: 1px; background: rgba(220, 80, 80, 0.2);
        }
        .env-empty {
            text-align:center; padding: 36px 20px;
            color: var(--text-secondary); font-size: 13px; opacity: 0.65;
        }
        .env-empty svg { display: block; margin: 0 auto 12px; opacity: 0.4; }
        .env-send-area {
            padding: 12px 18px 16px;
        }
        .env-send-info {
            display: flex; align-items: center; gap: 6px;
            font-size: 11px; color: var(--text-secondary);
            margin-bottom: 10px; padding: 7px 10px;
            background: var(--primary-bg); border-radius: 8px;
        }
        .env-write-btn {
            width: 100%;
            padding: 13px;
            background: var(--accent-color);
            color: white;
            border: none; border-radius: 14px;
            font-size: 14px; font-weight: 600;
            font-family: var(--font-family);
            cursor: pointer; letter-spacing: 1px;
            transition: all 0.25s;
            box-shadow: 0 4px 16px rgba(var(--accent-color-rgb), 0.35);
            display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        .env-write-btn:hover { opacity: 0.9; transform: translateY(-1px); }
        .env-close-btn {
            width: 100%; padding: 10px;
            background: transparent;
            border: 1px solid var(--border-color);
            border-radius: 14px; font-size: 13px;
            color: var(--text-secondary); cursor: pointer;
            font-family: var(--font-family);
            margin-top: 8px; transition: all 0.2s;
        }
        .env-close-btn:hover { background: var(--primary-bg); }
        .env-postmark {
            display: inline-flex; flex-direction: column; align-items: center;
            border: 2px solid rgba(var(--accent-color-rgb), 0.4);
            border-radius: 50%; width: 56px; height: 56px;
            justify-content: center; font-size: 8px; line-height: 1.3;
            text-align: center; color: var(--accent-color);
            opacity: 0.6; letter-spacing: 0.5px;
        }

        .file-input {
            display: none;
        }
        .empty-state {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            text-align: center;
            padding: 20px;
            width: 100%;
            transition: color 0.5s ease;
            pointer-events: none;
        }
        .empty-state i {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.4;
        }
        .empty-state p {
            font-size: 16px;
            font-weight: 500;
        }

        #typing-indicator-wrapper {
            display: none;
            position: fixed;
            bottom: 0;          
            left: 16px;
            z-index: 49;        
            pointer-events: auto;
            padding-bottom: 8px;
            background: transparent !important; 
        }
        .typing-indicator {
            display: inline-flex;
            align-items: center;
            gap: 9px;
            background: rgba(var(--secondary-bg-rgb), 0.92);
            backdrop-filter: blur(28px) saturate(2);
            -webkit-backdrop-filter: blur(28px) saturate(2);
            border: 1px solid rgba(var(--accent-color-rgb), 0.22);
            padding: 8px 16px 8px 8px;
            border-radius: 26px;
            box-shadow:
                0 8px 32px rgba(0,0,0,0.12),
                0 2px 8px rgba(0,0,0,0.07),
                0 0 0 0px rgba(var(--accent-color-rgb), 0),
                inset 0 1px 0 rgba(255,255,255,0.55),
                inset 0 -1px 0 rgba(0,0,0,0.04);
            animation: typingIndicatorIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
            transition: background 0.4s ease, box-shadow 0.3s ease, transform 0.25s ease, border-color 0.3s ease;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
        }
        .typing-indicator:hover {
            transform: translateY(-2px) scale(1.02);
            border-color: rgba(var(--accent-color-rgb), 0.40);
            box-shadow:
                0 12px 40px rgba(0,0,0,0.16),
                0 4px 14px rgba(0,0,0,0.10),
                0 0 0 4px rgba(var(--accent-color-rgb), 0.10),
                inset 0 1px 0 rgba(255,255,255,0.60),
                inset 0 -1px 0 rgba(0,0,0,0.04);
        }
        .typing-indicator:active {
            transform: translateY(0) scale(0.97);
            box-shadow:
                0 4px 16px rgba(0,0,0,0.10),
                0 1px 4px rgba(0,0,0,0.07),
                inset 0 1px 0 rgba(255,255,255,0.40);
        }
        .typing-indicator-avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(var(--accent-color-rgb),0.25), rgba(var(--accent-color-rgb),0.10));
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            overflow: hidden;
            border: 2px solid rgba(var(--accent-color-rgb), 0.30);
            box-shadow: 0 2px 10px rgba(var(--accent-color-rgb),0.22);
            animation: avatarPulse 3s ease-in-out infinite;
            transition: transform 0.3s ease;
        }
        .typing-indicator:hover .typing-indicator-avatar {
            transform: scale(1.08);
        }
        @keyframes avatarPulse {
            0%, 100% { box-shadow: 0 2px 8px rgba(var(--accent-color-rgb),0.20); }
            50%       { box-shadow: 0 2px 16px rgba(var(--accent-color-rgb),0.45), 0 0 0 3px rgba(var(--accent-color-rgb),0.12); }
        }
        .typing-indicator-avatar img {
            width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
        }
        .typing-indicator-avatar i {
            font-size: 12px;
            color: var(--accent-color);
        }
        .typing-indicator-label {
            font-size: 11.5px;
            font-weight: 600;
            color: var(--accent-color);
            opacity: 0.88;
            letter-spacing: 0.4px;
            max-width: 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .typing-indicator-settings-hint {
            font-size: 10px;
            color: var(--text-secondary);
            opacity: 0.65;
            margin-left: -1px;
            font-weight: 400;
            letter-spacing: 0;
        }
        @keyframes typingIndicatorIn {
            from { opacity: 0; transform: translateY(14px) scale(0.82); }
            to   { opacity: 1; transform: translateY(0)   scale(1); }
        }
        @keyframes typingIndicatorOut {
            from { opacity: 1; transform: translateY(0)   scale(1); }
            to   { opacity: 0; transform: translateY(8px)  scale(0.90); }
        }
        .typing-indicator.hiding {
            animation: typingIndicatorOut 0.25s ease forwards;
        }

        .typing-dots {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        .typing-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--accent-color);
            animation: typingBounce 1.3s infinite ease-in-out both;
            opacity: 0.55;
        }
        .typing-dot:nth-child(1) { animation-delay: 0s; }
        .typing-dot:nth-child(2) { animation-delay: 0.18s; }
        .typing-dot:nth-child(3) { animation-delay: 0.36s; }

        @keyframes typingBounce {
            0%, 60%, 100% { transform: translateY(0) scale(1);     opacity: 0.40; }
            30%            { transform: translateY(-7px) scale(1.4); opacity: 1; }
        }

        #ti-settings-modal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 99200;
            background: rgba(0,0,0,0.50);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            align-items: flex-end;
            justify-content: center;
            padding: 0;
        }
        #ti-settings-modal.open {
            display: flex;
            animation: tiModalOverlayIn 0.25s ease both;
        }
        @keyframes tiModalOverlayIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        #ti-settings-panel {
            background: var(--secondary-bg);
            border-radius: 24px 24px 0 0;
            width: 100%;
            max-width: 520px;
            padding: 0 0 env(safe-area-inset-bottom, 16px);
            box-shadow: 0 -8px 48px rgba(0,0,0,0.18);
            animation: tiPanelSlideUp 0.35s cubic-bezier(0.34,1.15,0.64,1) both;
            overflow: hidden;
        }
        @keyframes tiPanelSlideUp {
            from { transform: translateY(100%); }
            to   { transform: translateY(0); }
        }
        .ti-settings-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 20px 20px 16px;
            border-bottom: 1px solid var(--border-color);
        }
        .ti-settings-icon {
            width: 40px;
            height: 40px;
            border-radius: 14px;
            background: rgba(var(--accent-color-rgb), 0.12);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
        }
        .ti-settings-title {
            flex: 1;
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary);
        }
        .ti-settings-close {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: var(--primary-bg);
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .ti-settings-close:hover {
            background: var(--border-color);
            color: var(--text-primary);
        }
        .ti-settings-body {
            padding: 18px 20px 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .ti-settings-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .ti-settings-row-label {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .ti-settings-row-icon {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            background: rgba(var(--accent-color-rgb), 0.10);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            flex-shrink: 0;
        }
        .ti-settings-row-text {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .ti-settings-row-sub {
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 1px;
            opacity: 0.85;
        }
        .ti-text-edit-row {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .ti-text-edit-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .ti-text-input-wrap {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .ti-text-input {
            flex: 1;
            background: var(--primary-bg);
            border: 1.5px solid var(--border-color);
            border-radius: 12px;
            padding: 10px 14px;
            font-size: 14px;
            color: var(--text-primary);
            font-family: var(--font-family);
            outline: none;
            transition: border-color 0.2s;
        }
        .ti-text-input:focus {
            border-color: rgba(var(--accent-color-rgb), 0.60);
        }
        .ti-text-save-btn {
            background: var(--accent-color);
            color: #fff;
            border: none;
            border-radius: 12px;
            padding: 10px 16px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
            font-family: var(--font-family);
            transition: opacity 0.2s;
        }
        .ti-text-save-btn:hover { opacity: 0.85; }
        .ti-text-reset-btn {
            font-size: 11px;
            color: var(--text-secondary);
            cursor: pointer;
            text-decoration: underline;
            background: none;
            border: none;
            padding: 0;
            font-family: var(--font-family);
            transition: color 0.2s;
        }
        .ti-text-reset-btn:hover { color: var(--accent-color); }
        .ti-preview-box {
            background: var(--primary-bg);
            border-radius: 16px;
            padding: 14px 16px;
            display: flex;
            align-items: center;
            gap: 9px;
            border: 1px dashed rgba(var(--accent-color-rgb),0.25);
        }
        .ti-preview-dots {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        .ti-preview-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--accent-color);
            animation: typingBounce 1.3s infinite ease-in-out both;
            opacity: 0.55;
        }
        .ti-preview-dot:nth-child(1) { animation-delay: 0s; }
        .ti-preview-dot:nth-child(2) { animation-delay: 0.18s; }
        .ti-preview-dot:nth-child(3) { animation-delay: 0.36s; }

        .settings-item-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 16px;
        }

        #appearance-modal .settings-item-list {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
        }

        #appearance-modal .settings-item {
    display: flex;
    align-items: center;
    justify-content: center; 
    padding: 15px;
    width: 100%;
    margin-bottom: 0; 
    flex-direction: column; 
    gap: 8px;
    text-align: center;
        }

        #appearance-modal .settings-item i {
    font-size: 20px;
    width: auto;
    height: auto;
    background: none;
    margin: 0;
        }

        #appearance-modal .settings-item::after {
    display: none;
        }

        .settings-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 16px;
            background-color: var(--primary-bg);
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            border: 1px solid transparent;
            position: relative;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
        }


        .settings-item:hover {
            background-color: var(--secondary-bg);
            transform: translateX(3px);
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
            border-color: rgba(var(--accent-color-rgb), 0.3);
        }


        .settings-item i {
            font-size: 18px;
            color: var(--accent-color);
            width: 40px;
            height: 40px;
            background-color: rgba(var(--accent-color-rgb), 0.1);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .settings-item:hover i {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
            transform: scale(1.1);
        }


        .settings-item span {
            font-size: 15px;
            font-weight: 500;
            color: var(--text-primary);
            flex: 1;
        }


        .settings-item::after {
            content: "\f054";
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            color: var(--text-secondary);
            font-size: 12px;
            opacity: 0.5;
            transition: transform 0.3s ease;
        }

        .settings-item:hover::after {
            transform: translateX(3px);
            opacity: 0.8;
            color: var(--accent-color);
        }


        #advanced-modal .settings-item-list {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        #advanced-modal .settings-item {
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 20px 10px;
            background-color: var(--primary-bg);
            border: 1px solid var(--border-color);
            gap: 10px;
        }

        #advanced-modal .settings-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
            z-index: 1;
        }


        #advanced-modal .settings-item i {
            width: 56px;
            height: 56px;
            font-size: 24px;
            border-radius: 20px;
            margin-bottom: 4px;
        }


        #advanced-modal .settings-item::after {
            display: none;
        }

        #appearance-modal .settings-item-list {
            gap: 8px;
        }


        .import-export-buttons {
            display: flex;
            gap: 12px;
            margin-top: 5px;
        }
        .import-export-btn {
            flex: 1;
            padding: 15px;
            border-radius: 12px;
            border: 1px solid transparent;
            background-color: var(--primary-bg);
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 14px;
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.03);
        }
        .import-export-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .import-export-btn.export {
            background-color: rgba(var(--accent-color-rgb), 0.1);
            color: var(--accent-color);
            border-color: rgba(var(--accent-color-rgb), 0.2);
        }
        .import-export-btn.export:hover {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
        }

        .settings-item:hover {
            background-color: var(--primary-bg);
            transform: translateX(5px);
        }

        #my-status-input {
            background: transparent;
            border: none;
            outline: none;
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 500;
            font-family: var(--font-family);
            text-align: center;
            padding: 2px 6px;
            width: 100px;
        }


        :root {
            --welcome-bg: #0a0a12;
            --welcome-text-main: #ffffff;
            --welcome-text-sub: rgba(var(--accent-color-rgb), 0.85);
            --welcome-star: rgba(255,255,255,0.85);
            --welcome-circle-outer: rgba(255, 255, 255, 0.1);
            --welcome-loader-bg: rgba(255, 255, 255, 0.08);
        }

        html[data-theme="light"] {
            --welcome-bg: #f5f4f0;
            --welcome-text-main: #1a1a1a;
            --welcome-text-sub: rgba(var(--accent-color-rgb), 0.9);
            --welcome-star: rgba(var(--accent-color-rgb), 0.6);
            --welcome-circle-outer: rgba(var(--accent-color-rgb), 0.12);
            --welcome-loader-bg: rgba(var(--accent-color-rgb), 0.1);
        }

        html[data-theme="dark"] {
            --welcome-bg: #06060f;
            --welcome-text-main: #ffffff;
            --welcome-text-sub: rgba(var(--accent-color-rgb), 0.9);
            --welcome-star: #ffffff;
            --welcome-circle-outer: rgba(255, 255, 255, 0.1);
            --welcome-loader-bg: rgba(255, 255, 255, 0.08);
        }

        .welcome-animation {
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: var(--welcome-bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            overflow: hidden;
            transition: all 1.6s cubic-bezier(0.7, 0, 0.3, 1);
        }
        .welcome-animation.hidden {
            opacity: 0;
            transform: scale(1.08);
            filter: blur(40px) brightness(2);
            pointer-events: none;
        }

        .welcome-bg-gradient {
            position: absolute; inset: 0;
            background:
                radial-gradient(ellipse 80% 60% at 20% 20%, rgba(var(--accent-color-rgb), 0.22) 0%, transparent 55%),
                radial-gradient(ellipse 60% 50% at 80% 80%, rgba(var(--accent-color-rgb), 0.16) 0%, transparent 52%),
                radial-gradient(ellipse 100% 80% at 50% 50%, rgba(var(--accent-color-rgb), 0.05) 0%, transparent 65%),
                radial-gradient(ellipse 40% 40% at 90% 15%, rgba(255,255,255,0.04) 0%, transparent 45%);
            animation: bgPulse 10s ease-in-out infinite;
        }
        @keyframes bgPulse {
            0%, 100% { opacity: 0.6; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.06); }
        }

        .welcome-animation::before {
            content: '';
            position: absolute; inset: 0; z-index: 2; pointer-events: none;
            background:
                radial-gradient(ellipse 90% 90% at 50% 50%, transparent 40%, rgba(0,0,0,0.55) 100%);
        }
        html[data-theme="light"] .welcome-animation::before {
            background:
                radial-gradient(ellipse 90% 90% at 50% 50%, transparent 40%, rgba(var(--accent-color-rgb),0.08) 100%);
        }
        .welcome-animation::after {
            content: '';
            position: absolute; inset: 0; z-index: 1; pointer-events: none;
            background-image:
                linear-gradient(rgba(var(--accent-color-rgb),0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(var(--accent-color-rgb),0.03) 1px, transparent 1px);
            background-size: 48px 48px;
            animation: gridDrift 30s linear infinite;
        }
        @keyframes gridDrift {
            0% { background-position: 0 0; }
            100% { background-position: 48px 48px; }
        }

        .welcome-particles {
            position: absolute; inset: 0;
            pointer-events: none; overflow: hidden; z-index: 3;
        }
        .wp {
            position: absolute; pointer-events: none;
            animation: petalFloat var(--pDur, 10s) ease-in-out infinite var(--pDel, 0s);
            opacity: 0;
        }
        .wp.petal {
            width: var(--pSz, 6px);
            height: calc(var(--pSz, 6px) * 1.8);
            background: radial-gradient(ellipse at 40% 30%, rgba(var(--accent-color-rgb), 1), rgba(var(--accent-color-rgb), 0.15));
            border-radius: 50% 0 50% 0;
            filter: blur(0.5px);
        }
        .wp.sparkle {
            width: var(--pSz, 3px); height: var(--pSz, 3px);
            background: rgba(255,255,255,0.9);
            border-radius: 50%;
            box-shadow: 0 0 calc(var(--pSz, 3px) * 3) rgba(var(--accent-color-rgb), 0.8);
        }
        @keyframes petalFloat {
            0%   { transform: translateY(106vh) translateX(0) rotate(0deg) scale(0.4); opacity: 0; }
            8%   { opacity: 0.85; transform: translateY(88vh) translateX(var(--pX1, 15px)) rotate(30deg) scale(1); }
            50%  { opacity: 0.55; transform: translateY(42vh) translateX(var(--pX2, -22px)) rotate(155deg) scale(0.82); }
            90%  { opacity: 0.1; }
            100% { transform: translateY(-10vh) translateX(var(--pX3, 10px)) rotate(300deg) scale(0.3); opacity: 0; }
        }

        .stars-container {
            position: absolute; top: 0; left: 0;
            width: 100%; height: 100%;
            z-index: 2; pointer-events: none;
        }
        .star {
            position: absolute;
            background: var(--welcome-star, rgba(255,255,255,0.95));
            border-radius: 50%;
            animation: twinkle var(--duration) ease-in-out infinite;
            opacity: 0;
        }
        html[data-theme="light"] .star {
            background: rgba(var(--accent-color-rgb), 0.5);
            box-shadow: 0 0 4px rgba(var(--accent-color-rgb), 0.3);
        }
        @keyframes twinkle {
            0%, 100% { opacity: 0.08; transform: scale(0.6); }
            50% { opacity: 1; transform: scale(1.4); }
        }

        .welcome-content-wrapper {
            position: relative; z-index: 10;
            display: flex; flex-direction: column;
            align-items: center; gap: 32px;
            background: linear-gradient(160deg,
                rgba(255,255,255,0.055) 0%,
                rgba(255,255,255,0.02) 100%);
            backdrop-filter: blur(24px) saturate(1.4);
            -webkit-backdrop-filter: blur(24px) saturate(1.4);
            padding: 52px 64px 48px;
            border-radius: 44px;
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow:
                0 0 0 1px rgba(var(--accent-color-rgb), 0.12),
                0 40px 80px rgba(0,0,0,0.55),
                0 0 120px rgba(var(--accent-color-rgb), 0.08),
                inset 0 1px 0 rgba(255,255,255,0.12);
            animation: wrapperReveal 1.2s cubic-bezier(0.22,1,0.36,1) 0.1s both;
        }
        html[data-theme="light"] .welcome-content-wrapper {
            background: linear-gradient(160deg,
                rgba(255,255,255,0.75) 0%,
                rgba(255,255,255,0.55) 100%);
            border: 1px solid rgba(var(--accent-color-rgb),0.18);
            box-shadow:
                0 0 0 1px rgba(var(--accent-color-rgb), 0.12),
                0 30px 60px rgba(0,0,0,0.1),
                0 0 80px rgba(var(--accent-color-rgb), 0.06),
                inset 0 1px 0 rgba(255,255,255,0.8);
        }
        @keyframes wrapperReveal {
            0% { opacity:0; transform: translateY(20px) scale(0.97); filter:blur(12px); }
            100% { opacity:1; transform: translateY(0) scale(1); filter:blur(0); }
        }
        .welcome-content-wrapper::before {
            content: '';
            position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
            background: linear-gradient(90deg, transparent, rgba(var(--accent-color-rgb),0.7), transparent);
            border-radius: 1px;
        }

        .logo-tech-container {
            position: relative;
            width: 156px; height: 156px;
            display: flex; align-items: center; justify-content: center;
            animation: logoAppear 1.8s cubic-bezier(0.22,1,0.36,1) 0.3s both;
        }
        @keyframes logoAppear {
            0% { opacity:0; transform:scale(0.3) translateY(50px); filter:blur(24px); }
            60% { filter:blur(2px); }
            100% { opacity:1; transform:scale(1) translateY(0); filter:blur(0); }
        }

        .logo-tech-container::before {
            content: '';
            position: absolute; inset: -30px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(var(--accent-color-rgb),0.3) 0%, transparent 70%);
            animation: ambientGlow 3.5s ease-in-out infinite;
        }
        @keyframes ambientGlow {
            0%,100% { opacity:0.5; transform:scale(0.9); }
            50% { opacity:1; transform:scale(1.15); }
        }

        .logo-icon-main {
            font-size: 62px;
            color: #fff;
            z-index: 5;
            filter: drop-shadow(0 0 20px rgba(var(--accent-color-rgb), 1)) drop-shadow(0 0 6px rgba(255,255,255,0.4));
            animation: floatIcon 4s ease-in-out infinite, iconGlow 3s ease-in-out infinite;
            text-shadow: none;
        }
        html[data-theme="light"] .logo-icon-main {
            color: var(--accent-color);
            filter: drop-shadow(0 0 20px rgba(var(--accent-color-rgb), 0.5)) drop-shadow(0 0 6px rgba(var(--accent-color-rgb),0.2));
        }
        @keyframes floatIcon {
            0%,100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-9px) scale(1.06); }
        }
        @keyframes iconGlow {
            0%, 100% { filter: drop-shadow(0 0 16px rgba(var(--accent-color-rgb), 0.7)) drop-shadow(0 0 5px rgba(255,255,255,0.3)); }
            50% { filter: drop-shadow(0 0 40px rgba(var(--accent-color-rgb), 1)) drop-shadow(0 0 60px rgba(var(--accent-color-rgb), 0.5)) drop-shadow(0 0 5px rgba(255,255,255,0.8)); }
        }

        .logo-circle-outer {
            position: absolute;
            width: 100%; height: 100%;
            border: 1px solid rgba(var(--accent-color-rgb), 0.35);
            border-radius: 50%;
            animation: pulseRing 3.5s ease-in-out infinite;
        }
        .logo-circle-outer::before {
            content: '';
            position: absolute; inset: -22px;
            border-radius: 50%;
            border: 1px solid rgba(var(--accent-color-rgb), 0.15);
            animation: pulseRing 3.5s ease-in-out infinite 0.9s;
        }
        .logo-circle-outer::after {
            content: '';
            position: absolute; inset: -42px;
            border-radius: 50%;
            border: 1px solid rgba(var(--accent-color-rgb), 0.07);
            animation: pulseRing 3.5s ease-in-out infinite 1.6s;
        }
        @keyframes pulseRing {
            0%,100% { transform: scale(1); opacity: 0.6; }
            50% { transform: scale(1.05); opacity: 1; }
        }
        .logo-circle-inner {
            position: absolute; width: 68%; height: 68%;
            border: 1px dashed rgba(var(--accent-color-rgb), 0.5);
            border-radius: 50%;
            animation: rotateCircle 11s linear infinite;
        }

        .orbit-dot {
            position: absolute; width: 100%; height: 100%;
            border-radius: 50%;
            animation: rotateCircle 3.5s linear infinite;
        }
        .orbit-dot::after {
            content: '';
            position: absolute; top: 0; left: 50%;
            width: 8px; height: 8px;
            background: #fff; border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 14px rgba(var(--accent-color-rgb),1), 0 0 6px rgba(255,255,255,0.9);
        }
        html[data-theme="light"] .orbit-dot::after {
            background: var(--accent-color);
            box-shadow: 0 0 14px rgba(var(--accent-color-rgb),0.6);
        }
        .orbit-dot-2 {
            position: absolute; width: 68%; height: 68%;
            border-radius: 50%;
            animation: rotateCircle 6s linear infinite reverse;
            top: 16%; left: 16%;
        }
        .orbit-dot-2::after {
            content: '';
            position: absolute; top: 0; left: 50%;
            width: 5px; height: 5px;
            background: rgba(var(--accent-color-rgb), 0.9); border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 10px rgba(var(--accent-color-rgb),1);
        }
        .orbit-dot-3 {
            position: absolute; width: 136%; height: 136%;
            border-radius: 50%;
            animation: rotateCircle 9s linear infinite 1.2s;
            top: -18%; left: -18%;
            opacity: 0.5;
        }
        .orbit-dot-3::after {
            content: '';
            position: absolute; top: 50%; left: 100%;
            width: 4px; height: 4px;
            background: rgba(255,255,255,0.7); border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 8px rgba(var(--accent-color-rgb),0.9);
        }

        .text-tech-container {
            text-align: center;
            display: flex; flex-direction: column;
            align-items: center;
            gap: 10px; min-height: 84px;
        }

        .text-tech-container::before {
            content: '✦  LOADING  ✦';
            display: block;
            font-size: 8px; letter-spacing: 5px;
            color: rgba(var(--accent-color-rgb), 0.6);
            font-family: monospace; text-transform: uppercase;
            margin-bottom: -4px;
            animation: labelFadeIn 1.2s ease 0.8s both;
        }
        @keyframes labelFadeIn {
            from { opacity:0; letter-spacing:8px; }
            to { opacity:1; letter-spacing:5px; }
        }

        .welcome-title-glitch {
            font-family: 'Noto Serif SC', serif;
            font-size: 40px; font-weight: 700;
            letter-spacing: 10px;
            color: #ffffff;
            text-shadow: 0 0 30px rgba(var(--accent-color-rgb),0.8), 0 0 8px rgba(255,255,255,0.3);
            position: relative; opacity: 1;
            transition: color 0.5s ease;
        }
        .welcome-title-glitch.playing {
            opacity: 0;
            animation: cinematicFadeIn 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }
        html[data-theme="dark"] .welcome-title-glitch,
        .welcome-title-glitch {
            color: #ffffff;
            text-shadow: 0 0 30px rgba(var(--accent-color-rgb),0.8), 0 2px 12px rgba(0,0,0,0.4);
        }
        html[data-theme="light"] .welcome-title-glitch {
            color: var(--welcome-text-main);
            text-shadow: 0 0 30px rgba(var(--accent-color-rgb),0.5), 0 2px 12px rgba(0,0,0,0.08);
        }
        @keyframes cinematicFadeIn {
            0% { opacity:0; transform:scale(0.9); filter:blur(14px); letter-spacing:2px; }
            100% { opacity:1; transform:scale(1); filter:blur(0); letter-spacing:10px; }
        }
        .title-cinematic-enter {
            animation: cinematicIn 1.8s cubic-bezier(0.22,1,0.36,1) forwards;
        }
        @keyframes cinematicIn {
            0% { opacity:0; letter-spacing:22px; filter:blur(16px); transform:scale(0.92); }
            100% { opacity:1; letter-spacing:8px; filter:blur(0); transform:scale(1); }
        }
        .welcome-subtitle-scramble {
            font-family: monospace; font-size: 10.5px;
            color: rgba(var(--accent-color-rgb), 0.75);
            letter-spacing: 3px; opacity: 0.9;
            text-transform: uppercase; min-height: 18px;
        }

        .loader-tech {
            width: 200px; height: 1.5px;
            background: rgba(255,255,255,0.08);
            position: relative; overflow: visible;
            border-radius: 2px;
        }
        html[data-theme="light"] .loader-tech {
            background: rgba(var(--accent-color-rgb), 0.15);
        }
        .loader-tech::before {
            content: '';
            position: absolute; inset: -1px;
            border-radius: 2px;
            background: transparent;
            box-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.15);
        }
        .loader-tech-bar {
            position: absolute; top: 0; left: 0;
            width: 0%; height: 100%;
            background: linear-gradient(90deg, rgba(var(--accent-color-rgb),0.7), #fff, rgba(var(--accent-color-rgb),0.9));
            box-shadow: 0 0 16px rgba(var(--accent-color-rgb),0.9), 0 0 5px rgba(255,255,255,0.7);
            transition: width 0.22s linear;
            border-radius: 2px;
        }
        .loader-tech-bar::after {
            content: '';
            position: absolute; right: -4px; top: 50%;
            width: 7px; height: 7px;
            background: #fff;
            border-radius: 50%;
            transform: translateY(-50%);
            box-shadow: 0 0 12px rgba(var(--accent-color-rgb),1), 0 0 5px rgba(255,255,255,1);
        }

        .meteor {
            position: absolute;
            width: 1.5px; height: 80px;
            background: linear-gradient(to bottom,
                rgba(255,255,255,0) 0%,
                rgba(var(--accent-color-rgb),0.95) 45%,
                rgba(255,255,255,0.8) 75%,
                rgba(255,255,255,0) 100%
            );
            border-radius: 2px;
            animation: meteorFall var(--mDur,1.5s) ease-in var(--mDel,0s) forwards;
            transform-origin: top center;
            will-change: transform, opacity;
        }
        @keyframes meteorFall {
            0% { opacity:0; transform:rotate(var(--mRot,35deg)) translateY(-120px); }
            10% { opacity:1; }
            80% { opacity:0.5; }
            100% { opacity:0; transform:rotate(var(--mRot,35deg)) translateY(650px); }
        }

        @keyframes rotateCircle {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        @keyframes barPulse {
            0%,100% { box-shadow: 0 0 12px var(--accent-color); }
            50% { box-shadow: 0 0 28px var(--accent-color), 0 0 8px rgba(255,255,255,0.4); }
        }
        .loader-tech-bar.pulsing {
            animation: barPulse 0.9s ease-in-out infinite;
        }

        @keyframes pulseRingAlt {
            0% {
                transform: scale(0.8);
                opacity: 0.1;
                border-color: rgba(var(--accent-color-rgb), 0.2);
            }
            50% {
                transform: scale(1.1);
                opacity: 0.3;
                border-color: rgba(var(--accent-color-rgb), 0.5);
            }
            100% {
                transform: scale(0.8);
                opacity: 0.1;
                border-color: rgba(var(--accent-color-rgb), 0.2);
            }
        }

        @keyframes breath {
            0%, 100% {
                transform: scale(0.8);
                opacity: 0.1;
            }

            50% {
                transform: scale(1.2);
                opacity: 0.2;
            }
        }
        @keyframes iconFloat {
            0%, 100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-10px);
            }
        }
        @keyframes ripple {
            0% {
                width: 0;
                height: 0;
                opacity: 1;
            }

            100% {
                width: 150px;
                height: 150px;
                opacity: 0;
            }
        }
        @keyframes blink-caret {
            from, to {
                border-color: transparent;
            }

            50% {
                border-color: var(--accent-color);
            }
        }

        .batch-preview {
            position: absolute;
            bottom: 100%;
            left: 15px;
            right: 15px;
            margin-bottom: 4px;
            background-color: var(--secondary-bg);
            border-radius: var(--radius);
            padding: 12px;
            box-shadow: var(--shadow);
            display: none;
            flex-direction: column;
            gap: 8px;
            max-height: 150px;
            overflow-y: auto;
            border: 1px solid var(--border-color);
            z-index: 5;
            transition: all 0.5s ease;
            scrollbar-width: none;
            -ms-overflow-style: none;
            animation: batchPreviewSlideUp 0.3s ease;
        }
        .batch-preview::-webkit-scrollbar {
            display: none;
            width: 0;
        }
        @keyframes batchPreviewSlideUp {
            from {
                transform: translateY(10px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        .batch-preview-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background-color: var(--primary-bg);
            border-radius: 8px;
            font-size: 14px;
            transition: background-color 0.5s ease, opacity 0.3s ease;
            user-select: none;
            animation: batchItemAppear 0.2s ease;
        }
        @keyframes batchItemAppear {
            from {
                transform: scale(0.9);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }
        .batch-preview-text {
            flex-grow: 1;
            cursor: text;
            margin-right: 10px;
        }
        .batch-preview-input {
            flex-grow: 1;
            border: none;
            background-color: transparent;
            border-bottom: 1px solid var(--accent-color);
            color: var(--text-primary);
            font-family: var(--font-family);
            font-size: 14px;
            outline: none;
        }
        .batch-preview-remove {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 12px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: var(--transition);
        }
        .batch-preview-remove:hover {
            background-color: var(--border-color);
            color: var(--text-primary);
            transform: scale(1.1);
        }
        .batch-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 8px;
        }
        .batch-action-btn {
            padding: 6px 12px;
            border-radius: 6px;
            border: none;
            font-size: 12px;
            cursor: pointer;
            transition: var(--transition);
            font-family: var(--font-family);
        }
        .batch-send-btn {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
        }
        html[data-theme="dark"] .batch-send-btn {
            background-color: var(--accent-color-dark);
        }
        .batch-cancel-btn {
            background-color: var(--message-received-bg);
            color: var(--text-primary);
        }
        .appearance-group {
    display: flex;
    gap: 15px;
    align-items: stretch; 
    margin-bottom: 20px;
        }

        .theme-editor-entry-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--message-sent-text);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--accent-color-rgb), 0.3);
    border: none;
    text-align: center;
        }

        .theme-editor-entry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--accent-color-rgb), 0.4);
        }

        .theme-editor-entry-btn i {
    font-size: 24px;
    margin-bottom: 8px;
        }

        .theme-editor-entry-btn span {
    font-size: 13px;
    font-weight: 600;
        }

        .preset-colors-container {
    flex: 2;
    background-color: var(--primary-bg);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid var(--border-color);
        }

        .preset-colors-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
        }

        .theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); 
    gap: 8px;
    margin-bottom: 0; 
        }


        @media (max-width: 480px) {
    .appearance-group {
        flex-direction: column; 
    }
    .theme-editor-entry-btn {
        flex-direction: row;
        gap: 10px;
        padding: 12px;
    }
    .theme-editor-entry-btn i {
        font-size: 18px;
        margin-bottom: 0;
    }
        }
        .theme-picker-label {
            font-weight: 500;
            font-size: 14px;
        }
        .theme-color-btn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid var(--border-color);
            cursor: pointer;
            transition: var(--transition);
        }
        .theme-color-btn:hover {
            transform: scale(1.1);
        }
        .theme-color-btn.active {
            border-color: var(--text-primary);
            transform: scale(1.1);
        }
        #theme-gold {
            background-color: #c5a47e;
        }
        #theme-blue {
            background-color: #7FA6CD;
        }
        #theme-purple {
            background-color: #BB9EC7;
        }
        #theme-green {
            background-color: #7BC8A4;
        }
        #theme-pink {
            background-color: #F4A6B3;
        }
        #theme-black-white {
            background: linear-gradient(135deg, #000000 50%, #ffffff 50%);
        }
        #theme-pastel {
            background: linear-gradient(135deg, #A8D8EA, #AA96DA);
        }
        #theme-sunset {
            background: linear-gradient(135deg, #FF9A8B, #FF6B6B);
        }
        #theme-forest {
            background: linear-gradient(135deg, #7BA05B, #556B2F);
        }
        #theme-ocean {
            background: linear-gradient(135deg, #4A90E2, #2E5B9A);
        }

        .font-size-control {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 16px;
        }
        .font-size-label {
            font-weight: 500;
            font-size: 14px;
        }
        .font-size-slider {
            flex: 1;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            height: 6px;
            border-radius: 3px;
            background: var(--message-received-bg);
            outline: none;
        }
        .font-size-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--accent-color);
            cursor: pointer;
            transition: var(--transition);
        }
        .font-size-slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
        }
        .font-size-slider::-moz-range-thumb {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--accent-color);
            cursor: pointer;
            border: none;
        }
        .font-size-value {
            font-size: 14px;
            color: var(--text-secondary);
            min-width: 40px;
            text-align: center;
        }

        .settings-section {
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border-color);
        }
        .settings-section-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--accent-color);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        html[data-theme="dark"] .settings-section-title {
            color: var(--accent-color-dark);
        }


        .notification {
            position: fixed;
            top: 76px;
            left: 50%;
            transform: translateX(-50%) translateY(0);
            background: var(--secondary-bg);
            color: var(--text-primary);
            padding: 10px 18px 10px 14px;
            border-radius: 50px;
            box-shadow: 0 6px 24px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.07);
            z-index: 10001 !important;
            display: flex;
            align-items: center;
            gap: 8px;
            max-width: min(320px, 88vw);
            font-size: 13.5px;
            line-height: 1.4;
            letter-spacing: 0.2px;
            animation: notificationSlideIn 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            border: 1px solid var(--border-color);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        .notification.success {
            border-color: rgba(100,200,120,0.35);
            background: linear-gradient(135deg, var(--secondary-bg) 80%, rgba(100,200,120,0.07));
        }
        .notification.error {
            border-color: rgba(240,80,80,0.3);
            background: linear-gradient(135deg, var(--secondary-bg) 80%, rgba(240,80,80,0.07));
        }
        .notification.warning {
            border-color: rgba(255,193,7,0.35);
            background: linear-gradient(135deg, var(--secondary-bg) 80%, rgba(255,193,7,0.07));
        }
        .notification.info {
            border-color: rgba(var(--accent-color-rgb),0.3);
        }
        @keyframes notificationSlideIn {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(-20px);
            }

            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }
        .notification.hiding {
            animation: notificationSlideOut 0.4s ease-in forwards;
        }
        @keyframes notificationSlideOut {
            from {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }

            to {
                opacity: 0;
                transform: translateX(-50%) translateY(-20px);
            }
        }
        .notification i {
            font-size: 14px;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: var(--accent-color);
        }
        .notification.success i { color: #5cb85c; }
        .notification.error i   { color: #e05555; }
        .notification.warning i { color: #e6a817; }
        html[data-theme="dark"] .notification i {
            color: var(--accent-color-dark);
        }

        .import-export-buttons {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        .import-export-btn {
            flex: 1;
            padding: 10px 15px;
            border-radius: 8px;
            border: none;
            background-color: var(--message-received-bg);
            color: var(--text-primary);
            cursor: pointer;
            transition: var(--transition);
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-family: var(--font-family);
        }
        .import-export-btn:hover {
            background-color: var(--border-color);
            transform: translateY(-2px);
        }
        .import-export-btn.export {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
        }
        html[data-theme="dark"] .import-export-btn.export {
            background-color: var(--accent-color-dark);
        }

        .date-divider {
            display: flex;
            align-items: center;
            margin: 20px 0;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 500;
        }
        .date-divider::before, .date-divider::after {
            content: "";
            flex: 1;
            height: 1px;
            background-color: var(--border-color);
        }
        .date-divider span {
            padding: 0 12px;
        }


        .coin-toss-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(20, 20, 20, 0.6);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            z-index: 2000;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        .coin-toss-overlay.visible {
            display: flex;
            opacity: 1;
        }

        .coin-container {
            perspective: 1200px;
            margin-bottom: 40px;
            filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.2));
        }

        .coin {
            width: 180px;
            height: 180px;
            position: relative;
            transform-style: preserve-3d;
            border-radius: 50%;
        }

        .coin.flipping-heads {
            animation: flip-coin-heads 3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
        }
        .coin.flipping-tails {
            animation: flip-coin-tails 3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
        }

        .coin-face {
            position: absolute;
            width: 100%;
            height: 100%;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-family: 'Noto Serif SC', serif;
            border: 8px solid rgba(255, 255, 255, 0.2);
            box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
        }

        .coin-front {
            background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
            color: #333;
            transform: rotateY(0deg);
        }
        .coin-front::after {
            content: "";
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            border: 1px dashed #bdc3c7;
            border-radius: 50%;
        }

        .coin-back {
            background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
            color: #fdfbfb;
            transform: rotateY(180deg);
        }
        .coin-back::after {
            content: "";
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            border: 1px dashed #7f8c8d;
            border-radius: 50%;
        }

        .coin-text-main {
            font-size: 48px;
            font-weight: 400;
            letter-spacing: 4px;
            margin-bottom: 5px;
        }
        .coin-text-sub {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 2px;
            opacity: 0.78;
            font-family: sans-serif;
        }


        .coin-result-container {
            min-height: 60px;
            display: flex;
            justify-content: center;
        }

        .coin-result-text {
            font-family: 'Noto Serif SC', serif;
            font-size: 15px;
            color: #fff;
            font-weight: 300;
            opacity: 0.8;
            letter-spacing: 3px;
            transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
            margin-top: 20px;
            text-align: center;
        }


        .coin-toss-overlay.finished .coin-result-text {
            font-size: 28px;
            opacity: 1;
            font-weight: 500;
            letter-spacing: 2px;
            text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
            transform: scale(1.1);
        }


        .coin-confirm-buttons {
            display: flex;
            gap: 15px;
            margin-top: 30px;
            justify-content: center;

            opacity: 0;
            transform: translateY(20px);
            pointer-events: none;


            transition: opacity 0.3s ease, transform 0.3s ease;
        }


        .coin-toss-overlay.finished .coin-confirm-buttons {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;

            transition-delay: 0.3s;
        }

        .coin-btn-action {
            padding: 10px 24px;
            border-radius: 30px;
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.05);
            color: rgba(255,255,255,0.8);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-family: var(--font-family);
            backdrop-filter: blur(5px);
        }
        .coin-btn-action:hover {
            background: rgba(255,255,255,0.2);
            color: #fff;
            transform: translateY(-2px);
        }

        .coin-btn-primary {
            background: #fff;
            color: #000;
            border-color: #fff;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }
        .coin-btn-primary:hover {
            background: #f0f0f0;
            box-shadow: 0 6px 20px rgba(255,255,255,0.3);
            transform: translateY(-2px) scale(1.02);
        }

        @keyframes flip-coin-heads {
            0% {
                transform: rotateY(0deg) scale(1);
                animation-timing-function: ease-in;
            }
            35% {
                transform: rotateY(900deg) scale(1.35);
                animation-timing-function: ease-out;
            }
            75% {
                transform: rotateY(1800deg) scale(1.1);
            }
            100% {
                transform: rotateY(2160deg) scale(1);
            }
        }

        @keyframes flip-coin-tails {
            0% {
                transform: rotateY(0deg) scale(1);
                animation-timing-function: ease-in;
            }
            35% {
                transform: rotateY(900deg) scale(1.35);
                animation-timing-function: ease-out;
            }
            75% {
                transform: rotateY(1980deg) scale(1.1);
            }
            100% {
                transform: rotateY(2340deg) scale(1);
            }
        }

        .settings-footer {
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px solid var(--border-color);
            text-align: center;
            font-size: 12px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .settings-footer a {
            color: var(--accent-color);
            text-decoration: none;
        }

        .settings-footer a:hover {
            text-decoration: underline;
        }

        #session-modal .modal-content {
            max-width: 500px;
        }
        .session-list {
            flex: 1;
            overflow-y: auto;
            margin: 0 -10px;
            padding: 0 10px;
            max-height: 50vh;
        }
        .session-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            margin-bottom: 10px;
            transition: var(--transition);
        }
        .session-item:hover {
            background-color: var(--primary-bg);
            transform: translateX(5px);
        }
        .session-item.active {
            border-color: var(--accent-color);
            background-color: rgba(var(--accent-color-rgb), 0.1);
            font-weight: 600;
        }
        .session-info {
            cursor: pointer;
            flex-grow: 1;
        }
        .session-name {
            font-size: 15px;
        }
        .session-meta {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 4px;
        }
        .session-actions {
            display: flex;
            gap: 8px;
        }
        .session-action-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 14px;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        .session-action-btn:hover {
            color: var(--text-primary);
            background-color: var(--border-color);
            transform: scale(1.1);
        }
        .session-action-btn.delete:hover {
            color: #e53935;
        }


        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 15px 0;
            gap: 10px;
        }

        .pagination-btn {
            background-color: var(--message-received-bg);
            border: none;
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 14px;
            color: var(--text-primary);
            cursor: pointer;
            transition: var(--transition);
        }

        .pagination-btn:hover:not(:disabled) {
            background-color: var(--border-color);
            transform: translateY(-2px);
        }

        .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination-info {
            font-size: 14px;
            color: var(--text-secondary);
        }


        .fortune-card.tarot-style {
            background-color: var(--secondary-bg);
            border-radius: 16px;
            padding: 0;
            box-shadow: 0 10px 40px -10px rgba(0,0,0,0.15);
            overflow: hidden;
            text-align: center;
            position: relative;
            border: 1px solid var(--border-color);
            transition: transform 0.3s ease;
        }


        .fortune-card.tarot-style::before {
            content: "";
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            pointer-events: none;
        }


        .tarot-header {
            padding: 20px 0 10px;
            font-size: 12px;
            letter-spacing: 3px;
            color: var(--text-secondary);
            text-transform: uppercase;
            font-weight: 600;
        }


        .tarot-visual {
            height: 160px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 10px auto;
            position: relative;
        }


        .tarot-icon-vector {
            font-size: 64px;
            color: var(--text-primary);
            opacity: 0.8;
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
            transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }


        .tarot-visual.reversed .tarot-icon-vector {
            transform: rotate(180deg);
            opacity: 0.6;
        }

        .tarot-visual.reversed img {
            transform: rotate(180deg);
            transform-origin: center center;
        }


        .tarot-card-name {
            font-family: var(--font-family);
            font-size: 22px;
            font-weight: 600;
            margin-bottom: 5px;
            color: var(--text-primary);
            letter-spacing: 1px;
        }


        .tarot-position-badge {
            display: inline-block;
            font-size: 12px;
            padding: 4px 12px;
            border-radius: 20px;
            background-color: var(--primary-bg);
            color: var(--text-secondary);
            border: 1px solid var(--border-color);
            margin-bottom: 20px;
            font-weight: 500;
        }

        .tarot-position-badge.reversed {
            color: #e57373;
            background-color: rgba(229, 115, 115, 0.1);
            border-color: rgba(229, 115, 115, 0.2);
        }


        .tarot-details {
            padding: 0 30px 30px;
            position: relative;
            z-index: 2;
        }

        .tarot-divider {
            height: 1px;
            width: 40px;
            background-color: var(--accent-color);
            margin: 0 auto 15px;
        }

        .tarot-keyword {
            font-size: 14px;
            font-weight: 600;
            color: var(--accent-color);
            margin-bottom: 10px;
            letter-spacing: 1px;
        }

        .fortune-desc {
            font-size: 14px;
            line-height: 1.8;
            color: var(--text-secondary);
            font-style: italic;
        }

        .fortune-tip {
            margin-top: 15px;
            font-size: 12px;
            color: var(--text-secondary);
            opacity: 0.7;
            border-top: 1px dashed var(--border-color);
            padding-top: 10px;
        }


        .fortune-card {
            animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }
        @keyframes fadeUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }


        .batch-favorite-mode .message-wrapper {
            cursor: pointer;
        }

        .batch-favorite-mode .message-wrapper:hover .message {
            box-shadow: 0 0 0 2px var(--accent-color);
        }

        .batch-favorite-mode .message-wrapper.selected .message {
            box-shadow: 0 0 0 2px var(--favorite-color);
        }


        
        .fav-card {
            background-color: var(--primary-bg);
            border-radius: 12px;
            padding: 14px;
            border: 1px solid var(--border-color);
            position: relative;
            transition: transform 0.2s, box-shadow 0.2s;
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }
        .fav-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
            border-color: rgba(var(--accent-color-rgb), 0.3);
        }
        .fav-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
            border: 1px solid var(--border-color);
            background-color: var(--secondary-bg);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 14px;
        }
        .fav-content-wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .fav-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .fav-sender-name {
            font-weight: 600;
            color: var(--accent-color);
        }
        .fav-bubble {
            background-color: var(--secondary-bg);
            padding: 8px 12px;
            border-radius: 8px;
            border-top-left-radius: 2px;
            font-size: 14px;
            line-height: 1.5;
            color: var(--text-primary);
            border: 1px solid rgba(0,0,0,0.03);
            word-break: break-all;
        }
        .fav-bubble img {
            max-width: 100%;
            border-radius: 6px;
            display: block;
            margin-top: 5px;
        }
        .fav-action-btn {
            align-self: flex-end;
            font-size: 11px;
            color: var(--text-secondary);
            background: none;
            border: none;
            cursor: pointer;
            margin-top: 4px;
            opacity: 0.6;
            transition: 0.2s;
        }
        .fav-action-btn:hover {
            color: #e53935;
            opacity: 1;
            text-decoration: underline;
        }

        .no-favorites {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 0;
            color: var(--text-secondary);
            opacity: 0.6;
        }
        .no-favorites i {
            font-size: 36px;
            margin-bottom: 10px;
            color: var(--border-color);
        }


        .batch-favorite-checkbox {
            position: absolute;
            left: -35px;
            top: 50%;
            transform: translateY(-50%) scale(0);
            width: 22px;
            height: 22px;
            border-radius: 50%;
            border: 2px solid var(--text-secondary);
            background-color: var(--secondary-bg);
            cursor: pointer;
            z-index: 10;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
        }
        .batch-favorite-checkbox.checked {
            background-color: #ffc107;
            border-color: #ffc107;
            box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
        }
        .batch-favorite-checkbox.checked::after {
            content: "✓";
            font-weight: 900;
            color: #fff;
            font-size: 12px;
        }

        .batch-favorite-mode .message-wrapper {
            transform: translateX(30px);
            transition: transform 0.3s ease;
        }

        .batch-favorite-mode .message-wrapper .batch-favorite-checkbox {
            transform: translateY(-50%) scale(1);
            opacity: 1;
        }

        .message-wrapper.selected .message {
            box-shadow: 0 0 0 2px #ffc107, 0 4px 12px rgba(255, 193, 7, 0.2);
            transform: scale(1.02);
        }

        .batch-favorite-actions {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: rgba(var(--secondary-bg-rgb), 0.9);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(128,128,128,0.2);
            border-radius: 50px;
            padding: 8px 10px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            display: flex;
            gap: 10px;
            z-index: 2002;
            animation: floatUpAction 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }
        @keyframes floatUpAction {
            to {
                transform: translateX(-50%) translateY(0);
            }
        }

        .batch-action-btn-pill {
            padding: 10px 20px;
            border-radius: 25px;
            border: none;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 6px;
            font-family: var(--font-family);
        }
        .batch-btn-confirm {
            background-color: #ffc107;
            color: #fff;
            box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
        }
        .batch-btn-confirm:hover {
            transform: translateY(-2px);
            filter: brightness(1.1);
        }
        .batch-btn-cancel {
            background-color: transparent;
            color: var(--text-primary);
        }
        .batch-btn-cancel:hover {
            background-color: var(--border-color);
        }


        #custom-replies-modal .modal-content {
            background-color: var(--primary-bg);
            display: flex;
            flex-direction: column;
            max-height: 80vh;
            padding: 0;
            height: 90vh; 
            max-height: 90vh; 
        }


        #custom-replies-modal .modal-title {
            padding: 20px 24px 10px;
            background-color: var(--secondary-bg);
            margin-bottom: 0;
            font-size: 18px;
            border-bottom: none;
            flex-shrink: 0; 
        }


        .reply-tabs {
            display: flex;
            padding: 0 20px 15px;
            background-color: var(--secondary-bg);
            gap: 12px;
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0; 
        }

        .reply-tab-btn {
            flex: 1;
            padding: 10px 0;
            border-radius: 20px;

            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            background-color: var(--primary-bg);
            color: var(--text-secondary);
            border: 1px solid transparent;
            position: relative;
            overflow: hidden;
        }

        .reply-tab-btn:hover {
            background-color: var(--border-color);
            color: var(--text-primary);
        }

        .reply-tab-btn.active {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
            box-shadow: 0 4px 10px rgba(var(--accent-color-rgb), 0.3);
            transform: translateY(-1px);
        }


        .reply-toolbar {
            padding: 15px 20px;
            display: flex;
            gap: 12px;
            align-items: center;
            background-color: var(--primary-bg);
            flex-shrink: 0; 
        }

        .reply-search {
            flex: 1;
            background-color: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 10px 16px;
            font-size: 14px;
            color: var(--text-primary);
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(0,0,0,0.02);
        }

        .reply-search:focus {
            border-color: var(--accent-color);
            background-color: var(--secondary-bg);
            box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.15);
            transform: translateY(-1px);
        }

        .reply-tool-btn {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background-color: var(--secondary-bg);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }

        .reply-tool-btn:hover {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
            border-color: var(--accent-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(var(--accent-color-rgb), 0.2);
        }

        .custom-replies-list {
            padding: 10px 20px;
            gap: 12px;
            background-color: var(--primary-bg);
            flex: 1;
            overflow-y: auto;
            min-height: 0;
        }
        .reply-list-with-buttons {
            padding-bottom: 90px !important; 
        }

        .custom-reply-item {
            background-color: var(--secondary-bg);
            border-radius: var(--radius);

            padding: 16px 18px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border: 1px solid var(--border-color);
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            box-shadow: 0 10px 28px rgba(0,0,0,0.06);
            position: relative;
            overflow: hidden;
        }

        .custom-reply-item:hover {
            transform: translateY(-2px) scale(1.01);
            box-shadow: 0 18px 45px rgba(0,0,0,0.12);
            border-color: rgba(var(--accent-color-rgb), 0.3);
        }
        .custom-reply-text {
    flex: 1;
    white-space: normal; 
    word-break: break-all; 
    line-height: 1.4;
    padding-right: 10px;
    font-size: 14px;
        }


        .custom-reply-item.disabled {
            background-color: rgba(var(--primary-bg-rgb), 0.5);
            border-style: dashed;
            opacity: 0.7;
        }
        .custom-reply-item.disabled .custom-reply-text {
            text-decoration: line-through;
            color: var(--text-secondary);
        }

        .custom-reply-actions {
            display: flex;
            gap: 8px;
            flex-shrink: 0;
        }

        .reply-action-mini {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            border: none;
            background-color: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.18s ease;
            font-size: 13px;
            opacity: 0.7;
        }
        .reply-action-mini:hover {
            opacity: 1;
            transform: translateY(-1px);
        }

        .reply-action-mini.edit-reply:hover,
        .reply-action-mini.modify-default:hover,
        .reply-action-mini.edit-btn:hover {
            background-color: rgba(var(--accent-color-rgb), 0.12);
            border-color: rgba(var(--accent-color-rgb), 0.3);
            color: var(--accent-color);
        }

        .reply-action-mini.delete-reply:hover,
        .reply-action-mini.delete-btn:hover {
            background-color: rgba(239, 68, 68, 0.08);
            border-color: rgba(239, 68, 68, 0.3);
            color: #ef4444;
        }

        .reply-action-mini.toggle-default:hover {
            background-color: rgba(var(--accent-color-rgb), 0.08);
            color: var(--accent-color);
        }

        #custom-replies-modal .modal-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: rgba(var(--secondary-bg-rgb), 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    margin-top: 0;
    flex-shrink: 0;
        }

        #add-custom-reply {
            background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
            color: var(--message-sent-text);
            border: none;
            padding: 12px;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 600;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 15px rgba(var(--accent-color-rgb), 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        #add-custom-reply:hover {
            filter: brightness(1.1);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(var(--accent-color-rgb), 0.4);
        }


        html[data-theme="dark"] .custom-reply-item {
            background-color: rgba(255,255,255,0.03);
        }
        html[data-theme="dark"] .reply-action-mini {
            border-color: rgba(255,255,255,0.1);
        }


        .stats-dashboard {
            display: flex;
            flex-direction: column;
            gap: 15px;
            padding: 5px 0;
        }


        .stats-card {
            background-color: var(--primary-bg);
            border-radius: 16px;
            padding: 16px;
            border: 1px solid var(--border-color);
            margin-bottom: 5px;
        }


        .stats-overview-grid {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .overview-item.overview-large {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 16px 8px;
            background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.12), rgba(var(--accent-color-rgb), 0.04));
            border-radius: 14px;
            text-align: center;
            border: 1px solid rgba(var(--accent-color-rgb), 0.2);
        }

        .overview-item.overview-large .overview-value {
            font-size: 36px;
            color: var(--accent-color);
        }

        .overview-row-two {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .overview-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 12px 8px;
            background-color: var(--secondary-bg);
            border-radius: 12px;
            text-align: center;
            border: 1px solid transparent;
        }

        .overview-item:hover {
            border-color: var(--border-color);
            background-color: var(--primary-bg);
        }

        .overview-item.overview-date {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            gap: 12px;
            padding: 11px 14px;
            text-align: left;
        }

        .overview-date-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: rgba(var(--accent-color-rgb), 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent-color);
            font-size: 13px;
            flex-shrink: 0;
        }

        .overview-date-label {
            font-size: 10px;
            color: var(--text-secondary);
            margin-bottom: 3px;
            letter-spacing: 0.3px;
        }

        .overview-date-value {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            letter-spacing: 0.3px;
        }

        .overview-row-dates {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .overview-value {
            font-family: 'Georgia', serif;
            font-size: 22px;
            font-weight: 700;
            color: var(--accent-color);
            line-height: 1.2;
        }

        .overview-label {
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 4px;
        }


        .stats-card-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
            border-bottom: 1px dashed var(--border-color);
            padding-bottom: 8px;
        }

        .stats-rank-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .stats-toggle-btn {
            flex: 1;
            padding: 8px 12px;
            border: 1.5px solid var(--border-color);
            border-radius: 20px;
            background: var(--secondary-bg);
            color: var(--text-secondary);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.25s ease;
            font-family: var(--font-family);
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        .stats-toggle-btn.active {
            background: var(--accent-color);
            color: #fff;
            border-color: var(--accent-color);
            box-shadow: 0 2px 8px rgba(var(--accent-color-rgb), 0.3);
        }
        .stats-toggle-btn:not(.active):hover {
            border-color: var(--accent-color);
            color: var(--accent-color);
        }

        .rank-item {
            position: relative;
            display: flex;
            align-items: center;
            padding: 8px 10px;
            background: transparent;
            border-radius: 8px;
            overflow: hidden;
            min-height: 44px;
        }


        .rank-progress-bg {
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            background-color: rgba(var(--accent-color-rgb), 0.12);
            z-index: 0;
            border-radius: 8px;
            transition: width 0.6s ease;
        }


        .rank-info {
            position: relative;
            z-index: 1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            gap: 12px;
        }

        .rank-number {
            width: 24px;
            font-weight: 800;
            font-style: italic;
            color: var(--text-secondary);
            opacity: 0.5;
            flex-shrink: 0;
            text-align: center;
            font-size: 14px;
        }

        .rank-item:nth-child(1) .rank-number {
            color: #FFD700;
            opacity: 1;
            text-shadow: 0 1px 0 rgba(0,0,0,0.1);
            font-size: 16px;
        }
        .rank-item:nth-child(2) .rank-number {
            color: #9EA1A3;
            opacity: 1;
            font-size: 15px;
        }
        .rank-item:nth-child(3) .rank-number {
            color: #CD7F32;
            opacity: 1;
            font-size: 15px;
        }


        .rank-text {
            flex: 1;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            line-height: 1.4;
            white-space: normal;
            word-break: break-all;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .rank-count {
            flex-shrink: 0;
            font-size: 12px;
            color: var(--accent-color);
            font-weight: 700;
            background-color: var(--secondary-bg);
            padding: 4px 8px;
            border-radius: 6px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            border: 1px solid var(--border-color);
            min-width: 40px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }
        .rank-count small {
            font-size: 9px;
            opacity: 0.7;
            font-weight: normal;
            margin-top: 2px;
        }

        .stats-empty-state {
            text-align: center;
            padding: 30px 10px;
            color: var(--text-secondary);
        }

        #stats-modal .modal-content {
            display: flex;
            flex-direction: column;
            max-height: 85vh;
            padding: 20px;
            overflow: hidden;
        }

        #stats-modal .modal-title {
            flex-shrink: 0;
            margin-bottom: 15px;
        }

        #stats-content {
            flex: 1;
            overflow-y: auto;
            min-height: 0;
            padding-right: 5px;
            margin-bottom: 15px;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        #stats-content::-webkit-scrollbar {
            display: none;
        }

        #stats-modal .modal-buttons {
            flex-shrink: 0;
            margin-top: 0;
            padding-top: 10px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: flex-end;
        }
        
        

        #anniversary-modal .modal-content {
    padding: 0;
    background-color: var(--primary-bg);
    display: flex;
    flex-direction: column;
    height: 82vh; 
    max-height: 82vh;
    overflow: hidden;
    position: relative;
        }

        .ann-header-card {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark, var(--accent-color)) 60%, rgba(var(--accent-color-rgb),0.7) 100%);
    color: #fff;
    opacity: 0.72;
    padding: 0;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    z-index: 5;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    align-items: stretch;
        }

        .ann-header-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.4s;
        }

        .ann-header-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
        }

        .ann-header-card-inner {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 18px;
    gap: 2px;
        }

        .ann-header-upload-btn {
    position: static;
    z-index: 5;
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
        }
        .ann-header-upload-btn:hover { background: rgba(255,255,255,0.35); }

        #ann-card-toolbar {
    display: none;
    padding: 8px 14px 4px;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2px;
        }

        .ann-header-card::before {
    content: '❤︎';
    position: absolute;
    font-size: 80px;
    right: -10px;
    top: -10px;
    opacity: 0.08;
    pointer-events: none;
    line-height: 1;
    z-index: 1;
        }

        .ann-header-icon {
    font-size: 22px;
    margin-bottom: 4px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
        }

        .ann-header-label {
    font-size: 10px;
    letter-spacing: 3px;
    opacity: 0.75;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
        }

        .ann-header-title {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.82;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
        }

        .ann-header-days {
    font-size: 54px;
    font-weight: 800;
    font-family: 'Georgia', serif;
    margin: 2px 0;
    line-height: 1;
    text-shadow: none;
    letter-spacing: -2px;
    opacity: 0.92;
        }

        .ann-header-days-unit {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
    margin-left: 4px;
    letter-spacing: 0;
    vertical-align: baseline;
        }

        .ann-header-date {
    font-size: 11px;
    background: rgba(255,255,255,0.14);
    padding: 4px 14px;
    border-radius: 20px;
    display: inline-block;
    backdrop-filter: blur(5px);
    margin-top: 6px;
    letter-spacing: 0.4px;
    opacity: 0.86;
        }

        .ann-header-milestones {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
        }

        .ann-milestone-chip {
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
        }

        .ann-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
        }

        .ann-item-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
        }

        .ann-item-card.ann-item-active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.18);
        }

        .ann-item-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
        }

        .ann-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
        }

        .ann-item-card.type-past {
    background: linear-gradient(135deg, rgba(255,154,158,0.06) 0%, var(--secondary-bg) 60%);
        }
        .ann-item-card.type-past::before { background: linear-gradient(180deg, #ff9a9e, #fecfef); }

        .ann-item-card.type-future {
    background: linear-gradient(135deg, rgba(118,75,162,0.07) 0%, var(--secondary-bg) 60%);
        }
        .ann-item-card.type-future::before { background: linear-gradient(180deg, #764ba2, #a78bfa); }

        .ann-item-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
    padding-left: 10px;
        }

        .ann-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
        }

        .ann-item-date {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
        }

        .ann-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
        }
        .ann-item-card.type-past .ann-tag {
    background: rgba(255,154,158,0.18);
    color: #d14d6e;
    border: 1px solid rgba(255,154,158,0.3);
        }
        .ann-item-card.type-future .ann-tag {
    background: rgba(118,75,162,0.13);
    color: #764ba2;
    border: 1px solid rgba(118,75,162,0.25);
        }

        html[data-theme="dark"] .ann-item-card.type-past .ann-tag { color: #ff9a9e; }
        html[data-theme="dark"] .ann-item-card.type-future .ann-tag { color: #c4b5fd; }

        .ann-item-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 12px;
        }

        .ann-item-days {
    font-size: 26px;
    font-weight: 800;
    font-family: 'Georgia', serif;
    line-height: 1;
    letter-spacing: -0.5px;
        }
        .ann-item-card.type-past .ann-item-days { color: #e07a8f; }
        .ann-item-card.type-future .ann-item-days { color: #764ba2; }
        html[data-theme="dark"] .ann-item-card.type-past .ann-item-days { color: #ffa0b0; }
        html[data-theme="dark"] .ann-item-card.type-future .ann-item-days { color: #c4b5fd; }

        .ann-item-days-unit {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-family);
    letter-spacing: 0;
        }

        .ann-item-days-label {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.75;
        }

        .ann-delete-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    margin-left: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
    border: 1px solid transparent;
        }

        .ann-delete-btn:hover {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
    transform: scale(1.1);
        }

        .ann-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 12px;
    padding: 40px 20px;
        }

        .ann-empty-icon {
    font-size: 52px;
    opacity: 0.3;
        }

        .ann-empty p {
    font-size: 14px;
    opacity: 0.6;
    text-align: center;
    line-height: 1.6;
        }

        .ann-footer {
    padding: 14px 16px;
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    z-index: 10;
        }

        .ann-editor-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--secondary-bg);
    z-index: 20;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
        }

        .ann-editor-slide.active {
    transform: translateY(0);
        }

        .ann-editor-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(var(--accent-color-rgb),0.08), transparent);
        }

        .ann-back-btn {
    background: none;
    border: none;
    font-size: 18px;
    margin-right: 15px;
    color: var(--accent-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
        }

        .ann-back-btn:hover {
    background: rgba(var(--accent-color-rgb), 0.12);
        }

        .ann-editor-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
        }

        .ann-form-group {
    margin-bottom: 22px;
        }

        .ann-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
        }

        .ann-label i {
    color: var(--accent-color);
    font-size: 13px;
        }

        .ann-type-selector {
    display: flex;
    gap: 10px;
        }

        .ann-type-btn {
    flex: 1;
    padding: 13px 10px;
    border: 2px solid var(--border-color);
    background: var(--primary-bg);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
        }

        .ann-type-btn .ann-type-hint {
            font-size: 10px;
            opacity: 0.72;
            font-weight: 400;
        }

        .ann-type-btn.active {
    background: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px rgba(var(--accent-color-rgb), 0.2);
        }


        @media (max-width: 768px) {
    .message-input, 
    .modal-input, 
    .modal-textarea,
    .reply-search,
    #my-status-input {
        font-size: 16px !important; 
    }
    .user-info {
        min-width: 45px;
    }
    .avatar {
        width: 48px;
        height: 48px;
    }
    .username {
        font-size: 12px;
        max-width: 55px;
    }
    .status {
        font-size: 10px;
    }
    .header-motto {
        font-size: 9px;
        top: 5px;
    }
    .header-actions {
        gap: 6px;
    }
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .chat-container {
        padding: 20px 10px;
    }
    .message-wrapper {
        max-width: 90%;
    }
    .input-area {
        padding: 10px 12px;
        gap: 8px;
    }
    .input-btn {
        width: 42px;
        height: 42px;
    }
    .message-input {
        min-height: 42px;
        padding: 10px 16px;
    }
    .modal-content {
        width: 95%;
        max-width: none;
    }
    .batch-preview {
        left: 10px;
        right: 10px;
        bottom: 100%;
    }
    .stats-content {
        max-height: 300px;
    }
        }

        @media (max-width: 480px) {
    .header-inner {
        padding: 10px 6px;
    }
    .user-info {
        min-width: 40px;
    }
    .avatar {
        width: 40px;
        height: 40px;
    }
    .username {
        font-size: 11px;
        max-width: 45px;
    }
    .status {
        font-size: 9px;
        padding: 1px 4px;
    }
    .header-motto {
        font-size: 8px;
        top: 4px;
    }
    .header-actions {
        gap: 4px;
    }
    .action-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .chat-container {
        padding: 15px 8px;
    }
    .input-area {
        padding: 8px 10px;
        gap: 6px;
    }
    .input-btn {
        width: 38px;
        height: 38px;
    }
    .message-input {
        min-height: 38px;
        padding: 8px 14px;
        font-size: 14px;
    }
    .batch-preview {
        left: 8px;
        right: 8px;
        bottom: 100%;
        max-height: 130px;
    }
    .empty-state i {
        font-size: 48px;
    }
    .empty-state p {
        font-size: 14px;
    }
        }

        @media (min-width: 481px) and (max-width: 1024px) {
    .sticker-picker-popover {
        width: min(320px, calc(100vw - 40px));
        height: min(350px, calc(100svh - 200px));
        right: 0;
        bottom: calc(100% + 6px);
        max-height: calc(100svh - 180px);
    }
    .input-area {
        padding: 8px 10px;
    }
    .input-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
        }

        @media (max-width: 1024px) {
    .sticker-picker-popover {
        max-height: calc(100svh - 160px);
        height: min(350px, calc(100svh - 160px));
        bottom: calc(100% + 6px);
    }
    .combo-content-area {
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
        }

        @media (max-width: 360px) {
    .username {
        display: none;
    }
    .user-info {
        gap: 2px;
    }
    .header-inner {
        padding: 8px 5px;
    }
    .input-buttons {
        gap: 5px;
    }
    .input-btn {
        width: 36px;
        height: 36px;
    }
        }

        .report-card {
    background-color: rgba(255,255,255,0.5);
            border-radius: var(--radius);
    padding: 20px;
            margin-bottom: 15px;
            box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    animation: slideInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
        }

        html[data-theme="dark"] .report-card {
    background-color: rgba(30,30,30,0.5);
    border: 1px solid rgba(255,255,255,0.05);
        }

        .report-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
        }

        .report-card .highlight-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
    margin: 5px 0;
        }

        .report-card .sub-text {
    font-size: 12px;
    opacity: 0.82;
    line-height: 1.5;
        }

        .report-tag {
    display: inline-block;
    background: var(--message-received-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
        }

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

        .settings-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
            padding: 10px 5px;
        }

        .settings-card {
            background-color: var(--primary-bg);
            border-radius: var(--radius);
            padding: 25px 15px;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
            position: relative;
            overflow: hidden;
        }


        .settings-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 14px 32px rgba(0, 0, 0, 0.10);
            border-color: var(--accent-color);
            background-color: var(--secondary-bg);
        }


        .settings-card i {
            font-size: 28px;
            color: var(--accent-color);
            width: 64px;
            height: 64px;
            background-color: rgba(var(--accent-color-rgb), 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 5px;
            transition: all 0.4s ease;
        }

        html[data-theme="dark"] .settings-card i {
            background-color: rgba(var(--accent-color-rgb), 0.2);
        }


        .settings-card:hover i {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.28);
        }

        .settings-card span {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
            letter-spacing: 0.5px;
        }


        .settings-footer {
            margin-top: 25px;
            padding: 20px;
            border-radius: 16px;
            background-color: rgba(var(--primary-bg-rgb), 0.5);
            border: 1px dashed var(--border-color);
            text-align: center;
            font-size: 12px;
            color: var(--text-secondary);
            line-height: 1.8;
        }

        .settings-footer p {
            margin: 2px 0;
        }

        @media (max-width: 480px) {
            .settings-grid {
                gap: 10px;
                padding: 6px 2px;
            }
            .settings-card {
                padding: 16px 10px;
                gap: 8px;
                border-radius: 16px;
            }
            .settings-card i {
                width: 44px;
                height: 44px;
                font-size: 19px;
                margin-bottom: 0;
            }
            .settings-card span {
                font-size: 12.5px;
                letter-spacing: 0.2px;
            }
        }
        @media (max-width: 380px) {
            .settings-grid {
                gap: 8px;
            }
            .settings-card {
                padding: 13px 8px;
                gap: 6px;
                border-radius: 14px;
            }
            .settings-card i {
                width: 38px;
                height: 38px;
                font-size: 16px;
            }
            .settings-card span {
                font-size: 11.5px;
            }
        }
        @media (max-width: 320px) {
            .settings-card {
                padding: 10px 6px;
                gap: 5px;
            }
            .settings-card i {
                width: 34px;
                height: 34px;
                font-size: 14px;
            }
            .settings-card span {
                font-size: 11px;
            }
        }


        .anniversary-animation {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 3000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.5s ease;
        }

        .anniversary-animation.active {
            opacity: 1;
            pointer-events: all;
        }

        .anniversary-animation-content {
            background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
            border-radius: 20px;
            padding: 30px;
            text-align: center;
            color: white;
            max-width: 80%;
            box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
            transform: scale(0.8);
            opacity: 0;
            transition: all 0.5s ease;
        }

        .anniversary-animation.active .anniversary-animation-content {
            transform: scale(1);
            opacity: 1;
        }

        .anniversary-animation-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 8px;
            opacity: 0.88;
        }

        .anniversary-animation-days {
            font-size: 36px;
            font-weight: bold;
            margin: 16px 0;
            text-shadow: none;
            opacity: 0.92;
        }

        .anniversary-animation-message {
            font-size: 13px;
            opacity: 0.72;
        }


        .anniversary-type-selector {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }

        .anniversary-type-btn {
            flex: 1;
            padding: 10px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            background-color: var(--primary-bg);
            color: var(--text-primary);
            cursor: pointer;
            transition: var(--transition);
            text-align: center;
        }

        .anniversary-type-btn.active {
            background-color: var(--accent-color);
            color: var(--message-sent-text);
            border-color: var(--accent-color);
        }

        .anniversary-type-btn:hover {
            transform: translateY(-2px);
        }
        .player-container {
            position: fixed;
            top: 100px;
            left: 20px;
            width: 300px;
            height: 148px;
            background: rgba(var(--secondary-bg-rgb), 0.9);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 28px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 1px 0 rgba(255,255,255,0.06) inset;
            transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            border-radius 0.4s ease,
            opacity 0.3s ease, visibility 0.3s ease;
            z-index: 990;
            overflow: hidden;
            cursor: grab;
            border: 1px solid rgba(var(--accent-color-rgb), 0.12);
            display: none;
            touch-action: none;
        }

        .player-container.visible {
            display: block;
        }

        .player-container:active {
            cursor: grabbing;
        }

        .player-container.collapsed {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            padding: 0;
            border-color: rgba(var(--accent-color-rgb), 0.25);
            box-shadow: 0 4px 20px rgba(var(--accent-color-rgb), 0.2), 0 1px 0 rgba(255,255,255,0.06) inset;
        }

        .full-view {
            opacity: 1;
            transform: translateY(0);
            transition: all 0.3s ease 0.1s;
            padding: 15px 20px;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .player-container.collapsed .full-view {
            opacity: 0;
            pointer-events: none;
            transform: translateY(-20px);
            position: absolute;
        }

        .mini-view {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .player-container.collapsed .mini-view {
            opacity: 1;
            pointer-events: auto;
        }


        .vinyl-record {
            width: 44px;
            height: 44px;
            background-color: #1a1a1a;

            border-radius: 50%;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 3px 12px rgba(0,0,0,0.25);
            animation: spin 4s linear infinite;
            animation-play-state: paused;

            border: 2.5px solid rgba(var(--accent-color-rgb), 0.5);

            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            transition: border-color 0.5s ease, box-shadow 0.3s ease, background-color 0.3s ease;
        }
        .vinyl-record.has-cover {
            background-color: transparent;
        }


        .player-container.collapsed.playing .vinyl-record {
            animation-play-state: running;
        }
        @keyframes spin {
            100% {
                transform: rotate(360deg);
            }
        }


        .vinyl-record::after {
            content: '';
            width: 10px;
            height: 10px;
            background: var(--accent-color);

            border-radius: 50%;
            position: absolute;
            z-index: 1;
            transition: background-color 0.5s ease;
        }


        .vinyl-record svg {
            width: 14px;
            height: 14px;
            fill: var(--accent-color);

            z-index: 2;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .mini-view:hover .vinyl-record svg {
            opacity: 1;
        }


        .vinyl-record.has-cover::after {
            display: none !important;
            width: 0;
            height: 0;
            opacity: 0;
        }


        .vinyl-record.has-cover svg {
            display: none !important;
        }


        #upload-cover-btn:hover {
            border-color: var(--accent-color);
            color: var(--accent-color);
            transform: scale(1.1);
        }

        .minimize-btn {
            position: absolute;
            top: 10px;
            right: 15px;
            width: 24px;
            height: 24px;
            cursor: pointer;
            opacity: 0.6;
            transition: opacity 0.2s;
            z-index: 10;
            color: var(--text-secondary);
        }
        .minimize-btn:hover {
            opacity: 1;
            color: var(--text-primary);
        }
        .minimize-btn svg {
            width: 100%;
            height: 100%;
            fill: currentColor;
        }

        .track-info {
            text-align: center;
            margin-top: 5px;
        }
        .track-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            letter-spacing: 0.2px;
        }
        .track-sub {
            font-size: 11px;
            color: var(--text-secondary);
            opacity: 0.85;
            letter-spacing: 0.3px;
        }


        .progress-wrapper {
            width: 100%;
            height: 4px;
            background: var(--border-color);
            border-radius: 2px;
            cursor: pointer;
            margin: 10px 0;
            position: relative;
        }
        .progress-wrapper::before {
            content: '';
            position: absolute;
            top: -6px;
            bottom: -6px;
            left: 0;
            right: 0;
        }
        .progress-bar {
            height: 100%;
            width: 0%;
            background: var(--accent-color);

            border-radius: 2px;
            position: relative;
            transition: background-color 0.3s ease;
        }
        .progress-bar::after {
            content: '';
            position: absolute;
            right: -4px;
            top: -3px;
            width: 10px;
            height: 10px;
            background: var(--accent-color);
            border-radius: 50%;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .progress-wrapper:hover .progress-bar::after {
            opacity: 1;
        }


        .controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 5px;
        }
        .btn {
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-secondary);
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border-radius: 50%;
        }
        .btn:hover {
            background: var(--message-received-bg);
            color: var(--text-primary);
        }
        .btn-main {
            width: 44px;
            height: 44px;
            background: var(--accent-color);

            color: var(--message-sent-text);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }
        html[data-theme="dark"] .btn-main {
            background: var(--accent-color-dark);
        }
        .btn-main:hover {
            transform: scale(1.05);
            filter: brightness(1.1);
            color: var(--message-sent-text);
        }
        .btn svg {
            width: 18px;
            height: 18px;
            fill: currentColor;
        }


        .playlist-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    background: rgba(var(--secondary-bg-rgb), 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 980;
    display: flex;
    flex-direction: column;
    height: 400px;
    max-height: 60vh;
    overflow: hidden;
    padding: 0;
        }

        .playlist-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
        }

        .playlist-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--secondary-bg-rgb), 0.98);
    z-index: 5;
        }

        .pl-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-family);
    letter-spacing: 1px;
        }

        .pl-header-actions {
    display: flex;
    gap: 8px;
        }

        .pl-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
        }

        .pl-icon-btn:hover, .pl-icon-btn.active {
    background-color: var(--primary-bg);
    color: var(--accent-color);
        }

        .playlist-search-wrapper {
    flex-shrink: 0;
    padding: 0 15px;
    background: rgba(var(--secondary-bg-rgb), 0.95);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: all 0.3s ease;
        }

        .playlist-search-wrapper.active {
    height: 50px;
    opacity: 1;
    padding: 8px 15px;
        }

        .playlist-search-input {
    width: 100%;
    background-color: var(--primary-bg);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 6px 10px 6px 30px;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23999'%3E%3Cpath d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 12px;
    background-position: 10px center;
        }

        .playlist-search-input:focus {
    background-color: var(--secondary-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.1);
        }

        .playlist-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
        }

        .playlist-content::-webkit-scrollbar {
    display: none;
        }

        .playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 10px;
        }

        .playlist-item:hover {
    background-color: var(--primary-bg);
        }

        .playlist-item.playing {
    background-color: rgba(var(--accent-color-rgb), 0.08);
        }

        .song-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
        }

        .song-title-row {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    font-weight: 500;
        }

        .song-title-row .highlight {
    color: var(--accent-color);
    font-weight: bold;
        }

        .playlist-item.playing .song-title-row {
    color: var(--accent-color);
    font-weight: 700;
        }

        .song-sub-row {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.92;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
        }

        .item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
        }

        .action-icon-btn.delete {
    font-size: 16px;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 100%;
        }

        .playlist-item:hover .action-icon-btn.delete {
    opacity: 0.6;
        }

        .action-icon-btn.delete:hover {
    opacity: 1 !important;
    color: #ff4757;
    transform: scale(1.1);
        }

        .custom-tag {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-color);
    opacity: 0.8;
    box-shadow: 0 0 0 1px rgba(var(--accent-color-rgb), 0.3);
    cursor: pointer;
    position: relative;
        }
        .custom-tag::after {
    content: "●";
    font-size: 10px;
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
        }
        .custom-tag:hover {
    transform: scale(1.2);
    opacity: 1;
        }
        .empty-search-result {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.8;
        }

        .pagination {
            display: none !important;
        }


        .chat-container {
            padding-top: 20px;
        }


        .history-loader {
            position: absolute;
            top: 10px;
            left: 0;
            width: 100%;
            height: 30px;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 5;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;

        }


        .history-loader.visible {
            opacity: 1;
        }


        .history-spinner {
            width: 24px;
            height: 24px;
            border: 3px solid rgba(var(--accent-color-rgb), 0.2);
            border-top-color: var(--accent-color);
            border-radius: 50%;
            animation: history-spin 0.8s linear infinite;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        @keyframes history-spin {
            to {
                transform: rotate(360deg);
            }
        }

        .input-btn:active,
        .action-btn:active,
        .modal-btn:active,
        .batch-action-btn:active,
        .reply-action-mini:active,
        .settings-item:active,
        .session-item:active,
        .coin-btn-action:active,
        .import-export-btn:active {
            transform: scale(0.92) !important;

            transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);

        }


        .ripple-effect {
            position: relative;
            overflow: hidden;

            transform: translate3d(0, 0, 0);

        }


        .ripple-wave {
            position: absolute;
            border-radius: 50%;
            transform: scale(0);
            animation: ripple-anim 0.6s linear;
            pointer-events: none;

            background: rgba(255, 255, 255, 0.4);

            z-index: 99;
        }


        .modal-btn-primary .ripple-wave,
        .send-btn .ripple-wave,
        .batch-send-btn .ripple-wave,
        .theme-color-btn .ripple-wave {
            background: rgba(255, 255, 255, 0.6);
        }


        .modal-btn-secondary .ripple-wave,
        .input-btn:not(.send-btn) .ripple-wave,
        .settings-item .ripple-wave {
            background: rgba(0, 0, 0, 0.1);

        }


        @keyframes ripple-anim {
            to {
                transform: scale(4);

                opacity: 0;

            }
        }


        .send-btn:hover {
            box-shadow: 0 6px 15px rgba(var(--accent-color-rgb), 0.4);
            transform: translateY(-2px) scale(1.05);
        }


        .input-btn:not(.send-btn):hover {
            background-color: var(--border-color);
            color: var(--accent-color);
            transform: translateY(-2px);
        }


        .settings-item {
            transition: all 0.2s ease;
        }
        .settings-item:hover {
            background-color: var(--secondary-bg);
            border-color: rgba(var(--accent-color-rgb), 0.3);
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            transform: translateX(5px) scale(1.01);

        }


        .modal-btn-secondary:hover {
            background-color: #f5f5f5;
            color: #333;
            border-color: #ddd;
        }
        html[data-theme="dark"] .modal-btn-secondary:hover {
            background-color: #333;
            color: #fff;
            border-color: #555;
        }

        .bg-gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); 
            gap: 15px;
            padding: 15px 5px;
            max-height: 400px;
            overflow-y: auto;
        }

        .bg-item {
            position: relative;
            width: 100%;
            aspect-ratio: 1 / 1; 
            border-radius: 50%;
            overflow: hidden;
            cursor: pointer;
            border: 3px solid transparent; 
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
        }

        .bg-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.15);
        }

        .bg-item img, .bg-item div.bg-color-block {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .bg-item.active {
            border-color: var(--accent-color);
            box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.3);
        }

        .bg-item.active::after {
            content: '\f00c';
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 30px;
            height: 30px;
            background: var(--accent-color);
            border-radius: 50%;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.3);
            z-index: 2;
            animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes popIn {
            from { transform: translate(-50%, -50%) scale(0); }
            to { transform: translate(-50%, -50%) scale(1); }
        }

        .bg-add-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background-color: var(--message-received-bg);
            color: var(--text-secondary);
            border-radius: 50%; 
            border: 2px dashed var(--border-color);
            gap: 8px;
        }
        
        .bg-add-btn i {
            font-size: 24px;
            opacity: 0.7;
        }
        
        .bg-add-btn span {
            font-size: 12px;
            font-weight: 500;
        }

        .bg-add-btn:hover {
            background-color: var(--border-color);
            color: var(--accent-color);
            border-color: var(--accent-color);
        }

        .bg-delete-btn {
            position: absolute;
            top: 6px;
            right: 6px;
            width: 24px;
            height: 24px;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(2px);
            color: #fff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            opacity: 0;
            transform: scale(0.8);
            transition: all 0.2s;
            z-index: 5;
        }
        .bg-item:hover .bg-delete-btn {
            opacity: 1;
            transform: scale(1);
        }
        .bg-delete-btn:hover {
            background: #ff4757;
            transform: scale(1.1);
        }
        .tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: none; 
        }
        .tour-overlay.active {
    opacity: 1;
    pointer-events: all;
        }

        .tour-highlight-box {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10001;
        }

        .tour-popover {
    position: absolute;
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 16px 20px;
    width: 300px;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
        }
        .tour-popover.visible {
    opacity: 1;
    transform: translateY(0);
        }
        .tour-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
        }
        .tour-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
        }
        html[data-theme="dark"] .tour-title {
    color: var(--accent-color-dark);
        }
        .tour-step-counter {
    font-size: 12px;
    color: var(--text-secondary);
    background-color: var(--primary-bg);
    padding: 2px 8px;
    border-radius: 10px;
        }
        .tour-popover-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 16px;
        }
        .tour-popover-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
        }
        .tour-navigation {
    display: flex;
    gap: 8px;
        }
        .tour-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
        }
        .tour-btn:hover {
    transform: translateY(-1px);
        }
        .tour-btn:active {
    transform: scale(0.95) !important;
        }
        .tour-btn-skip {
    background-color: transparent;
    color: var(--text-secondary);
        }
        .tour-btn-skip:hover {
    background-color: var(--message-received-bg);
        }
        .tour-btn-primary {
    background-color: var(--accent-color);
    color: var(--message-sent-text);
        }
        html[data-theme="dark"] .tour-btn-primary {
    background-color: var(--accent-color-dark);
        }
        .tour-btn-primary:hover {
    filter: brightness(1.1);
        }


        #custom-replies-modal .modal-title {
            flex-shrink: 0;
            padding: 20px 24px 10px;
            background-color: var(--secondary-bg);
            margin-bottom: 0;
            border-bottom: none;
        }

        #custom-replies-modal .reply-tabs {
            flex-shrink: 0;
            padding: 0 20px 15px;
            background-color: var(--secondary-bg);
            border-bottom: 1px solid var(--border-color);
        }

        #custom-replies-modal .reply-toolbar {
            flex-shrink: 0;
            padding: 15px 20px;
            background-color: var(--primary-bg);
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .modal-sidebar {
    width: 100%;
    height: auto;
    background-color: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    padding: 10px 20px;
    gap: 10px;
    flex-shrink: 0;
    justify-content: center;
        }

        .sidebar-btn {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    min-width: 120px;
    justify-content: center;
        }

        .sidebar-btn i {
    font-size: 18px;
        }

        .sidebar-btn.active {
    background-color: var(--secondary-bg);
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }

        .modal-main-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    position: relative;
    overflow: hidden; 
        }

        .modal-main-view .reply-tabs {
    padding: 15px 20px 10px;
    background-color: var(--secondary-bg);
    white-space: nowrap;
    overflow-x: auto;
    flex-shrink: 0;
        }

        .modal-main-view .reply-toolbar {
    padding: 10px 20px;
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
        }

        .content-list-area {
    flex: 1;
    overflow-y: auto !important; 
    overflow-x: hidden;
    padding: 15px;
    padding-bottom: 80px !important; 
    background-color: var(--primary-bg);
    height: 0; 
    -webkit-overflow-scrolling: touch; 
        }

        .content-list-area.grid-mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important; 
    gap: 12px !important;
    align-content: start; 
        }

        .content-list-area.list-mode .custom-reply-item {
    margin-bottom: 10px; 
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    height: auto; 
    min-height: 50px;
        }

        .content-list-area.grid-mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    align-content: start;
        }

        .modal-main-view .modal-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(var(--secondary-bg-rgb), 0.95);
    backdrop-filter: blur(10px);
        }

        .sticker-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; 
    border-radius: 12px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    background-color: var(--secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
        }

        .sticker-item.sticker-disabled {
    opacity: 0.38;
    filter: grayscale(0.85) contrast(0.9);
    border-style: dashed;
        }

        .sticker-item.sticker-batch-selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb,180,140,100),0.22);
        }

        .sticker-batch-check {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(var(--accent-color-rgb,180,140,100),0.18);
    border: 1px solid rgba(var(--accent-color-rgb,180,140,100),0.35);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.15s ease;
    pointer-events: none;
    z-index: 3;
        }

        .sticker-item.sticker-batch-selected .sticker-batch-check {
    opacity: 1;
    transform: scale(1);
        }

        .sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
        }

        .sticker-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .sticker-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0; 
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 2;
        }

        .sticker-item:hover .sticker-delete-btn,
        .sticker-grid-item:hover .sticker-delete-btn {
    opacity: 1;
    transform: scale(1);
        }

        .sticker-delete-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
        }

        #custom-replies-modal .modal-buttons {
            position: static; 
            flex-shrink: 0; 
            width: 100%;
            background-color: var(--secondary-bg);
            padding: 20px;
            border-top: 1px solid var(--border-color);
            margin-top: 0;
            z-index: 10;
        }
        #custom-replies-modal .modal-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10;
    flex-shrink: 0;
        }

        .emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 15px;
        }

        .emoji-item {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-bg);
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
        }

        .emoji-item:hover {
    background-color: var(--border-color);
    transform: scale(1.1);
        }

        .emoji-item.disabled {
    opacity: 0.4;
    background-color: var(--primary-bg);
    filter: grayscale(100%);
        }

        .emoji-item.disabled::after {
    content: '\f05e'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    font-size: 14px;
    color: #ff4757;
        }

        #theme-editor-modal .modal-content {
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
        }
        .theme-editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
        }
        .theme-editor-toolbar select {
    flex-grow: 1;
    min-width: 140px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
        }
        #theme-editor-grid {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
        }
        .theme-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 4px 2px;
        }
        .color-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-bg), rgba(var(--accent-color-rgb),0.03));
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
        }
        .color-picker-item:hover {
    border-color: rgba(var(--accent-color-rgb),0.3);
    box-shadow: 0 2px 8px rgba(var(--accent-color-rgb),0.08);
        }
        .color-picker-item label {
    font-size: 12px;
    flex-grow: 1;
    color: var(--text-secondary);
        }
        .color-picker-item input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
        }
        .color-picker-item input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
        .color-picker-item input[type="color"]::-webkit-color-swatch {
    border-radius: 8px;
    border: 2px solid var(--border-color);
        }
        .color-picker-item input[type="color"]::-moz-color-swatch {
    border-radius: 8px;
    border: 2px solid var(--border-color);
        }
        .avatar-container {
    position: relative;
    width: 56px;
    height: 56px;
    order: 2;
    flex-shrink: 0;
        }

        .avatar-shape-circle { border-radius: 50% !important; overflow: hidden !important; }
        .avatar-shape-circle img, .avatar-shape-circle i { border-radius: 50% !important; clip-path: none !important; }
        .avatar-shape-circle .avatar { border-radius: 50% !important; overflow: hidden; }
        .avatar-shape-square { border-radius: var(--avatar-corner-radius, 8px) !important; overflow: hidden !important; }
        .avatar-shape-square img, .avatar-shape-square i { border-radius: var(--avatar-corner-radius, 8px) !important; clip-path: none !important; }
        .avatar-shape-square .avatar { border-radius: var(--avatar-corner-radius, 8px) !important; overflow: hidden; }

        .message-avatar.shape-circle { border-radius: 50% !important; overflow: hidden !important; }
        .message-avatar.shape-circle img, .message-avatar.shape-circle i { border-radius: 50% !important; clip-path: none !important;}
        .message-avatar.shape-square { border-radius: var(--avatar-corner-radius, 8px) !important; overflow: hidden !important; }
        .message-avatar.shape-square img, .message-avatar.shape-square i { border-radius: var(--avatar-corner-radius, 8px) !important; clip-path: none !important; }
        .avatar {
    width: 100% !important;
    height: 100% !important;
    position: relative;
    z-index: 1;
        }

        .avatar-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none; 
        }

        .message-avatar {
    position: relative;
        }

        .message-avatar .avatar-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
        }
        .message-avatar img, .message-avatar i {
    position: absolute; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: calc(var(--in-chat-avatar-size) * 0.5); 
        }


        .frame-settings-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 10px;
        }
        .frame-preview-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
        }
        .frame-preview {
    width: 80px;
    height: 80px;
    position: relative;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--secondary-bg);
    border: 2px dashed var(--border-color);
    overflow: visible;
        }
        .frame-preview .preview-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
        overflow: hidden;
        position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: var(--secondary-bg);
    border: 2px dashed var(--border-color); 
    display: flex;
    align-items: center;
    justify-content: center;

        }
        .frame-preview .preview-bg-layer {
    width: 100%;
    height: 100%;
    border-radius: 50%; 
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: var(--secondary-bg);
    border: 2px dashed var(--border-color);
    box-sizing: border-box; 
    overflow: hidden; 
        }
        .frame-preview .preview-bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
        border-radius: 50%; 
    display: block;
    
        }
        .frame-preview .preview-bg-layer i {
    font-size: 32px;
    color: var(--text-secondary);
        position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
        }

        .frame-preview .preview-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-secondary);
        }
        .frame-preview .preview-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    max-width: none; 
    max-height: none;
        }
        .frame-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
        }
        .frame-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
    background: var(--secondary-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
        }
        .frame-slider-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
        }
        .frame-slider-group label {
    width: 36px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 12px;
        }
        .frame-slider-group input[type="range"] {
    flex-grow: 1;
    min-width: 0;
        }
        .frame-slider-group span {
    width: 36px;
    flex-shrink: 0;
    text-align: right;
    font-size: 11px;
    color: var(--text-secondary);
        }

        @media (max-width: 768px) {
    .avatar-container {
        width: 46px;
        height: 46px;
    }
        }
        @media (max-width: 480px) {
    .avatar-container {
        width: 40px;
        height: 40px;
    }
        }
        #custom-bubble-css {
    background-color: #2b2b2b; 
    color: #f8f8f2; 
    border: 1px solid var(--border-color);
    padding: 10px;
    line-height: 1.4;
    border-radius: 8px;
    resize: vertical;
        }

        html[data-theme="light"] #custom-bubble-css {
    background-color: #f5f5f5;
    color: #333;
        }
        .content-list-area.grid-mode {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    grid-auto-rows: max-content !important; 
    gap: 15px !important;
    align-content: start !important;
    padding-bottom: 120px !important; 
    overflow-y: auto !important;
    height: auto !important;
        }

        .sticker-item {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
    overflow: hidden !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    margin: 0 !important; 
        }

        .sticker-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; 
    display: block !important;
        }

        .emoji-grid {
    padding-bottom: 100px !important;
        }
        .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 10px;
        }
        .current-month-label {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
        }
        .calendar-nav-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
        }
        .calendar-nav-btn:hover {
    color: var(--accent-color);
        }
        .calendar-weekdays, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
        }
        .calendar-weekdays div {
    font-size: 12px;
    color: var(--text-secondary);
    padding-bottom: 5px;
        }
        .calendar-day {
    min-height: 50px; 
    padding: 2px;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    align-items: center;
        }

        @media (max-width: 480px) {
    .calendar-weekdays div { font-size: 10px; }
    .calendar-day { 
        min-height: 45px; 
        font-size: 10px;
    }
        }
        .mood-detail-dot {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 20px !important; 
        height: 20px !important;
        border-radius: 50% !important; 
        padding: 0 !important;
        margin: 1px auto !important; 
        font-size: 12px !important;
        line-height: 1 !important;
        overflow: hidden;
    }
        .mood-text-span {
        display: none;
    }
    
 .mood-kaomoji-span {
        display: block;
        transform: scale(0.9);
    }

    .mood-dots-container {
        flex-direction: row !important;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2px;
    }
        .mood-detail-dot {
    width: 100%;
    border-radius: 4px;
    padding: 2px;
    font-size: 10px;
    text-align: center;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    transform: scale(0.9); 
        }

        .mood-detail-dot.partner-mood {
    opacity: 0.9;
    border: 1px dashed rgba(255,255,255,0.5); 
        }
        .calendar-day:hover {
    background-color: var(--message-received-bg);
        }
        .calendar-day.today {
    background-color: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    font-weight: bold;
    border-color: var(--accent-color);
        }
        .calendar-day.empty {
    pointer-events: none;
        }
        .mood-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
        }
        .mood-marker {
    font-size: 10px;
    width: 16px; 
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--secondary-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .mood-marker.me { color: var(--accent-color); border: 1px solid rgba(var(--accent-color-rgb), 0.3); }
        .mood-marker.partner { color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.3); }

        .calendar-footer-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-secondary);
        }
        .legend-item { display: flex; align-items: center; gap: 5px; }
        .legend-item .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
        .legend-item .dot.me { background-color: var(--accent-color); }
        .legend-item .dot.partner { background-color: #ff6b6b; }

        .mood-selector-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
        }
        .mood-selector-overlay.active { display: flex; animation: fadeIn 0.3s ease; }
        .mood-selector-card {
    background: var(--secondary-bg);
    padding: 20px;
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .mood-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
        }
        .mood-options-slider-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-height: 240px;
    padding-right: 2px;
        }
        .mood-options-slider-wrapper::-webkit-scrollbar { display:none; }
        .mood-options-slider-wrapper .mood-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
    width: 100%;
        }

        .theme-schemes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
        }
        .theme-schemes-list::-webkit-scrollbar { display: none; }
        .theme-scheme-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--primary-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
        }
        .theme-scheme-item:hover {
    border-color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.06);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(var(--accent-color-rgb), 0.15);
        }
        .theme-scheme-item.active-scheme {
    border-color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.1);
        }
        .scheme-preview-dots {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
        }
        .scheme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
        }
        .scheme-info {
    flex: 1;
    text-align: left;
    min-width: 0;
        }
        .scheme-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
        }
        .scheme-meta {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
        }
        .scheme-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
        }
        .scheme-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
        }
        .scheme-action-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
        }
        .scheme-action-btn.delete:hover {
    background: rgba(255,71,87,0.1);
    color: #ff4757;
        }
        .theme-schemes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.7;
        }
        .theme-schemes-empty i {
    font-size: 24px;
    opacity: 0.4;
        }

        .mood-page-btn {
    background: var(--border-color);
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    padding: 0 0 2px 0;
    flex-shrink: 0;
        }
        .mood-page-btn:hover { background: var(--accent-color); color: #fff; }
        .mood-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
        .mood-tab-btn {
    background: var(--border-color);
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: var(--font-family);
    font-weight: 500;
        }
        .mood-tab-btn.active {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--accent-color-rgb), 0.35);
        }
        .mood-custom-add-btn {
    margin-top: 10px;
    width: 100%;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s;
        }
        .mood-custom-add-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
        .custom-mood-color-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
        }
        .custom-mood-color-dot.selected { border-color: var(--text-primary); transform: scale(1.2); }
        .mood-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--primary-bg);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 58px;
    position: relative;
        }
        .mood-option-btn:hover {
    transform: translateY(-2px);
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(var(--accent-color-rgb), 0.3);
        }
        .mood-kaomoji { font-size: 20px; margin-bottom: 4px; white-space: nowrap; line-height: 1; }
        .mood-label { font-size: 11px; opacity: 0.75; font-weight: 500; }

        .mood-custom-actions {
    position: absolute;
    top: 2px; right: 2px;
    display: none;
    gap: 2px;
    background: rgba(var(--secondary-bg-rgb), 0.9);
    border-radius: 6px;
    padding: 2px;
        }
        .mood-option-custom:hover .mood-custom-actions { display: flex; }
        .mood-custom-action-btn {
    border: none; background: none; cursor: pointer;
    font-size: 11px; padding: 2px 3px; border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
        }
        .mood-custom-action-btn:hover { background: var(--border-color); }

        .stats-weather-tag {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: center;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px dashed var(--border-color);
    transition: all 0.2s;
    min-width: 60px;
        }
        .stats-weather-tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.06);
        }

        @keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
        }
        #fortune-lenormand-modal {
    z-index: 9999 !important; 
        }

        .tarot-container-3d {
    perspective: 1000px;
    width: 200px;
    height: 320px;
    margin: 0 auto 20px;
    cursor: pointer;
        }

        .tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
        }

        .tarot-container-3d.flipped .tarot-card-inner {
    transform: rotateY(180deg);
        }

        .tarot-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
        }

        .tarot-front {
    background: linear-gradient(135deg, #2c3e50, #000);
    color: #fff;
    border: 2px solid #bdc3c7;
        }

        .tarot-pattern {
    font-size: 40px;
    opacity: 0.3;
    animation: pulse 3s infinite;
        }

        .tarot-back {
    background-color: var(--secondary-bg);
    transform: rotateY(180deg);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
        }

        .fortune-result-area {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.5s; 
    padding: 0 20px;
    text-align: center;
        }

        .fortune-result-area.visible {
    opacity: 1;
    transform: translateY(0);
        }

        .lenormand-sys-btn, .lenormand-num-btn {
    padding: 8px 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
        }
        .lenormand-sys-btn.active, .lenormand-num-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
        }
        .lenormand-sys-btn:hover:not(.active), .lenormand-num-btn:hover:not(.active) {
    border-color: var(--accent-color);
    color: var(--accent-color);
        }
        .lenormand-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 14px 0;
        }
        .lenormand-card-item {
    background: var(--secondary-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    min-width: 80px;
    max-width: 110px;
    flex: 1;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: lenCardIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(12px);
        }
        @keyframes lenCardIn {
    to { opacity: 1; transform: translateY(0); }
        }
        .lenormand-card-icon {
    font-size: 28px;
    margin-bottom: 6px;
    display: block;
        }
        .lenormand-card-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
        }
        .lenormand-card-num {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
        }
        .lenormand-card-keyword {
    font-size: 12px;
    color: var(--accent-color);
    font-style: italic;
        }
        .lenormand-card-meaning {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
    text-align: left;
    border-top: 1px dashed var(--border-color);
    padding-top: 6px;
        }
        .lenormand-question-show {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--primary-bg);
    border-radius: 10px;
    border-left: 3px solid var(--accent-color);
        }
        .lenormand-synthesis {
    background: linear-gradient(135deg, rgba(var(--accent-color-rgb),0.08), rgba(var(--accent-color-rgb),0.02));
    border: 1px solid rgba(var(--accent-color-rgb),0.2);
    border-radius: 14px;
    padding: 14px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.7;
        }
        .lenormand-synthesis-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 6px;
    letter-spacing: 1px;
        }

        #mood-modal .modal-content {
    background-color: var(--primary-bg);
    max-height: 90vh;
        }

        .mood-stats-bar {
    height: 12px !important; 
    border-radius: 6px !important;
    background: #eee !important;
    margin: 10px 0 20px 0 !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
        }

        html[data-theme="dark"] .mood-stats-bar {
    background: #333 !important;
        }

        #month-mood-summary {
    font-weight: bold;
    font-size: 13px;
        }
        .mood-stat-segment { height: 100%; transition: width 0.5s; }

        .calendar-day {
    border-radius: 12px;
    background-color: var(--secondary-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    min-height: 60px; 
    justify-content: flex-start;
    padding: 4px;
    border: 1px solid transparent;
        }
        .calendar-day span { font-weight: 600; font-size: 12px; margin-bottom: 2px; }

        .mood-detail-dot {
    width: 100%;
    border-radius: 6px;
    padding: 2px 4px;
    font-size: 10px;
    margin-top: 2px;
    text-align: center;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
        }

        .mood-input-wrapper {
    width: 100%;
    margin-top: 15px;
    text-align: left;
        }
        .mood-note-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--primary-bg);
    color: var(--text-primary);
    resize: none;
    font-size: 13px;
    margin-top: 8px;
        }

        .day-detail-card {
    background: var(--secondary-bg);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    position: relative;
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        }
        .day-detail-date { font-size: 18px; font-weight: bold; margin-bottom: 10px; }
        .day-detail-content { 
    background: var(--primary-bg); 
    padding: 15px; 
    border-radius: 8px; 
    font-size: 14px; 
    line-height: 1.6;
    min-height: 60px;
    white-space: pre-wrap;
        }
        .user-info .avatar,
        .user-info .username {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
        }

        .user-info.changing .avatar,
        .user-info.changing .username {
    opacity: 0;
    transform: scale(0.9);
        }
        .message-sender-name {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    margin-left: 4px;
    display: none; 
        }

        body.show-partner-name .message-wrapper.received .message-sender-name {
    display: block;
        }

        .mood-stats-card {
    background: var(--secondary-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
        }

        .mood-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
        }

        .mood-circles-wrapper {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
        }

        .mood-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
        }

        .mood-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(var(--accent-color) var(--percent), var(--message-received-bg) 0);
    transition: all 0.5s ease;
        }

        .mood-circle::before {
    content: "";
    position: absolute;
    width: 52px;
    height: 52px;
    background-color: var(--secondary-bg);
    border-radius: 50%;
        }

        .mood-circle-text {
    position: absolute;
    z-index: 2;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
        }

        .mood-circle-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
        }

        .mood-bar-container {
    height: 8px;
    width: 100%;
    background-color: var(--message-received-bg);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    margin-top: 5px;
        }

        .mood-bar-segment {
    height: 100%;
    transition: width 0.6s ease;
        }

        .dominant-mood-tag {
    background-color: var(--primary-bg);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
        }
        .mood-view-section {
    display: block;
    animation: fadeIn 0.3s ease;
        }
        .mood-view-section.hidden-view {
    display: none;
        }

        .mood-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
        }

        .view-switch-btn {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
        }
        .view-switch-btn:hover, .view-switch-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
        }

        .mood-stat-group {
    margin-bottom: 20px;
    background: var(--primary-bg);
    padding: 15px;
    border-radius: 12px;
        }
        .mood-stat-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
        }

        .sticker-picker-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 320px;
    height: 350px; 
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeUp 0.2s ease;
        }

        .sticker-picker-popover.active {
    display: flex;
        }

        .combo-tabs-header {
    display: flex;
    background-color: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    gap: 10px;
    flex-shrink: 0;
        }

        .combo-tab-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
        }

        .combo-tab-btn:hover {
    background-color: var(--border-color);
        }

        .combo-tab-btn.active {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--accent-color-rgb), 0.3);
        }

        .combo-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background-color: var(--secondary-bg);
        }

        .sticker-grid-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px;
        }

        .sticker-grid-item {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: var(--primary-bg);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
        }

        .sticker-grid-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
        }

        .sticker-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
        }

        .poke-list-view {
    display: flex;
    flex-direction: column;
    gap: 6px;
        }

        .poke-quick-item {
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(var(--accent-color-rgb),0.13) 0%, rgba(var(--accent-color-rgb),0.04) 50%, rgba(var(--accent-color-rgb),0.09) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 5px rgba(var(--accent-color-rgb),0.1);
        }
        .poke-quick-item::before {
    content: '✦';
    font-size: 10px;
    color: var(--accent-color);
    opacity: 0.5;
    flex-shrink: 0;
        }

        .poke-quick-item:hover {
    background: linear-gradient(135deg, rgba(var(--accent-color-rgb),0.22) 0%, rgba(var(--accent-color-rgb),0.08) 50%, rgba(var(--accent-color-rgb),0.16) 100%);
    transform: translateX(4px);
    color: var(--text-primary);
    box-shadow: 0 3px 10px rgba(var(--accent-color-rgb),0.18);
        }

        .custom-poke-btn {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-color-rgb),0.8));
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(var(--accent-color-rgb), 0.25);
    transition: all 0.22s ease;
    letter-spacing: 0.3px;
        }

        .custom-poke-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(var(--accent-color-rgb), 0.32);
        }

        .empty-sticker-tip {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
        }
        .empty-sticker-tip i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
        }
        .sticker-picker-header {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--primary-bg);
        }
        .sticker-picker-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
        }
        .picker-item {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
        }
        .picker-item:hover {
    background-color: var(--primary-bg);
        }
        .picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
        }
        .picker-item span {
    font-size: 24px;
        }

        .decision-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 0;
        }
        .decision-option-card {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
        }
        .decision-option-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.2);
        }
        .decision-option-card i {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--accent-color);
        }
        .decision-option-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
        }
        .decision-option-card p {
    font-size: 12px;
    color: var(--text-secondary);
        }

        .fl-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 0 !important;
    border-radius: 20px !important;
        }
        .fl-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--secondary-bg);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    flex-shrink: 0;
        }
        .fl-tab {
    flex: 1;
    padding: 14px 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.25s ease;
    position: relative;
        }
        .fl-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.25s ease;
        }
        .fl-tab.active {
    color: var(--accent-color);
    font-weight: 600;
    background: rgba(var(--accent-color-rgb), 0.04);
        }
        .fl-tab.active::after {
    opacity: 1;
    transform: scaleX(1);
        }
        .fl-panel {
    display: none;
    padding: 20px;
    min-height: 200px;
        }
        .fl-panel.fl-panel-active {
    display: block;
        }
        .leno-num-section {
    margin-bottom: 20px;
        }
        .leno-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
        }
        .leno-num-btns {
    display: flex;
    gap: 12px;
        }
        .lenormand-num-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
        }
        .leno-btn-num {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
        }
        .leno-btn-label {
    font-size: 11px;
    opacity: 0.6;
        }
        .lenormand-num-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px rgba(var(--accent-color-rgb), 0.35);
    transform: translateY(-2px);
        }
        .lenormand-num-btn.active .leno-btn-label {
    opacity: 0.85;
        }
        .lenormand-num-btn:hover:not(.active) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
        }
        .leno-num-desc {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    font-style: italic;
    opacity: 0.7;
    transition: all 0.2s;
        }
        .leno-question-section {
    margin-bottom: 18px;
        }
        .leno-question-input {
    width: 100%;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    background: var(--primary-bg);
    color: var(--text-primary);
    resize: none;
    height: 70px;
    font-family: var(--font-family);
    line-height: 1.6;
    transition: border-color 0.2s;
    outline: none;
    margin-top: 10px;
        }
        .leno-question-input:focus {
    border-color: var(--accent-color);
        }
        .leno-draw-btn {
    width: 100%;
    margin-top: 4px;
    padding: 14px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
    letter-spacing: 1px;
    box-shadow: 0 4px 14px rgba(var(--accent-color-rgb), 0.25);
        }

        .tarot-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 4px 0 8px;
    width: 100%;
        }
        .tarot-row > div {
    flex: 1; 
    min-width: 0;
        }
        .tarot-responsive {
    width: 100% !important;
    aspect-ratio: 13 / 22; 
    height: auto !important;
        }
        .tarot-row.single-card > div {
    flex: 0 0 55%;
    max-width: 180px;
        }

        .tarot-row:not(.single-card) .tarot-face.tarot-back {
    padding: 8px 6px !important;
        }
        .tarot-row:not(.single-card) .tarot-card-name {
    font-size: 13px !important;
        }
        .tarot-row:not(.single-card) .tarot-face.tarot-back .tarot-position-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
    margin: 2px auto !important;
        }
        .tarot-row:not(.single-card) .tarot-face.tarot-back div[style*="font-weight: bold;"] {
    font-size: 10px !important;
    margin: 4px 0 2px !important;
        }
        .tarot-row:not(.single-card) .tarot-face.tarot-back div[style*="text-align: left;"] {
    font-size: 9.5px !important;
    line-height: 1.4 !important;
        }

        .minor-fortune-section {
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--primary-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
        }
        .minor-fortune-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
        }
        .minor-fortune-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
        }
        .minor-card-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 80px;
    transition: box-shadow 0.2s;
        }
        .minor-card-chip:hover {
    box-shadow: 0 3px 10px rgba(var(--accent-color-rgb), 0.15);
        }
        .minor-card-chip-suit {
    font-size: 16px;
        }
        .minor-card-chip-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
        }
        .minor-card-chip-keyword {
    font-size: 10px;
    color: var(--accent-color);
    text-align: center;
        }
        .minor-card-chip-badge {
    font-size: 9px;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
        }
        .minor-card-chip-badge.rev {
    background: rgba(229,115,115,0.1);
    color: #e07b6a;
        }
        .minor-fortune-insight {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
        }
        .tarot-spread-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
        }
        .tarot-spread-btn .leno-btn-num {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
        }
        .tarot-spread-btn .leno-btn-label {
    font-size: 11px;
    opacity: 0.6;
        }
        .tarot-spread-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px rgba(var(--accent-color-rgb), 0.35);
    transform: translateY(-2px);
        }
        .tarot-spread-btn.active .leno-btn-label {
    opacity: 0.85;
        }
        .tarot-spread-btn:hover:not(.active) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
        }

        @keyframes cardReveal {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .fortune-card.tarot-style {
    animation: cardReveal 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) both;
        }
        .fortune-card.tarot-style:nth-child(2) { animation-delay: 0.1s; }
        .fortune-card.tarot-style:nth-child(3) { animation-delay: 0.2s; }
        .fortune-card.tarot-style:nth-child(4) { animation-delay: 0.3s; }

        .divi-history-item {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    transition: box-shadow 0.2s;
    cursor: default;
        }
        .divi-history-item:hover {
    box-shadow: 0 4px 14px rgba(var(--accent-color-rgb), 0.15);
        }
        .divi-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
        }
        .divi-history-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.1);
    border-radius: 20px;
    padding: 2px 10px;
    letter-spacing: 0.5px;
        }
        .divi-history-time {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
        }
        .divi-history-question {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-style: italic;
    opacity: 0.85;
        }
        .divi-history-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
        }
        .divi-history-card-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: var(--secondary-bg);
    display: flex;
    align-items: center;
    gap: 4px;
        }
        .divi-history-card-tag.reversed {
    color: #e07b6a;
    border-color: rgba(224,123,106,0.3);
        }
        .divi-history-expand-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: var(--accent-color);
    cursor: pointer;
    font-family: var(--font-family);
    padding: 4px 0 0;
    display: block;
    width: 100%;
    text-align: right;
    opacity: 0.8;
        }
        .divi-history-detail {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
        }
        .divi-history-detail.open {
    display: block;
        }

        .picker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
        }
        .picker-box-stage {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
        }
        .picker-cards-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 90px;
    align-items: center;
        }
        .picker-card {
    width: 72px;
    height: 90px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--primary-bg) 100%);
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: default;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
    padding: 6px;
    word-break: break-all;
    position: relative;
    overflow: hidden;
    animation: cardEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        }
        @keyframes cardEnter {
    from { opacity: 0; transform: translateY(12px) scale(0.88); }
    to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .picker-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--accent-color-rgb),0.06) 0%, transparent 60%);
    border-radius: inherit;
        }
        .picker-card.selected {
    background: linear-gradient(135deg, var(--accent-color) 0%, rgba(var(--accent-color-rgb),0.75) 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-6px) scale(1.08);
    box-shadow: 0 10px 28px rgba(var(--accent-color-rgb), 0.4);
    animation: cardWin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        }
        @keyframes cardWin {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-10px) scale(1.12) rotate(-2deg); }
    70% { transform: translateY(-5px) scale(1.1) rotate(1deg); }
    100% { transform: translateY(-6px) scale(1.08) rotate(0deg); }
        }
        .picker-card.unselected {
    opacity: 0.4;
    transform: scale(0.94);
        }
        .picker-result-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    min-height: 28px;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(var(--accent-color-rgb), 0.08);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    opacity: 0;
    transition: opacity 0.4s ease;
    width: 100%;
        }
        .picker-result-text.show { opacity: 1; }
        .picker-controls { width: 100%; }
        .picker-options-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
        }
        .picker-options-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 10px;
    background: var(--primary-bg);
        }
        .picker-option-item {
    display: flex;
    gap: 8px;
    padding: 7px 8px;
    align-items: center;
    border-radius: 8px;
    transition: background 0.15s;
        }
        .picker-option-item:hover { background: var(--message-received-bg); }
        .picker-option-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
        }
        .picker-option-input {
    flex: 1;
    border: none;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 3px 4px;
    font-size: 14px;
    outline: none;
    font-family: var(--font-family);
    color: var(--text-primary);
        }
        .picker-option-remove {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 12px;
        }
        .picker-option-remove:hover { color: #ff4757; background: rgba(255,71,87,0.1); }
        .picker-add-btn {
    width: 100%;
    margin-bottom: 10px;
    font-size: 13px;
    border-style: dashed !important;
    opacity: 0.75;
    transition: opacity 0.2s !important;
        }
        .picker-add-btn:hover { opacity: 1 !important; }
        .wheel-option-input { flex:1; border:none; background:transparent; border-bottom:1px solid var(--border-color); padding:3px 4px; font-size:14px; outline:none; font-family:var(--font-family); color:var(--text-primary); }


        @keyframes messageAppear {
    0% { opacity: 0; transform: translateY(8px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
        }

        .modal-btn, .settings-item, .setting-pill-row, .action-btn, .input-btn {
    position: relative;
    overflow: hidden;
        }
        .modal-btn::after, .settings-item::after, .setting-pill-row::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(var(--accent-color-rgb),0.2) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
        }
        .modal-btn:active::after, .settings-item:active::after, .setting-pill-row:active::after {
    opacity: 1;
    transform: scale(2);
    transition: 0s;
        }

        @keyframes modalContentSlideIn {
    from { opacity: 0; transform: translateY(28px) scale(0.93); }
    to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .settings-item {
    transition: all 0.2s cubic-bezier(0.25,0.8,0.25,1);
        }
        .settings-item:hover {
    transform: translateX(2px);
        }

        @keyframes slideUpNotif {
    from { opacity:0; transform:translateX(-50%) translateY(24px) scale(0.9); }
    60% { transform: translateX(-50%) translateY(-4px) scale(1.02); }
    to { opacity:1; transform:translateX(-50%) translateY(0) scale(1); }
        }

        .action-btn:hover {
    box-shadow: 0 0 0 6px rgba(var(--accent-color-rgb), 0.1);
        }

        .send-btn:hover {
    box-shadow: 0 4px 16px rgba(var(--accent-color-rgb), 0.45), 0 0 0 4px rgba(var(--accent-color-rgb),0.1);
        }

        .message-input:focus {
    box-shadow: none !important;
    outline: none !important;
        }

        .calendar-day {
    transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), background 0.2s, border-color 0.2s;
        }
        .calendar-day:active { transform: scale(0.9); }

        .mood-selector-card, .day-detail-card {
    animation: cardSlideUp 0.38s cubic-bezier(0.34,1.4,0.64,1) forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.96);
        }
        @keyframes cardSlideUp {
    to { opacity:1; transform: translateY(0) scale(1); }
        }

        .mood-tab-btn, .combo-tab, .stats-toggle-btn, .view-switch-btn {
    transition: all 0.22s cubic-bezier(0.25,0.8,0.25,1) !important;
        }

        .picker-item:hover {
    transform: scale(1.12) translateY(-2px) !important;
        }

        #user-sticker-picker.active {
    animation: pickerSlideUp 0.3s cubic-bezier(0.34,1.2,0.64,1) forwards;
        }
        @keyframes pickerSlideUp {
    from { opacity:0; transform: translateY(16px) scale(0.97); }
    to { opacity:1; transform: translateY(0) scale(1); }
        }

        .header {
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }
        html[data-theme="light"] .header {
            background-color: rgba(255,255,255,0.92);
        }
        html[data-theme="dark"] .header {
            background-color: rgba(30,30,30,0.92);
        }
        .avatar-container {
            position: relative;
        }
        .avatar-container::after {
            content: '';
            position: absolute;
            inset: -2px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-color-rgb),0.3));
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .avatar-container:hover::after {
            opacity: 0.7;
        }
        .message {
            letter-spacing: 0.1px;
        }

        #read-receipt-style-row {
            background: rgba(var(--accent-color-rgb),0.04);
            border-radius: 10px;
            padding: 8px 12px !important;
        }


        #chat-modal .modal-content {
            padding: 0 !important;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            max-height: 92vh;
        }
        .cs-header {
            padding: 18px 20px 0;
            background: var(--secondary-bg);
            flex-shrink: 0;
        }
        .cs-header-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 14px;
        }
        .cs-header-title {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 17px;
            font-weight: 700;
            color: var(--text-primary);
            font-family: var(--font-family);
        }
        .cs-header-icon {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            background: rgba(var(--accent-color-rgb), 0.12);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent-color);
            font-size: 15px;
        }
        .cs-tabs {
            display: flex;
            gap: 2px;
            padding: 0 0 0;
            overflow-x: auto;
            border-bottom: 1.5px solid var(--border-color);
        }
        .cs-tab {
            flex-shrink: 0;
            padding: 9px 13px;
            font-size: 12.5px;
            font-weight: 600;
            color: var(--text-secondary);
            background: none;
            border: none;
            cursor: pointer;
            border-bottom: 2.5px solid transparent;
            margin-bottom: -1.5px;
            transition: color 0.2s, border-color 0.2s;
            font-family: var(--font-family);
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .cs-tab.active {
            color: var(--accent-color);
            border-bottom-color: var(--accent-color);
        }
        .cs-tab i { font-size: 11px; }
        .cs-panels {
            flex: 1;
            overflow-y: auto;
            overscroll-behavior: contain;
        }
        .cs-panel {
            display: none;
            padding: 18px 20px 8px;
            animation: csFadeIn 0.2s ease;
        }
        .cs-panel.active { display: block; }
        @keyframes csFadeIn {
            from { opacity: 0; transform: translateY(4px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .cs-group-label {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            color: var(--text-secondary);
            opacity: 0.65;
            margin: 0 0 8px;
        }
        .cs-card {
            background: var(--primary-bg);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            overflow: hidden;
            margin-bottom: 10px;
        }
        .cs-name-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-bottom: 10px;
        }
        .cs-name-btn {
            padding: 13px 12px;
            border: 1px solid var(--border-color);
            border-radius: 13px;
            background: var(--primary-bg);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 7px;
            font-family: var(--font-family);
            transition: all 0.2s;
        }
        .cs-name-btn:hover {
            border-color: var(--accent-color);
            background: rgba(var(--accent-color-rgb), 0.06);
        }
        .cs-name-btn i {
            font-size: 18px;
            color: var(--accent-color);
        }
        .cs-name-btn span { font-size: 12px; }
        .cs-hint {
            font-size: 11px;
            color: var(--text-secondary);
            opacity: 0.8;
            margin: 4px 2px 16px;
        }
        .cs-slider-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 11px 14px;
            border-bottom: 1px solid var(--border-color);
        }
        .cs-slider-row:last-child { border-bottom: none; }
        .cs-slider-label {
            font-size: 12.5px;
            font-weight: 600;
            color: var(--text-primary);
            width: 58px;
            flex-shrink: 0;
        }
        .cs-slider-row input[type=range] {
            flex: 1;
            height: 4px;
            accent-color: var(--accent-color);
        }
        .cs-slider-val {
            font-size: 12px;
            font-weight: 700;
            color: var(--accent-color);
            min-width: 36px;
            text-align: right;
        }
        .cs-card .setting-pill-row {
            border-radius: 0 !important;
            background: transparent !important;
            border: none !important;
            border-bottom: 1px solid var(--border-color) !important;
            padding: 12px 14px !important;
            margin: 0 !important;
        }
        .cs-card .setting-pill-row:last-child {
            border-bottom: none !important;
        }
        .cs-rr-style-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 9px 14px;
            border-bottom: 1px solid var(--border-color);
            background: rgba(var(--accent-color-rgb), 0.03);
        }
        .cs-rr-style-label {
            font-size: 12px;
            color: var(--text-secondary);
            flex: 1;
            padding-left: 36px;
        }
        .cs-time-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            padding: 12px 14px;
        }
        .cs-time-grid .settings-item {
            border-radius: 10px !important;
            font-size: 13px;
        }
        .cs-time-grid .settings-item:last-child {
            grid-column: 1 / -1;
        }
        .cs-immersive-wrap {
            padding: 4px 0;
        }
        .cs-sound-inner {
            padding: 0 14px 12px;
        }
        .cs-footer {
            flex-shrink: 0;
            display: flex;
            gap: 8px;
            padding: 12px 20px;
            padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
            border-top: 1px solid var(--border-color);
            background: var(--secondary-bg);
        }

        
        #data-modal {
            align-items: flex-end !important;
            padding: 0 !important;
        }

        #data-modal .modal-content {
            padding: 0 !important;
            overflow: hidden !important;
            display: flex !important;
            flex-direction: column !important;
            height: 93dvh !important;
            max-height: 93dvh !important;
            min-height: 200px !important;
            border-radius: 28px 28px 0 0 !important;
            width: 100% !important;
            max-width: 520px !important;
            margin: 0 auto !important;
            box-shadow: 0 -8px 40px rgba(0,0,0,0.18) !important;
            background: var(--primary-bg) !important;
            will-change: transform, opacity;
            animation: dmSheetIn 0.38s cubic-bezier(0.32,0.72,0,1) both !important;
            transform: translateY(0) !important;
            opacity: 1 !important;
        }

        @keyframes dmSheetIn {
            from { transform: translateY(60px); opacity: 0; }
            to   { transform: translateY(0);    opacity: 1; }
        }

        .dm-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 18px 12px;
            flex-shrink: 0;
            border-bottom: 1px solid var(--border-color);
            background: var(--secondary-bg);
        }
        .dm-topbar-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .dm-topbar-back {
            width: 34px; height: 34px;
            border-radius: 10px;
            border: 1.5px solid var(--border-color);
            background: transparent;
            color: var(--text-secondary);
            display: flex; align-items: center; justify-content: center;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.18s;
            flex-shrink: 0;
        }
        .dm-topbar-back:hover { border-color: var(--accent-color); color: var(--accent-color); }
        .dm-topbar-title {
            font-size: 17px;
            font-weight: 700;
            color: var(--text-primary);
            font-family: var(--font-family);
        }
        .dm-topbar-close {
            width: 34px; height: 34px;
            border-radius: 10px;
            border: none;
            background: rgba(var(--accent-color-rgb), 0.12);
            color: var(--accent-color);
            display: flex; align-items: center; justify-content: center;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.18s;
            flex-shrink: 0;
        }
        .dm-topbar-close:hover { background: rgba(var(--accent-color-rgb), 0.22); }

        .dm-body {
            flex: 1 1 0 !important;
            min-height: 0 !important;
            overflow-y: auto !important;
            overflow-x: hidden;
            overscroll-behavior: contain;
            padding: 12px 14px max(32px, calc(env(safe-area-inset-bottom, 0px) + 20px));
            display: flex;
            flex-direction: column;
            gap: 10px;
            -webkit-overflow-scrolling: touch;
        }
        .dm-body::-webkit-scrollbar { width: 0; }

        .dm-storage-card {
            background: var(--secondary-bg);
            border-radius: 18px;
            border: 1px solid var(--border-color);
            padding: 14px 16px;
            position: relative;
            overflow: hidden;
        }
        .dm-storage-card::before {
            content: '';
            position: absolute;
            top: -20px; right: -20px;
            width: 100px; height: 100px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(var(--accent-color-rgb),0.12) 0%, transparent 70%);
            pointer-events: none;
        }
        .dm-storage-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        .dm-storage-title {
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            color: var(--text-secondary);
        }
        .dm-storage-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--accent-color);
            font-variant-numeric: tabular-nums;
        }
        .dm-stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
            margin-bottom: 10px;
        }
        .dm-stat-block {
            background: var(--primary-bg);
            border-radius: 12px;
            padding: 9px 6px;
            text-align: center;
        }
        .dm-stat-block-icon {
            font-size: 14px;
            margin-bottom: 4px;
            opacity: 0.7;
        }
        .dm-stat-pill-val {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            line-height: 1;
        }
        .dm-stat-pill-key {
            font-size: 10px;
            color: var(--text-secondary);
            margin-top: 3px;
        }
        .dm-progress-track {
            width: 100%;
            height: 6px;
            background: rgba(var(--accent-color-rgb), 0.12);
            border-radius: 99px;
            overflow: hidden;
        }
        .dm-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--accent-color), rgba(var(--accent-color-rgb),0.55));
            border-radius: 99px;
            transition: width 0.9s cubic-bezier(.22,1,.36,1);
        }

        .dm-section-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 10.5px;
            font-weight: 700;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            color: var(--text-secondary);
            padding: 2px 2px 0;
            margin-top: 2px;
        }
        .dm-section-label i { font-size: 10px; opacity: 0.65; }
        .dm-section-label.danger-label { color: #e05050; opacity: 0.85; }

        .dm-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .dm-tile {
            background: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 14px 13px 13px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
            position: relative;
            overflow: hidden;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }
        .dm-tile::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 18px;
            background: rgba(var(--accent-color-rgb), 0);
            transition: background 0.18s;
        }
        .dm-tile:active {
            transform: scale(0.96);
        }
        .dm-tile:active::after {
            background: rgba(var(--accent-color-rgb), 0.06);
        }

        .dm-tile-icon {
            width: 40px; height: 40px;
            border-radius: 12px;
            display: flex; align-items: center; justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
        }
        .dm-tile-icon.blue   { background: linear-gradient(135deg,#4A90E2,#3576C8); color:#fff; }
        .dm-tile-icon.teal   { background: linear-gradient(135deg,#3BC8A4,#20A882); color:#fff; }
        .dm-tile-icon.amber  { background: linear-gradient(135deg,#FFB74D,#F08C00); color:#fff; }
        .dm-tile-icon.violet { background: linear-gradient(135deg,#9C6FD4,#7C4FBA); color:#fff; }
        .dm-tile-icon.slate  { background: linear-gradient(135deg,rgba(var(--accent-color-rgb),0.25),rgba(var(--accent-color-rgb),0.12)); color:var(--accent-color); }
        .dm-tile-icon.red    { background: linear-gradient(135deg,#F06060,#D03030); color:#fff; }

        .dm-tile-title {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
            font-family: var(--font-family);
            line-height: 1.2;
            margin-bottom: 3px;
        }
        .dm-tile-desc {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.4;
        }
        .dm-tile-arrow {
            position: absolute;
            bottom: 12px; right: 14px;
            font-size: 10px;
            color: var(--text-secondary);
            opacity: 0.35;
        }

        .dm-row-card {
            background: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-radius: 18px;
            overflow: hidden;
        }
        .dm-row-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 13px 16px;
            border-bottom: 1px solid var(--border-color);
            transition: background 0.15s;
        }
        .dm-row-item:last-child { border-bottom: none; }
        .dm-row-item:active { background: rgba(var(--accent-color-rgb), 0.04); }

        .dm-row-icon {
            width: 36px; height: 36px;
            border-radius: 11px;
            display: flex; align-items: center; justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
        }
        .dm-row-icon.amber  { background: linear-gradient(135deg,#FFB74D,#F08C00); color:#fff; }
        .dm-row-icon.slate  { background: linear-gradient(135deg,rgba(var(--accent-color-rgb),0.25),rgba(var(--accent-color-rgb),0.12)); color:var(--accent-color); }
        .dm-row-icon.violet { background: linear-gradient(135deg,#9C6FD4,#7C4FBA); color:#fff; }
        .dm-row-icon.red    { background: linear-gradient(135deg,#F06060,#D03030); color:#fff; }

        .dm-row-info { flex: 1; min-width: 0; }
        .dm-row-title {
            font-size: 13.5px;
            font-weight: 600;
            color: var(--text-primary);
            font-family: var(--font-family);
        }
        .dm-row-desc {
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 1px;
        }

        .dm-toggle-pill {
            position: relative;
            display: inline-block;
            width: 48px; height: 28px;
            flex-shrink: 0;
        }
        .dm-toggle-pill input {
            opacity: 0; width: 0; height: 0; position: absolute;
        }
        .dm-toggle-slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background: var(--border-color);
            border-radius: 28px;
            transition: 0.28s;
        }
        .dm-toggle-slider::after {
            content: '';
            position: absolute;
            left: 3px; top: 3px;
            width: 22px; height: 22px;
            background: #fff;
            border-radius: 50%;
            transition: 0.28s;
            box-shadow: 0 1px 4px rgba(0,0,0,0.22);
        }
        .dm-toggle-pill input:checked + .dm-toggle-slider {
            background: var(--accent-color);
        }
        .dm-toggle-pill input:checked + .dm-toggle-slider::after {
            transform: translateX(20px);
        }

        .dm-danger-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            border: 1.5px solid rgba(224,80,80,0.3);
            background: rgba(224,80,80,0.06);
            color: #e05050;
            cursor: pointer;
            font-family: var(--font-family);
            transition: all 0.18s;
            flex-shrink: 0;
            white-space: nowrap;
        }
        .dm-danger-btn:hover { background: rgba(224,80,80,0.12); border-color: #e05050; }
        .dm-danger-btn:active { transform: scale(0.97); }

        .dm-nav-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px; height: 32px;
            border-radius: 10px;
            border: 1.5px solid var(--border-color);
            background: var(--primary-bg);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 12px;
            transition: all 0.18s;
            flex-shrink: 0;
        }
        .dm-nav-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }

        .dm-action-drawer {
            position: fixed;
            inset: 0;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.22s;
        }
        .dm-action-drawer.open {
            pointer-events: all;
            opacity: 1;
        }
        .dm-drawer-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0,0,0,0.42);
            backdrop-filter: blur(3px);
        }
        .dm-drawer-sheet {
            position: relative;
            z-index: 1;
            background: var(--secondary-bg);
            border-radius: 28px 28px 0 0;
            padding: 0 0 max(20px, env(safe-area-inset-bottom, 0px));
            transform: translateY(40px);
            transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
        }
        .dm-action-drawer.open .dm-drawer-sheet {
            transform: translateY(0);
        }
        .dm-drawer-handle {
            width: 36px; height: 4px;
            background: var(--border-color);
            border-radius: 99px;
            margin: 12px auto 0;
        }
        .dm-drawer-title {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px 20px 12px;
            border-bottom: 1px solid var(--border-color);
        }
        .dm-drawer-title-icon {
            width: 36px; height: 36px;
            border-radius: 11px;
            display: flex; align-items: center; justify-content: center;
            font-size: 15px;
            flex-shrink: 0;
        }
        .dm-drawer-title-text {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            font-family: var(--font-family);
        }
        .dm-drawer-subtitle {
            font-size: 11.5px;
            color: var(--text-secondary);
            margin-top: 1px;
        }
        .dm-drawer-actions {
            padding: 14px 16px 4px;
            display: flex;
            flex-direction: column;
            gap: 9px;
        }
        .dm-drawer-action-btn {
            display: flex;
            align-items: center;
            gap: 14px;
            width: 100%;
            padding: 15px 18px;
            border-radius: 16px;
            border: 1.5px solid var(--border-color);
            background: var(--primary-bg);
            cursor: pointer;
            transition: all 0.18s;
            text-align: left;
            font-family: var(--font-family);
            -webkit-tap-highlight-color: transparent;
        }
        .dm-drawer-action-btn:active { transform: scale(0.98); }
        .dm-drawer-action-btn.primary {
            background: var(--accent-color);
            border-color: var(--accent-color);
        }
        .dm-drawer-action-btn.primary:active { opacity: 0.85; }
        .dm-drawer-btn-icon {
            width: 38px; height: 38px;
            border-radius: 11px;
            background: rgba(255,255,255,0.15);
            display: flex; align-items: center; justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
            color: #fff;
        }
        .dm-drawer-action-btn:not(.primary) .dm-drawer-btn-icon {
            background: rgba(var(--accent-color-rgb),0.1);
            color: var(--accent-color);
        }
        .dm-drawer-btn-title {
            font-size: 14px;
            font-weight: 600;
            color: #fff;
            line-height: 1.2;
        }
        .dm-drawer-action-btn:not(.primary) .dm-drawer-btn-title {
            color: var(--text-primary);
        }
        .dm-drawer-btn-desc {
            font-size: 11.5px;
            color: rgba(255,255,255,0.7);
            margin-top: 2px;
        }
        .dm-drawer-action-btn:not(.primary) .dm-drawer-btn-desc {
            color: var(--text-secondary);
        }
        .dm-drawer-cancel {
            display: block;
            width: calc(100% - 32px);
            margin: 8px 16px 2px;
            padding: 14px;
            border-radius: 14px;
            border: none;
            background: rgba(var(--accent-color-rgb), 0.08);
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 600;
            font-family: var(--font-family);
            cursor: pointer;
            transition: all 0.18s;
        }
        .dm-drawer-cancel:active { transform: scale(0.98); }

        .dm-btn { display: none !important; }
        .dm-badge { display: none !important; }
        .dm-action-card { display: none !important; }

        @media (max-width: 480px) {
            #data-modal .modal-content { max-height: 96dvh; border-radius: 24px 24px 0 0; }

            .dm-tile { padding: 12px 10px 11px; }
            .dm-tile-title { font-size: 12px; }
            .dm-tile-desc  { font-size: 10px; }
            .dm-tile-icon  { width: 36px; height: 36px; font-size: 14px; }

            .dm-row-item {
                flex-wrap: nowrap;
                gap: 10px;
                align-items: center;
                padding: 12px 14px;
            }
            .dm-row-info {
                flex: 1 1 0;
                min-width: 0;
            }
            .dm-row-title {
                font-size: 13px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            .dm-row-desc {
                font-size: 10.5px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            .dm-row-item .dm-toggle-pill { flex-shrink: 0; }
            .dm-nav-btn { width: 28px; height: 28px; flex-shrink: 0; }

            .dm-row-item:has(.dm-danger-btn) {
                flex-wrap: wrap;
            }
            .dm-danger-row-mobile {
                flex-wrap: wrap !important;
            }
            .dm-danger-btn {
                width: 100%;
                justify-content: center;
                padding: 9px 12px;
                font-size: 13px;
                flex-shrink: 0;
                box-sizing: border-box;
            }
        }

        @keyframes slideUpSheet {
            from { transform: translateY(100%); opacity: 0; }
            to   { transform: translateY(0);    opacity: 1; }
        }
        @keyframes fadeOut {
            from { opacity: 1; }
            to   { opacity: 0; }
        }

        .reply-group-section {
            transition: opacity 0.2s;
        }
        .reply-group-section:hover {
            border-color: rgba(var(--accent-color-rgb), 0.3) !important;
        }

        .export-row:has(input:checked) {
            border-color: rgba(var(--accent-color-rgb), 0.4) !important;
            background: rgba(var(--accent-color-rgb), 0.04) !important;
        }

        .custom-reply-item .disable-btn svg,
        .custom-reply-item .group-btn svg {
            display: block;
        }

        :root { --header-bg-rgb: 255,255,255; }
        html[data-theme="dark"] { --header-bg-rgb: 30,30,30; }
        .header {
            background: rgba(var(--header-bg-rgb), 0.72) !important;
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: 0 1px 0 rgba(0,0,0,0.04) !important;
        }

        body.bottom-collapse-mode .collapse-hideable { display: none !important; }
        body.bottom-collapse-mode #collapse-expand-btn { display: flex !important; }
        #collapse-expand-btn.open {
            background: var(--accent-color) !important;
            color: #fff !important;
        }
        #collapse-expand-btn.open i { transform: rotate(180deg); }
        #collapse-expand-btn i { transition: transform 0.25s; }

        #collapsed-extras-panel {
            overflow: hidden;
        }
        .collapsed-extras-inner {
            animation: collapseSlideIn 0.22s cubic-bezier(0.4,0,0.2,1);
        }
        @keyframes collapseSlideIn {
            from { opacity: 0; transform: translateY(-8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .collapsed-extra-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 48px; 
            border: none;
            border-radius: 12px;
            background: rgba(var(--accent-color-rgb), 0.08);
            color: var(--accent-color);
            cursor: pointer;
            font-size: 20px; 
            transition: background 0.18s, transform 0.15s;
        }
        .collapsed-extra-btn span {
            display: none; 
        }
        .collapsed-extra-btn:hover, .collapsed-extra-btn:active {
            background: rgba(var(--accent-color-rgb), 0.18);
            transform: scale(1.04);
        }
        .collapsed-exit-btn {
            margin-left: auto;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1px solid var(--border-color);
            background: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: background 0.18s, color 0.18s;
        }
        .collapsed-exit-btn:hover {
            background: rgba(255,80,80,0.1);
            color: #ff5050;
            border-color: rgba(255,80,80,0.3);
        }

        #bottom-collapse-cs-toggle.active .setting-pill-switch { background: var(--accent-color) !important; }
        #bottom-collapse-cs-toggle.active .setting-pill-knob { right: 3px !important; left: auto !important; }
        #bottom-collapse-cs-toggle .setting-pill-switch { transition: background 0.3s; }
        #bottom-collapse-cs-toggle .setting-pill-knob { transition: right 0.25s, left 0.25s; }

        .msg-highlight {
            animation: msgHighlightPulse 1.5s ease !important;
        }
        @keyframes msgHighlightPulse {
            0% { background: transparent; }
            25% { background: rgba(var(--accent-color-rgb), 0.15); border-radius: 12px; }
            75% { background: rgba(var(--accent-color-rgb), 0.15); border-radius: 12px; }
            100% { background: transparent; }
        }
        .reply-indicator { cursor: pointer; }
        .reply-indicator:hover .reply-indicator-text { color: var(--accent-color); }

        body[data-avatar-pos="custom"] .message-avatar {
            margin-top: var(--avatar-custom-offset, 0px);
        }

        #fortune-sub-daily .tarot-face.tarot-back {
            padding: 0 !important;
            overflow: hidden !important;
        }
        #fortune-sub-daily .tarot-visual {
            height: 100% !important;
            width: 100% !important;
            margin: 0 !important;
        }

        .stats-nav-btn {
            flex: 1;
            padding: 7px 6px;
            border: none;
            border-radius: 9px;
            background: transparent;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: var(--font-family);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            white-space: nowrap;
        }
        .stats-nav-btn.active {
            background: var(--primary-bg);
            color: var(--accent-color);
            box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        }
        .stats-nav-btn:hover:not(.active) {
            background: rgba(var(--accent-color-rgb), 0.07);
            color: var(--text-primary);
        }

        #wordcloud-panel {
            overflow-y: auto;
            max-height: 72vh;
            padding: 6px 0 16px;
            scrollbar-width: none;
        }
        #wordcloud-panel::-webkit-scrollbar { display: none; }

        #wordcloud-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .wc-header {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .wc-tabs {
            flex: 1;
            background: var(--primary-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 3px;
        }
        .wc-tabs-track { display: flex; gap: 2px; }

        .wc-view-btn {
            flex: 1;
            padding: 7px 6px;
            border: none;
            border-radius: 9px;
            background: transparent;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: var(--font-family);
            transition: all 0.2s ease;
            white-space: nowrap;
        }
        .wc-view-btn.active {
            background: var(--secondary-bg);
            color: var(--accent-color);
            box-shadow: 0 1px 6px rgba(0,0,0,0.08);
        }
        .wc-view-btn:hover:not(.active) {
            color: var(--text-primary);
        }

        .wc-regen-btn {
            width: 36px; height: 36px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            flex-shrink: 0;
            transition: color 0.2s, border-color 0.2s, transform 0.3s;
        }
        .wc-regen-btn:hover {
            color: var(--accent-color);
            border-color: var(--accent-color);
            transform: rotate(180deg);
        }

        .wc-summary {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin-top: -2px;
        }
        .wc-summary-pill {
            font-size: 11px;
            font-weight: 500;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 4px;
            opacity: 0.7;
        }
        .wc-summary-pill i { color: var(--accent-color); opacity: 1; }

        .wc-canvas-wrap {
            border-radius: 16px;
            overflow: hidden;
            border: 1px solid var(--border-color);
        }
        .wc-canvas-wrap canvas {
            display: block;
            width: 100%;
            height: auto;
        }

        .wc-rank-section {
            background: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 14px 16px;
        }
        .wc-rank-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }
        .wc-rank-title i { color: var(--accent-color); }

        .wc-rank-list { display: flex; flex-direction: column; gap: 8px; }
        .wc-rank-empty { text-align: center; padding: 12px; color: var(--text-secondary); font-size: 12px; }

        .wc-rank-item {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .wc-rank-num {
            font-size: 12px;
            width: 22px;
            flex-shrink: 0;
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.5px;
        }
        .wc-rank-word {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
            width: 52px;
            flex-shrink: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .wc-rank-bar-wrap {
            flex: 1;
            height: 5px;
            background: var(--primary-bg);
            border-radius: 99px;
            overflow: hidden;
        }
        .wc-rank-bar {
            height: 100%;
            border-radius: 99px;
            transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .wc-rank-count {
            font-size: 12px;
            color: var(--text-secondary);
            width: 32px;
            text-align: right;
            flex-shrink: 0;
            font-variant-numeric: tabular-nums;
        }

        .wc-empty {
            text-align: center;
            padding: 50px 20px;
            color: var(--text-secondary);
        }
        .wc-empty i {
            font-size: 36px;
            display: block;
            margin-bottom: 12px;
            opacity: 0.2;
            animation: wc-float 3s ease-in-out infinite;
        }
        .wc-empty p { font-size: 14px; font-weight: 600; margin: 0 0 4px; color: var(--text-primary); opacity: 0.6; }
        .wc-empty span { font-size: 12px; opacity: 0.4; }
        @keyframes wc-float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-6px); }
        }

        .search-result-item:hover {
            border-color: rgba(var(--accent-color-rgb), 0.35) !important;
            background: var(--secondary-bg) !important;
        }
        .stats-search-box {
            background: var(--secondary-bg);
            border-radius: 12px;
            padding: 12px;
            border: 1px solid var(--border-color);
        }
        .stats-search-box input[type="text"]:focus,
        .stats-search-box input[type="date"]:focus {
            border-color: var(--accent-color) !important;
        }

        .header[data-always-clear] {
            opacity: 1 !important;
            transition: none !important;
        }

        #keepalive-audio-switch.active .setting-pill-knob {
            transform: translateX(20px);
            background: #fff;
        }

        .keepalive-dot {
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--border-color);
            border: 1.5px solid var(--primary-bg);
            transition: background 0.4s ease, box-shadow 0.4s ease;
            pointer-events: none;
        }
        .keepalive-dot.alive {
            background: #4cd964;
            box-shadow: 0 0 0 3px rgba(76,217,100,0.3);
            animation: dot-pulse 1.8s ease-in-out infinite;
        }
        @keyframes dot-pulse {
            0%,100% { box-shadow: 0 0 0 3px rgba(76,217,100,0.3); }
            50%      { box-shadow: 0 0 0 6px rgba(76,217,100,0.1); }
        }
        .keepalive-wave-bar {
            width: 3px;
            height: 14px;
            border-radius: 3px;
            background: var(--accent-color);
            opacity: 0.7;
            animation: wave-bounce 0.8s ease-in-out infinite alternate;
            animation-play-state: paused;
        }
        @keyframes wave-bounce {
            0%   { transform: scaleY(0.3); }
            100% { transform: scaleY(1.0); }
        }

        .search-result-item {
            display: flex;
            gap: 10px;
            align-items: flex-start;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            margin-bottom: 6px;
            background: var(--primary-bg);
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s;
        }
        .search-result-item:hover {
            border-color: rgba(var(--accent-color-rgb), 0.35);
            background: var(--secondary-bg);
        }
        .sri-avatar {
            width: 30px; height: 30px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0; font-size: 13px;
        }
        .sri-me      { background: rgba(var(--accent-color-rgb), 0.15); color: var(--accent-color); }
        .sri-partner { background: rgba(var(--accent-color-rgb), 0.07); color: var(--accent-color); }
        .sri-body    { flex: 1; min-width: 0; }
        .sri-meta    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
        .sri-name    { font-size: 12px; font-weight: 600; color: var(--text-primary); }
        .sri-time    { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; margin-left: 8px; }
        .sri-text    { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; word-break: break-word; }
        .sri-empty   { text-align: center; padding: 28px 0 16px; color: var(--text-secondary); font-size: 13px; }
        .sri-empty i { font-size: 26px; opacity: 0.25; display: block; margin-bottom: 10px; }

        .stats-search-box {
            background: var(--secondary-bg);
            border-radius: 12px;
            padding: 12px;
            border: 1px solid var(--border-color);
            margin-bottom: 2px;
        }
        .stats-search-box input:focus {
            border-color: var(--accent-color) !important;
            outline: none;
        }
