/* ==========================================================================
   EDITORIAL OBSIDIAN DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Dynamic Typography Variables */
    --font-size-message: 15px;
    --font-family-message: var(--font-sans);

    /* Backgrounds */
    --bg-main: #090A0F;
    --bg-surface: #10131E;
    --bg-surface-elevated: #141826;
    --bg-user-bubble: #151926;
    
    /* Borders */
    --border-subtle: #1E2436;
    --border-user: #20263A;
    --border-active: #2A334D;
    
    /* Typography */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-dark: #090A0F;

    /* Accents */
    --accent-indigo: #818CF8;
    --accent-glow: rgba(129, 140, 248, 0.25);
    
    /* Feedback Colors */
    --color-rose: #FB7185;
    --color-rose-bg: #201216;
    --color-rose-border: #3D1720;
    
    --color-amber: #FBBF24;
    --color-amber-bg: #1C180E;
    --color-amber-border: #382D14;
    
    /* Font Stacks */
    --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, sans-serif;
    --font-mono: "Consolas", "Monaco", "Courier New", monospace;
}

/* Reset & Root Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

#app-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

/* ==========================================================================
   1. DEDICATED FULLSCREEN SIGN-IN VIEW (SIGN IN TO ALING)
   ========================================================================== */

.login-fullscreen {
    position: fixed;
    inset: 0;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 24px;
}

.login-card {
    background: #10131E;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 44px 32px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-spark {
    font-size: 26px;
    color: var(--accent-indigo);
    margin-bottom: 8px;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 28px;
    max-width: 300px;
}

.login-card form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-input {
    width: 100%;
    background: #161A28;
    border: 1px solid #23293D;
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.login-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}

.login-submit-btn {
    width: 100%;
    background: var(--accent-indigo);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.15s, transform 0.1s;
}

.login-submit-btn:hover {
    opacity: 0.9;
}
.login-submit-btn:active {
    transform: scale(0.99);
}

.form-error {
    width: 100%;
    background: var(--color-rose-bg);
    border: 1px solid var(--color-rose-border);
    color: var(--color-rose);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
}

.onboarding-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ==========================================================================
   2. CONVERSATION STREAM & EDITORIAL LAYOUT
   ========================================================================== */

#chat-stream-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 32px 24px 140px;
}

#chat-stream-container::-webkit-scrollbar {
    width: 6px;
}
#chat-stream-container::-webkit-scrollbar-track {
    background: transparent;
}
#chat-stream-container::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}
#chat-stream-container::-webkit-scrollbar-thumb:hover {
    background: var(--border-active);
}

#chat-stream {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Welcome Card */
.welcome-card {
    text-align: center;
    padding: 60px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.welcome-spark {
    font-size: 20px;
    color: var(--accent-indigo);
    margin-bottom: 4px;
}
.welcome-card h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.welcome-card p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 440px;
    line-height: 1.6;
}

/* Messages List */
#messages-list {
    display: flex;
    flex-direction: column;
    gap: 36px;
    width: 100%;
}

.message-row {
    display: flex;
    width: 100%;
    margin: 4px 0;
}

/* User Message */
.message-row.user {
    justify-content: flex-end;
}

/* ==========================================================================
   USER BUBBLE & SLEEK MORPHING SYSTEM (IN-FLIGHT -> CONFIRMED / SOFT-RETRY)
   ========================================================================== */

.message-row.user {
    justify-content: flex-end;
}

/* Base user bubble: Smoothly transitions dimensions, radius, colors */
.user-bubble {
    background-color: var(--bg-user-bubble);
    border: 1px solid var(--border-user);
    border-radius: 18px 18px 4px 18px;
    padding: 14px 20px;
    max-width: 620px;
    color: var(--text-primary);
    font-size: var(--font-size-message) !important;
    font-family: var(--font-family-message) !important;
    line-height: 1.65;
    word-break: break-word;
    user-select: text;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    
    /* Sleek Cubic-Bezier Morphing Curve */
    transition: 
        max-width 0.42s cubic-bezier(0.16, 1, 0.3, 1),
        padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. In-Flight State: Sleek compact square/capsule holding the spinner */
.user-bubble.in-flight {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 16px;
    background-color: #121624;
    border-color: #262E45;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 16px rgba(129, 140, 248, 0.12);
    animation: popInBubble 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popInBubble {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Sleek Dual-Track Minimalist Spinner Ring */
.bubble-spinner-ring {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(129, 140, 248, 0.15);
    border-top-color: var(--accent-indigo);
    border-radius: 50%;
    animation: smoothSpinRing 0.85s infinite linear;
}

@keyframes smoothSpinRing {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. Soft-Rose Failed State: Warm, dignified, calm, non-aggressive */
/* Failed State: Expands out of the 44px square into the soft-rose retry capsule */
.user-bubble.failed-bubble {
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    background: linear-gradient(135deg, #1C1217 0%, #151016 100%) !important;
    border: 1px solid #48232C !important;
    border-radius: 14px !important;
    padding: 9px 16px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 18px rgba(251, 113, 133, 0.08) !important;
    animation: softFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.user-bubble.failed-bubble .bubble-spinner-ring {
    display: none !important;
}

.user-bubble.failed-bubble:hover {
    background: linear-gradient(135deg, #24141B 0%, #19121B 100%) !important;
    border-color: #632C38 !important;
    box-shadow: 0 4px 20px rgba(251, 113, 133, 0.16) !important;
    transform: translateY(-1px);
}

.user-bubble.failed-bubble:active {
    transform: scale(0.98);
}

.bubble-retry-content {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    color: #FDA4AF; /* Soft cream-rose tone */
    user-select: none;
}

.bubble-retry-content .retry-icon {
    font-size: 13px;
    color: #FB7185;
    transition: transform 0.25s ease;
}

.user-bubble.failed-bubble:hover .retry-icon {
    transform: rotate(45deg);
}

.bubble-text-content {
    animation: fadeInText 0.32s ease forwards;
}

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

@keyframes softFadeIn {
    from {
        opacity: 0.6;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Companion Message */
.message-row.bot {
    justify-content: flex-start;
}

.bot-container {
    max-width: 780px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
}

.bot-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.bot-header .spark {
    color: var(--accent-indigo);
    font-size: 12px;
}

.bot-content,
.bot-content p,
.bot-content ul,
.bot-content ol,
.bot-content li,
.bot-content blockquote {
    font-size: var(--font-size-message) !important;
    font-family: var(--font-family-message) !important;
    line-height: 1.7;
    color: var(--text-primary);
    user-select: text;
}

.bot-content p {
    margin-bottom: 12px;
}
.bot-content p:last-child {
    margin-bottom: 0;
}
.bot-content strong {
    font-weight: 600;
    color: #FFFFFF;
}
.bot-content em {
    color: #CBD5E1;
    font-style: italic;
}
.bot-content ul, .bot-content ol {
    margin: 8px 0 12px 20px;
}
.bot-content li {
    margin-bottom: 4px;
}
.bot-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: #121522;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-indigo);
}

/* Thinking Indicator */
.thinking-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
}
.thinking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-indigo);
    box-shadow: 0 0 10px var(--accent-indigo);
    animation: breath 1.8s infinite ease-in-out;
}
.thinking-text {
    font-size: 13px;
    font-style: italic;
    color: var(--text-muted);
}

@keyframes breath {
    0%, 100% { opacity: 0.3; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ==========================================================================
   3. PROGRESSIVE DISCLOSURE CHIPS
   ========================================================================== */

.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.meta-chip.neutral {
    background: #111420;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}
.meta-chip.neutral:hover {
    background: #171B2B;
    border-color: var(--border-active);
    color: var(--text-primary);
}

.meta-chip.red {
    background: var(--color-rose-bg);
    border: 1px solid var(--color-rose-border);
    color: var(--color-rose);
}
.meta-chip.red:hover {
    background: #2D151B;
}

.meta-chip.yellow {
    background: var(--color-amber-bg);
    border: 1px solid var(--color-amber-border);
    color: var(--color-amber);
}
.meta-chip.yellow:hover {
    background: #292211;
}

/* ==========================================================================
   4. FLOATING COMMAND ISLAND (BOTTOM DOCK)
   ========================================================================== */

#command-dock-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 24px 24px;
    pointer-events: none;
    z-index: 50;
}

#command-dock {
    pointer-events: auto;
    width: 100%;
    max-width: 820px;
    background-color: rgba(16, 19, 30, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.65);
}

.dock-btn {
    border: 1px solid #23293D;
    background-color: #161A28;
    color: var(--accent-indigo);
    border-radius: 18px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.dock-btn:hover {
    background-color: #1E2336;
    border-color: var(--accent-indigo);
    color: #FFFFFF;
}

#settings-btn {
    color: #7C849B;
}
#settings-btn:hover {
    color: var(--text-primary);
}

#mic-btn.recording {
    background-color: #F43F5E !important;
    border-color: #F43F5E !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.5);
    animation: pulse-mic 1.4s infinite;
}

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

#input-container {
    flex: 1;
    display: flex;
    align-items: center;
}

#user-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: var(--font-size-message) !important;
    font-family: var(--font-family-message) !important;
    line-height: 1.5;
    resize: none;
    padding: 6px 4px;
    max-height: 140px;
}

#user-input::placeholder {
    color: #475569;
}

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

/* ==========================================================================
   5. MODALS & INSPECTORS (PROGRESSIVE DISCLOSURE)
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    z-index: 99;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0D101A;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    max-width: 540px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8);
    z-index: 100;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-title .icon {
    font-size: 18px;
}
.modal-title h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}
.close-modal-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-section {
    margin-bottom: 20px;
}
.modal-section:last-child {
    margin-bottom: 0;
}
.modal-section h4 {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.chip-list, .sources-list, .feedback-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.context-card, .source-card, .feedback-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.source-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.source-card a {
    color: var(--accent-indigo);
    text-decoration: none;
}
.source-card a:hover {
    text-decoration: underline;
}

.fb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
}
.fb-original {
    color: var(--color-rose);
}
.fb-arrow {
    color: var(--text-muted);
}
.fb-correction {
    color: #34D399;
}
.fb-reason {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   6. WORKSPACE SETTINGS HUB MODAL
   ========================================================================== */

.settings-modal-card {
    max-width: 580px;
}
.settings-scroll-body {
    max-height: 65vh;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-group-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.settings-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.tile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tile-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.tile-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.badge-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    background: #171B2B;
    border: 1px solid var(--border-subtle);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--accent-indigo);
}

/* Voice Profile Grid */
.voice-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.voice-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}
.voice-card:hover {
    border-color: var(--border-active);
    background: #141826;
}
.voice-card.selected {
    background: #161B2B;
    border-color: var(--accent-indigo);
}
.voice-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.voice-card-desc {
    font-size: 10px;
    color: var(--text-muted);
}

/* iOS Style Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #23293D;
    transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 22px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #CBD5E1;
    transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-indigo);
}
input:checked + .slider:before {
    transform: translateX(16px);
    background-color: #FFFFFF;
}

/* Settings Actions */
.settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.sign-out-btn {
    background: transparent;
    border: 1px solid var(--color-rose-border);
    color: var(--color-rose);
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.sign-out-btn:hover {
    background: var(--color-rose-bg);
}

.primary-btn {
    background: var(--accent-indigo);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 13px;
    padding: 9px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.primary-btn:hover {
    opacity: 0.9;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Settings Tabs Bar */
.settings-tabs-bar {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 16px;
    gap: 6px;
    background: #090B12;
    overflow-x: auto;
}
.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    color: var(--accent-indigo);
    border-bottom-color: var(--accent-indigo);
}

.settings-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input Grids & User Management */
.input-with-btn, .user-create-grid {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.add-key-btn {
    background: var(--accent-indigo);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 12px;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-msg {
    font-size: 12px;
    color: #34D399;
    margin-top: 6px;
}

/* Keys and Student Roster Items */
.keys-list, .students-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.key-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}
.delete-key-btn {
    background: transparent;
    border: none;
    color: var(--color-rose);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
}
.delete-key-btn:hover {
    color: #F87171;
}

.slider-range {
    width: 100%;
    accent-color: var(--accent-indigo);
    cursor: pointer;
}

.font-options-grid, .model-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.font-card, .model-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
}
.font-card:hover, .model-card:hover {
    border-color: var(--border-active);
}
.font-card.selected, .model-card.selected {
    background: #161B2B;
    border-color: var(--accent-indigo);
}
.model-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.model-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    #chat-stream-container {
        padding: 16px 12px 130px;
    }
    #command-dock-wrapper {
        padding: 0 12px 16px;
    }
    .user-bubble {
        max-width: 85%;
    }
    .voice-cards-grid {
        grid-template-columns: 1fr;
    }
    .user-create-grid {
        flex-direction: column;
    }
}

/* ==========================================================================
   LIVE VOICE DIAGNOSTICS & TELEMETRY STYLES
   ========================================================================== */

.diag-status-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.diag-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
    transition: all 0.2s ease;
}
.diag-status-indicator.recording {
    background-color: var(--color-rose);
    box-shadow: 0 0 10px var(--color-rose);
}
.diag-status-indicator.processing {
    background-color: var(--color-amber);
    box-shadow: 0 0 10px var(--color-amber);
}
.diag-status-indicator.success {
    background-color: #34D399;
    box-shadow: 0 0 10px #34D399;
}
.diag-status-indicator.error {
    background-color: var(--color-rose);
    box-shadow: 0 0 10px var(--color-rose);
}

.diag-status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#diag-status-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
#diag-status-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.diag-terminal {
    background: #080A10;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-line.info { color: #94A3B8; }
.log-line.success { color: #34D399; }
.log-line.warning { color: var(--color-amber); }
.log-line.error { color: var(--color-rose); font-weight: 600; }

.diag-raw-box {
    background: #080A10;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #CBD5E1;
    max-height: 140px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}