/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #07090f;
    --surface: #0e1120;
    --surface2: #151a2e;
    --border: rgba(255, 255, 255, .07);
    --accent: #f5c842;
    --accent2: #ff8c42;
    --blue: #4d7cff;
    --purple: #9a5cff;
    --text: #e8eaf0;
    --muted: #687092;
    --green: #22d87a;
    --user-bg: linear-gradient(135deg, #4d7cff 0%, #9a5cff 100%);
    --bot-bg: #151a2e;
    --radius: 16px;
    --sidebar-w: 270px;
}

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
}

/* Branded loading splash */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 44%, rgba(245, 200, 66, .10), transparent 36%),
        radial-gradient(ellipse at 50% 100%, rgba(77, 124, 255, .08), transparent 46%),
        var(--bg);
    opacity: 1;
    visibility: visible;
    transition: opacity .55s ease, visibility .55s ease;
}

.splash-screen::before {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 46px 46px;
    content: "";
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 72%);
}

.splash-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: splash-arrive .7s cubic-bezier(.2,.8,.2,1) both;
}

.splash-mark {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    margin-bottom: 25px;
    border: 1px solid rgba(245, 200, 66, .42);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(245,200,66,.18), rgba(255,140,66,.08));
    color: var(--accent);
    font-size: 35px;
    box-shadow: 0 0 55px rgba(245, 200, 66, .13), inset 0 1px rgba(255,255,255,.12);
    animation: splash-float 2.8s ease-in-out infinite;
}

.splash-brand {
    font: 700 13px 'Space Mono', monospace;
    letter-spacing: .23em;
    color: var(--text);
}

.splash-brand span { color: var(--accent); }

.splash-content p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    letter-spacing: .02em;
}

.splash-loader {
    display: flex;
    gap: 6px;
    margin-top: 31px;
}

.splash-loader span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: splash-pulse 1s ease-in-out infinite;
}

.splash-loader span:nth-child(2) { animation-delay: .15s; }
.splash-loader span:nth-child(3) { animation-delay: .3s; }

.splash-orbit {
    position: absolute;
    width: min(72vw, 580px);
    aspect-ratio: 1;
    border: 1px solid rgba(245, 200, 66, .055);
    border-radius: 50%;
    animation: splash-orbit 24s linear infinite;
}

.splash-orbit::after {
    position: absolute;
    top: 17%;
    left: 17%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 18px rgba(255, 140, 66, .8);
    content: "";
}

.splash-orbit-two {
    width: min(52vw, 420px);
    border-color: rgba(77, 124, 255, .07);
    animation-direction: reverse;
    animation-duration: 32s;
}

.splash-orbit-two::after { background: var(--blue); box-shadow: 0 0 18px rgba(77, 124, 255, .8); }

@keyframes splash-arrive { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes splash-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes splash-pulse { 0%, 60%, 100% { opacity: .35; transform: translateY(0) scale(.8); } 30% { opacity: 1; transform: translateY(-4px) scale(1); } }
@keyframes splash-orbit { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .splash-content, .splash-mark, .splash-loader span, .splash-orbit { animation: none; }
    .splash-screen { transition-duration: .15s; }
}

/* ===== LAYOUT ===== */
.chat-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    gap: 16px;
    transition: transform .3s ease;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.swx-icon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(245, 200, 66, .5));
}

.brand h2 {
    font-family: 'Space Mono', monospace;
    font-size: 17px;
    letter-spacing: .5px;
    color: var(--accent);
}

.status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    animation: pulse 2s infinite;
}

.dot.green {
    background: var(--green);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .5;
        transform: scale(1.3);
    }
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5c842, #ff8c42);
    color: #07090f;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .15s;
}

.new-chat-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

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

.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    padding: 0 4px;
}

.history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history::-webkit-scrollbar {
    width: 3px;
}

.history::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.history-item {
    padding: 11px 14px;
    background: var(--surface2);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    transition: border-color .2s, background .2s;
}

.history-item:hover {
    border-color: var(--border);
    background: #1c2340;
}

.history-item.active {
    border-color: rgba(245, 200, 66, .3);
    background: rgba(245, 200, 66, .06);
}

.history-empty {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    padding: 20px 0;
}

.sidebar-footer {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.footer-btn {
    flex: 1;
    padding: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.footer-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, .18);
}

/* ===== MAIN CHAT ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

/* HEADER */
.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.header-avatar {
    width: 40px;
    height: 40px;
    background: rgba(245, 200, 66, .12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(245, 200, 66, .2);
}

.header-info h3 {
    font-size: 15px;
    font-weight: 600;
}

.online-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--green);
}

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

.hdr-btn {
    width: 36px;
    height: 36px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s, border-color .2s;
}

.hdr-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, .18);
}

/* SEARCH BAR */
.search-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
}

.search-bar.visible {
    display: flex;
}

.search-bar i {
    color: var(--muted);
    font-size: 13px;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: var(--muted);
}

.search-bar button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
}

.search-bar button:hover {
    color: var(--text);
}

/* MESSAGES */
.messages {
    flex: 1;
    padding: 28px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
    width: 4px;
}

.messages::-webkit-scrollbar-thumb {
    background: var(--surface2);
    border-radius: 2px;
}

/* Message bubbles */
.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: fadeUp .3s ease forwards;
    opacity: 0;
}

.msg-row.user {
    flex-direction: row-reverse;
}

.msg-row.typing-row {
    opacity: 1;
    animation: none;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: rgba(245, 200, 66, .1);
    border: 1px solid rgba(245, 200, 66, .15);
}

.msg-row.user .msg-avatar {
    background: rgba(77, 124, 255, .15);
    border-color: rgba(77, 124, 255, .2);
}

.msg-body {
    max-width: 65%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-row.user .msg-body {
    align-items: flex-end;
}

.msg {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 14.5px;
    word-break: break-word;
}

.msg.bot {
    background: var(--bot-bg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg.user {
    background: var(--user-bg);
    border-bottom-right-radius: 4px;
}

.msg-meta {
    font-size: 11px;
    color: var(--muted);
}

/* Typing indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 6px 4px;
}

.typing-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(245, 200, 66, .4);
    animation: bounce .8s infinite;
}

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

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

@keyframes bounce {

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

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

/* System / date divider */
.divider {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    position: relative;
    margin: 4px 0;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    right: calc(50% + 60px);
}

.divider::after {
    left: calc(50% + 60px);
}

/* Highlight for search */
mark {
    background: rgba(245, 200, 66, .35);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ===== SUGGESTIONS TRAY ===== */
.suggestions-tray {
    padding: 14px 20px 10px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestions-tray .tray-label { margin-right: auto; }

.flow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
    max-width: 100%;
}

.flow-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 2px solid rgba(245, 200, 66, .34);
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(245, 200, 66, .13), rgba(255, 140, 66, .07));
    color: var(--text);
    font: 600 13px 'DM Sans', sans-serif;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(128, 87, 13, .72), 0 8px 14px rgba(0, 0, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .2), inset 0 -2px 0 rgba(126, 78, 10, .22);
    transition: background .2s, border-color .2s, transform .14s, box-shadow .14s;
}

.flow-choice i,
.chip i {
    font-size: 12px;
    color: var(--accent);
}

.flow-choice i { margin-right: 2px; }

.shortcut-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}

.flow-choice:hover {
    background: linear-gradient(135deg, rgba(245, 200, 66, .22), rgba(255, 140, 66, .14));
    border-color: rgba(245, 200, 66, .78);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(128, 87, 13, .76), 0 12px 20px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .24), inset 0 -2px 0 rgba(126, 78, 10, .2);
}

.flow-choice:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(128, 87, 13, .72), 0 3px 7px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.suggestions-tray .chip {
    min-height: 46px;
    padding: 10px 17px;
    border-width: 2px;
    border-color: rgba(245, 200, 66, .34);
    background: linear-gradient(135deg, rgba(245, 200, 66, .12), rgba(255, 140, 66, .065));
    box-shadow: 0 4px 0 rgba(128, 87, 13, .72), 0 8px 14px rgba(0, 0, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .2), inset 0 -2px 0 rgba(126, 78, 10, .22);
    font-weight: 600;
    transition: border-color .2s, background .2s, transform .18s, box-shadow .2s;
}

.suggestions-tray .chip:hover {
    border-color: rgba(245, 200, 66, .78);
    background: linear-gradient(135deg, rgba(245, 200, 66, .23), rgba(255, 140, 66, .14));
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(128, 87, 13, .76), 0 12px 20px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .24), inset 0 -2px 0 rgba(126, 78, 10, .2);
}

.suggestions-tray .chip:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(128, 87, 13, .72), 0 3px 7px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.flow-link { color: var(--accent); }

.history-item {
    width: 100%;
    text-align: left;
    font-family: 'DM Sans', sans-serif;
}

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

.tray-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tray-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s, border-color .2s;
}

.nav-btn:disabled {
    opacity: .3;
    cursor: default;
}

.nav-btn:not(:disabled):hover {
    color: var(--text);
    border-color: var(--accent);
}

.page-indicator {
    font-size: 11px;
    color: var(--muted);
    font-family: 'Space Mono', monospace;
    min-width: 36px;
    text-align: center;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.chip {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--surface2);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    transition: border-color .2s, background .2s, transform .15s;
    white-space: nowrap;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip:hover {
    border-color: var(--accent);
    background: rgba(245, 200, 66, .08);
    transform: translateY(-1px);
}

.chip:active {
    transform: translateY(0);
}

.chips-loading {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== INPUT AREA ===== */
.input-area {
    padding: 16px 20px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 6px 6px 18px;
    transition: border-color .2s;
}

.input-wrapper:focus-within {
    border-color: rgba(245, 200, 66, .4);
    box-shadow: 0 0 0 3px rgba(245, 200, 66, .06);
}

.input-wrapper.input-locked {
    border-color: rgba(245, 200, 66, .18);
    background: rgba(21, 26, 46, .68);
}

.input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
}

.input-wrapper input::placeholder {
    color: var(--muted);
}

.input-wrapper input:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5c842, #ff8c42);
    border: none;
    color: #07090f;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s, transform .15s;
    flex-shrink: 0;
}

.send-btn:hover {
    opacity: .9;
    transform: scale(1.04);
}

.send-btn:active {
    transform: scale(.97);
}

.send-btn:disabled {
    opacity: .28;
    cursor: default;
    transform: none;
}

.input-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    padding-left: 4px;
}

kbd {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 22px;
    border-radius: 100px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    z-index: 999;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== FOOTER BUTTON LABELS ===== */
.footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
}

.footer-btn span {
    font-size: 12px;
}

/* ===== MODAL BACKDROP ===== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
    animation: modalIn .25s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.93) translateY(12px);
    }

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-body::-webkit-scrollbar {
    width: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Settings sections */
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
    font-weight: 600;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.setting-label {
    font-size: 14px;
    font-weight: 500;
}

.setting-desc {
    font-size: 12px;
    color: var(--muted);
}

/* Toggle group (theme, size, etc.) */
.toggle-group {
    display: flex;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
    flex-shrink: 0;
}

.tgl-opt {
    padding: 6px 12px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background .2s, color .2s;
    white-space: nowrap;
}

.tgl-opt.active {
    background: var(--accent);
    color: #07090f;
    font-weight: 600;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    border-radius: 100px;
    background: var(--surface2);
    border: 1px solid var(--border);
    transition: background .25s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform .25s, background .25s;
}

input:checked+.slider {
    background: rgba(245, 200, 66, .2);
    border-color: var(--accent);
}

input:checked+.slider::before {
    transform: translateX(18px);
    background: var(--accent);
}

/* Select */
.setting-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 7px 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}

.setting-select:focus {
    border-color: var(--accent);
}

/* Action buttons in settings */
.action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color .2s, background .2s;
    flex-shrink: 0;
}

.action-btn:hover {
    border-color: var(--accent);
    background: rgba(245, 200, 66, .08);
}

.action-btn.danger {
    color: #ff5b5b;
}

.action-btn.danger:hover {
    border-color: #ff5b5b;
    background: rgba(255, 91, 91, .08);
}

/* Help modal */
.about-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.about-icon {
    font-size: 32px;
    line-height: 1;
}

.about-card strong {
    display: block;
    margin-bottom: 4px;
}

.about-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.help-step strong {
    color: var(--text);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(245, 200, 66, .15);
    border: 1px solid rgba(245, 200, 66, .25);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.shortcut-row span {
    margin-left: 4px;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.faq-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.faq-q {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    color: var(--text);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-align: left;
}

.faq-q i {
    color: var(--muted);
    font-size: 11px;
    transition: transform .2s;
    flex-shrink: 0;
}

.faq-q.open i {
    transform: rotate(180deg);
}

.faq-a {
    display: none;
    padding: 0 16px 13px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}

.faq-a.open {
    display: block;
}

/* Contact cards */
.contact-cards {
    display: flex;
    gap: 10px;
}

.contact-card {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: border-color .2s, background .2s;
}

.contact-card:hover {
    border-color: var(--accent);
    background: rgba(245, 200, 66, .05);
}

.contact-card i {
    font-size: 20px;
    color: var(--accent);
}

.contact-card span {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.contact-card small {
    font-size: 11px;
    color: var(--muted);
}

/* Light theme */
body.light {
    --bg: #f4f5f9;
    --surface: #ffffff;
    --surface2: #edf0f7;
    --border: rgba(0, 0, 0, .08);
    --text: #1a1d2e;
    --muted: #7b839e;
    --bot-bg: #edf0f7;
}

/* Font size variants */
body.font-small .msg {
    font-size: 12.5px;
}

body.font-large .msg {
    font-size: 16.5px;
}

/* Bubble style */
body.bubble-sharp .msg {
    border-radius: 6px;
}

body.bubble-sharp .msg.bot {
    border-bottom-left-radius: 2px;
}

body.bubble-sharp .msg.user {
    border-bottom-right-radius: 2px;
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    color: var(--text2);
    font-size: 13px;
    text-decoration: none;
    transition: color .2s;
    min-height: 46px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-sizing: border-box;
}

.back-link-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 50%;
    padding: 2px;
}

.back-link:hover {
    color: var(--text);
}

/* ══════════════════════════════════════════
   FAQ POWERED BY
══════════════════════════════════════════ */

.faq-powered-by {

    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;



    font-size: 13px;
    

    position: sticky;
    bottom: 0;

    z-index: 5;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.faq-powered-logo {

    display: flex;
    align-items: center;

    gap: 1px;
}

.faq-powered-logo img {

    width: 18px;
    height: 18px;

    object-fit: contain;
}

.faq-powered-text {

    font-weight: 700;

    font-size: 16px;

    color: #ffffff;

    background: none;
    -webkit-text-fill-color: #ffffff;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, .5);
    }

    .sidebar-close {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .msg-body {
        max-width: 80%;
    }

    .input-hint {
        display: none;
    }

    .messages {
        padding: 20px 16px;
    }

    .suggestions-tray { padding: 10px 14px; }
    .suggestions-tray .tray-label { width: 100%; }
    .flow-actions { gap: 6px; }
    .flow-choice { min-height: 42px; font-size: 12px; padding: 9px 13px; }
    .suggestions-tray .chip { min-height: 44px; padding: 9px 13px; }
}
