:root {
    --color-primary: #1e3a5f;
    --color-secondary: #2563eb;
    --color-accent: #3b82f6;
    --color-surface: #1e293b;
}

[data-persona="CEO"] {
    --color-primary: #1e3a5f;
    --color-secondary: #1d4ed8;
    --color-accent: #3b82f6;
    --color-surface: #172554;
}

[data-persona="COO"] {
    --color-primary: #064e3b;
    --color-secondary: #059669;
    --color-accent: #34d399;
    --color-surface: #022c22;
}

[data-persona="CTO"] {
    --color-primary: #1e293b;
    --color-secondary: #475569;
    --color-accent: #94a3b8;
    --color-surface: #0f172a;
}

[data-persona="CISO"] {
    --color-primary: #78350f;
    --color-secondary: #d97706;
    --color-accent: #fbbf24;
    --color-surface: #451a03;
}

body {
    padding-bottom: env(safe-area-inset-bottom);
}

.app-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-surface));
}

.persona-btn.active {
    background-color: var(--color-accent);
    color: #0f172a;
    font-weight: 600;
}

.tab-btn.active {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.mic-btn.recording {
    animation: pulse-ring 1.5s ease-in-out infinite;
    background-color: #ef4444 !important;
}

#agent-connect-btn.live {
    background-color: #e0455e !important;
    color: #fff !important;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.score-ring {
    background: conic-gradient(var(--color-accent) calc(var(--score) * 1%), #334155 0);
}

.bottom-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
    .bottom-nav {
        position: static;
        border-top: none;
        background: transparent;
    }
}

/* Dashboard design tokens (from temp/ prototype) */
.dash-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.dash-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dash-btn-primary {
    background: #6366f1;
    color: #0f172a;
    border-radius: 0.75rem;
    transition: background-color 0.2s, opacity 0.2s;
}

.dash-btn-primary:hover {
    background: #4f46e5;
    color: #f8fafc;
}

.dash-input {
    padding: 0.5rem 1rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    color: #f8fafc;
}

.dash-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.dash-error {
    background: rgba(127, 29, 29, 0.5);
    border: 1px solid #b91c1c;
    color: #fecaca;
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.agent-filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    white-space: nowrap;
    font-size: 0.875rem;
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
    transition: background-color 0.2s, color 0.2s;
}

.agent-filter-btn:hover {
    background: #334155;
}

.agent-filter-btn.active {
    background: #6366f1;
    color: #0f172a;
    border-color: #6366f1;
}

.agent-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.badge-note { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.badge-priority { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.badge-idea { background: rgba(234, 179, 8, 0.1); color: #facc15; border-color: rgba(234, 179, 8, 0.2); }
.badge-reminder { background: rgba(168, 85, 247, 0.1); color: #c084fc; border-color: rgba(168, 85, 247, 0.2); }

.badge-linkedin { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.badge-instagram { background: rgba(236, 72, 153, 0.1); color: #f472b6; border-color: rgba(236, 72, 153, 0.2); }
.badge-youtube { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }

.platform-hook {
    border-width: 1px;
}

.tab-btn[data-tab="agent"].active,
.tab-btn[data-tab="content"].active {
    color: #818cf8;
    border-color: #6366f1;
}

.agent-delete-btn {
    padding: 0.25rem;
    color: #94a3b8;
    transition: color 0.2s;
    flex-shrink: 0;
}

.agent-delete-btn:hover {
    color: #f87171;
}

.agent-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.agent-modal.hidden {
    display: none;
}

.agent-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(2px);
}

.agent-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
}

.agent-priority-column {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1rem;
}

.agent-priority-list {
    min-height: 4rem;
}

.agent-priority-item {
    padding: 0.75rem 1rem;
    cursor: grab;
    user-select: none;
}

.agent-priority-item:active {
    cursor: grabbing;
}

.agent-priority-label {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.agent-priority-label:hover {
    color: #a5b4fc;
}

.agent-priority-ghost {
    opacity: 0.4;
}

.agent-priority-list:empty::after {
    content: 'Drop priorities here';
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    padding: 1.5rem 0.5rem;
}
