* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
    --bg-main: #050816;
    --bg-accent: #0c1220;
    --bg-deep: rgba(9, 12, 20, 0.82);
    --glass-bg: rgba(140, 190, 255, 0.08);
    --glass-bg-strong: rgba(255, 255, 255, 0.12);
    --glass-bg-hover: rgba(120, 208, 255, 0.14);
    --glass-bg-active: rgba(110, 200, 255, 0.18);
    --glass-border: 1px solid rgba(255, 255, 255, 0.12);
    --glass-border-glow: 1px solid rgba(182, 234, 255, 0.45);
    --text-primary: #edf3ff;
    --text-muted: rgba(226, 234, 255, 0.66);
    --accent-glow: rgba(70, 188, 255, 0.24);
    --sidebar-width: 280px;
    --accent: #7fe3ff;
    --font-scale: 1;
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.38);
    --shadow-glow: 0 0 30px rgba(82, 202, 255, 0.2);
}

body {
    background:
        radial-gradient(circle at 15% 15%, rgba(104, 240, 255, 0.26), transparent 28%),
        radial-gradient(circle at 80% 20%, rgba(100, 120, 255, 0.26), transparent 30%),
        linear-gradient(135deg, #040814 0%, #081520 42%, #040d1d 100%);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
    font-size: 1rem;
}

body.theme-cyberpunk { --accent: #67f7d1; --accent-glow: rgba(103, 247, 209, 0.28); }
body.theme-sunset { --accent: #ff9f68; --accent-glow: rgba(255, 159, 104, 0.24); }
body.theme-aurora { --bg-main: #08151b; --bg-accent: #112a32; --accent: #72f1c5; --accent-glow: rgba(114, 241, 197, 0.24); --glass-bg-hover: rgba(114, 241, 197, 0.12); --glass-bg-active: rgba(114, 241, 197, 0.18); }
body.theme-ocean { --bg-main: #06111e; --bg-accent: #0a1e31; --accent: #62b8ff; --accent-glow: rgba(98, 184, 255, 0.24); --glass-bg-hover: rgba(98, 184, 255, 0.12); --glass-bg-active: rgba(98, 184, 255, 0.18); }
body.theme-forest { --bg-main: #0b1510; --bg-accent: #122417; --accent: #a7e46f; --accent-glow: rgba(167, 228, 111, 0.22); --glass-bg-hover: rgba(167, 228, 111, 0.12); --glass-bg-active: rgba(167, 228, 111, 0.17); }
body.theme-graphite { --bg-main: #111214; --bg-accent: #1e2228; --accent: #d7dbe3; --accent-glow: rgba(215, 219, 227, 0.14); --glass-bg-hover: rgba(215, 219, 227, 0.1); --glass-bg-active: rgba(215, 219, 227, 0.16); }
body.theme-cotton-candy { --bg-main: #190f1b; --bg-accent: #251629; --accent: #ff9fd7; --accent-glow: rgba(255, 159, 215, 0.24); --glass-bg-hover: rgba(255, 159, 215, 0.12); --glass-bg-active: rgba(255, 159, 215, 0.18); }
body.theme-brainrot { --bg-main: #07100b; --bg-accent: #0f1b11; --accent: #b6f36b; --accent-glow: rgba(182, 243, 107, 0.2); --glass-bg-hover: rgba(182, 243, 107, 0.1); --glass-bg-active: rgba(182, 243, 107, 0.16); }
body.theme-light { --bg-main: #eef2f7; --bg-accent: #ffffff; --text-primary: #1c2430; --text-muted: rgba(28, 36, 48, 0.58); --glass-bg: rgba(255, 255, 255, 0.7); --glass-bg-hover: rgba(255, 255, 255, 0.92); --glass-bg-active: rgba(20, 30, 45, 0.12); }
body.custom-background { background-image: linear-gradient(rgba(7, 8, 10, 0.58), rgba(7, 8, 10, 0.7)), var(--custom-background-image); background-size: cover; background-position: center; background-attachment: fixed; }
body.custom-background.theme-light { background-image: linear-gradient(rgba(238, 242, 247, 0.68), rgba(238, 242, 247, 0.78)), var(--custom-background-image); }
body.font-mono, body.font-mono button, body.font-mono input, body.font-mono select, body.font-mono textarea { font-family: "Courier New", monospace; }

body::before {
    content: '';
    position: absolute;
    inset: 10% 20% auto 20%;
    height: 60vh;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(255,255,255,0) 68%);
    filter: blur(88px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.95;
    animation: ambientDrift 14s ease-in-out infinite alternate;
}

.auth-screen {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(2, 7, 14, 0.96);
    z-index: 2000;
}

.auth-screen.is-visible {
    display: grid;
}

.auth-card {
    width: min(100%, 380px);
    padding: 0 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.auth-logo {
    width: 112px;
    height: 112px;
    border-radius: 0;
    background: transparent;
    color: #10151d;
    display: grid;
    place-items: center;
    font-size: 2.3rem;
    line-height: 1;
    margin-bottom: 16px;
    overflow: visible;
    box-shadow: none;
}

.auth-logo img,
.auth-logo svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-card h1 {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.06em;
    margin-bottom: 22px;
    text-align: center;
    color: #ffffff;
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.auth-field span,
.auth-row label {
    font-size: 0.85rem;
    color: rgba(233, 238, 255, 0.9);
    font-weight: 500;
}

.auth-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.auth-link {
    font-size: 0.82rem;
    color: #5ea7ff;
    text-decoration: none;
}

.auth-password-wrap {
    position: relative;
    width: 100%;
}

.auth-password-wrap input {
    padding-right: 44px;
}

.auth-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: rgba(226, 233, 255, 0.8);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.18s ease, color 0.18s ease;
}

.auth-password-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.auth-card input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(17, 24, 33, 0.8);
    color: #f4f7ff;
    padding: 14px 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-card input:focus {
    border-color: rgba(112, 203, 255, 0.8);
    box-shadow: 0 0 0 1px rgba(112, 203, 255, 0.18);
}

.auth-primary-btn,
.auth-provider-btn {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.auth-primary-btn {
    margin-top: 8px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #34d399 0%, #2bbf8a 100%);
    color: #04150f;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 26px rgba(52, 211, 153, 0.2);
}

.auth-primary-btn:hover,
.auth-provider-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.auth-divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: rgba(223, 229, 246, 0.7);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.12);
}

.auth-provider-btn {
    background: rgba(255,255,255,0.05);
    color: #eef4ff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
}

.provider-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    flex: 0 0 18px;
}

.provider-mark.google {
    background: linear-gradient(135deg, #fefefe, #e3e5ea);
    color: #0e2945;
}

.provider-mark.apple {
    background: linear-gradient(135deg, #fafafa, #dfe3ea);
    color: #1a1a1d;
}

.auth-footer {
    margin-top: 18px;
    font-size: 0.93rem;
    color: rgba(233, 238, 255, 0.8);
    text-align: center;
}

.auth-footer a {
    color: #5ea7ff;
    text-decoration: none;
}

.auth-footer-small {
    margin-top: 10px;
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    background: linear-gradient(180deg, rgba(8, 13, 22, 0.32), rgba(5, 10, 17, 0.15));
    isolation: isolate;
}

.app-layout.auth-visible {
    display: none;
}

@keyframes ambientDrift {
    0% { transform: translate3d(-2%, -2%, 0) scale(0.98); opacity: 0.8; }
    100% { transform: translate3d(2%, 2%, 0) scale(1.08); opacity: 1; }
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    background: linear-gradient(180deg, rgba(8, 13, 22, 0.32), rgba(5, 10, 17, 0.15));
    isolation: isolate;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(15, 18, 28, 0.74), rgba(8, 10, 17, 0.7));
    backdrop-filter: blur(26px) saturate(1.2);
    -webkit-backdrop-filter: blur(26px) saturate(1.2);
    border-right: var(--glass-border);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    padding: 14px 12px 12px;
    gap: 10px;
    overflow: hidden;
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, filter 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, opacity, filter;
    animation: sidebarReveal 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sidebarReveal {
    0% { opacity: 0.35; filter: blur(4px); transform: translate3d(-18px, 0, 0); }
    100% { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0); }
}

.app-layout.sidebar-collapsed .sidebar {
    opacity: 0.82;
    filter: blur(2px);
    transform: translate3d(calc(-100% - 14px), 0, 0);
    border-right-color: transparent;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}

@media (min-width: 769px) {
    .app-layout.sidebar-collapsed .sidebar {
        width: 0;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
        border-right-width: 0;
    }
}

.app-layout:not(.sidebar-collapsed) .mobile-menu-btn {
    left: calc(var(--sidebar-width) + 18px);
}

.sidebar-header .logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.sparkle {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.sparkle svg {
    width: 100%;
    height: 100%;
    display: block;
}

.new-chat-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    animation: softFadeIn 0.5s ease-out;
}

.new-chat-btn:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.new-chat-btn:active {
    transform: translateY(0) scale(0.99);
}

.sidebar-section {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 4px;
}

.section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 20px 12px 8px 12px;
}


#recent-chats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Sidebar Recent Item */
.recent-item {
    position: relative;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: itemSlideIn 0.32s ease-out both;
}

.recent-item:hover {
    background: var(--glass-bg-hover);
    transform: translateX(2px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.recent-item.active {
    background: var(--glass-bg-active);
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(146, 207, 255, 0.14), 0 0 22px rgba(82, 202, 255, 0.08);
}

@keyframes itemSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}


.recent-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-title-wrap {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
}

.pinned-flag {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 0.86rem;
    line-height: 1;
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 48%, transparent));
}

.conversation-actions {
    position: relative;
    flex: 0 0 auto;
}

.conversation-menu-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.recent-item:hover .conversation-menu-trigger,
.conversation-menu-trigger:focus-visible,
.conversation-menu-trigger[aria-expanded="true"] {
    opacity: 1;
}

.conversation-menu-trigger:hover,
.conversation-menu-trigger[aria-expanded="true"] {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.conversation-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1200;
    display: none;
    width: 200px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-color: color-mix(in srgb, var(--accent) 28%, rgba(255, 255, 255, 0.12));
    border-radius: 16px;
    background: rgba(22, 24, 30, 0.98);
    background: color-mix(in srgb, var(--accent) 7%, rgba(22, 24, 30, 0.97));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    transform-origin: top right;
    /* Stack items vertically - fixes overlapping text */
    flex-direction: column;
    gap: 2px;
}

.conversation-menu[hidden] {
    display: none !important;
}

.conversation-menu.is-open {
    display: flex;
    animation: conversation-menu-in 0.16s ease-out both;
}

.conversation-menu.fixed {
    position: fixed;
    top: auto;
    right: auto;
    bottom: auto;
    margin: 0;
    z-index: 3000;
    background: #16181e;
    background: color-mix(in srgb, var(--accent) 7%, rgba(22, 24, 30, 0.98));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

@keyframes conversation-menu-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.conversation-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: nowrap;
    text-align: left;
    flex: 0 0 auto;
    transition: background 0.18s ease, color 0.18s ease;
}

.conversation-menu-item:hover,
.conversation-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    outline: none;
}

.conversation-menu-item.danger:hover,
.conversation-menu-item.danger:focus-visible {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.conversation-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    color: currentColor;
    font-size: 1rem;
    line-height: 1;
}

.sidebar-footer {
    border-top: var(--glass-border);
    padding-top: 12px;
    position: relative;
}

.user-profile-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-profile-row .user-profile {
    min-width: 0;
    flex: 1;
}

.auth-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px 10px;
    border: var(--glass-border);
    border-radius: 8px;
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
}

.auth-btn:hover {
    background: var(--glass-bg-hover);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    color: #fff;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.status-online {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 4px;
}

.identity-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.developer-badge,
.owner-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
}

.identity-badges [hidden] {
    display: none !important;
}

.developer-badge {
    background: linear-gradient(135deg, rgba(118, 201, 255, 0.18), rgba(86, 165, 255, 0.28));
    border: 1px solid rgba(122, 208, 255, 0.5);
    color: #dff6ff;
}

.owner-badge {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(255, 176, 73, 0.24));
    border: 1px solid rgba(255, 197, 93, 0.52);
    color: #fff1c8;
}

.status-online .dot {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 6px #ffffff;
}

/* Main Area */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    height: 100vh;
    width: 100%;
    padding: 12px 0 0;
    z-index: 1;
}

.top-header {
    width: 100%;
    padding: 10px 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

.top-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(17, 19, 24, 0.9);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.05rem;
    flex: 0 0 38px;
}

.settings-btn:hover, .settings-btn[aria-expanded="true"] { background: var(--accent); color: #071016; }
.model-badge {
    color: var(--accent);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    opacity: 0.9;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
}
.export-btn, .settings-btn { border-color: color-mix(in srgb, var(--accent) 38%, transparent); }

.settings-panel {
    position: fixed;
    left: calc(var(--sidebar-width) + 12px);
    bottom: 12px;
    top: auto;
    right: auto;
    z-index: 1000;
    width: min(350px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 84px));
    display: none;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(22, 24, 30, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.settings-panel.open { display: block; animation: tool-bubble-in 0.18s ease-out both; }
.admin-dashboard-panel {
    position: fixed;
    right: 32px;
    top: 48px;
    width: min(500px, calc(100vw - 56px));
    max-height: calc(100vh - 64px);
    display: none;
    z-index: 1200;
    padding: 18px 18px 10px;
    border: 1px solid rgba(120, 180, 255, 0.2);
    border-radius: 22px;
    background: rgba(9, 15, 22, 0.9);
    box-shadow: 0 28px 90px rgba(0,0,0,0.5), 0 0 40px rgba(38, 143, 255, 0.14);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    overflow: hidden;
}

.admin-dashboard-panel.is-open {
    display: block;
    animation: tool-bubble-in 0.18s ease-out both;
}

.admin-dashboard-panel[hidden] {
    display: none !important;
}

.admin-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-dashboard-eyebrow {
    margin: 0 0 6px;
    color: rgba(166, 192, 255, 0.72);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-dashboard-header h2 {
    margin: 0;
    color: #f3f7ff;
    font-size: clamp(1.6rem, 2vw, 2.1rem);
    letter-spacing: -0.06em;
}

.admin-close-btn {
    border: 0;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
    border-radius: 10px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.15rem;
}

.admin-dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: var(--text-primary);
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-card {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-card small {
    color: rgba(214, 224, 238, 0.7);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-card strong {
    font-size: 1rem;
    font-weight: 700;
    color: #f4f7ff;
}

.admin-card.status-ok {
    border-color: rgba(40, 207, 151, 0.36);
    background: rgba(40, 207, 151, 0.08);
}

.admin-card.status-bad {
    border-color: rgba(255, 174, 92, 0.4);
    background: rgba(255, 174, 92, 0.08);
}

.admin-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-section h3 {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(214, 224, 238, 0.86);
}

.admin-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-log-item {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    color: rgba(232, 237, 248, 0.9);
    font-size: 0.77rem;
    line-height: 1.5;
}

.admin-log-item time {
    color: rgba(142, 198, 255, 0.8);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    min-width: 62px;
}

.settings-panel-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.settings-panel-header strong, .settings-panel-header span { display: block; }
.settings-panel-header span { margin-top: 4px; color: var(--text-muted); font-size: 0.72rem; }
.settings-close { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; }
.settings-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.settings-tab { min-width: 0; padding: 9px 5px; border: 0; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; background: transparent; color: var(--text-muted); cursor: pointer; font: inherit; font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease; }
.settings-tab:hover, .settings-tab.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.settings-tab.is-active { border-bottom-color: var(--accent); }
.settings-tab-panel { min-height: 260px; animation: settings-panel-in 0.16s ease-out both; }
.settings-tab-panel[hidden] { display: none; }
@keyframes settings-panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.settings-scroll { max-height: calc(min(720px, 100vh - 160px)); overflow-y: auto; padding: 10px 14px 14px; }
.setting-row, .setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; color: var(--text-primary); font-size: 0.78rem; }
.setting-row select, .memory-input, .settings-actions button { border: 1px solid color-mix(in srgb, var(--accent) 24%, rgba(255,255,255,0.11)); border-radius: 9px; background: color-mix(in srgb, var(--accent) 7%, rgba(255,255,255,0.07)); color: var(--text-primary); padding: 7px 8px; font: inherit; font-size: 0.72rem; }
.setting-row select { color-scheme: dark; }
.setting-row select option { background: #17191f; color: #f0f2f5; }
.theme-light .setting-row select { color-scheme: light; }
.theme-light .setting-row select option { background: #ffffff; color: #1c2430; }
.setting-row select { max-width: 170px; }
.setting-row input[type="range"] { width: 150px; accent-color: var(--accent); }
.setting-toggle input { accent-color: var(--accent); }
.memory-input { width: 100%; resize: vertical; }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.settings-actions button { cursor: pointer; }
.settings-actions button:hover { background: var(--accent); color: #071016; }
.settings-actions button:last-child { grid-column: 1 / -1; }
.settings-auth-actions { display: grid; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.settings-auth-actions .auth-btn { margin-top: 0; }
.vision-settings-intro { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text-primary); }
.vision-settings-intro strong, .vision-settings-intro small { display: block; }
.vision-settings-intro strong { font-size: 0.78rem; }
.vision-settings-intro small { margin-top: 4px; color: var(--text-muted); font-size: 0.67rem; line-height: 1.4; }
.vision-orb { color: var(--accent); font-size: 1.25rem; animation: vision-pulse 1.8s ease-in-out infinite; }
.vision-launch-btn, .vision-control { border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text-primary); cursor: pointer; font: inherit; font-size: 0.75rem; padding: 10px 12px; transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease; }
.vision-launch-btn { width: 100%; margin-top: 12px; }
.vision-launch-btn:hover, .vision-control:hover { background: var(--accent); color: #071016; transform: translateY(-1px); }
.vision-overlay { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 20px; background: rgba(2, 5, 8, 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.vision-overlay[hidden] { display: none; }
.vision-frame { width: min(1180px, 100%); max-height: calc(100vh - 40px); padding: 18px; border: 1px solid color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0.15)); border-radius: 20px; background: color-mix(in srgb, var(--accent) 7%, rgba(14, 17, 22, 0.96)); box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 40px color-mix(in srgb, var(--accent) 14%, transparent); }
.vision-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.vision-title { display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.vision-title strong, .vision-title small { display: block; }
.vision-title strong { font-size: 1rem; letter-spacing: 0.01em; }
.vision-title small { margin-top: 3px; color: var(--text-muted); font-size: 0.7rem; }
.vision-live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); animation: vision-live 1.4s ease-out infinite; }
.vision-close { width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 10px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; }
.vision-close:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vision-body { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; align-items: stretch; }
.vision-preview-wrap { position: relative; min-height: 440px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 14px; background: #050608; }
.vision-preview-wrap video { display: block; width: 100%; max-height: min(62vh, 620px); object-fit: contain; background: #050608; }
.vision-scan-line { position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); box-shadow: 0 0 14px var(--accent); opacity: 0.7; animation: vision-scan 3.4s linear infinite; pointer-events: none; }
.vision-corner { position: absolute; width: 24px; height: 24px; border-color: var(--accent); border-style: solid; opacity: 0.9; pointer-events: none; }
.corner-top-left { top: 12px; left: 12px; border-width: 2px 0 0 2px; }.corner-top-right { top: 12px; right: 12px; border-width: 2px 2px 0 0; }.corner-bottom-left { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; }.corner-bottom-right { right: 12px; bottom: 12px; border-width: 0 2px 2px 0; }
.vision-controls { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 14px; background: rgba(0,0,0,0.16); }
.vision-control-heading { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.09); }
.vision-control-heading strong, .vision-control-heading small { display: block; grid-column: 2; }
.vision-control-heading strong { font-size: 0.78rem; color: var(--text-primary); }
.vision-control-heading small { color: var(--text-muted); font-size: 0.64rem; }
.vision-control-icon { grid-row: 1 / span 2; color: var(--accent); font-size: 1.2rem; animation: vision-pulse 1.8s ease-in-out infinite; }
.vision-control { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; }
.vision-control.primary { background: var(--accent); color: #071016; }
.vision-control.stop { margin-top: auto; border-color: rgba(239,68,68,0.38); background: rgba(239,68,68,0.1); color: #fca5a5; }
.vision-control.stop:hover { background: #ef4444; color: #fff; }
.vision-auto-toggle { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.09); color: var(--text-primary); cursor: pointer; }
.vision-auto-toggle input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }
.vision-auto-toggle strong, .vision-auto-toggle small { display: block; }
.vision-auto-toggle strong { font-size: 0.68rem; }
.vision-auto-toggle small { margin-top: 3px; color: var(--text-muted); font-size: 0.6rem; line-height: 1.35; }
.vision-control:disabled { cursor: not-allowed; opacity: 0.42; transform: none; }
.vision-note { margin-top: 10px; color: var(--text-muted); font-size: 0.68rem; text-align: right; }
@keyframes vision-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 52%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes vision-pulse { 50% { opacity: 0.52; transform: scale(0.88); } }
@keyframes vision-scan { from { transform: translateY(0); } to { transform: translateY(620px); } }
.mascot-preview { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: 1.15rem; }
.mascot-preview span { color: var(--text-muted); font-size: 0.7rem; }
.custom-theme-tools { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.custom-theme-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--text-primary); font-size: 0.78rem; }
.custom-theme-heading small { color: var(--text-muted); font-size: 0.65rem; text-align: right; }
.custom-theme-actions { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 9px; }
.settings-action-btn { border: 1px solid color-mix(in srgb, var(--accent) 28%, rgba(255,255,255,0.12)); border-radius: 9px; background: color-mix(in srgb, var(--accent) 8%, rgba(255,255,255,0.06)); color: var(--text-primary); padding: 8px 10px; cursor: pointer; font: inherit; font-size: 0.72rem; }
.settings-action-btn:hover { background: var(--accent); color: #071016; }

button.mobile-menu-btn,
button.export-btn {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(14, 20, 29, 0.7) !important;
    border: 1px solid rgba(164, 222, 255, 0.16) !important;
    color: #f3f8ff !important;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.04);
    font: inherit;
}

button.mobile-menu-btn {
    position: fixed;
    top: 14px;
    left: 18px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding: 0;
    z-index: 1100;
}

.app-layout:not(.sidebar-collapsed) .mobile-menu-btn {
    left: calc(var(--sidebar-width) + 18px);
}

.app-layout.sidebar-collapsed .mobile-menu-btn {
    left: 18px;
}

button.export-btn {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

button.mobile-menu-btn:hover,
button.export-btn:hover {
    background: rgba(18, 30, 42, 0.9) !important;
    border-color: rgba(167, 234, 255, 0.26) !important;
    transform: translateY(-1px);
}

/* Welcome Screen */
.welcome-container {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: min(100%, 820px);
    max-width: 820px;
    margin: 0 auto;
    min-height: calc(100vh - 190px);
    padding: 0 28px;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
}

.app-layout.guest-mode .welcome-container,
.app-layout.logged-in-mode .welcome-container,
.app-layout.new-chat-mode .welcome-container {
    min-height: calc(100vh - 190px);
    padding: 0 28px;
}

.welcome-title {
    font-size: clamp(2.5rem, 4vw, 4rem);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.06em;
    background: linear-gradient(120deg, #edf6ff 0%, #bfe7ff 24%, #8ae0ff 46%, #d8e6ff 72%, #f5fbff 100%);
    background-size: 180% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 6s ease infinite, heroFloat 7s ease-in-out infinite alternate;
    text-shadow: 0 0 30px rgba(107, 210, 255, 0.18);
    transform-origin: center;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

@keyframes shine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes heroFloat {
    0% { transform: translate3d(0, 9px, 0) scale(0.995); opacity: 0.86; }
    50% { transform: translate3d(0, -1px, 0) scale(1.001); opacity: 0.96; }
    100% { transform: translate3d(0, -10px, 0) scale(1.01); opacity: 1; }
}

.welcome-subtitle {
    font-size: clamp(1.2rem, 2.2vw, 2.2rem);
    color: rgba(227, 233, 255, 0.88);
    font-weight: 500;
    letter-spacing: -0.03em;
    text-align: center;
    animation: subtextFloat 8s ease-in-out infinite alternate;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

@keyframes subtextFloat {
    0% { transform: translate3d(0, 6px, 0); opacity: 0.76; }
    50% { transform: translate3d(0, 0, 0); opacity: 0.94; }
    100% { transform: translate3d(0, -6px, 0); opacity: 1; }
}

.chat-container {
    flex: 1 1 auto;
    width: min(100%, 860px);
    min-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 24px;
    margin: 0 auto;
    position: relative;
}

.app-layout.new-chat-mode .chat-container,
.app-layout:not(.active-chat-mode) .chat-container {
    justify-content: center;
}

.app-layout.active-chat-mode .chat-container {
    justify-content: flex-start;
    align-items: stretch;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 10px 0 110px;
    width: 100%;
    scroll-padding-bottom: 110px;
    overscroll-behavior: contain;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 100%;
    line-height: 1.7;
    font-size: 1rem;
    word-break: break-word;
    padding: 10px 14px;
    border-radius: 22px;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(180deg, rgba(150, 176, 255, 0.17), rgba(117, 143, 255, 0.09));
    border: 1px solid rgba(182, 201, 255, 0.22);
    box-shadow: 0 12px 28px rgba(7, 10, 17, 0.28), inset 0 1px 0 rgba(255,255,255,0.08);
    max-width: min(86%, 620px);
    color: #ffffff;
}

.message.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: min(100%, 760px);
    color: #edf2ff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.avatar-tag {
    font-size: 1.4rem;
    color: var(--accent);
    margin-top: -2px;
}


/* Message Content Formatting */
.message p {
    margin: 0.5em 0;
    line-height: 1.6;
}

.message ul, .message ol {
    margin: 0.75em 0;
    padding-left: 2em;
    line-height: 1.8;
}

.message table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    overflow: hidden;
    table-layout: fixed;
}

.message thead th,
.message tbody td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    color: rgba(255, 255, 255, 0.92);
}

.message thead th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 700;
    color: #ffffff;
}

.message tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.message table th:first-child,
.message table td:first-child {
    width: 32%;
}

.message table th:last-child,
.message table td:last-child {
    width: 30%;
}

.message table td code {
    white-space: normal;
}

.message li {
    margin: 0.4em 0;
    line-height: 1.6;
    color: #e2e8f0;
}

.message ul li {
    list-style-type: disc;
    list-style-color: rgba(255, 255, 255, 0.6);
}

.message ol {
    counter-reset: item;
    list-style: none;
}

.message ol li {
    counter-increment: item;
    margin-left: 0;
    padding-left: 1.5em;
    position: relative;
}

.message ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 1.8em;
    height: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

.message ul ul, .message ol ol, .message ul ol, .message ol ul {
    margin: 0.4em 0;
    padding-left: 1.5em;
}

.message blockquote {
    margin: 0.75em 0;
    padding: 1em;
    padding-left: 1.2em;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

.message code {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #a8d8ff;
}

.message strong {
    font-weight: 600;
    color: #ffffff;
}

.message em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

.message h1, .message h2, .message h3, .message h4, .message h5, .message h6 {
    margin: 0.75em 0 0.5em 0;
    line-height: 1.4;
    font-weight: 600;
    color: #ffffff;
}

.message h1 { font-size: 1.5em; }
.message h2 { font-size: 1.3em; }
.message h3 { font-size: 1.1em; }
.message h4 { font-size: 1em; }
.message h5 { font-size: 0.95em; }
.message h6 { font-size: 0.9em; }

.message.user {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.06);
    padding: 14px 20px;
    border-radius: 24px;
    border: none;
    max-width: 85%;
    color: #ffffff;
}

.message.assistant {
    align-self: flex-start;
    background: transparent;
    padding: 12px 0;
    border: none;
    width: 100%;
    color: #e3e3e3;
}


.thinking-indicator {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-style: italic;
    display: none;
}

/* Code Copy Button */
.code-container {
    position: relative;
    margin: 0.75em 0;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-container pre {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 16px;
    overflow-x: auto;
    max-width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.5;
    color: #a8d8ff;
}


.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Floating Input Bar */
.input-wrapper {
    width: min(100%, 820px);
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.input-pill {
    width: 100%;
    background: linear-gradient(180deg, rgba(16, 24, 35, 0.78), rgba(9, 14, 22, 0.9));
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(165, 220, 255, 0.15);
    border-radius: 28px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.05), 0 0 30px rgba(82, 202, 255, 0.08);
    transition: all 0.3s ease;
    min-height: 58px;
}

.input-pill:focus-within {
    background: linear-gradient(180deg, rgba(21, 30, 42, 0.9), rgba(11, 17, 24, 0.94));
    border-color: rgba(165, 220, 255, 0.34);
    box-shadow: 0 0 0 1px rgba(127, 227, 255, 0.2), 0 18px 32px rgba(0,0,0,0.32), 0 0 28px rgba(82, 202, 255, 0.12);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    padding: 0 8px;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    padding: 6px 8px 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    font-size: 0.72rem;
}

.attachment-thumb {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    object-fit: cover;
    border-radius: 7px;
}

.attachment-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-remove {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.attachment-remove:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.add-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.add-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.add-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(45deg);
}

/* Gemini-style States */
.app-layout.new-chat-mode .chat-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.app-layout.new-chat-mode .welcome-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 760px);
    min-height: 0;
    margin: auto;
    padding: clamp(9vh, 12vh, 15vh) 24px 8vh;
}

.app-layout.new-chat-mode .chat-box {
    display: none;
}

.app-layout.active-chat-mode .welcome-container {
    display: none;
}

.app-layout.active-chat-mode .chat-box {
    display: flex;
}

.app-layout.conversation-loading .chat-box::before {
    content: "Loading conversation...";
    align-self: center;
    margin-top: 20vh;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.app-layout.new-chat-mode .input-wrapper,
.app-layout.guest-mode .input-wrapper,
.app-layout.logged-in-mode .input-wrapper {
    position: relative;
    left: auto;
    bottom: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px 20px;
}


.input-pill input,
.input-pill textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
}

.input-pill textarea {
    resize: none;
    min-height: 24px;
    max-height: 160px;
    line-height: 1.5;
    padding: 6px 2px;
    overflow-y: auto;
}

.input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.icon-btn.recording {
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

.send-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 16%, transparent);
}

.send-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
}

.add-files-dropdown {
    position: absolute;
    left: 20px;
    bottom: calc(100% + 8px);
    width: min(320px, calc(100% - 40px));
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(24, 25, 30, 0.97);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform-origin: bottom left;
    z-index: 50;
}

.add-files-dropdown.open {
    display: flex;
    animation: tool-bubble-in 0.18s ease-out both;
}

@keyframes tool-bubble-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    animation: softFadeIn 0.28s ease-out both;
}

.dropdown-item:nth-child(2) { animation-delay: 0.04s; }
.dropdown-item:nth-child(3) { animation-delay: 0.08s; }

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

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

.dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.05rem;
}

.disclaimer {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

/* Sidebar Overlay Backdrop (hidden by default) */
.sidebar-overlay {
    display: none;
}

/* Scrollbars */
.chat-box::-webkit-scrollbar, .sidebar-section::-webkit-scrollbar {
    width: 4px;
}
.chat-box::-webkit-scrollbar-thumb, .sidebar-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* =========================================
   MOBILE RESPONSIVE BREAKPOINT (< 768px)
   ========================================= */
@media (max-width: 768px) {
    .settings-tabs { gap: 2px; padding-left: 6px; padding-right: 6px; }
    .settings-tab { padding-left: 2px; padding-right: 2px; font-size: 0.6rem; }
    .vision-overlay { padding: 10px; }
    .vision-frame { padding: 12px; border-radius: 16px; }
    .vision-body { grid-template-columns: 1fr; }
    .vision-preview-wrap { min-height: 190px; }
    .vision-controls { display: grid; grid-template-columns: 1fr 1fr; }
    .vision-control-heading, .vision-note { grid-column: 1 / -1; }
    .vision-control.stop { margin-top: 0; }
    .vision-control { min-height: 44px; padding-left: 8px; padding-right: 8px; }
    .vision-note { text-align: left; line-height: 1.4; }

    .conversation-menu-trigger {
        opacity: 1;
        width: 34px;
        height: 34px;
    }

    .conversation-menu {
        right: -2px;
        width: min(190px, calc(100vw - 76px));
    }

    .app-layout:not(.sidebar-collapsed) .mobile-menu-btn {
        left: 18px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 1000;
        background: rgba(10, 11, 13, 0.98);
        backdrop-filter: blur(25px);
        box-shadow: 5px 0 25px rgba(0,0,0,0.5);
        margin-left: 0;
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .app-layout.sidebar-collapsed .sidebar {
        left: 0;
        transform: translateX(-100%);
        border-right-color: transparent;
    }

    .sidebar-overlay.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        backdrop-filter: blur(3px);
    }

    .main-content {
        width: 100vw;
    }

    .model-badge {
        display: none;
    }

    .chat-container {
        padding: 0 12px;
    }

    .input-wrapper {
        padding: 0 12px 16px 12px;
    }

    .add-files-dropdown {
        left: 12px;
        width: min(360px, calc(100% - 24px));
    }

    .input-pill {
        gap: 8px;
        padding: 8px 10px;
        min-height: 52px;
    }

    .attachment-list {
        padding: 0 4px;
    }

    .input-pill input,
    .input-pill textarea {
        font-size: 16px;
    }

    .add-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 1.45rem;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
    }

    .send-btn {
        padding: 8px 14px;
    }

    .add-files-dropdown {
        padding-left: 8px;
        padding-right: 8px;
    }

    .message {
        max-width: 90%;
        font-size: 0.9rem;
    }

    .message p {
        margin: 0.4em 0;
    }

    .message ul, .message ol {
        margin: 0.6em 0;
        padding-left: 1.75em;
    }

    .message li {
        margin: 0.3em 0;
    }

    .message ol li::before {
        width: 1.6em;
        height: 1.6em;
        font-size: 0.8em;
    }

    .code-container {
        max-width: 100%;
        overflow: hidden;
        margin: 0.6em 0;
    }

    .code-container pre {
        font-size: 0.75rem;
        padding: 12px;
        line-height: 1.4;
    }

    .copy-code-btn {
        top: 6px;
        right: 6px;
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .top-header {
        padding: 12px 16px;
    }

    .settings-panel {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-height: calc(100vh - 24px);
    }

    .top-header {
        padding-inline: 12px;
    }

    .main-content {
        padding-top: 8px;
    }

    .chat-container {
        padding: 0 12px;
    }

    .message {
        padding: 10px 12px;
        border-radius: 18px;
    }
}

/* General mobile layout safeguards */
@media (max-width: 768px) {
    :root {
        --mobile-gutter: 12px;
        --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    }

    body,
    .app-layout,
    .main-content {
        height: 100dvh;
        min-height: 100dvh;
    }

    body {
        overflow: hidden;
    }

    .auth-screen {
        overflow-y: auto;
        padding: 24px var(--mobile-gutter) calc(24px + var(--mobile-safe-bottom));
        place-items: center;
    }

    .auth-card {
        width: min(100%, 380px);
        padding: 20px 4px 12px;
    }

    .auth-card h1 {
        font-size: clamp(1.7rem, 8vw, 2.1rem);
        margin-bottom: 18px;
    }

    .sidebar {
        width: min(86vw, 320px);
        min-width: min(86vw, 320px);
        z-index: 1200;
        padding-top: max(14px, env(safe-area-inset-top, 0px));
        padding-bottom: calc(12px + var(--mobile-safe-bottom));
        animation: none;
        transform: translateX(-100%);
    }

    .main-content {
        padding-top: max(8px, env(safe-area-inset-top, 0px));
    }

    .top-header {
        min-height: 46px;
        padding: 6px var(--mobile-gutter) 0;
    }

    .top-header-actions {
        gap: 0;
    }

    .top-header .export-btn,
    .top-header .model-badge {
        display: none;
    }

    .chat-container {
        width: 100%;
        min-height: 0;
        flex: 1 1 auto;
        padding: 0 var(--mobile-gutter);
    }

    .app-layout.new-chat-mode .welcome-container,
    .app-layout.guest-mode .welcome-container,
    .app-layout.logged-in-mode .welcome-container {
        width: 100%;
        min-height: 0;
        padding: 12vh var(--mobile-gutter) 8vh;
    }

    .welcome-title {
        font-size: clamp(2rem, 11vw, 3rem);
    }

    .welcome-subtitle {
        max-width: 90vw;
        font-size: clamp(1rem, 5vw, 1.5rem);
    }

    .chat-box {
        min-width: 0;
        padding-bottom: 96px;
        scroll-padding-bottom: 96px;
    }

    .message,
    .message.user,
    .message.assistant {
        max-width: 100%;
        min-width: 0;
    }

    .message.user {
        align-self: flex-end;
    }

    .message .content {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .message table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .input-wrapper {
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        padding: 0 var(--mobile-gutter) calc(10px + var(--mobile-safe-bottom));
    }

    .input-pill {
        gap: 6px;
        padding: 7px 8px;
        border-radius: 20px;
    }

    .input-pill input,
    .input-pill textarea {
        min-width: 0;
        width: 0;
    }

    .input-actions {
        flex: 0 0 auto;
        gap: 5px;
    }

    .send-btn {
        min-width: 54px;
        padding: 8px 10px;
    }

    .attachment-list {
        max-height: 76px;
        overflow-y: auto;
    }

    .add-files-dropdown {
        bottom: calc(100% + 6px);
        width: min(300px, calc(100vw - 24px));
    }

    .dropdown-item {
        flex-direction: row;
        align-items: center;
        min-height: 42px;
    }

    .settings-panel {
        left: var(--mobile-gutter);
        right: var(--mobile-gutter);
        bottom: calc(8px + var(--mobile-safe-bottom));
        width: auto;
        max-height: calc(100dvh - 16px - var(--mobile-safe-bottom));
        border-radius: 16px;
    }

    .settings-panel-header {
        padding: 14px;
    }

    .settings-tabs {
        display: flex;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-tab {
        flex: 0 0 92px;
        font-size: 0.68rem;
    }

    .settings-scroll {
        max-height: calc(100dvh - 150px - var(--mobile-safe-bottom));
        padding: 8px 12px 14px;
    }

    .setting-row,
    .setting-toggle {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .setting-row select,
    .setting-row input[type="range"] {
        width: 100%;
        max-width: none;
    }

    .settings-actions {
        grid-template-columns: 1fr;
    }

    .settings-actions button:last-child {
        grid-column: auto;
    }

    .custom-theme-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .custom-theme-heading small {
        text-align: left;
    }

    .custom-theme-actions {
        grid-template-columns: 1fr 1fr;
    }

    .vision-overlay {
        overflow-y: auto;
        padding: max(8px, env(safe-area-inset-top, 0px)) var(--mobile-gutter) calc(8px + var(--mobile-safe-bottom));
        place-items: start center;
    }

    .vision-frame {
        width: 100%;
        max-height: none;
        margin: auto 0;
        padding: 12px;
    }

    .vision-body {
        gap: 10px;
    }

    .vision-preview-wrap {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .vision-preview-wrap video {
        width: 100%;
        height: 100%;
        max-height: none;
    }

    .vision-controls {
        grid-template-columns: 1fr 1fr;
        padding: 10px;
    }

    .vision-auto-toggle {
        grid-column: 1 / -1;
    }

    .admin-dashboard-panel {
        top: max(8px, env(safe-area-inset-top, 0px));
        right: var(--mobile-gutter);
        bottom: calc(8px + var(--mobile-safe-bottom));
        left: var(--mobile-gutter);
        width: auto;
        max-height: none;
        overflow-y: auto;
        border-radius: 16px;
        padding: 14px 12px 10px;
    }

    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .admin-log-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .admin-log-item time {
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .auth-card {
        width: 100%;
    }

    .auth-provider-btn,
    .auth-primary-btn {
        min-height: 46px;
    }

    .vision-title strong {
        font-size: 0.88rem;
    }

    .vision-title small {
        max-width: 190px;
        line-height: 1.35;
    }

    .vision-controls {
        grid-template-columns: 1fr;
    }

    .vision-control-heading,
    .vision-auto-toggle,
    .vision-note {
        grid-column: auto;
    }

    .input-pill {
        gap: 4px;
    }

    .icon-btn,
    .add-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    .send-btn {
        min-width: 50px;
        padding-inline: 8px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        left: 18px !important;
        top: max(14px, env(safe-area-inset-top, 0px)) !important;
        z-index: 1201;
        transition: left 0.28s ease, background 0.2s ease, transform 0.2s ease;
    }

    .mobile-menu-btn.is-sidebar-open {
        left: calc(min(86vw, 320px) - 54px) !important;
        background: var(--accent) !important;
        border-color: var(--accent) !important;
        color: #071016 !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 18px var(--accent-glow);
    }

    .sidebar-overlay.active {
        z-index: 1199;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    body,
    .app-layout,
    .main-content {
        height: 100dvh;
        min-height: 100dvh;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(86vw, 320px);
        min-width: min(86vw, 320px);
        height: 100%;
        z-index: 1200;
        margin-left: 0;
        padding-top: 10px;
        padding-bottom: 10px;
        animation: none;
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        width: 100vw;
    }

    .sidebar-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1199;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(3px);
    }

    .mobile-menu-btn,
    .mobile-menu-btn.is-sidebar-open {
        left: 18px !important;
        top: 10px !important;
        z-index: 1201;
    }

    .mobile-menu-btn.is-sidebar-open {
        left: calc(min(86vw, 320px) - 54px) !important;
    }

    .top-header {
        min-height: 42px;
        padding-top: 4px;
    }

    .chat-container {
        min-height: 0;
        padding-inline: 12px;
    }

    .input-wrapper {
        padding-bottom: 8px;
    }

    .app-layout.new-chat-mode .welcome-container,
    .app-layout.guest-mode .welcome-container,
    .app-layout.logged-in-mode .welcome-container {
        padding-top: 4vh;
        padding-bottom: 3vh;
    }
}

.message-image-preview {
    display: block;
    width: min(320px, 100%);
    max-height: 280px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    object-fit: cover;
}

.message-image-unavailable {
    margin-top: 10px;
    padding: 10px 14px;
    width: fit-content;
    max-width: min(320px, 100%);
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    max-width: min(420px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.file-card-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.file-card-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-card-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.file-card-meta small {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.file-card-download {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #071016;
    font: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
}

.file-card-download:hover {
    filter: brightness(1.08);
}

.print-header {
    display: none;
}

.export-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    z-index: 60;
    width: min(300px, calc(100vw - 24px));
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(24, 25, 30, 0.97);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.export-dropdown.open {
    display: flex;
    animation: tool-bubble-in 0.18s ease-out both;
}

@media print {
    body {
        overflow: visible;
        height: auto;
        background: #ffffff;
        color: #000000;
    }
    body::before {
        display: none;
    }
    .sidebar,
    .top-header,
    .input-wrapper,
    .settings-panel,
    .vision-overlay,
    .admin-dashboard-panel,
    .scroll-jump,
    .msg-actions,
    .welcome-suggestions,
    .composer-toast,
    .reminder-dropdown,
    .export-dropdown,
    .announce-banner,
    .mobile-menu-btn {
        display: none !important;
    }
    .app-layout,
    .main-content {
        display: block;
        height: auto;
        width: auto;
        padding: 0;
    }
    .chat-container {
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 0 8px;
    }
    .chat-box {
        display: block;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .print-header {
        display: block;
        text-align: center;
        margin-bottom: 12px;
        color: #000000;
        font-size: 0.85rem;
    }
    .message {
        break-inside: avoid;
        max-width: 100% !important;
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #dddddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .message * {
        color: #000000 !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }
    .code-container pre {
        white-space: pre-wrap;
    }
}