/* === Vexa Design System — Clean Minimal === */
:root {
    --bg-base: #1a1a1a;
    --bg-surface: #222222;
    --bg-elevated: #2a2a2a;
    --bg-overlay: #333333;
    --accent: #d4a574;
    --accent-dim: rgba(212, 165, 116, 0.1);
    --accent-bright: #e8c49a;
    --text-primary: #ececec;
    --text-secondary: #999999;
    --text-tertiary: #666666;
    --status-urgent: #e5534b;
    --status-warn: #d4a72c;
    --status-ok: #57ab5a;
    --status-live: #57ab5a;
    --border: #333333;
    --border-glow: #3d3d3d;
    --border-active: rgba(212, 165, 116, 0.4);
    --font-display: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --sidebar-width: 200px;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --glow-sm: none;
    --glow-md: none;
    --glow-lg: none;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: var(--font-display);
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === App Layout === */
.app { display: flex; height: 100vh; height: 100dvh; width: 100vw; }

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    z-index: 100;
}
.sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.sidebar-bottom { padding: 0 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
    font-family: var(--font-display);
    font-weight: 500;
    text-align: left;
}
.nav-item:hover { color: var(--text-primary); background: var(--accent-dim); }
.nav-item.active {
    color: var(--text-primary);
    background: var(--accent-dim);
    font-weight: 600;
}
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}
.nav-item .nav-badge.urgent {
    background: rgba(255, 77, 106, 0.15);
    color: var(--status-urgent);
}
.nav-item:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* === Main Content === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* === Header === */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    border-bottom: 1px solid var(--border);
    height: 56px;
    flex-shrink: 0;
    background: var(--bg-surface);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.view-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.header-center {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}
.header-right { display: flex; align-items: center; gap: 16px; }
.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(87, 171, 90, 0.08);
    border: 1px solid rgba(87, 171, 90, 0.2);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: var(--status-live);
}
.system-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-live);
}
.notification-bell {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.notification-bell:hover { color: var(--text-primary); background: var(--bg-elevated); }
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--status-urgent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === View Container === */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.view-container::-webkit-scrollbar { width: 5px; }
.view-container::-webkit-scrollbar-track { background: transparent; }
.view-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
/* When showing chat, remove padding and let chat fill */
.view-container:has(.chat-view) { padding: 16px 32px; overflow: hidden; }

/* === Panel (shared card style) === */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}
.panel::before { display: none; }
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
}
.panel-action {
    font-size: 11px;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
}
.panel-action:hover { color: var(--accent); }

/* === Chat View (inside view-container, not an overlay) === */
.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 750px;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
}
.response-card {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    animation: cardSlideIn 200ms ease-out;
    max-width: 85%;
}
.response-card.card-user {
    align-self: flex-end;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    max-width: 70%;
}
.response-card.card-assistant {
    align-self: flex-start;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}
.response-card.card-error {
    border: 1px solid rgba(229, 83, 75, 0.3);
    align-self: flex-start;
    background: var(--bg-surface);
}
@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat message content */
.chat-msg { font-size: 14px; line-height: 1.7; color: var(--text-primary); }
.chat-msg p { margin-bottom: 8px; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg strong { font-weight: 600; }
.chat-msg ul, .chat-msg ol { padding-left: 20px; margin-bottom: 8px; }
.chat-msg li { margin-bottom: 4px; }
.chat-msg code { font-family: var(--font-mono); background: var(--bg-base); padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.chat-msg .msg-label { font-size: 11px; font-weight: 500; color: var(--text-tertiary); margin-bottom: 4px; display: block; }
.card-user .chat-msg { color: var(--text-secondary); font-size: 13px; }

/* === Ask Bar (Talk to Vexa) === */
.ask-bar-container {
    padding: 12px 32px 16px;
    flex-shrink: 0;
    background: var(--bg-base);
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 60;
}
.ask-bar {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 6px 8px 6px 20px;
    gap: 8px;
    transition: all var(--transition-fast);
}
.ask-bar:focus-within {
    border-color: var(--border-active);
}
.ask-bar-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    white-space: nowrap;
    margin-right: 8px;
}
.ask-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-display);
    padding: 8px 0;
}
.ask-input::placeholder { color: var(--text-tertiary); }
.ask-actions { display: flex; align-items: center; gap: 4px; }
.ask-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 18px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 500;
    transition: all var(--transition-fast);
}
.ask-btn:hover { color: var(--accent); border-color: var(--border-glow); box-shadow: var(--glow-sm); }
.mic-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    flex-shrink: 0;
}
.mic-btn:hover { background: rgba(212, 165, 116, 0.15); }
.mic-btn.active {
    background: rgba(212, 165, 116, 0.2);
    animation: micPulse 1.5s ease-in-out infinite;
}
@keyframes micPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.ask-hint {
    margin-top: 8px;
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
}
.ask-hint kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
}

/* === Today View === */
.today-view { display: flex; flex-direction: column; align-items: center; gap: 32px; padding-top: 40px; }
.today-greeting {
    text-align: center;
    font-size: 24px;
    font-weight: 300;
    color: var(--text-primary);
}
.today-stats { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    box-shadow: var(--glow-sm);
}
.stat-item .stat-value { font-size: 20px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }

.today-priorities { width: 100%; max-width: 640px; }
.section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
    margin-bottom: 12px;
}
.priority-list { display: flex; flex-direction: column; gap: 6px; }
.priority-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}
.priority-item:hover { border-color: var(--border-glow); }
.priority-item .priority-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
    width: 20px;
}
.priority-item.overdue { border-left: 3px solid var(--status-urgent); }
.priority-item.overdue .priority-label {
    color: var(--status-urgent);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(255, 77, 106, 0.1);
    border-radius: 3px;
}

.today-suggestion {
    width: 100%;
    max-width: 640px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
}
.today-suggestion::before { display: none; }
.suggestion-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
    margin-bottom: 8px;
}
.suggestion-text { font-size: 14px; color: var(--text-primary); line-height: 1.6; }
.suggestion-actions { display: flex; gap: 8px; margin-top: 16px; }

/* === Buttons === */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn:hover { color: var(--text-primary); border-color: var(--border-glow); }
.btn-primary {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
    font-weight: 600;
}
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

/* === Orb (AI Core Sphere) === */
.orb-container { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.orb {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
}
.orb-glow {
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.08), transparent 70%);
    animation: orbGlowPulse 3s ease-in-out infinite;
    transition: transform 0.1s ease-out;
}
.orb-ring {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 1px solid rgba(212, 165, 116, 0.15);
    animation: orbRingSpin 10s linear infinite;
}
.orb-ring::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}
.orb-ring-2 {
    position: absolute;
    inset: -26px;
    border-radius: 50%;
    border: 1px solid rgba(212, 165, 116, 0.06);
    animation: orbRingSpin 15s linear infinite reverse;
}
.orb-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, 
        rgba(232, 196, 154, 0.9), 
        rgba(212, 165, 116, 0.5) 50%, 
        rgba(100, 70, 40, 0.3) 80%, 
        rgba(26, 26, 26, 0.8));
    box-shadow: 0 0 30px rgba(212, 165, 116, 0.15);
    animation: orbCorePulse 3s ease-in-out infinite;
    transition: transform 0.05s ease-out;
}
.orb-inner-ring {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    border: 1px solid rgba(212, 165, 116, 0.15);
    animation: orbRingSpin 6s linear infinite reverse;
}
/* Audio visualizer rings */
.orb-audio-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(0, 229, 255, 0.4);
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.1s, transform 0.1s;
}
.orb-audio-ring.ring-1 { inset: -8px; }
.orb-audio-ring.ring-2 { inset: -18px; border-width: 1.5px; }
.orb-audio-ring.ring-3 { inset: -30px; border-width: 1px; border-color: rgba(0, 229, 255, 0.2); }

.orb-state-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes orbGlowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.03); }
}
@keyframes orbRingSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes orbCorePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Orb states */
.orb.listening .orb-core { animation: orbListen 0.6s ease-in-out infinite; }
.orb.thinking .orb-ring { animation: orbRingSpin 1.5s linear infinite; }
.orb.thinking .orb-core { animation: orbThink 1.2s ease-in-out infinite; }
.orb.speaking .orb-core { animation: orbSpeak 0.4s ease-in-out infinite; }
.orb.offline .orb-core {
    background: radial-gradient(circle at 35% 35%, rgba(229, 83, 75, 0.7), rgba(229, 83, 75, 0.2) 60%, rgba(26, 26, 26, 0.8));
}
@keyframes orbListen { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes orbThink { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; transform: scale(0.97); } }
@keyframes orbSpeak { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* === Tasks View === */
.tasks-view { max-width: 700px; }
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: all var(--transition-fast);
}
.task-item:hover { background: var(--bg-elevated); }
.task-item.overdue { border-left: 3px solid var(--status-urgent); }
.task-item.in-progress { border-left: 3px solid var(--status-warn); }
.task-priority {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.task-priority.high { background: rgba(255, 77, 106, 0.12); color: var(--status-urgent); border: 1px solid rgba(255, 77, 106, 0.2); }
.task-priority.medium { background: rgba(255, 170, 51, 0.12); color: var(--status-warn); border: 1px solid rgba(255, 170, 51, 0.2); }
.task-priority.low { background: var(--bg-elevated); color: var(--text-tertiary); border: 1px solid var(--border); }
.task-title { flex: 1; font-size: 13px; }
.task-due { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }
.task-due.overdue { color: var(--status-urgent); }
/* === People View === */
.people-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.contact-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition-fast);
    cursor: pointer;
}
.contact-card:hover { background: var(--bg-elevated); }
.contact-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.contact-role { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.contact-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.contact-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.contact-status.warm_lead { background: rgba(255, 170, 51, 0.1); color: var(--status-warn); border: 1px solid rgba(255, 170, 51, 0.2); }
.contact-status.demo_scheduled { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--border-glow); }
.contact-status.proposal_sent { background: rgba(0, 229, 255, 0.08); color: var(--accent); border: 1px solid var(--border-glow); }
.contact-status.follow_up_needed { background: rgba(255, 77, 106, 0.1); color: var(--status-urgent); border: 1px solid rgba(255, 77, 106, 0.2); }
.contact-status.cold_intro { background: var(--bg-elevated); color: var(--text-tertiary); border: 1px solid var(--border); }
.contact-status.interested { background: rgba(255, 170, 51, 0.1); color: var(--status-warn); border: 1px solid rgba(255, 170, 51, 0.2); }

/* === Email View === */
.email-view { max-width: 700px; }
.email-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.email-item:hover { background: var(--bg-elevated); }
.email-item.unread { border-left: 3px solid var(--accent); }
.email-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }
.email-dot.read { background: transparent; box-shadow: none; }
.email-content { flex: 1; min-width: 0; }
.email-from { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.email-subject { font-size: 12px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-date { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); flex-shrink: 0; }

/* === Calendar View === */
.calendar-view { max-width: 700px; }
.event-item {
    display: flex;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: all var(--transition-fast);
}
.event-item:hover { border-color: var(--border-glow); }
.event-time { font-size: 12px; font-family: var(--font-mono); color: var(--accent); min-width: 90px; flex-shrink: 0; }
.event-details { flex: 1; }
.event-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.event-location { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

/* === Links View === */
.links-view { max-width: 700px; }
.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: all var(--transition-fast);
}
.link-item:hover { background: var(--bg-elevated); }
.link-title { font-size: 13px; color: var(--accent); flex: 1; }
.link-tags { display: flex; gap: 4px; }
.link-tag {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
}

/* === Brain/Graph View === */
.brain-view { width: 100%; height: 100%; position: relative; }
#graphCanvas { width: 100%; height: 100%; display: block; cursor: grab; }
#graphCanvas:active { cursor: grabbing; }
.graph-tooltip {
    position: absolute;
    background: var(--bg-overlay);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 200;
    max-width: 250px;
    box-shadow: var(--glow-md);
}
.graph-tooltip.visible { opacity: 1; }

/* === Utilities === */
.hidden { display: none !important; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Task Status Dot + Label */
.task-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.task-status-dot.overdue { background: var(--status-urgent); box-shadow: 0 0 6px var(--status-urgent); }
.task-status-dot.in_progress { background: var(--status-warn); box-shadow: 0 0 6px var(--status-warn); }
.task-status-dot.pending { background: var(--text-tertiary); }
.task-status-dot.completed { background: var(--status-ok); box-shadow: 0 0 6px var(--status-ok); }

.task-status-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-left: auto;
}
.task-status-label.overdue { color: var(--status-urgent); background: rgba(255, 77, 106, 0.1); }
.task-status-label.in_progress { color: var(--status-warn); background: rgba(255, 170, 51, 0.1); }
.task-status-label.pending { color: var(--text-tertiary); background: var(--bg-elevated); }
.task-status-label.completed { color: var(--status-ok); background: rgba(0, 229, 255, 0.1); }

/* === Notification Panel === */
.notif-wrapper { position: relative; }
.notif-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-height: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 500;
    overflow: hidden;
    animation: panelSlideIn 150ms ease-out;
}
.notif-panel.hidden { display: none; }
@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.notif-panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.notif-panel-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: background var(--transition-fast);
    cursor: pointer;
}
.notif-item:hover { background: var(--bg-elevated); }
.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.notif-item-dot.urgent { background: var(--status-urgent); box-shadow: 0 0 6px var(--status-urgent); }
.notif-item-dot.warn { background: var(--status-warn); box-shadow: 0 0 6px var(--status-warn); }
.notif-item-dot.info { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.notif-item-content { flex: 1; }
.notif-item-title { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.notif-item-desc { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.notif-item-time { font-size: 10px; color: var(--text-tertiary); font-family: var(--font-mono); flex-shrink: 0; margin-top: 4px; }

/* === Notification Actions === */
.notif-item-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.notif-item:hover .notif-item-actions { opacity: 1; }
.notif-action {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all var(--transition-fast);
}
.notif-action:hover { color: var(--accent); border-color: var(--border-glow); box-shadow: var(--glow-sm); }
.notif-action.danger:hover { color: var(--status-urgent); border-color: rgba(255, 77, 106, 0.3); box-shadow: 0 0 8px rgba(255, 77, 106, 0.15); }

/* === Orb ring-2 === */
.orb-ring-2 {
    position: absolute;
    inset: -26px;
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 255, 0.06);
    animation: orbRingSpin 15s linear infinite reverse;
}

/* === Settings View === */
.settings-view { max-width: 700px; display: flex; flex-direction: column; gap: 28px; }
.settings-section {}
.settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.setting-item:last-child { border-bottom: none; }
.setting-item:hover { background: var(--bg-elevated); }
.setting-label { display: flex; align-items: center; gap: 12px; }
.setting-name { font-size: 13px; color: var(--text-primary); }
.setting-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.setting-status.ok { color: var(--status-ok); background: rgba(0, 229, 255, 0.08); }
.setting-status.warn { color: var(--status-warn); background: rgba(255, 170, 51, 0.08); }
.setting-status.info { color: var(--text-secondary); background: var(--bg-elevated); }
.setting-control { display: flex; align-items: center; gap: 8px; }
.setting-value-display { font-size: 13px; color: var(--text-secondary); font-family: var(--font-mono); }
.setting-meta { font-size: 11px; color: var(--text-tertiary); }
.setting-input {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    width: 220px;
    transition: border-color var(--transition-fast);
}
.setting-input:focus { outline: none; border-color: var(--border-active); box-shadow: 0 0 0 2px var(--accent-dim); }
.setting-input.key-input { width: 180px; }
.setting-select {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
}
.setting-select:focus { outline: none; border-color: var(--border-active); }
.btn-sm { font-size: 11px; padding: 4px 10px; }
.btn-sm.danger { color: var(--status-urgent); border-color: rgba(255, 77, 106, 0.3); }
.btn-sm.danger:hover { background: rgba(255, 77, 106, 0.1); }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all var(--transition-fast);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-tertiary);
    border-radius: 50%;
    transition: all var(--transition-fast);
}
.toggle input:checked + .toggle-slider { background: var(--accent-dim); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* === Response Card Styles === */
.response-card.card-user { background: var(--bg-elevated); border-color: var(--border); }
.response-card.card-assistant { background: var(--bg-surface); border-color: var(--border-glow); box-shadow: var(--glow-sm); }
.response-card.card-error { border-color: rgba(255, 77, 106, 0.3); }

.card-user-msg { font-size: 13px; color: var(--text-secondary); font-style: italic; }
.card-error { color: var(--status-urgent); font-size: 13px; }
.card-spoken { font-size: 14px; color: var(--text-primary); line-height: 1.7; margin-bottom: 12px; }
.card-tool-badge { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Structured card inner */
.card-structured { margin-top: 8px; }

/* Email cards */
.card-email-item { padding: 10px 12px; border-left: 2px solid var(--border); margin-bottom: 6px; border-radius: 0 6px 6px 0; background: var(--bg-base); }
.card-email-item.card-email-urgent { border-left-color: var(--status-urgent); }
.card-email-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.card-email-from { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.card-email-subject { font-size: 12px; color: var(--text-secondary); }
.card-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; letter-spacing: 0.3px; }
.card-badge.urgent { background: rgba(255, 77, 106, 0.12); color: var(--status-urgent); }

/* Brief cards */
.card-brief-weather { font-size: 13px; color: var(--accent); margin-bottom: 12px; font-weight: 500; }
.card-brief-section { margin-bottom: 10px; }
.card-brief-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-tertiary); display: block; margin-bottom: 6px; }
.card-brief-label.card-label-urgent { color: var(--status-urgent); }
.card-brief-row { font-size: 12px; color: var(--text-primary); padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.card-brief-row.urgent { color: var(--status-urgent); }
.card-brief-time { font-family: var(--font-mono); font-size: 11px; color: var(--accent); min-width: 70px; }
.card-brief-num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); font-weight: 700; }

/* Plan cards */
.card-plan-item { font-size: 12px; padding: 6px 0; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.card-plan-item.urgent { color: var(--status-urgent); }
.card-plan-num { font-family: var(--font-mono); font-weight: 700; color: var(--accent); width: 18px; }
.card-plan-due { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin-left: auto; }

/* Task cards */
.card-task-item { font-size: 12px; padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.card-task-priority { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 1px 5px; border-radius: 3px; }
.card-task-priority.high { background: rgba(255, 77, 106, 0.12); color: var(--status-urgent); }
.card-task-priority.medium { background: rgba(255, 170, 51, 0.12); color: var(--status-warn); }

/* Contact cards */
.card-contact-name { font-size: 14px; font-weight: 600; }
.card-contact-role { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Search cards */
.card-search-count { font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; }
.card-search-item { font-size: 12px; padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.card-search-name { color: var(--accent); font-weight: 500; }
.card-search-type { font-size: 10px; color: var(--text-tertiary); background: var(--bg-elevated); padding: 1px 6px; border-radius: 3px; }

/* === Stop Button === */
.stop-btn {
    background: rgba(229, 83, 75, 0.1) !important;
    border-color: rgba(229, 83, 75, 0.3) !important;
    color: var(--status-urgent) !important;
    min-width: 60px !important;
}
.stop-btn:hover {
    background: rgba(229, 83, 75, 0.2) !important;
}
.stop-btn.hidden { display: none !important; }

/* === Mobile Responsive === */
@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }

    .app { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 8px 12px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        gap: 4px;
    }
    .sidebar-logo { display: none; }
    .sidebar-nav {
        flex-direction: row;
        gap: 2px;
        flex: 1;
        overflow-x: auto;
    }
    .sidebar-bottom { display: none; }
    .nav-item {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
        gap: 6px;
    }
    .nav-item svg { width: 14px; height: 14px; }
    .nav-item.active::before { display: none; }

    .main-content { flex: 1; overflow: hidden; }

    .header {
        padding: 10px 16px;
        height: 48px;
    }
    .header-center { display: none; }
    .view-title { font-size: 12px; }

    .view-container {
        padding: 16px;
    }
    .view-container:has(.chat-view) { padding: 12px 16px; }

    /* Chat view mobile */
    .chat-view { max-width: 100%; }
    .response-card { max-width: 90% !important; padding: 10px 14px; }
    .chat-msg { font-size: 14px; line-height: 1.6; }

    /* Ask bar mobile */
    .ask-bar-container {
        padding: 10px 12px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 20px));
        background: var(--bg-base);
        border-top: 1px solid var(--border);
    }
    .ask-bar { padding: 4px 6px 4px 14px; border-radius: 24px; }
    .ask-bar-label { display: none; }
    .ask-input { font-size: 16px; padding: 8px 0; } /* 16px prevents iOS zoom */
    .ask-hint { display: none; }
    .ask-btn { height: 34px; padding: 0 10px; font-size: 11px; flex-shrink: 0; }
    .mic-btn { width: 36px; height: 36px; flex-shrink: 0; }

    /* Today view mobile */
    .today-view { padding-top: 20px; gap: 20px; }
    .today-greeting { font-size: 20px; }
    .today-stats { flex-wrap: wrap; gap: 8px; }
    .stat-item { padding: 10px 14px; font-size: 12px; }
    .stat-item .stat-value { font-size: 16px; }
    .today-priorities, .today-suggestion { max-width: 100%; }
    .priority-item { padding: 10px 12px; font-size: 13px; }

    /* Orb mobile */
    .orb { width: 100px; height: 100px; }

    /* Tasks/Email/People mobile */
    .tasks-view, .email-view, .calendar-view, .links-view { max-width: 100%; }
    .people-view { grid-template-columns: 1fr; }

    /* Notification panel mobile */
    .notif-panel { width: calc(100vw - 24px); right: -8px; }
}

/* PWA standalone (when added to home screen) */
@media (display-mode: standalone) {
    .sidebar { padding-top: env(safe-area-inset-top, 8px); }
    .ask-bar-container { padding-bottom: env(safe-area-inset-bottom, 12px); }
}

/* Orb tappable */
.orb { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.orb:active .orb-core { transform: scale(0.95); }
