:root {
    --bg: #06070c;
    --bg-soft: #11131a;
    --bg-card: rgba(28, 33, 45, 0.5);
    --bg-muted: rgba(39, 44, 57, 0.48);
    --bg-input: rgba(34, 39, 52, 0.72);
    --text: #f6f7fb;
    --text-muted: #b8beca;
    --text-dim: #8b92a1;
    --border: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.2);
    --accent: #7f56ff;
    --accent-soft: #9b7dff;
    --success: #19c37d;
    --danger: #d85151;
    --radius-xl: 26px;
    --radius-lg: 18px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --scrim-top: rgba(8, 10, 14, 0.78);
    --scrim-bottom: rgba(7, 9, 13, 0.9);
}

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

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

code,
pre,
kbd {
    font-family: "JetBrains Mono", monospace;
}

.app-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 16% -8%, rgba(131, 120, 255, 0.24), transparent 35%),
        radial-gradient(circle at 90% 120%, rgba(99, 196, 255, 0.1), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%);
    z-index: -2;
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-card {
    width: min(470px, 96vw);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 26px;
    animation: fadeInScale 0.3s ease;
}

.auth-card-wide {
    width: min(900px, 96vw);
}

.auth-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}

.auth-main {
    min-width: 0;
}

.auth-side {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 12px;
}

.auth-side h3 {
    margin: 0 0 10px;
    font-size: 0.94rem;
}

.auth-feature {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #1f2125;
    padding: 8px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.84rem;
    animation: fadeInUp 0.2s ease both;
}

.auth-feature:nth-child(2) { animation-delay: 0.05s; }
.auth-feature:nth-child(3) { animation-delay: 0.1s; }
.auth-feature:nth-child(4) { animation-delay: 0.15s; }
.auth-feature:nth-child(5) { animation-delay: 0.2s; }

.auth-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(25, 195, 125, 0.55);
    background: rgba(25, 195, 125, 0.12);
    color: #bef4df;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 10px;
}

.auth-card h1 {
    margin: 12px 0 8px;
    font-size: clamp(1.42rem, 2.4vw, 1.9rem);
}

.auth-card p {
    margin: 0 0 16px;
    line-height: 1.55;
    color: var(--text-muted);
}

.auth-error {
    margin-bottom: 12px;
    border: 1px solid rgba(216, 81, 81, 0.45);
    background: rgba(216, 81, 81, 0.13);
    color: #ffc4c4;
    padding: 10px 12px;
    border-radius: var(--radius);
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    border-radius: var(--radius);
    outline: none;
    padding: 11px 12px;
    transition: border-color 0.15s ease;
}

.auth-form input:focus {
    border-color: var(--accent-soft);
}

.auth-footnote {
    margin-top: 14px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.auth-footnote a {
    color: #c6b0ff;
    text-decoration: none;
}

.dashboard {
    width: min(1000px, calc(100% - 10px));
    margin: 0 auto;
    position: relative;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    animation: fadeInScale 0.35s ease;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(18, 22, 31, 0.62);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(130%);
}

.panel-center {
    min-height: 100dvh;
    height: 100dvh;
    padding: 8px 2px 6px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.panel-center::before,
.panel-center::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 18;
}

.panel-center::before {
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    height: 14px;
    background: linear-gradient(180deg, rgba(8, 10, 14, 0.52), rgba(8, 10, 14, 0));
    backdrop-filter: blur(6px) saturate(112%);
}

.panel-center::after {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    height: 16px;
    background: linear-gradient(180deg, rgba(7, 9, 13, 0), rgba(7, 9, 13, 0.62));
    backdrop-filter: blur(7px) saturate(116%);
}

.panel-left,
.panel-right {
    position: fixed;
    top: 10px;
    bottom: 10px;
    width: min(300px, calc(100vw - 20px));
    z-index: 70;
    overflow: auto;
    padding: 12px;
    transition: transform 0.26s ease, opacity 0.22s ease;
}

.panel-left {
    left: 10px;
    transform: translateX(-114%);
}

.panel-right {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(620px, calc(100vw - 24px));
    max-height: min(86dvh, 860px);
    transform: translate(-50%, 58%);
    opacity: 0;
    pointer-events: none;
}

.panel-right.open {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
}

.panel-left.open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.drawer-head h3 {
    margin: 0;
    font-size: 1rem;
}

.chat-search-wrap {
    margin: 10px 0;
}

.chat-search-wrap input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    border-radius: 12px;
    outline: none;
    padding: 10px 12px;
}

.chat-search-wrap input:focus {
    border-color: var(--accent-soft);
}

.chat-list {
    display: grid;
    gap: 8px;
}

.chat-item {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(24, 29, 40, 0.62);
    color: var(--text);
    border-radius: 11px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    animation: fadeInUp 0.2s ease both;
    animation-delay: calc(var(--item-index, 0) * 26ms);
}

.chat-item:hover {
    background: rgba(35, 41, 55, 0.7);
    transform: translateY(-1px);
}

.chat-item.active {
    border-color: rgba(130, 147, 255, 0.48);
    background: rgba(41, 49, 66, 0.75);
}

.chat-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-meta {
    color: var(--text-muted);
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 4px) 4px 10px;
    position: sticky;
    top: 0;
    z-index: 32;
    background: linear-gradient(180deg, rgba(8, 10, 14, 0.88), rgba(8, 10, 14, 0.52) 72%, transparent);
    backdrop-filter: blur(18px) saturate(128%);
}

.topbar-side {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.brand-pill {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(180deg, rgba(63, 69, 86, 0.62), rgba(34, 38, 48, 0.55));
    border-radius: 999px;
    min-height: 46px;
    padding: 0 16px;
    font-weight: 700;
    font-size: clamp(1rem, 2.2vw, 1.28rem);
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.004em;
}

.chat-title-row {
    display: none;
}

.model-chip {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    background: #15171b;
}

.message-list {
    min-height: 0;
    overflow: auto;
    border-radius: 0;
    border: 0;
    background: transparent;
    padding: 4px 2px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.empty-state {
    margin: 0 auto;
    text-align: center;
    color: var(--text-muted);
    max-width: 760px;
    width: 100%;
    padding: clamp(48px, 13vh, 140px) 6px 6px;
}

.empty-state h2 {
    margin: 0 0 16px;
    color: #f5f5f8;
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 800;
}

.hero-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 620px;
    margin: 0 auto;
}

.hero-chip {
    min-width: min(45%, 220px);
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(18, 24, 35, 0.55);
    color: #d0d2d8;
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.hero-chip:hover {
    border-color: rgba(157, 173, 255, 0.36);
    background: rgba(28, 34, 46, 0.72);
    transform: translateY(-1px);
}

.hero-chip svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.chip-green svg {
    color: #2dc771;
}

.chip-blue svg {
    color: #5b78ff;
}

.chip-pink svg {
    color: #cb5cff;
}

.msg {
    width: auto;
    max-width: min(620px, 88%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    padding: 10px 14px;
    line-height: 1.45;
    background: rgba(29, 35, 48, 0.7);
    animation: fadeInUp 0.22s ease both;
    animation-delay: calc(var(--msg-index, 0) * 22ms);
}

.msg-user {
    align-self: flex-end;
    margin-right: 6px;
    margin-left: auto;
    background: linear-gradient(180deg, rgba(127, 86, 255, 0.88), rgba(93, 52, 214, 0.84));
    border-color: rgba(182, 158, 255, 0.4);
    box-shadow: 0 12px 24px rgba(90, 55, 172, 0.36);
}

.msg-assistant {
    align-self: flex-start;
    margin-left: 8px;
    margin-right: auto;
    max-width: min(760px, 92%);
    border: 0;
    background: rgba(18, 22, 31, 0.45);
    padding: 0 2px;
    border-radius: 16px;
    backdrop-filter: blur(12px);
}

.msg-focus {
    outline: 1px solid #3f4350;
    outline-offset: 6px;
    border-radius: 16px;
}

.msg-meta {
    display: none;
}

.msg-content {
    font-size: 0.94rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.msg-user .msg-content {
    color: #f6efff;
    font-weight: 550;
}

.msg-assistant .msg-content {
    color: #f0f2f6;
    font-weight: 520;
}

.msg-content p {
    margin: 0.24em 0;
}

.msg-content ul,
.msg-content ol {
    margin: 0.6em 0;
    padding-left: 1.2em;
}

.msg pre {
    overflow: auto;
    border: 1px solid #333843;
    border-radius: 11px;
    padding: 10px;
    background: #0b0d11;
    position: relative;
}

.msg code {
    background: #0d0f13;
    border-radius: 7px;
    padding: 2px 5px;
}

.code-copy {
    position: absolute;
    top: 6px;
    right: 6px;
    border: 1px solid #3b404b;
    background: #161a21;
    color: #d6d7df;
    border-radius: 7px;
    padding: 4px 7px;
    font-size: 0.68rem;
    cursor: pointer;
}

.msg-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.msg-image-link {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.msg-image-link:hover {
    transform: translateY(-2px);
    border-color: #5a6070;
}

.msg-image-link img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.msg-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-icon-btn {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(20, 24, 33, 0.54);
    color: #aeb3be;
    border-radius: 999px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.msg-icon-btn .ico {
    width: 14px;
    height: 14px;
}

.msg-icon-btn:hover {
    border-color: rgba(176, 193, 255, 0.4);
    color: #f2f4f8;
    background: rgba(31, 36, 49, 0.82);
}

.msg-icon-btn.active {
    border-color: #8c54ee;
    color: #cdaeff;
    background: rgba(140, 84, 238, 0.17);
}

.msg-user .msg-actions {
    justify-content: flex-end;
}

.attachment-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    border: 1px solid var(--border);
    background: #101216;
    border-radius: 14px;
    padding: 8px;
    animation: fadeInUp 0.18s ease;
}

.attachment-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #1a1d23;
    transition: transform 0.2s ease;
}

.attachment-card:hover {
    transform: translateY(-2px);
}

.attachment-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.attachment-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    border: 1px solid #555;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    padding: 3px 5px;
}

.composer {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: end;
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding: 7px 2px calc(env(safe-area-inset-bottom, 0px) + 8px);
    background: linear-gradient(180deg, rgba(6, 8, 12, 0), rgba(6, 8, 12, 0.48) 34%, rgba(6, 8, 12, 0.84) 76%, rgba(6, 8, 12, 0.92));
    backdrop-filter: blur(10px) saturate(116%);
    isolation: isolate;
}

.composer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -18px;
    height: 18px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(6, 8, 12, 0), rgba(6, 8, 12, 0.56));
    backdrop-filter: blur(10px);
}

.composer-track {
    min-height: 56px;
    border: 1px solid rgba(177, 188, 218, 0.26);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(53, 58, 72, 0.82), rgba(35, 40, 52, 0.74));
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 0 8px 0 14px;
    gap: 6px;
    overflow: hidden;
    backdrop-filter: blur(20px) saturate(135%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 10px 22px rgba(0, 0, 0, 0.28);
    position: relative;
}

.composer-track::after {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 62px;
    width: 1px;
    background: linear-gradient(
        180deg,
        rgba(179, 194, 226, 0.04),
        rgba(179, 194, 226, 0.5),
        rgba(179, 194, 226, 0.04)
    );
    pointer-events: none;
}

.composer textarea {
    resize: none;
    min-height: 46px;
    max-height: 120px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    letter-spacing: 0;
    line-height: 1.4;
    outline: none;
    padding: 11px 0;
    overflow-y: auto;
}

.composer textarea:focus-visible,
.composer textarea:focus {
    outline: none;
}

.composer textarea::placeholder {
    color: #b0b3ba;
    font-weight: 550;
}

.icon-btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 999px;
    cursor: pointer;
}

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

.orb-btn {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(180deg, rgba(66, 72, 88, 0.74), rgba(35, 40, 51, 0.68));
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease;
}

.orb-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.orb-send {
    background: linear-gradient(180deg, var(--accent-soft), var(--accent));
    border-color: rgba(170, 125, 255, 0.7);
}

.orb-plus {
    background: linear-gradient(180deg, rgba(63, 69, 84, 0.72), rgba(35, 39, 49, 0.66));
}

.composer .orb-plus {
    width: 50px;
    height: 50px;
    border-color: rgba(177, 188, 218, 0.36);
    background: linear-gradient(180deg, rgba(59, 65, 81, 0.84), rgba(35, 40, 52, 0.82));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 12px 24px rgba(0, 0, 0, 0.28);
}

.composer-tools {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-right: 1px;
}

.voice-btn {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(190, 151, 255, 0.82);
    background: linear-gradient(180deg, #b67dff, #8f56ff);
    color: #ffffff;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease;
    box-shadow: 0 8px 18px rgba(117, 70, 222, 0.42);
}

.voice-btn .ico {
    width: 18px;
    height: 18px;
}

.voice-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.typing {
    width: fit-content;
    background: #1a1d23;
    border: 1px solid #353a45;
    color: #c9ccd3;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
}

.typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #bdbfc6;
    animation: pulse 1.1s infinite ease;
}

.typing-dots i:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-dots i:nth-child(3) {
    animation-delay: 0.36s;
}

.settings-box {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(20, 24, 33, 0.65);
    padding: 10px;
    margin-bottom: 12px;
}

.settings-box h4,
.usage-feed-wrap h4 {
    margin: 0 0 10px;
    font-size: 0.92rem;
}

.settings-box label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.83rem;
    margin-bottom: 8px;
}

.settings-box textarea,
.settings-box input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    border-radius: 9px;
    padding: 9px;
    outline: none;
}

.settings-box textarea {
    resize: vertical;
}

.settings-box textarea:focus,
.settings-box input:focus {
    border-color: var(--accent-soft);
}

.settings-meta {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.profile-chip {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    width: fit-content;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    background: rgba(20, 24, 33, 0.66);
    padding: 10px;
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.stat-value {
    margin-top: 4px;
    font-size: 0.98rem;
}

.usage-feed {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.usage-item {
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #15181d;
    padding: 8px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.btn {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(58, 65, 83, 0.68), rgba(35, 40, 51, 0.64));
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform 0.14s ease, filter 0.14s ease;
}

.btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 1px solid rgba(163, 180, 255, 0.55);
    outline-offset: 1px;
}

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

.btn-primary {
    border-color: #1ca984;
    background: linear-gradient(180deg, #19c37d, #119462);
    color: #effff8;
}

.btn-ghost {
    background: #21252d;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

.btn-full {
    width: 100%;
}

.ico {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.drop-active {
    outline: 2px dashed rgba(168, 107, 255, 0.7);
    outline-offset: -4px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.54);
    z-index: 60;
}

.mobile-overlay.open {
    display: block;
}

@media (max-width: 980px) {
    .dashboard {
        width: calc(100% - 4px);
        margin: 0 auto;
        min-height: 100dvh;
    }

    .panel-center {
        min-height: 100dvh;
        border-radius: 0;
        padding: 8px 0 6px;
    }

    .auth-card-wide {
        width: min(520px, 96vw);
    }

    .auth-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .panel-right {
        width: min(96vw, 520px);
        max-height: min(84dvh, 760px);
        transform: translate(-50%, 66%);
    }

    .panel-right.open {
        transform: translate(-50%, -50%);
    }

    .message-list {
        gap: 10px;
    }

    .chat-item {
        padding: 8px 9px;
    }

    .chat-item-meta {
        display: none;
    }

    .msg {
        width: auto;
        max-width: min(86%, 340px);
        border-radius: 20px;
        padding: 9px 13px;
    }

    .msg-user {
        margin: 0 6px 0 auto;
    }

    .msg-assistant {
        max-width: calc(100% - 24px);
        margin: 0 auto 0 6px;
        padding: 0;
    }

    .empty-state h2 {
        font-size: clamp(1.55rem, 7vw, 2rem);
    }

    .hero-chip {
        min-width: min(100%, 320px);
        font-size: 0.86rem;
        padding: 8px 11px;
    }

    .orb-btn {
        width: 44px;
        height: 44px;
    }

    .brand-pill {
        min-height: 46px;
        padding: 0 14px;
        font-size: clamp(0.98rem, 4.3vw, 1.2rem);
    }

    .voice-btn {
        width: 42px;
        height: 42px;
    }

    .composer textarea {
        font-size: 0.9rem;
    }
}

@media (max-width: 420px) {
    .mobile-topbar {
        padding: calc(env(safe-area-inset-top, 0px) + 2px) 0 6px;
    }

    .hero-actions {
        gap: 6px;
    }

    .hero-chip {
        min-width: 100%;
        font-size: 0.82rem;
    }

    .empty-state {
        padding: clamp(34px, 11vh, 90px) 2px 4px;
    }

    .msg {
        width: auto;
        max-width: min(88%, 320px);
        padding: 8px 12px;
    }

    .msg-user {
        margin-right: 4px;
    }

    .msg-assistant {
        max-width: calc(100% - 16px);
        margin-left: 4px;
    }

    .composer-track {
        min-height: 52px;
    }

    .composer-track::after {
        right: 58px;
    }

    .composer textarea {
        min-height: 42px;
        font-size: 0.88rem;
    }
}
