/* ============================================
   STOCKMAN - Premium UI with Dark/Light Modes
   ============================================ */

:root {
    /* Colors - Dark Mode (default) */
    --bg-primary: #000000;
    --bg-secondary: #080808;
    --bg-card: #0d0d0d;
    --bg-card-hover: #151515;
    --bg-input: #0a0a0a;
    --bg-tertiary: #121212;

    --text-primary: #ffffff;
    --text-secondary: #9a9a9a;
    --text-muted: #5a5a5a;

    --accent: #00FF88;
    --accent-light: #33ffaa;
    --accent-dim: rgba(0, 255, 136, 0.08);
    --accent-glow: rgba(0, 255, 136, 0.25);

    --border: #1a1a1a;
    --border-light: #2a2a2a;
    --border-subtle: #141414;

    --success: #00FF88;
    --red: #ff5252;
    --error: #ff5252;
    --warning: #ffc107;
    --blue: #4da6ff;

    /* Theme-adaptive colors (dark defaults) */
    --on-accent: #000000;
    --overlay-bg: rgba(0, 0, 0, 0.75);
    --glass-bg: rgba(30, 30, 35, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-subtle: rgba(255, 255, 255, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.08);
    --glass-highlight-hover: rgba(255, 255, 255, 0.12);
    --header-bg: rgba(0, 0, 0, 0.95);
    --scrollbar-color: rgba(255, 255, 255, 0.15);
    --code-bg: rgba(0, 0, 0, 0.3);
    --code-bg-hover: rgba(0, 0, 0, 0.4);

    /* Sizing */
    --header-height: 60px;
    --input-height: 140px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    /* Shadows */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
    --glow: 0 0 24px var(--accent-glow);
    --card-glow: 0 0 40px rgba(0, 255, 136, 0.08);
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f5;
    --bg-input: #f0f2f5;
    --bg-tertiary: #e8ecf1;

    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --accent: #059669;
    --accent-light: #34d399;
    --accent-dim: rgba(5, 150, 105, 0.08);
    --accent-glow: rgba(5, 150, 105, 0.15);

    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-subtle: #e2e8f0;

    --success: #059669;
    --red: #ef4444;
    --error: #ef4444;
    --warning: #d97706;
    --blue: #2563eb;

    /* Theme-adaptive colors (light overrides) */
    --on-accent: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.97);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-subtle: rgba(0, 0, 0, 0.04);
    --glass-highlight: rgba(0, 0, 0, 0.04);
    --glass-highlight-hover: rgba(0, 0, 0, 0.07);
    --header-bg: rgba(255, 255, 255, 0.95);
    --scrollbar-color: rgba(0, 0, 0, 0.15);
    --code-bg: rgba(0, 0, 0, 0.04);
    --code-bg-hover: rgba(0, 0, 0, 0.06);

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
    --glow: 0 0 24px var(--accent-glow);
    --card-glow: 0 0 40px rgba(5, 150, 105, 0.06);
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Global hidden class */
.hidden {
    display: none !important;
}

/* Auth modal close button always visible - users can explore without signing in */

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* ============================================
   Header
   ============================================ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 20px;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* ============================================
   Stock Ticker
   ============================================ */

.ticker-container {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    height: 36px;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: flex;
    width: 100%;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    align-items: center;
    gap: 40px;
    animation: ticker-scroll 30s linear infinite;
    white-space: nowrap;
    padding-left: 100%;
    /* Fix fuzzy text during animation */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-shrink: 0;
}

.ticker-symbol {
    font-weight: 600;
    color: var(--text-primary);
}

.ticker-price {
    color: var(--text-secondary);
}

.ticker-change {
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.ticker-change.up {
    color: var(--success);
    background: rgba(0, 255, 136, 0.1);
}

.ticker-change.down {
    color: var(--error);
    background: rgba(255, 77, 77, 0.1);
}

.ticker-placeholder {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.ticker-divider {
    color: var(--border-light);
    font-size: 10px;
}

/* Stale data indicator - shows when using cached data */
.ticker-item.stale {
    opacity: 0.7;
}

.ticker-item.stale .ticker-price::after {
    content: " •";
    color: var(--text-muted);
    font-size: 8px;
}

/* Global Market Status (below ticker) */
.global-market-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.global-market-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.global-market-status.open .status-dot {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: pulse 2s infinite;
}

.global-market-status.closed .status-dot {
    background: var(--error);
}

.global-market-status.pre-market .status-dot,
.global-market-status.after-hours .status-dot {
    background: var(--warning);
    animation: pulse 2s infinite;
}

.global-market-status .status-text {
    color: var(--text-muted);
    font-weight: 500;
}

.global-market-status.open .status-text {
    color: var(--success);
}

.global-market-status.closed .status-text {
    color: var(--text-muted);
}

.global-market-status.pre-market .status-text,
.global-market-status.after-hours .status-text {
    color: var(--warning);
}

.global-market-status .status-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: 4px;
}

/* ============================================
   Chat Container
   ============================================ */

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   Welcome Card
   ============================================ */

.welcome-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 28px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), var(--accent), var(--accent-dim), transparent);
    opacity: 0.6;
}

.welcome-card.hidden {
    display: none;
}

.welcome-greeting h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.welcome-greeting p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto;
}

.quick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 32px 0;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.quick-action-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.15);
}

.quick-action-btn svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.quick-action-btn:hover svg {
    opacity: 1;
}

.welcome-hint {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.welcome-hint p {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   Messages
   ============================================ */

.messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--on-accent);
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content {
    font-size: 15px;
    line-height: 1.6;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
}

.message.user .message-time {
    color: var(--on-accent);
    opacity: 0.5;
}

/* ============================================
   Input Area
   ============================================ */

.input-area {
    padding: 16px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.message-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.message-input:focus {
    border-color: var(--accent);
}

.send-btn {
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    padding: 0 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover {
    box-shadow: var(--glow);
    transform: scale(1.02);
}

.send-btn svg {
    stroke: var(--on-accent);
}

/* Voice Buttons */
.voice-buttons {
    display: flex;
    gap: 12px;
}

.voice-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Show full labels by default, hide short labels */
.voice-btn .btn-label-full {
    display: inline;
}

.voice-btn .btn-label-short {
    display: none;
}

.voice-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.voice-btn.voice-chat {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.08) 0%, rgba(0, 255, 136, 0.02) 100%);
}

.voice-btn.voice-chat:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.05) 100%);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.15);
}

.voice-btn.voice-text:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.voice-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================
   Modal
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stock List */
.stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.stock-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-ticker {
    font-weight: 600;
    font-size: 16px;
    color: var(--accent);
}

.stock-details {
    font-size: 13px;
    color: var(--text-muted);
}

.remove-btn {
    background: transparent;
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--error);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: var(--error);
    color: var(--on-accent);
}

/* Add Stock Form */
.add-stock-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stock-input {
    flex: 1;
    min-width: 100px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.stock-input.small {
    flex: 0.5;
    min-width: 80px;
}

.stock-input:focus {
    border-color: var(--accent);
}

.add-btn {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    color: var(--on-accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-btn:hover {
    box-shadow: var(--glow);
}

/* Enhanced Portfolio Form */
.add-stock-form.enhanced {
    flex-direction: column;
    gap: 12px;
}

.add-stock-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toggle-advanced-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: fit-content;
}

.toggle-advanced-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.toggle-advanced-btn.expanded {
    border-color: var(--accent);
    color: var(--accent);
    border-style: solid;
}

.toggle-icon {
    font-size: 14px;
    font-weight: 600;
    width: 16px;
    text-align: center;
}

.advanced-fields {
    background: rgba(0, 255, 136, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    animation: slideDown 0.2s ease-out;
}

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

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.field-group:last-child {
    margin-bottom: 0;
}

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

.field-row {
    display: flex;
    gap: 12px;
}

.field-row .field-group {
    flex: 1;
}

.thesis-input {
    width: 100%;
    min-height: 60px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.thesis-input:focus {
    border-color: var(--accent);
}

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

.field-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin: 8px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-hint::before {
    content: "💡";
    font-size: 10px;
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.profile-form label {
    font-size: 14px;
    color: var(--text-secondary);
}

.notification-settings h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.notification-btn {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: var(--accent-dim);
}

/* Voice Settings */
.voice-settings {
    margin-bottom: 24px;
}

.voice-settings h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.voice-settings label {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.voice-settings select {
    width: 100%;
    margin-bottom: 12px;
}

.add-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.add-btn.secondary:hover {
    background: var(--accent-dim);
}

.setting-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 0;
}

/* ============================================
   Voice Conversation Mode - Minimal Floating Pill
   ============================================ */

/* ============================================
   Voice Overlay - Full Screen Experience
   Professional design inspired by ChatGPT/Grok
   ============================================ */

.voice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: voiceOverlayFadeIn 0.3s ease-out;
    pointer-events: none;
}

.voice-overlay.hidden {
    display: none;
}

@keyframes voiceOverlayFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Backdrop - elegant blur effect */
.voice-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
}

/* Centered content container - card style */
.voice-overlay-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 48px 40px 40px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    pointer-events: auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

/* ============================================
   ELEGANT ORB - Glassy, Ethereal, Premium
   ============================================ */

/* Orb container */
.voice-orb-container {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

/* Main orb wrapper */
.voice-orb {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ambient glow behind everything */
.orb-ambient {
    position: absolute;
    width: 180%;
    height: 180%;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(0, 255, 136, 0.15) 0%,
        rgba(0, 255, 136, 0.05) 40%,
        transparent 70%);
    animation: ambientPulse 4s ease-in-out infinite;
    pointer-events: none;
}

/* Elegant rings */
.orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    animation: ringFloat 8s ease-in-out infinite;
}

.orb-ring-outer {
    width: 100%;
    height: 100%;
    border-color: rgba(0, 255, 136, 0.2);
    animation-delay: 0s;
}

.orb-ring-middle {
    width: 85%;
    height: 85%;
    border-color: rgba(0, 255, 136, 0.3);
    animation-delay: -2s;
}

.orb-ring-inner {
    width: 70%;
    height: 70%;
    border-color: rgba(0, 255, 136, 0.4);
    animation-delay: -4s;
}

/* Floating particles container */
.orb-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff88, 0 0 16px rgba(0, 255, 136, 0.5);
}

.p1 { top: 10%; left: 50%; animation: particleOrbit 12s linear infinite; }
.p2 { top: 50%; left: 90%; animation: particleOrbit 10s linear infinite reverse; animation-delay: -2s; }
.p3 { top: 90%; left: 50%; animation: particleOrbit 14s linear infinite; animation-delay: -4s; }
.p4 { top: 50%; left: 10%; animation: particleOrbit 11s linear infinite reverse; animation-delay: -6s; }
.p5 { top: 25%; left: 25%; animation: particleOrbit 13s linear infinite; animation-delay: -3s; }
.p6 { top: 75%; left: 75%; animation: particleOrbit 9s linear infinite reverse; animation-delay: -5s; }

/* Central core */
.orb-core {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-core-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        rgba(0, 255, 136, 0.95) 0%,
        rgba(0, 217, 112, 0.85) 30%,
        rgba(0, 153, 77, 0.75) 60%,
        rgba(0, 102, 51, 0.65) 100%);
    box-shadow:
        0 0 30px rgba(0, 255, 136, 0.6),
        0 0 60px rgba(0, 255, 136, 0.3),
        0 0 90px rgba(0, 255, 136, 0.15),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: coreBreath 3s ease-in-out infinite;
}

/* Glass shine effect on core */
.orb-core-shine {
    position: absolute;
    width: 70%;
    height: 70%;
    top: 8%;
    left: 8%;
    border-radius: 50%;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.1) 40%,
        transparent 60%);
    pointer-events: none;
}

/* Status pill */
.voice-orb-status {
    position: absolute;
    bottom: -45px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #00ff88;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 1px solid rgba(0, 255, 136, 0.3);
    transition: all 0.4s ease;
}

/* Keyframe animations */
@keyframes ambientPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes ringFloat {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
    25% { transform: scale(1.02) rotate(3deg); opacity: 0.8; }
    50% { transform: scale(1) rotate(0deg); opacity: 0.6; }
    75% { transform: scale(0.98) rotate(-3deg); opacity: 0.8; }
}

@keyframes particleOrbit {
    from { transform: rotate(0deg) translateX(90px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(90px) rotate(-360deg); }
}

@keyframes coreBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ============================================
   LISTENING STATE - Calm, attentive
   ============================================ */
.voice-orb.listening .orb-ambient {
    animation-duration: 3s;
}

.voice-orb.listening .orb-ring {
    animation-duration: 4s;
}

.voice-orb.listening .orb-core-inner {
    animation: coreListenPulse 1.5s ease-in-out infinite;
}

.voice-orb.listening .particle {
    animation-duration: 8s;
}

@keyframes coreListenPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(0, 255, 136, 0.6), 0 0 60px rgba(0, 255, 136, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 0 50px rgba(0, 255, 136, 0.8), 0 0 80px rgba(0, 255, 136, 0.4); }
}

/* ============================================
   PROCESSING STATE - Thinking, computing
   ============================================ */
.voice-orb.processing .orb-ambient {
    background: radial-gradient(circle,
        rgba(255, 193, 7, 0.15) 0%,
        rgba(255, 193, 7, 0.05) 40%,
        transparent 70%);
}

.voice-orb.processing .orb-ring {
    border-color: rgba(255, 193, 7, 0.4);
    animation: ringProcessing 2s linear infinite;
}

.voice-orb.processing .particle {
    background: #ffc107;
    box-shadow: 0 0 8px #ffc107, 0 0 16px rgba(255, 193, 7, 0.5);
    animation-duration: 3s;
}

.voice-orb.processing .orb-core-inner {
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 193, 7, 0.95) 0%,
        rgba(255, 152, 0, 0.85) 30%,
        rgba(245, 124, 0, 0.75) 60%,
        rgba(230, 81, 0, 0.65) 100%);
    box-shadow:
        0 0 30px rgba(255, 193, 7, 0.6),
        0 0 60px rgba(255, 152, 0, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: coreProcess 1s ease-in-out infinite;
}

.voice-orb.processing .voice-orb-status {
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.4);
}

@keyframes ringProcessing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes coreProcess {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.92); }
}

/* ============================================
   SPEAKING STATE - Active, expressive
   ============================================ */
.voice-orb.speaking .orb-ambient {
    background: radial-gradient(circle,
        rgba(124, 77, 255, 0.2) 0%,
        rgba(124, 77, 255, 0.08) 40%,
        transparent 70%);
    animation-duration: 1.5s;
}

.voice-orb.speaking .orb-ring {
    border-color: rgba(124, 77, 255, 0.5);
    animation: ringSpeaking 3s ease-in-out infinite;
}

.voice-orb.speaking .particle {
    background: #7c4dff;
    box-shadow: 0 0 8px #7c4dff, 0 0 16px rgba(124, 77, 255, 0.5);
    animation-duration: 4s;
}

.voice-orb.speaking .orb-core-inner {
    background: radial-gradient(circle at 35% 35%,
        rgba(124, 77, 255, 0.95) 0%,
        rgba(83, 109, 254, 0.85) 30%,
        rgba(63, 81, 181, 0.75) 60%,
        rgba(48, 63, 159, 0.65) 100%);
    box-shadow:
        0 0 35px rgba(124, 77, 255, 0.7),
        0 0 70px rgba(83, 109, 254, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.15);
    animation: coreSpeakPulse 0.5s ease-in-out infinite;
}

.voice-orb.speaking .voice-orb-status {
    color: #7c4dff;
    border-color: rgba(124, 77, 255, 0.4);
}

@keyframes ringSpeaking {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.04); }
    50% { transform: scale(0.98); }
    75% { transform: scale(1.02); }
}

@keyframes coreSpeakPulse {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.08); }
    75% { transform: scale(0.96); }
}

/* ============================================
   PAUSED/ERROR STATE
   ============================================ */
.voice-orb.paused .orb-ambient,
.voice-orb-paused .orb-ambient {
    opacity: 0.2;
}

.voice-orb.paused .orb-ring,
.voice-orb-paused .orb-ring {
    border-color: rgba(100, 100, 100, 0.3);
    animation-play-state: paused;
}

.voice-orb.paused .particle,
.voice-orb-paused .particle {
    opacity: 0.3;
    animation-play-state: paused;
}

.voice-orb.paused .orb-core-inner,
.voice-orb-paused .orb-core-inner {
    background: radial-gradient(circle at 35% 35%, #555 0%, #333 100%);
    box-shadow: 0 0 20px rgba(100, 100, 100, 0.3);
    animation-play-state: paused;
}

.voice-orb.paused .voice-orb-status,
.voice-orb-paused .voice-orb-status {
    color: #666;
    border-color: rgba(100, 100, 100, 0.3);
}

/* Status text */
.voice-status {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
    min-height: 24px;
}

/* Error state for voice status */
.voice-status-error {
    color: var(--error);
}

.voice-error-icon {
    margin-right: 6px;
}

/* Paused orb state (for error/retry) */
.voice-orb-paused .voice-orb-ring {
    animation: none !important;
    opacity: 0.2;
}

.voice-orb-paused .voice-orb-core {
    animation: none !important;
    opacity: 0.5;
}

/* Retry UI container */
.voice-retry-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    max-width: 320px;
    text-align: center;
}

.voice-help-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Retry button */
.voice-retry-btn {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 24px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-retry-btn:hover {
    background: var(--accent);
    filter: brightness(1.15);
    transform: scale(1.02);
}

.voice-retry-btn:active {
    transform: scale(0.98);
}

/* Cancel button */
.voice-cancel-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-cancel-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Transcript display */
/* Live transcript - current speech being recognized */
.voice-transcript {
    font-size: 14px;
    color: var(--text-muted);
    min-height: 20px;
    max-width: 340px;
    line-height: 1.4;
    font-style: italic;
    text-align: center;
    transition: opacity 0.2s ease;
}

.voice-transcript:empty {
    display: none;
}

/* Conversation log - clean iMessage-style chat bubbles */
.voice-conversation-log {
    width: 100%;
    max-width: 380px;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 16px;
    padding: 12px 4px;
    display: none;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) transparent;
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
}

.voice-conversation-log:not(:empty) {
    display: flex;
}

.voice-conversation-log .voice-log-entry {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 80%;
    word-wrap: break-word;
    animation: voiceLogFadeIn 0.25s ease-out;
    position: relative;
}

.voice-conversation-log .voice-log-entry.user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 500;
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 4px var(--accent-glow);
}

.voice-conversation-log .voice-log-entry.assistant {
    align-self: flex-start;
    background: var(--glass-highlight);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border-subtle);
}

/* Role labels */
.voice-conversation-log .voice-log-entry::before {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 3px;
    opacity: 0.6;
}

.voice-conversation-log .voice-log-entry.user::before {
    content: 'You';
    text-align: right;
    color: var(--on-accent);
}

.voice-conversation-log .voice-log-entry.assistant::before {
    content: 'Stockman';
    color: var(--accent);
}

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

/* Waveform canvas */
.voice-waveform {
    width: 200px;
    height: 40px;
    opacity: 0.8;
}

/* Control buttons container - clean centered layout */
.voice-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-top: 16px;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--glass-highlight);
}

/* Bottom row with mute and end buttons */
.voice-controls-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 56px;
}

/* Control button wrapper for label */
.voice-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.voice-btn-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Control button base */
.voice-control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.voice-control-btn svg {
    width: 22px;
    height: 22px;
}

/* Mute button */
.voice-mute-btn {
    background: var(--glass-highlight);
    border: 1px solid var(--glass-border);
}

.voice-mute-btn svg {
    stroke: var(--text-primary);
}

.voice-mute-btn:hover {
    background: var(--glass-highlight-hover);
    transform: scale(1.05);
}

.voice-mute-btn.muted {
    background: rgba(255, 77, 77, 0.15);
    border-color: rgba(255, 77, 77, 0.4);
}

.voice-mute-btn.muted svg {
    stroke: #ff6b6b;
}

.voice-mute-btn .mic-off {
    display: none;
}

.voice-mute-btn.muted .mic-on {
    display: none;
}

.voice-mute-btn.muted .mic-off {
    display: block;
}

/* Done button - prominent pill style */
.voice-done-btn {
    background: var(--accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 36px;
    border-radius: 28px;
    width: auto;
    height: auto;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.voice-done-btn svg {
    stroke: var(--on-accent);
    width: 20px;
    height: 20px;
}

.voice-done-btn .done-btn-label {
    color: var(--on-accent);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.voice-done-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.4);
}

.voice-done-btn:active {
    transform: scale(0.97);
}

.voice-done-btn.hidden {
    display: none;
}

/* Interrupt button - stop AI speaking */
.voice-interrupt-btn {
    background: rgba(255, 77, 77, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 36px;
    border-radius: 28px;
    width: auto;
    height: auto;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

.voice-interrupt-btn svg {
    stroke: #fff;
    width: 20px;
    height: 20px;
}

.voice-interrupt-btn .interrupt-btn-label {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.voice-interrupt-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(255, 77, 77, 0.4);
}

.voice-interrupt-btn:active {
    transform: scale(0.97);
}

.voice-interrupt-btn.hidden {
    display: none;
}

/* End button */
.voice-end-btn {
    background: rgba(255, 77, 77, 0.12);
    border: 1px solid rgba(255, 77, 77, 0.25);
}

.voice-end-btn svg {
    stroke: #ff6b6b;
}

.voice-end-btn:hover {
    background: rgba(255, 77, 77, 0.2);
    transform: scale(1.05);
}

.voice-end-btn:active {
    transform: scale(0.95);
}

/* Mobile optimizations for voice overlay */
@media (max-width: 480px) {
    .voice-overlay-content {
        padding: 32px 24px 28px;
        gap: 16px;
        max-width: 320px;
        border-radius: 20px;
    }

    .voice-orb-container {
        width: 100px;
        height: 100px;
    }

    .voice-orb-core {
        width: 44px;
        height: 44px;
    }

    .voice-status {
        font-size: 15px;
    }

    .voice-transcript {
        font-size: 12px;
        max-width: 280px;
    }

    .voice-conversation-log {
        max-width: 300px;
        max-height: 200px;
        margin-top: 10px;
        gap: 8px;
    }

    .voice-conversation-log .voice-log-entry {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 16px;
    }

    .voice-waveform {
        width: 140px;
        height: 28px;
    }

    .voice-controls {
        gap: 20px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .voice-controls-row {
        gap: 40px;
    }

    .voice-control-btn {
        width: 50px;
        height: 50px;
    }

    .voice-control-btn svg {
        width: 20px;
        height: 20px;
    }

    .voice-btn-label {
        font-size: 11px;
    }

    .voice-done-btn {
        padding: 12px 28px;
        min-width: 120px;
        border-radius: 24px;
    }

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

    .voice-done-btn .done-btn-label {
        font-size: 14px;
    }

    .voice-interrupt-btn {
        padding: 12px 28px;
        min-width: 120px;
        border-radius: 24px;
    }

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

    .voice-interrupt-btn .interrupt-btn-label {
        font-size: 14px;
    }
}

/* Legacy pill styles - keeping for backward compatibility */
.voice-pill-mute {
    background: var(--glass-highlight);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-pill-mute svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    transition: stroke 0.2s ease;
}

.voice-pill-mute .mic-off {
    display: none;
}

.voice-pill-mute:hover {
    background: var(--glass-highlight-hover);
    border-color: var(--glass-border);
}

/* Muted state */
.voice-pill-mute.muted {
    background: rgba(255, 77, 77, 0.2);
    border-color: rgba(255, 77, 77, 0.5);
}

.voice-pill-mute.muted svg {
    stroke: var(--error);
}

.voice-pill-mute.muted .mic-on {
    display: none;
}

.voice-pill-mute.muted .mic-off {
    display: block;
}

/* Listening state - gentle pulse */
.voice-orb.listening::before {
    animation: orbPulseSmall 2s ease-in-out infinite;
}

.voice-orb.listening .voice-orb-inner {
    animation: orbBreathSmall 2s ease-in-out infinite;
}

@keyframes orbPulseSmall {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0; }
}

@keyframes orbBreathSmall {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.9); }
}

/* Speaking state - energetic */
.voice-orb.speaking::before {
    animation: orbSpeakSmall 0.5s ease-in-out infinite;
}

.voice-orb.speaking .voice-orb-inner {
    animation: orbSpeakCore 0.25s ease-in-out infinite alternate;
    background: linear-gradient(135deg, #00ff88 0%, #00ffcc 100%);
}

@keyframes orbSpeakSmall {
    0%, 100% { transform: scale(1); border-color: rgba(0, 255, 136, 0.5); }
    50% { transform: scale(1.1); border-color: rgba(0, 255, 136, 0.2); }
}

@keyframes orbSpeakCore {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Processing state - spin */
.voice-orb.processing .voice-orb-inner {
    animation: orbSpinSmall 1s linear infinite;
}

.voice-orb.processing::before {
    border-style: dashed;
    animation: orbSpinSmall 1.5s linear infinite reverse;
}

@keyframes orbSpinSmall {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pill content - status and transcript */
.voice-pill-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-pill-status {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-pill-transcript {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    opacity: 0;
    height: 0;
    transition: all 0.2s ease;
}

.voice-pill-transcript:not(:empty) {
    opacity: 0.8;
    height: 16px;
}

/* Close button */
.voice-pill-close {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-pill-close svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    transition: stroke 0.2s ease;
}

.voice-pill-close:hover {
    background: rgba(255, 77, 77, 0.15);
}

.voice-pill-close:hover svg {
    stroke: var(--error);
}

.voice-pill-close:active {
    transform: scale(0.9);
}

/* Hidden waveform canvas (for analysis only) */
.voice-waveform-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Voice button recording state */
.voice-btn.recording {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    animation: btnRecordingPulse 1.5s ease-in-out infinite;
}

@keyframes btnRecordingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
}

/* ============================================
   Typing Indicator
   ============================================ */

.typing-indicator {
    padding: 16px 20px;
}

.typing-indicator.hidden {
    display: none;
}

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

.typing-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

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

.typing-text {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ============================================
   Message Content Formatting
   ============================================ */

.message-content {
    font-size: 15px;
    line-height: 1.7;
}

.message-content p {
    margin-bottom: 12px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong, .message-content b {
    font-weight: 600;
    color: var(--accent);
}

.message-content ul, .message-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 6px;
}

.message-content code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

/* Chat headings from markdown ## and ### */
.message-content .chat-heading {
    color: var(--accent);
    font-weight: 600;
    margin: 16px 0 8px 0;
    line-height: 1.3;
}

.message-content h3.chat-heading {
    font-size: 16px;
}

.message-content h4.chat-heading {
    font-size: 14px;
}

.message-content .chat-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
    opacity: 0.5;
}

/* ============================================
   Comparison Card (side-by-side stock compare)
   ============================================ */

.comparison-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 12px 0;
    overflow: hidden;
}

.comparison-header {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.15) 0%, rgba(5, 150, 105, 0.05) 100%);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.comparison-vs {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.comparison-vs span {
    color: var(--accent);
    font-weight: 400;
    font-size: 14px;
    margin: 0 8px;
    text-transform: uppercase;
}

.comparison-body {
    padding: 16px;
}

.comparison-body p {
    margin-bottom: 8px;
}

.comparison-body strong {
    color: var(--accent);
}

.comparison-body ul {
    margin: 8px 0;
    padding-left: 20px;
}

.comparison-body li {
    margin-bottom: 4px;
}

.comparison-body .chat-heading {
    color: var(--accent);
    font-weight: 600;
    margin: 14px 0 6px 0;
}

.comparison-body hr.chat-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
    opacity: 0.4;
}

/* Winner highlight */
.comparison-winner {
    color: var(--accent) !important;
    font-weight: 700;
}

/* Responsive: on small screens, comparison is single-column naturally via text */
@media (max-width: 600px) {
    .comparison-card {
        margin: 8px -4px;
        border-radius: 8px;
    }

    .comparison-header {
        padding: 10px 12px;
    }

    .comparison-vs {
        font-size: 16px;
    }

    .comparison-body {
        padding: 12px;
    }
}

/* Light mode overrides */
[data-theme="light"] .comparison-card {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .comparison-header {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.1) 0%, rgba(5, 150, 105, 0.03) 100%);
}

/* ============================================
   Streaming Message Styles
   ============================================ */

.message.streaming .message-content p {
    margin-bottom: 0;
}

.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s ease-in-out infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.message.streaming {
    animation: fadeInStream 0.2s ease-out;
}

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

/* ============================================
   Tool Result Cards (AI Agent Actions)
   ============================================ */

.tool-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: toolCardSlideIn 0.3s ease-out;
}

@keyframes toolCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tool-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.tool-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tool-card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.tool-card-details {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tool card color variants */
.tool-card-green {
    border-left: 3px solid var(--success);
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.05) 0%, var(--bg-card) 50%);
}

.tool-card-red {
    border-left: 3px solid var(--error);
    background: linear-gradient(90deg, rgba(255, 77, 77, 0.05) 0%, var(--bg-card) 50%);
}

.tool-card-blue {
    border-left: 3px solid #4dabf7;
    background: linear-gradient(90deg, rgba(77, 171, 247, 0.05) 0%, var(--bg-card) 50%);
}

.tool-card-purple {
    border-left: 3px solid #b197fc;
    background: linear-gradient(90deg, rgba(177, 151, 252, 0.05) 0%, var(--bg-card) 50%);
}

.tool-card-yellow {
    border-left: 3px solid var(--warning);
    background: linear-gradient(90deg, rgba(255, 170, 0, 0.05) 0%, var(--bg-card) 50%);
}

.tool-card-gray {
    border-left: 3px solid var(--text-muted);
    background: linear-gradient(90deg, rgba(102, 102, 102, 0.05) 0%, var(--bg-card) 50%);
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .chat-container {
        padding: 16px;
    }

    .message {
        max-width: 90%;
    }

    .voice-buttons {
        flex-direction: column;
    }

    .add-stock-form {
        flex-direction: column;
    }

    .stock-input.small {
        flex: 1;
    }
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   Bottom Navigation
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 10px 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-secondary);
    background: var(--glass-highlight);
}

.nav-btn.active {
    color: var(--accent);
    background: rgba(0, 255, 136, 0.08);
}

.nav-btn svg {
    width: 22px;
    height: 22px;
}

.nav-btn span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ============================================
   Page Container & Content
   ============================================ */

.page-container {
    position: relative;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page-content {
    display: none;
    min-height: 100%;
}

.page-content.active {
    display: block;
    overflow-y: auto;
}

/* Adjust input area and chat for bottom nav */
.input-area {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* ============================================
   Skeleton Loaders
   ============================================ */

@keyframes skeleton-shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200px 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line.w30 { width: 30%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }

/* Ticker skeleton */
.ticker-skeleton {
    display: flex;
    gap: 24px;
    padding: 0 16px;
}

.skeleton-ticker-item {
    width: 100px;
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200px 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-mover {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 8px;
}

.skeleton-mover .skeleton-line:first-child {
    height: 16px;
}

.skeleton-mover .skeleton-line:last-child {
    height: 14px;
}

.skeleton-sector {
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.skeleton-earning {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 8px;
}

.skeleton-earning .skeleton-line:first-child {
    height: 16px;
}

.skeleton-earning .skeleton-line:last-child {
    height: 14px;
}

/* Index card skeleton state */
.index-card.loading .index-value,
.index-card.loading .index-change {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200px 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    color: transparent;
    border-radius: 4px;
    min-width: 60px;
}

/* ============================================
   Market Overview Page
   ============================================ */

/* Market Status Bar */
.market-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.market-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-status-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: pulse 2s infinite;
}

.market-status-indicator.open .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.market-status-indicator.closed .status-dot {
    background: var(--error);
    animation: none;
}

.market-status-indicator.pre-market .status-dot,
.market-status-indicator.after-hours .status-dot {
    background: var(--warning);
}

.market-status-indicator .status-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.market-status-indicator.open .status-text {
    color: var(--success);
}

.market-status-indicator.closed .status-text {
    color: var(--text-muted);
}

.market-status-time {
    color: var(--text-muted);
    font-size: 12px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.market-overview {
    padding: 20px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
    max-width: 800px;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.market-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s ease;
}

.market-section:hover {
    border-color: var(--border-light);
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}

.section-icon {
    font-size: 18px;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -10px;
    margin-bottom: 16px;
    letter-spacing: 0.2px;
}

/* Trade Alerts Section */
.alerts-section {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 255, 136, 0.02) 100%);
    border: 1px solid rgba(0, 255, 136, 0.15);
}

.alerts-section:hover {
    border-color: rgba(0, 255, 136, 0.25);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.section-header-row .section-title {
    margin-bottom: 0;
}

.alert-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scan-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.scan-btn:hover {
    background: rgba(0, 255, 136, 0.1);
}

.scan-btn.scanning {
    opacity: 0.7;
    pointer-events: none;
}

.scan-btn.scanning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.trade-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.alerts-empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.alerts-empty-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

.alerts-empty-state p {
    margin: 0;
    font-size: 13px;
}

.trade-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.trade-alert-item:hover {
    background: var(--code-bg-hover);
    border-color: var(--accent);
}

.trade-alert-item.priority-1 {
    border-left: 3px solid var(--accent);
}

.trade-alert-item.priority-2 {
    border-left: 3px solid #FFD700;
}

.trade-alert-item.priority-3 {
    border-left: 3px solid var(--text-muted);
}

.trade-alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.trade-alert-content {
    flex: 1;
    min-width: 0;
}

.trade-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.trade-alert-ticker {
    font-weight: 700;
    color: var(--accent);
    font-size: 14px;
}

.trade-alert-type {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--glass-highlight);
    padding: 2px 6px;
    border-radius: 8px;
}

.trade-alert-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.trade-alert-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.trade-alert-score {
    font-weight: 600;
}

.trade-alert-score.high {
    color: var(--accent);
}

.trade-alert-score.medium {
    color: #FFD700;
}

.trade-alert-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trade-alert-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.trade-alert-dismiss:hover {
    background: var(--glass-highlight);
    color: var(--text-secondary);
}

/* Unread alert styling */
.trade-alert-item.unread {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.3);
    position: relative;
}

.trade-alert-item.unread:hover {
    background: rgba(0, 255, 136, 0.12);
}

.trade-alert-unread-dot {
    position: absolute;
    top: 12px;
    left: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: unread-pulse 2s ease-in-out infinite;
}

@keyframes unread-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* Mark all read button */
.mark-all-read-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mark-all-read-btn:hover {
    background: var(--glass-highlight);
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

.mark-all-read-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   Signal Performance Tracking Section
   ============================================ */

.signal-performance-section {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.05) 0%, transparent 50%);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.signal-performance-section .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signal-icon {
    font-size: 18px;
}

.signal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.signal-stat-card {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    transition: all 0.2s ease;
}

.signal-stat-card:hover {
    background: var(--code-bg-hover);
    border-color: rgba(88, 166, 255, 0.4);
}

.signal-stat-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.signal-stat-winrate {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.signal-stat-winrate.good {
    color: var(--accent);
}

.signal-stat-winrate.neutral {
    color: var(--text-secondary);
}

.signal-stat-winrate.bad {
    color: var(--red);
}

.signal-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.signal-stat-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.signal-stat-return.positive {
    color: var(--accent);
}

.signal-stat-return.negative {
    color: var(--red);
}

.signal-stat-count {
    font-size: 10px;
    opacity: 0.7;
}

.signal-empty-state {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
}

.signal-empty-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.signal-empty-state p {
    font-size: 13px;
    line-height: 1.5;
}

.signal-performance-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.signal-info {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.signal-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   Portfolio Coach / AI Insights Section
   ============================================ */

.insights-section {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05) 0%, transparent 50%);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.insights-section .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.insights-icon {
    font-size: 18px;
}

.insights-scan-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #00cc6a 100%);
    border: none;
    color: var(--on-accent);
    font-weight: 600;
}

.insights-scan-btn:hover {
    background: linear-gradient(135deg, #00ff99 0%, var(--accent) 100%);
    box-shadow: 0 0 15px var(--accent-glow);
}

.portfolio-insights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.insight-item:hover {
    background: var(--code-bg-hover);
    border-color: var(--accent);
    transform: translateX(2px);
}

.insight-item.unread {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    border-color: rgba(0, 255, 136, 0.3);
}

.insight-item.unread:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 0, 0, 0.35) 100%);
}

/* Insight type coloring */
.insight-item.position_down_big,
.insight-item.big_daily_drop,
.insight-item.stop_loss_approaching {
    border-left: 3px solid #ff4d4d;
}

.insight-item.position_up_big,
.insight-item.big_daily_gain,
.insight-item.target_approaching {
    border-left: 3px solid var(--accent);
}

.insight-item.earnings_approaching,
.insight-item.insider_selling {
    border-left: 3px solid #FFD700;
}

.insight-item.concentration_warning {
    border-left: 3px solid #ff8c00;
}

.insight-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.insight-content {
    flex: 1;
    min-width: 0;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.insight-ticker {
    font-weight: 700;
    color: var(--accent);
    font-size: 15px;
    letter-spacing: 0.5px;
}

.insight-type-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--glass-highlight);
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-type-badge.urgent {
    background: rgba(255, 77, 77, 0.2);
    color: #ff6b6b;
}

.insight-type-badge.opportunity {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent);
}

.insight-type-badge.warning {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
}

.insight-message {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.insight-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.insight-price-info {
    display: flex;
    gap: 8px;
}

.insight-price-info span {
    background: var(--glass-highlight);
    padding: 2px 6px;
    border-radius: 4px;
}

.insight-pnl {
    font-weight: 600;
}

.insight-pnl.positive {
    color: var(--accent);
}

.insight-pnl.negative {
    color: #ff4d4d;
}

.insight-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.insight-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.insight-dismiss:hover {
    background: rgba(255, 77, 77, 0.1);
    color: #ff6b6b;
}

.insight-unread-dot {
    position: absolute;
    top: 14px;
    left: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: insight-pulse 2s ease-in-out infinite;
}

@keyframes insight-pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 10px var(--accent); }
    50% { opacity: 0.7; transform: scale(0.85); box-shadow: 0 0 5px var(--accent); }
}

.insights-empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.insights-empty-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.6;
}

.insights-empty-state p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.insights-empty-state .empty-subtitle {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.7;
}

/* Morning Briefing Card */
.morning-briefing-card {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 100, 80, 0.1) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.morning-briefing-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.morning-briefing-header .briefing-icon {
    font-size: 24px;
}

.morning-briefing-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
}

.morning-briefing-content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* News Feed Section */
.news-section {
    border: 1px solid rgba(138, 180, 248, 0.15);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(138, 180, 248, 0.02) 100%);
}

.news-section:hover {
    border-color: rgba(138, 180, 248, 0.25);
}

.news-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.news-loading {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-news {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

/* News Item Card */
.news-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(138, 180, 248, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* News Content Area */
.news-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.news-headline {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-source {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* News Footer - Sentiment, Score, Time */
.news-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Sentiment Indicator */
.news-sentiment {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sentiment-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sentiment-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sentiment Colors */
.news-sentiment.very_bullish .sentiment-dot {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}
.news-sentiment.very_bullish .sentiment-label {
    color: var(--accent);
}

.news-sentiment.bullish .sentiment-dot {
    background: #66ffaa;
}
.news-sentiment.bullish .sentiment-label {
    color: #66ffaa;
}

.news-sentiment.neutral .sentiment-dot {
    background: var(--text-muted);
}
.news-sentiment.neutral .sentiment-label {
    color: var(--text-muted);
}

.news-sentiment.bearish .sentiment-dot {
    background: #ffaa66;
}
.news-sentiment.bearish .sentiment-label {
    color: #ffaa66;
}

.news-sentiment.very_bearish .sentiment-dot {
    background: var(--error);
    box-shadow: 0 0 6px var(--error);
}
.news-sentiment.very_bearish .sentiment-label {
    color: var(--error);
}

/* Score Bar Container */
.news-score-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 120px;
}

.news-score-bar {
    flex: 1;
    height: 4px;
    background: var(--glass-highlight);
    border-radius: 2px;
    overflow: hidden;
}

.news-score-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.news-score-fill.bullish {
    background: linear-gradient(90deg, #66ffaa, var(--accent));
}

.news-score-fill.bearish {
    background: linear-gradient(90deg, #ffaa66, var(--error));
}

.news-score-fill.neutral {
    background: var(--text-muted);
}

.news-score-num {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: right;
}

/* Time */
.news-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}

/* Legacy sentiment badge (keeping for compatibility) */
.sentiment-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sentiment-badge.very_bullish {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent);
}

.sentiment-badge.bullish {
    background: rgba(0, 255, 136, 0.12);
    color: #66ffaa;
}

.sentiment-badge.neutral {
    background: var(--glass-highlight);
    color: var(--text-muted);
}

.sentiment-badge.bearish {
    background: rgba(255, 165, 0, 0.15);
    color: #ffaa66;
}

.sentiment-badge.very_bearish {
    background: rgba(255, 77, 77, 0.2);
    color: var(--error);
}

.news-empty {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Trending Stocks Section */
.trending-section {
    border: 1px solid rgba(255, 107, 53, 0.15);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 107, 53, 0.02) 100%);
}

.trending-section:hover {
    border-color: rgba(255, 107, 53, 0.25);
}

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

.trending-loading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-trending {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.trending-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.trending-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 28px;
}

.trending-rank.top-3 {
    color: var(--accent);
}

.trending-info {
    flex: 1;
    min-width: 0;
}

.trending-ticker {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.trending-name {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trending-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.trending-mentions {
    font-size: 13px;
    color: var(--text-secondary);
}

.trending-change {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
}

.trending-change.hot {
    background: rgba(255, 77, 77, 0.2);
    color: #ff6666;
}

.trending-change.up {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.trending-change.down {
    background: rgba(255, 165, 0, 0.15);
    color: #ffaa66;
}

.trending-change.cold {
    background: rgba(100, 100, 255, 0.15);
    color: #8888ff;
}

.trending-change.flat,
.trending-change.new {
    background: var(--glass-highlight);
    color: var(--text-muted);
}

.trending-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Congress Trading Section */
.congress-section {
    border: 1px solid rgba(77, 166, 255, 0.15);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(77, 166, 255, 0.02) 100%);
}

.congress-section:hover {
    border-color: rgba(77, 166, 255, 0.25);
}

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

.congress-loading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-congress {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

/* Congress Trading - Expandable Cards */
.congress-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.congress-item.expandable:hover {
    border-color: var(--accent);
}

.congress-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.congress-ticker-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 70px;
}

.congress-ticker {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: 0.5px;
}

.congress-signal-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.congress-signal-badge.congress-buying {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.congress-signal-badge.congress-selling {
    background: rgba(255, 102, 102, 0.15);
    color: #ff6666;
}

.congress-signal-badge.congress-mixed {
    background: var(--glass-highlight);
    color: var(--text-muted);
}

.congress-details-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.congress-company {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.congress-summary {
    font-size: 12px;
    color: var(--text-muted);
}

.congress-expand-icon {
    font-size: 22px;
    color: var(--text-muted);
    transition: transform 0.2s;
    margin-left: auto;
}

.congress-item.expanded .congress-expand-icon {
    transform: rotate(180deg);
}

/* Expandable trade details */
.congress-trades-details {
    display: none;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 16px 16px;
}

.congress-item.expanded .congress-trades-details {
    display: block;
}

.congress-trade {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.congress-trade:last-of-type {
    border-bottom: none;
}

.congress-trade-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.congress-trade-politician {
    display: flex;
    align-items: center;
    gap: 8px;
}

.party-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted);
}

.party-dot.party-r {
    background: #e53935;
}

.party-dot.party-d {
    background: #1e88e5;
}

.congress-trade-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.congress-trade-meta {
    font-size: 11px;
    color: var(--text-muted);
    padding-left: 18px;
}

.congress-trade-right {
    flex-shrink: 0;
    margin-left: 12px;
}

.congress-trade-tx {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.congress-trade-tx.tx-buy {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.congress-trade-tx.tx-sell {
    background: rgba(255, 102, 102, 0.15);
    color: #ff6666;
}

.congress-trade-tx.tx-exchange {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.congress-trade-tx.tx-neutral {
    background: var(--glass-highlight);
    color: var(--text-muted);
}

.congress-view-stock {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.2s;
}

.congress-view-stock:hover {
    background: rgba(0, 255, 136, 0.2);
}

.congress-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.congress-unavailable {
    text-align: center;
    padding: 28px 16px;
    background: rgba(77, 166, 255, 0.03);
    border-radius: var(--radius-sm);
}

.congress-unavailable-msg {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.congress-unavailable-help {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 14px;
}

.congress-alt-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.congress-alt-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: rgba(77, 166, 255, 0.08);
    border: 1px solid rgba(77, 166, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--blue);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.congress-alt-link:hover {
    background: var(--blue);
    color: var(--on-accent);
    border-color: var(--blue);
    transform: translateY(-1px);
}

/* Fear & Greed Index Gauge */
.fear-greed-section {
    border: 1px solid rgba(255, 193, 7, 0.15);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 193, 7, 0.02) 100%);
}

.fear-greed-section:hover {
    border-color: rgba(255, 193, 7, 0.25);
}

.fear-greed-gauge {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gauge-container {
    width: 100%;
}

.gauge-scale {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 10px;
    color: var(--text-muted);
}

.gauge-label {
    flex: 1;
    text-align: center;
}

.gauge-label.extreme-fear { color: #ff4444; }
.gauge-label.fear { color: #ff8844; }
.gauge-label.neutral { color: #ffcc44; }
.gauge-label.greed { color: #88cc44; }
.gauge-label.extreme-greed { color: #44cc44; }

.gauge-bar {
    position: relative;
    height: 12px;
    background: linear-gradient(to right,
        #ff4444 0%,
        #ff8844 25%,
        #ffcc44 50%,
        #88cc44 75%,
        #44cc44 100%
    );
    border-radius: 6px;
    overflow: visible;
}

.gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: transparent;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.gauge-pointer {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.5s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gauge-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gauge-score .score-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.gauge-score .score-label {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Fear & Greed color states */
.fear-greed-gauge.extreme-fear .score-value,
.fear-greed-gauge.extreme-fear .score-label {
    color: #ff4444;
}

.fear-greed-gauge.fear .score-value,
.fear-greed-gauge.fear .score-label {
    color: #ff8844;
}

.fear-greed-gauge.neutral .score-value,
.fear-greed-gauge.neutral .score-label {
    color: #ffcc44;
}

.fear-greed-gauge.greed .score-value,
.fear-greed-gauge.greed .score-label {
    color: #88cc44;
}

.fear-greed-gauge.extreme-greed .score-value,
.fear-greed-gauge.extreme-greed .score-label {
    color: #44cc44;
}

.gauge-interpretation {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

/* Indices Grid */
.indices-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.index-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.index-card.loading {
    opacity: 0.5;
}

.index-name {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.index-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.index-change {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

.index-change.up {
    color: var(--success);
}

.index-change.down {
    color: var(--error);
}

/* Movers List */
.movers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.mover-item:hover {
    background: var(--bg-card-hover);
}

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

.mover-symbol {
    font-weight: 600;
    color: var(--text-primary);
}

.mover-name {
    font-size: 12px;
    color: var(--text-muted);
}

.mover-price {
    text-align: right;
}

.mover-price-value {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.mover-change {
    font-size: 14px;
    font-weight: 500;
}

.mover-change.up {
    color: var(--success);
}

.mover-change.down {
    color: var(--error);
}

.mover-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* Sectors Grid */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sector-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.sector-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.sector-change {
    font-weight: 600;
    font-size: 14px;
}

.sector-change.up {
    color: var(--success);
}

.sector-change.down {
    color: var(--error);
}

.sector-placeholder {
    grid-column: 1 / -1;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* ============================================
   Earnings Calendar Page
   ============================================ */

.earnings-calendar {
    padding: 20px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
    max-width: 800px;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
    overflow-y: auto;
}

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

.earnings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.earnings-item:hover {
    background: var(--bg-card-hover);
}

.earnings-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.earnings-symbol {
    font-weight: 600;
    color: var(--text-primary);
}

.earnings-name {
    font-size: 12px;
    color: var(--text-muted);
}

.earnings-date {
    text-align: right;
}

.earnings-date-value {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.earnings-time {
    font-size: 12px;
    color: var(--text-muted);
}

.earnings-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
}

/* ============================================
   Stock Detail Modal
   ============================================ */

.stock-detail-modal {
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
}

.stock-detail-content {
    padding: 20px;
}

/* Stock header with logo */
.stock-header-detail {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.stock-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--bg-card);
    object-fit: contain;
}

.stock-header-info {
    flex: 1;
}

.stock-company-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stock-symbol-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
}

.stock-price-large {
    text-align: center;
    margin-bottom: 20px;
}

/* Stock Chart Container */
.stock-chart-container {
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--code-bg);
}

.chart-timeframe-tabs {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--code-bg-hover);
    border-bottom: 1px solid var(--border-color);
}

.chart-tab {
    flex: 1;
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab:hover {
    background: var(--glass-highlight);
    color: var(--text-primary);
}

.chart-tab.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.tradingview-widget {
    height: 280px;
    width: 100%;
}

.tradingview-widget-container__widget {
    height: 100%;
    width: 100%;
}

.stock-price-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.stock-price-change {
    font-size: 18px;
    font-weight: 500;
    margin-top: 4px;
}

.stock-price-change.up {
    color: var(--success);
}

.stock-price-change.down {
    color: var(--error);
}

.stock-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.stock-news {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.stock-news h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* News styles moved to main news section above */

/* SEC Filings Section */
.sec-filings-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 20px;
}

.sec-filings-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sec-filings-loading,
.sec-filings-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 0;
}

.sec-filings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sec-filing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s ease;
}

.sec-filing-item:hover {
    background: var(--glass-highlight);
}

.filing-type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 42px;
    text-align: center;
}

.filing-type-badge.annual {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.filing-type-badge.quarterly {
    background: rgba(0, 168, 255, 0.15);
    color: #00a8ff;
}

.filing-type-badge.event {
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
}

.filing-info {
    flex: 1;
}

.filing-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.filing-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.filing-link-icon {
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.sec-filing-item:hover .filing-link-icon {
    opacity: 1;
}

/* Paper Trading Section */
.paper-trading-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 20px;
}

.paper-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.paper-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.paper-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
    text-transform: uppercase;
}

.paper-trade-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

#paper-shares {
    width: 100px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.paper-price-display {
    color: var(--text-muted);
    font-size: 13px;
}

.paper-buttons {
    display: flex;
    gap: 8px;
}

.paper-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.paper-btn.buy {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.paper-btn.buy:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.25);
}

.paper-btn.sell {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
}

.paper-btn.sell:hover:not(:disabled) {
    background: rgba(255, 68, 68, 0.25);
}

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

.paper-result {
    margin-top: 8px;
    font-size: 13px;
}

.paper-success {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.paper-success.buy {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent);
}

.paper-success.sell {
    background: rgba(255, 170, 0, 0.1);
    color: #ffaa00;
}

.paper-error {
    padding: 8px 12px;
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border-radius: var(--radius-sm);
}

.paper-pending {
    color: var(--text-muted);
}

/* Paper Portfolio Section (Market page) */
.paper-portfolio-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.paper-portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.paper-portfolio-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.paper-reset-btn {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(255, 68, 68, 0.1);
    color: #ff6666;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.paper-account-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.paper-stat {
    text-align: center;
}

.paper-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.paper-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.paper-stat-value.profit {
    color: var(--accent);
}

.paper-stat-value.loss {
    color: #ff4444;
}

.paper-positions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.paper-position-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.paper-position-item:hover {
    background: var(--glass-highlight);
}

.paper-position-ticker {
    font-weight: 600;
    color: var(--accent);
}

.paper-position-shares {
    font-size: 12px;
    color: var(--text-muted);
}

.paper-position-value {
    font-size: 13px;
    color: var(--text-primary);
    text-align: right;
}

.paper-position-pnl {
    font-size: 12px;
    text-align: right;
}

.paper-position-pnl.profit {
    color: var(--accent);
}

.paper-position-pnl.loss {
    color: #ff4444;
}

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

@media (max-width: 600px) {
    .paper-account-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .paper-position-item {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .paper-position-shares {
        text-align: right;
    }

    .paper-position-value {
        text-align: left;
    }
}

/* AI Trade Ideas Section */
.trade-ideas-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.trade-ideas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.trade-ideas-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.generate-ideas-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(138, 43, 226, 0.15);
    color: #a855f7;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.generate-ideas-btn:hover:not(:disabled) {
    background: rgba(138, 43, 226, 0.25);
}

.generate-ideas-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.generate-ideas-btn svg.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.trade-ideas-content {
    margin-top: 12px;
}

.ideas-loading {
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

.ideas-empty,
.ideas-error {
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px;
    text-align: center;
    background: var(--code-bg);
    border-radius: var(--radius-sm);
}

.ideas-error {
    color: #ff6666;
    background: rgba(255, 68, 68, 0.1);
}

.ideas-header-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.ideas-list {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.ideas-list p {
    margin-bottom: 12px;
}

.ideas-list strong {
    color: var(--text-secondary);
}

.ideas-list li {
    margin-left: 16px;
    margin-bottom: 4px;
}

.idea-ticker {
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}

.idea-ticker:hover {
    text-decoration: underline;
}

.idea-price {
    font-weight: 600;
    color: #00a8ff;
}

/* Price Alerts Section */
.stock-alert-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--code-bg);
    border-radius: var(--radius-sm);
}

.alert-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.alert-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.alert-inputs {
    display: flex;
    gap: 8px;
}

.alert-select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.alert-price-input {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    flex: 1;
}

.alert-currency {
    color: var(--text-muted);
    font-size: 14px;
}

.alert-price-input input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 4px;
    width: 100%;
    outline: none;
}

.alert-price-input input::placeholder {
    color: var(--text-muted);
}

.alert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.alert-btn:hover {
    background: var(--primary-dark);
}

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

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

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.alert-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-condition {
    font-weight: 600;
    font-size: 16px;
}

.alert-condition.above {
    color: var(--success);
}

.alert-condition.below {
    color: var(--error);
}

.alert-target {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.alert-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.alert-delete-btn:hover {
    color: var(--error);
    background: rgba(255, 59, 48, 0.1);
}

.no-alerts {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

/* Alert Notification Toast */
.alert-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.alert-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Mobile-First Responsive Design
   ============================================ */

/* Tablet and below */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        height: 56px;
    }

    .logo {
        font-size: 18px;
        letter-spacing: 1.5px;
    }

    .chat-container {
        padding: 16px;
    }

    .message {
        max-width: 90%;
        padding: 12px 16px;
    }

    .welcome-card {
        padding: 24px 20px;
    }

    .welcome-greeting h2 {
        font-size: 20px;
    }

    .welcome-greeting p {
        font-size: 14px;
    }

    .quick-actions {
        gap: 8px;
        margin: 20px 0;
    }

    .quick-action-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* Voice conversation pill - mobile optimized */
    .voice-conversation {
        bottom: calc(70px + env(safe-area-inset-bottom));
        width: calc(100% - 32px);
        max-width: 280px;
    }

    .voice-pill {
        padding: 6px 12px 6px 6px;
        gap: 10px;
    }

    .voice-orb {
        width: 40px;
        height: 40px;
    }

    .voice-orb-inner {
        width: 24px;
        height: 24px;
    }

    .voice-pill-status {
        font-size: 13px;
    }

    .voice-pill-transcript {
        font-size: 11px;
        max-width: 140px;
    }

    /* Input area mobile */
    .input-area {
        padding: 12px 16px;
        padding-bottom: calc(65px + env(safe-area-inset-bottom));
    }

    .input-container {
        margin-bottom: 10px;
    }

    .message-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .send-btn {
        padding: 0 16px;
    }

    .voice-buttons {
        gap: 8px;
    }

    .voice-btn {
        padding: 12px 16px;
        font-size: 13px;
        gap: 8px;
    }

    /* On mobile: hide full labels, show short labels */
    .voice-btn .btn-label-full {
        display: none;
    }

    .voice-btn .btn-label-short {
        display: inline;
        font-size: 12px;
    }

    .voice-btn svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    /* Bottom nav mobile */
    .bottom-nav {
        padding: 6px 0;
    }

    .nav-btn {
        padding: 6px 12px;
    }

    .nav-btn span {
        font-size: 10px;
    }

    /* Settings modal mobile */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        padding: 20px;
    }

    .settings-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Market page mobile */
    .market-overview,
    .earnings-calendar {
        padding: 16px;
    }

    .section-title {
        font-size: 16px;
    }

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

    .index-card {
        padding: 14px;
    }

    .mover-item,
    .earnings-item {
        padding: 12px 14px;
    }

    .sectors-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stock-stats {
        grid-template-columns: 1fr;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .logo {
        font-size: 16px;
    }

    .welcome-greeting h2 {
        font-size: 18px;
    }

    .quick-action-btn {
        padding: 10px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .quick-action-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Voice pill - small screens */
    .voice-pill {
        min-width: 180px;
        max-width: 260px;
    }

    .voice-orb {
        width: 36px;
        height: 36px;
    }

    .voice-orb-inner {
        width: 22px;
        height: 22px;
    }

    .voice-pill-status {
        font-size: 12px;
    }

    .voice-pill-transcript {
        font-size: 10px;
        max-width: 120px;
    }

    .voice-pill-close svg {
        width: 16px;
        height: 16px;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .voice-conversation {
        bottom: calc(60px + env(safe-area-inset-bottom));
    }

    .voice-pill {
        padding: 4px 10px 4px 4px;
    }

    .voice-orb {
        width: 36px;
        height: 36px;
    }

    .voice-orb-inner {
        width: 22px;
        height: 22px;
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .icon-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .voice-btn {
        min-height: 48px;
    }

    .nav-btn {
        min-width: 60px;
        min-height: 44px;
    }

    .voice-pill-mute {
        min-width: 40px;
        min-height: 40px;
    }

    .voice-pill-close {
        min-width: 36px;
        min-height: 36px;
    }

    .ticker-item {
        padding: 4px 0;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(0px, env(safe-area-inset-top));
    }

    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Prevent text selection on interactive elements */
.voice-btn,
.nav-btn,
.quick-action-btn,
.end-conversation-btn,
.mute-btn {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling on mobile */
.chat-container,
.market-overview,
.earnings-calendar,
.modal-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* ============================================
   PROFESSIONAL TRADING FEATURES
   ============================================ */

/* Trading Warning Banner */
.trading-warning-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.15), rgba(255, 100, 0, 0.1));
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 170, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 170, 0, 0.5); }
}

.trading-warning-banner .warning-icon {
    font-size: 24px;
}

.trading-warning-banner .warning-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trading-warning-banner .warning-title {
    font-weight: 600;
    color: var(--warning);
    font-size: 14px;
}

.trading-warning-banner .warning-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Economic Calendar */
.calendar-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--text-muted);
}

.calendar-event.impact-extreme {
    border-left-color: #ff4d4d;
    background: rgba(255, 77, 77, 0.05);
}

.calendar-event.impact-high {
    border-left-color: var(--warning);
    background: rgba(255, 170, 0, 0.05);
}

.calendar-event.impact-medium {
    border-left-color: #4da6ff;
}

.calendar-event .event-date {
    min-width: 65px;
    text-align: center;
}

.calendar-event .event-date .date-day {
    font-size: 12px;
    color: var(--text-secondary);
}

.calendar-event .event-date .date-time {
    font-size: 11px;
    color: var(--text-muted);
}

.calendar-event .event-info {
    flex: 1;
}

.calendar-event .event-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.calendar-event .event-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.calendar-event .event-impact {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.calendar-event .event-impact.extreme {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

.calendar-event .event-impact.high {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
}

.calendar-event .event-impact.medium {
    background: rgba(77, 166, 255, 0.2);
    color: #4da6ff;
}

.calendar-event .event-impact.low {
    background: var(--glass-highlight);
    color: var(--text-secondary);
}

.calendar-event .event-move {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.calendar-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

/* Upcoming Earnings (Watchlist & Portfolio) */
.earnings-watchlist-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.earnings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.earnings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border-left: 3px solid var(--accent);
}

.earnings-item:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}

.earnings-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.earnings-ticker {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.earnings-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.earnings-badge.portfolio {
    background: rgba(100, 130, 255, 0.15);
    color: #6482ff;
}

.earnings-badge.watchlist {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent);
}

.earnings-date-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.earnings-days {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.earnings-days.imminent {
    color: #ff4d4d;
    animation: pulse-warning 1.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.earnings-date-detail {
    font-size: 11px;
    color: var(--text-muted);
}

.earnings-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.earnings-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.earnings-empty-state p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.earnings-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

/* Portfolio P&L Styles */
.portfolio-pnl-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.pnl-stat {
    text-align: center;
}

.pnl-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pnl-stat .stat-value {
    font-size: 18px;
    font-weight: 600;
}

.pnl-stat .stat-value.positive {
    color: var(--success);
}

.pnl-stat .stat-value.negative {
    color: var(--error);
}

.position-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.position-row .position-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.position-row .position-ticker {
    font-weight: 600;
    color: var(--text-primary);
}

.position-row .position-shares {
    font-size: 12px;
    color: var(--text-secondary);
}

.position-row .position-pnl {
    text-align: right;
}

.position-row .pnl-amount {
    font-weight: 600;
    font-size: 15px;
}

.position-row .pnl-pct {
    font-size: 12px;
}

/* Trade Plan Modal Styles */
.trade-plan-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.trade-plan-card h4 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 14px;
}

.trade-plan-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.trade-plan-row:last-child {
    border-bottom: none;
}

.trade-plan-row .label {
    color: var(--text-secondary);
    font-size: 13px;
}

.trade-plan-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

.trade-plan-row .value.buy {
    color: var(--success);
}

.trade-plan-row .value.sell {
    color: var(--error);
}

.trade-rules {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.trade-rules li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding-left: 8px;
}

/* IV Rank Badge */
.iv-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.iv-rank-badge.high {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

.iv-rank-badge.elevated {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
}

.iv-rank-badge.normal {
    background: var(--glass-highlight);
    color: var(--text-secondary);
}

.iv-rank-badge.low {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

/* Hedge Fund Badge */
.hedge-fund-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(147, 112, 219, 0.2);
    color: #9370db;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.smart-money-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(147, 112, 219, 0.1);
    border: 1px solid rgba(147, 112, 219, 0.3);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.smart-money-indicator .indicator-icon {
    font-size: 16px;
}

.smart-money-indicator .indicator-text {
    font-size: 12px;
    color: #9370db;
}

/* ============================================
   Stockman Score Section (Stock Detail Modal)
   ============================================ */

.stockman-score-section {
    margin: 16px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.stockman-score-loading,
.stockman-score-error {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

.stockman-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.score-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.score-icon {
    font-size: 18px;
}

.score-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--on-accent);
    text-transform: uppercase;
}

.stockman-score-main {
    display: flex;
    gap: 16px;
    align-items: center;
}

.score-circle {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border: 4px solid var(--accent);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.score-max {
    font-size: 11px;
    color: var(--text-secondary);
}

.score-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-breakdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breakdown-label {
    width: 70px;
    font-size: 11px;
    color: var(--text-secondary);
}

.breakdown-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.breakdown-value {
    width: 24px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
}

.stockman-signals,
.stockman-risks {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.signals-label,
.risks-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.signal-item {
    font-size: 12px;
    color: var(--accent);
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.signal-item::before {
    content: '✓';
    flex-shrink: 0;
}

.risk-item {
    font-size: 12px;
    color: #ff6666;
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.risk-item::before {
    content: '⚠';
    flex-shrink: 0;
}

/* ============================================
   Pro Insights Section (Stock Detail Modal)
   ============================================ */

.pro-insights-section {
    margin: 16px 0;
}

.pro-insights-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pro-insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.pro-insight-card .insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.pro-insight-card .insight-icon {
    font-size: 18px;
}

.pro-insight-card .insight-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.pro-insight-card .insight-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: auto;
}

/* IV Rank Display */
.iv-rank-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 10px;
}

.iv-rank-display .iv-rank-value {
    font-size: 32px;
    font-weight: 700;
}

.iv-rank-display .iv-rank-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.iv-rank-display.iv-high .iv-rank-value {
    color: #ff4d4d;
}

.iv-rank-display.iv-normal .iv-rank-value {
    color: var(--warning);
}

.iv-rank-display.iv-low .iv-rank-value {
    color: var(--success);
}

.iv-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.iv-details .iv-stat {
    font-size: 12px;
    color: var(--text-secondary);
}

.iv-details .iv-recommendation {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Trade Plan Grid */
.trade-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.trade-plan-grid .plan-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trade-plan-grid .plan-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-plan-grid .plan-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.trade-plan-grid .plan-value.up {
    color: var(--success);
}

.trade-plan-grid .plan-value.down {
    color: var(--error);
}

/* Risk/Reward Display */
.risk-reward {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.risk-reward .rr-label {
    color: var(--text-secondary);
}

.risk-reward .rr-value {
    font-weight: 600;
}

.risk-reward .rr-value.good {
    color: var(--success);
}

.risk-reward .rr-value.warning {
    color: var(--warning);
}

.risk-reward .rr-details {
    color: var(--text-secondary);
    font-size: 12px;
}

.pro-loading {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ============================================
   Economic Calendar Styles (Additional)
   ============================================ */

.calendar-date-group {
    margin-bottom: 16px;
}

.calendar-date-group.today .calendar-date-header {
    color: var(--accent);
}

.calendar-date-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.calendar-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid transparent;
}

.calendar-event.impact-extreme {
    border-left-color: #ff4d4d;
}

.calendar-event.impact-high {
    border-left-color: #ffaa00;
}

.calendar-event.impact-medium {
    border-left-color: #ffdd00;
}

.calendar-event.impact-low {
    border-left-color: var(--success);
}

.calendar-event .event-time {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 60px;
}

.calendar-event .event-details {
    flex: 1;
}

.calendar-event .event-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.calendar-event .event-description {
    font-size: 12px;
    color: var(--text-secondary);
}

.calendar-event .event-impact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.calendar-event .impact-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.calendar-event .impact-badge.impact-extreme {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

.calendar-event .impact-badge.impact-high {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
}

.calendar-event .impact-badge.impact-medium {
    background: rgba(255, 221, 0, 0.2);
    color: #ffdd00;
}

.calendar-event .impact-badge.impact-low {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.calendar-event .typical-move {
    font-size: 10px;
    color: var(--text-secondary);
}

.calendar-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

.calendar-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Mobile adjustments for pro insights */
@media (max-width: 480px) {
    .trade-plan-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .risk-reward {
        flex-direction: column;
        align-items: flex-start;
    }

    .iv-rank-display .iv-rank-value {
        font-size: 28px;
    }

    .calendar-event {
        flex-direction: column;
        gap: 8px;
    }

    .calendar-event .event-impact {
        flex-direction: row;
        align-items: center;
    }
}

/* ============================================
   AUTH & USER MENU
   ============================================ */

/* Auth Button in Header */
.auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn:hover {
    background: var(--accent-dim);
}

.auth-btn svg {
    flex-shrink: 0;
}

/* Streak Display (in header) */
.streak-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 20px;
    margin-right: 12px;
    font-weight: 600;
    color: #FFA500;
    transition: all 0.3s ease;
}

.streak-display.hidden {
    display: none;
}

.streak-display.streak-active {
    animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 10px rgba(255, 165, 0, 0.3); }
}

.streak-fire {
    font-size: 16px;
    animation: flameWiggle 0.5s ease-in-out infinite alternate;
}

@keyframes flameWiggle {
    0% { transform: rotate(-3deg); }
    100% { transform: rotate(3deg); }
}

.streak-count {
    font-size: 14px;
    font-weight: 700;
    color: #FFA500;
}

/* Streak Milestone Modal */
.streak-milestone-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.streak-milestone-modal.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.streak-milestone-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #FFD700;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.3);
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.streak-milestone-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.streak-milestone-title {
    font-size: 24px;
    color: #FFD700;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.streak-milestone-badge {
    font-size: 28px;
    color: #fff;
    margin: 0 0 12px 0;
    font-weight: 800;
}

.streak-milestone-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.streak-milestone-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border: none;
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.streak-milestone-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Portfolio Performance Section */
.portfolio-performance-section {
    display: none; /* Hidden until user has holdings */
}

.pnl-summary-card {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 255, 136, 0.02) 100%);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pnl-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pnl-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.pnl-change {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.pnl-change.positive .pnl-change-value,
.pnl-change.positive .pnl-change-pct {
    color: var(--accent);
}

.pnl-change.negative .pnl-change-value,
.pnl-change.negative .pnl-change-pct {
    color: #FF6B6B;
}

.pnl-change-value {
    font-size: 18px;
    font-weight: 600;
}

.pnl-change-pct {
    font-size: 14px;
    font-weight: 500;
}

.pnl-change-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Chart Period Tabs */
.chart-period-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--surface);
    padding: 4px;
    border-radius: 12px;
    width: fit-content;
}

.period-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-tab:hover {
    color: var(--text-primary);
    background: var(--glass-highlight);
}

.period-tab.active {
    background: var(--accent);
    color: var(--on-accent);
}

/* Portfolio Chart Container */
.portfolio-chart-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    height: 250px;
    margin-bottom: 24px;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Holdings Section */
.holdings-section {
    margin-top: 24px;
}

.holdings-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.holdings-chart-container {
    height: 200px;
    margin-bottom: 16px;
}

/* Holdings List */
.holding-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.holding-item:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

.holding-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.holding-ticker {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.holding-shares {
    font-size: 12px;
    color: var(--text-secondary);
}

.holding-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.holding-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.holding-pnl {
    font-size: 12px;
    font-weight: 500;
}

.holding-pnl.positive {
    color: var(--accent);
}

.holding-pnl.negative {
    color: #FF6B6B;
}

/* User Menu (when logged in) */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu.hidden {
    display: none;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px 6px 6px;
    border-radius: 24px;
    transition: all 0.2s ease;
}

.user-menu-trigger:hover {
    background: var(--glass-highlight);
}

.user-menu-trigger:hover .user-avatar-btn {
    border-color: var(--accent);
}

.user-menu-trigger:hover .dropdown-chevron {
    color: var(--accent);
}

.dropdown-chevron {
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.user-menu-trigger[aria-expanded="true"] .dropdown-chevron {
    transform: rotate(180deg);
}

.user-avatar-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    padding: 0;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: var(--bg-card);
    /* Hide alt text and broken image icon */
    color: transparent;
    font-size: 0;
}

/* Hide broken image icon in various browsers */
.user-avatar::before {
    content: '';
    display: block;
}

.user-avatar[src=""],
.user-avatar:not([src]) {
    display: none;
}

.user-avatar.hidden {
    display: none;
}

.user-initials {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
}

.user-avatar:not(.hidden) + .user-initials {
    display: none;
}

/* Alert Badge on Avatar */
.alert-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    box-sizing: border-box;
}

.alert-badge.hidden {
    display: none;
}

.alert-badge.pulse {
    animation: badge-pulse 0.6s ease-out;
}

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

.user-name-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.hidden {
    display: none;
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.dropdown-header span {
    display: block;
}

.dropdown-header span:first-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.dropdown-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.user-dropdown button:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.user-dropdown button svg {
    opacity: 0.7;
}

.user-dropdown button:hover svg {
    opacity: 1;
}

.user-dropdown .sign-out-btn {
    color: var(--error);
}

.user-dropdown .sign-out-btn:hover {
    background: rgba(255, 77, 77, 0.1);
}

/* ============================================
   AUTH MODAL
   ============================================ */

.auth-modal-content {
    max-width: 400px;
}

.auth-content {
    text-align: center;
}

.auth-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Google Button */
.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: #fff;
    border: none;
    border-radius: var(--radius);
    color: #333;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-google-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Magic Link Form */
.auth-input-group {
    text-align: left;
    margin-bottom: 16px;
}

.auth-input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.auth-input-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.auth-input-group input::placeholder {
    color: var(--text-muted);
}

.auth-forgot-link {
    text-align: right;
    margin-top: -4px;
    margin-bottom: 12px;
}
.auth-forgot-link button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}
.auth-forgot-link button:hover {
    opacity: 1;
    text-decoration: underline;
}

.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: var(--on-accent);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-submit-btn:hover {
    box-shadow: var(--glow);
}

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

.auth-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Success State */
.auth-success {
    padding: 24px 0;
}

.auth-success.hidden {
    display: none;
}

.auth-success svg {
    color: var(--accent);
    margin-bottom: 16px;
}

.auth-success h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.auth-success p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.auth-error.hidden {
    display: none;
}

.auth-toggle {
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-toggle-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 0;
    margin-left: 4px;
}

.auth-toggle-btn:hover {
    text-decoration: underline;
}

/* Auth Required State - Blocks app until login */
body.auth-required main,
body.auth-required .bottom-nav,
body.auth-required .input-container,
body.auth-required .stock-ticker {
    pointer-events: none;
    opacity: 0.3;
    filter: blur(2px);
}

body.auth-required header {
    pointer-events: none;
}

body.auth-required #auth-modal {
    pointer-events: auto;
}

/* ============================================
   NOTIFICATION PREFERENCES
   ============================================ */

.notifications-prefs {
    max-height: 60vh;
    overflow-y: auto;
}

.pref-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.pref-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

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

.pref-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.pref-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-enabled {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.status-disabled {
    background: var(--glass-highlight);
    color: var(--text-muted);
}

.auth-required-badge {
    background: rgba(255, 170, 0, 0.15);
    color: var(--warning);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}

/* Toggle Switches */
.pref-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.pref-toggle:last-of-type {
    border-bottom: none;
}

.pref-toggle input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pref-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pref-toggle input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.pref-toggle input[type="checkbox"]:checked::after {
    left: 22px;
    background: var(--on-accent);
}

.toggle-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.pref-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* Preference Options (sub-settings) */
.pref-options {
    padding: 12px 0 12px 56px;
    border-bottom: 1px solid var(--border);
}

.pref-options.hidden {
    display: none;
}

.pref-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pref-options label:last-child {
    margin-bottom: 0;
}

.pref-input-small {
    width: 70px;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    text-align: center;
}

.pref-input-small:focus {
    border-color: var(--accent);
    outline: none;
}

.price-range-inputs,
.time-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Save Button */
.save-prefs-btn {
    width: 100%;
    margin-top: 8px;
}

/* Push Status Section */
.push-status-section {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05), transparent);
}

.push-status-section .add-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 10000;
    animation: toastSlideUp 0.3s ease;
}

.toast-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-info button {
    background: var(--accent);
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.toast-success {
    background: rgba(0, 255, 136, 0.9);
    color: var(--on-accent);
}

.toast-error {
    background: rgba(255, 77, 77, 0.9);
    color: #fff;
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile Auth Adjustments */
@media (max-width: 480px) {
    .auth-btn span {
        display: none;
    }

    .auth-btn {
        padding: 8px 12px;
    }

    .user-menu-btn span {
        display: none;
    }

    .settings-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        margin-bottom: 20px;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 12px;
    }

    .pref-options {
        padding-left: 0;
    }

    .pref-options label {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ============================================
   MEMORY UI STYLES
   ============================================ */

.memory-section {
    padding: 16px;
}

.memory-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.memory-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text);
}

.memory-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.memory-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.memory-loading,
.memory-error {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.memory-error button {
    margin-top: 12px;
}

.memory-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.memory-empty svg {
    opacity: 0.4;
    margin-bottom: 16px;
}

.memory-empty h4 {
    margin: 0 0 8px 0;
    color: var(--text);
}

.memory-empty p {
    margin: 0;
    font-size: 13px;
}

.memory-category {
    margin-bottom: 16px;
}

.memory-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
    margin-bottom: 8px;
}

.memory-category-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.memory-category-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--glass-highlight);
    padding: 2px 6px;
    border-radius: 10px;
}

.memory-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.memory-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.memory-item:hover {
    background: var(--glass-highlight);
    border-color: var(--border-light);
}

.memory-content {
    flex: 1;
    min-width: 0;
}

.memory-text {
    display: block;
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.memory-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.memory-source {
    font-size: 12px;
    cursor: help;
}

.memory-confidence {
    width: 40px;
    height: 4px;
    background: var(--glass-highlight);
    border-radius: 2px;
    overflow: hidden;
}

.confidence-bar {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.memory-date {
    font-size: 11px;
    color: var(--text-muted);
}

.memory-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.memory-edit-btn,
.memory-delete-btn,
.memory-save-btn,
.memory-cancel-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-highlight);
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Hide edit/delete buttons until hovering over the memory item (desktop only) */
@media (hover: hover) {
    .memory-item .memory-edit-btn,
    .memory-item .memory-delete-btn {
        opacity: 0;
        pointer-events: none;
    }

    .memory-item:hover .memory-edit-btn,
    .memory-item:hover .memory-delete-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

.memory-edit-btn:hover,
.memory-save-btn:hover {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.memory-delete-btn:hover,
.memory-cancel-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #E74C3C;
}

.memory-save-btn {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent);
}

.memory-cancel-btn {
    background: var(--glass-highlight);
}

.memory-edit-input {
    flex: 1;
    background: var(--code-bg);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text);
    outline: none;
}

.memory-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.memory-info {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.memory-info p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text);
}

.memory-info ul {
    margin: 0;
    padding-left: 20px;
}

.memory-info li {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.5;
}

/* Memory tab scrolling on mobile */
@media (max-width: 480px) {
    .memory-list {
        max-height: 300px;
    }

    .memory-item {
        flex-direction: column;
        gap: 8px;
    }

    .memory-actions {
        align-self: flex-end;
        gap: 12px; /* More space between buttons on mobile */
    }

    /* Larger touch targets on mobile - Apple recommends 44px minimum */
    .memory-edit-btn,
    .memory-delete-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .memory-edit-btn svg,
    .memory-delete-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   ONBOARDING FLOW
   9-screen investor profile setup
   ============================================ */

.onboarding-modal-content {
    max-width: 520px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    animation: slideUp 0.3s ease-out;
}

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

.onboarding-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

/* Progress Bar */
.onboarding-progress {
    margin-bottom: 24px;
}

.progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #00cc6a);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Screens */
.onboarding-screen {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.onboarding-screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.onboarding-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

.onboarding-icon.success {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.onboarding-screen h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.onboarding-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.onboarding-privacy {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 16px;
}

/* Fields */
.onboarding-field {
    margin-bottom: 20px;
}

.onboarding-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.onboarding-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.onboarding-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.onboarding-input.small {
    width: auto;
    flex: 1;
}

.onboarding-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    min-height: 80px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.onboarding-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Option Buttons */
.onboarding-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.onboarding-options.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
}

.onboarding-options.multi-select {
    flex-direction: row;
    flex-wrap: wrap;
}

.option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--text-primary);
}

.option-btn:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.option-btn.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.option-btn.compact {
    flex-direction: row;
    justify-content: center;
    padding: 10px 16px;
    flex: 0 0 auto;
}

.option-btn.compact.multi {
    flex: 0 0 calc(50% - 4px);
}

.option-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

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

.option-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.option-btn.compact .option-desc {
    display: none;
}

/* Actions */
.onboarding-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.onboarding-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.onboarding-btn.primary {
    background: var(--accent);
    color: var(--on-accent);
}

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

.onboarding-btn.secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.onboarding-btn.secondary:hover {
    background: var(--bg-card-hover);
}

.onboarding-btn.small {
    flex: 0 0 auto;
    padding: 10px 16px;
    font-size: 14px;
}

.onboarding-btn.large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Quick Portfolio Input */
.quick-portfolio-input {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.quick-portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.quick-portfolio-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.quick-portfolio-item .ticker {
    font-weight: 600;
    color: var(--accent);
}

.quick-portfolio-item .shares {
    color: var(--text-secondary);
    font-size: 14px;
}

.quick-portfolio-item .remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}

.quick-portfolio-item .remove-btn:hover {
    color: var(--error);
}

/* Profile Summary Card */
.profile-summary-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.profile-summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.profile-summary-card .summary-row:last-child {
    border-bottom: none;
}

.profile-summary-card .summary-label {
    color: var(--text-muted);
    font-size: 13px;
}

.profile-summary-card .summary-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

/* Risk Badge */
.risk-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.risk-badge.conservative {
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.risk-badge.moderate {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.risk-badge.aggressive {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.risk-badge.very_aggressive {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* First Badge */
.first-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: var(--radius);
    margin-bottom: 24px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
}

.badge-icon {
    font-size: 24px;
}

.badge-text {
    font-weight: 600;
    color: #ffd700;
}

/* Celebration Confetti */
.onboarding-celebration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.celebration-confetti {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .onboarding-modal-content {
        padding: 16px;
        max-height: 95vh;
    }

    .onboarding-screen h2 {
        font-size: 20px;
    }

    .onboarding-options.horizontal {
        flex-direction: column;
    }

    .option-btn.compact {
        width: 100%;
        flex: 0 0 auto;
    }

    .option-btn.compact.multi {
        flex: 0 0 100%;
    }

    .quick-portfolio-input {
        flex-direction: column;
    }

    .quick-portfolio-input .onboarding-input.small {
        width: 100%;
    }

    .onboarding-actions {
        flex-direction: column-reverse;
    }

    .onboarding-btn {
        width: 100%;
    }
}

/* ============================================
   LIGHT MODE - Comprehensive Overrides
   Catches all remaining hardcoded dark-mode colors
   ============================================ */

[data-theme="light"] .header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Skeleton loading animations - light mode */
[data-theme="light"] .skeleton-line {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.06) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.06) 100%
    );
    background-size: 200px 100%;
}

[data-theme="light"] .skeleton-ticker-item {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.04) 0%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.04) 100%
    );
    background-size: 200px 100%;
}

[data-theme="light"] .index-card.loading .index-value,
[data-theme="light"] .index-card.loading .index-change {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.06) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.06) 100%
    );
    background-size: 200px 100%;
}

/* Voice overlay orb - lighter glow in light mode */
[data-theme="light"] .voice-orb-inner {
    background: radial-gradient(
        circle at 40% 40%,
        rgba(5, 150, 105, 0.9) 0%,
        rgba(5, 150, 105, 0.7) 30%,
        rgba(5, 150, 105, 0.5) 60%,
        rgba(5, 150, 105, 0.3) 100%);
    box-shadow:
        0 0 30px rgba(5, 150, 105, 0.5),
        0 0 60px rgba(5, 150, 105, 0.2),
        0 0 90px rgba(5, 150, 105, 0.1);
}

[data-theme="light"] .voice-orb.speaking .voice-orb-inner {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

/* Voice overlay background adjustments */
[data-theme="light"] .voice-overlay-backdrop {
    background: rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .voice-orb-background {
    background: rgba(0, 0, 0, 0.7);
}

/* Chart cards & market page */
[data-theme="light"] .insights-section {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05) 0%, transparent 50%);
    border-color: rgba(5, 150, 105, 0.2);
}

[data-theme="light"] .insight-item.unread {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(255, 255, 255, 0.5) 100%);
    border-color: rgba(5, 150, 105, 0.3);
}

[data-theme="light"] .insight-item.unread:hover {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.12) 0%, rgba(255, 255, 255, 0.5) 100%);
}

/* Trade alerts unread */
[data-theme="light"] .trade-alert-item.unread {
    background: rgba(5, 150, 105, 0.06);
    border-color: rgba(5, 150, 105, 0.2);
}

[data-theme="light"] .trade-alert-item.unread:hover {
    background: rgba(5, 150, 105, 0.1);
}

/* Voice chat button gradient */
[data-theme="light"] .voice-btn.voice-chat {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.06) 0%, rgba(5, 150, 105, 0.02) 100%);
}

[data-theme="light"] .voice-btn.voice-chat:hover {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.12) 0%, rgba(5, 150, 105, 0.04) 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.12);
}

/* Send button glow */
[data-theme="light"] .send-btn:hover {
    box-shadow: 0 0 16px rgba(5, 150, 105, 0.2);
}

/* Advanced fields */
[data-theme="light"] .advanced-fields {
    background: rgba(5, 150, 105, 0.03);
}

/* Accent glow orb borders */
[data-theme="light"] .voice-orb::before {
    border-color: rgba(5, 150, 105, 0.2);
}

/* Score badge - keep dark text on colored badges */
[data-theme="light"] .score-badge {
    color: #000;
}

/* Toast notifications */
[data-theme="light"] .toast-success {
    background: rgba(5, 150, 105, 0.9);
    color: #ffffff;
}

[data-theme="light"] .toast-info button {
    color: #ffffff;
}

/* Auth google button - maintain white background in light mode */
[data-theme="light"] .auth-google-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    color: #333;
}

[data-theme="light"] .auth-google-btn:hover {
    background: #f9fafb;
}

/* Alert notification */
[data-theme="light"] .alert-notification {
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.25);
}

/* Streak milestone - gold buttons always dark text */
[data-theme="light"] .streak-milestone-btn {
    color: #000;
}

/* Premium/pro card with dark gradient - override for light */
[data-theme="light"] .pro-upgrade-card,
[data-theme="light"] .premium-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 2px solid #d4a017;
}

[data-theme="light"] .pro-upgrade-card .pro-btn,
[data-theme="light"] .premium-card .premium-btn {
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    color: #fff;
}

/* Error states */
[data-theme="light"] .auth-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* Muted state voice pill */
[data-theme="light"] .voice-pill-mute.muted {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Market page cards shadows */
[data-theme="light"] .index-card,
[data-theme="light"] .market-card,
[data-theme="light"] .stock-item {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Scrollbar */
[data-theme="light"] .voice-conversation-log {
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* Input focus ring */
[data-theme="light"] .message-input:focus {
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

/* Fear/greed gauge - these semantic colors work in both modes */

/* Nav page links */
[data-theme="light"] .nav-page-link.active,
[data-theme="light"] .page-tab.active {
    color: var(--accent);
    border-color: var(--accent);
}

/* Congress ticker section */
[data-theme="light"] .congress-ticker-section {
    border-bottom: 1px solid var(--border);
}

/* TradingView embeds - they need dark theme regardless (their own styling) */

/* Remove bright green glow effects that look off on white */
[data-theme="light"] .unread-alert-dot,
[data-theme="light"] .trade-alert-unread-dot {
    box-shadow: 0 0 6px rgba(5, 150, 105, 0.4);
}

/* Card glow toned down */
[data-theme="light"] .stock-item:hover,
[data-theme="light"] .insight-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Onboarding */
[data-theme="light"] .onboarding-overlay {
    background: var(--overlay-bg);
}

[data-theme="light"] .onboarding-modal {
    background: var(--bg-card);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .option-btn {
    background: var(--bg-input);
    border-color: var(--border);
}

[data-theme="light"] .option-btn:hover {
    background: var(--bg-card-hover);
}

[data-theme="light"] .option-btn.selected {
    background: rgba(5, 150, 105, 0.08);
    border-color: var(--accent);
}

/* Debug panel - keep dark for readability */
[data-theme="light"] #debug-panel-container {
    background: rgba(0, 0, 0, 0.95) !important;
    color: #fff !important;
}

/* Streak milestone - light mode */
[data-theme="light"] .streak-milestone-content {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #d4a017;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .streak-milestone-badge {
    color: #d4a017;
}

/* Voice overlay - ensure readable text */
[data-theme="light"] .voice-status-text {
    color: var(--text-primary);
}

[data-theme="light"] .voice-overlay-title {
    color: var(--text-primary);
}

/* Make code blocks / pre elements respect theme */
[data-theme="light"] pre,
[data-theme="light"] code {
    background: var(--bg-secondary);
    border-color: var(--border);
}

/* Quick action buttons in message content */
[data-theme="light"] .message-action-btn {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

/* Sidebar / nav panels */
[data-theme="light"] .side-panel,
[data-theme="light"] .nav-panel {
    background: var(--bg-card);
    border-color: var(--border);
}

/* Summary / report cards with accent borders */
[data-theme="light"] .report-section {
    border-color: var(--border);
}

/* Watchlist / stock cards box shadow */
[data-theme="light"] .watchlist-card:hover,
[data-theme="light"] .market-section-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Score History Section
   ============================================ */

.score-history-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.score-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.score-history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #fff);
}

.score-history-icon {
    font-size: 16px;
}

.score-history-period {
    font-size: 12px;
    color: var(--text-secondary, #888);
    font-weight: 400;
}

.score-history-change {
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.score-change-up {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.score-change-down {
    color: #ff6666;
    background: rgba(255, 102, 102, 0.1);
}

.score-change-flat {
    color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
}

.score-history-sparkline {
    margin: 8px 0;
}

.score-history-sparkline svg {
    width: 100%;
    height: 50px;
}

.sparkline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-top: 4px;
}

.score-history-summary {
    font-size: 13px;
    color: var(--text-secondary, #ccc);
    margin-top: 8px;
    line-height: 1.4;
}

.score-history-explanation {
    font-size: 12px;
    color: var(--text-tertiary, #999);
    margin-top: 4px;
    font-style: italic;
}

.score-history-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #888);
    padding: 12px 0;
}

.score-history-loading {
    font-size: 13px;
    color: var(--text-secondary, #888);
    padding: 12px 0;
}

/* Light theme overrides */
[data-theme="light"] .score-history-section {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="light"] .score-change-up {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

[data-theme="light"] .score-change-down {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

[data-theme="light"] .score-change-flat {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
}
