/* ============================================
   CheckoutIQ — Premium Light SaaS Dashboard
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Surface hierarchy */
    --bg: #f6f7f9;
    --bg-gradient-1: radial-gradient(ellipse at 20% 0%, rgba(13, 148, 136, 0.04) 0%, transparent 50%);
    --bg-gradient-2: radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);
    --card-border-strong: rgba(0, 0, 0, 0.12);
    --card-hover: #fafbfc;

    /* Surface shades */
    --surface-1: #f9fafb;
    --surface-2: #f3f4f6;
    --surface-3: #fafbfc;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;

    /* Text hierarchy */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-muted: var(--text-tertiary);

    /* Accent — signature gradient */
    --accent: #0d9488;
    --accent-end: #06b6d4;
    --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent-end));
    --accent-glow: rgba(13, 148, 136, 0.12);
    --accent-glow-strong: rgba(13, 148, 136, 0.2);

    /* Semantic */
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);

    /* Shape */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* Elevation — multi-layered */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 0 1px rgba(13,148,136,0.1), 0 4px 20px rgba(13,148,136,0.12);

    /* Motion */
    --transition: 0.2s ease;
    --spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Font */
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'Geist Mono', 'JetBrains Mono', 'SF Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    background-image: var(--bg-gradient-1), var(--bg-gradient-2);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h2 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* --- Animations --- */
@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
    50% { box-shadow: 0 0 20px 4px var(--accent-glow); }
}

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

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
}

@keyframes completeBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes bannerSlide {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes counterPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes thinkingDots {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.3); }
    70% { box-shadow: 0 0 0 8px rgba(13, 148, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- Top Navigation --- */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topnav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 22px;
    line-height: 1;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topnav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.topnav-center .control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* --- Inputs --- */
.input-url {
    width: 320px;
    padding: 8px 16px;
    background: var(--surface-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: all var(--transition);
}

.input-url::placeholder {
    color: var(--text-tertiary);
}

.input-url:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-url.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.input-select {
    padding: 8px 16px;
    padding-right: 32px;
    background: var(--surface-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition);
}

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

.input-select option {
    background: #ffffff;
    color: var(--text-primary);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn:active:not(:disabled) {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 10px;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.16);
}

/* --- Status Pill --- */
.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    border: 1px solid var(--card-border);
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-medium);
    flex-shrink: 0;
}

.status-pill.idle .status-dot {
    background: var(--border-medium);
}

.status-pill.running .status-dot {
    background: var(--success);
    animation: dotPulse 1.5s ease infinite;
}

.status-pill.completed .status-dot {
    background: var(--success);
}

.status-pill.error .status-dot {
    background: var(--danger);
}

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

.status-pill.running .status-text {
    color: var(--success);
}

.status-pill.completed .status-text {
    color: var(--success);
}

.status-pill.error .status-text {
    color: var(--danger);
}

/* --- Timer --- */
.timer {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.timer.running {
    color: var(--text-primary);
    animation: timerPulse 2s ease infinite;
}

/* --- Event Counter --- */
.event-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--radius-pill);
    cursor: default;
}

.counter-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.event-counter.pop .counter-value {
    animation: counterPop 0.3s ease;
}

/* --- Record Button --- */
.btn-record {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--surface-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-record:hover {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.25);
    color: var(--danger);
}

.record-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    opacity: 0.5;
    transition: all var(--transition);
}

.btn-record.recording {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger);
}

.btn-record.recording .record-dot {
    opacity: 1;
    animation: dotPulse 1s ease infinite;
}

/* === SIDEBAR NAVIGATION === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 56px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.03);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(13,148,136,0.25);
    text-decoration: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    transition: all var(--transition);
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.sidebar-icon:hover {
    background: var(--bg);
    color: var(--text-secondary);
}

.sidebar-icon.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.sidebar-icon[title]::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1000;
}

.sidebar-icon:hover[title]::after {
    opacity: 1;
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
    margin-top: auto;
}

.sidebar-plan {
    font-size: 9px;
    font-weight: 600;
    color: var(--success);
    margin-top: 4px;
    text-align: center;
}

.sidebar-logout {
    margin-top: 8px;
    opacity: 0.4;
    transition: opacity 0.15s;
}
.sidebar-logout:hover {
    opacity: 1;
}

/* Offset main content for fixed sidebar */
.app-main {
    margin-left: 56px;
    flex: 1;
    min-height: 100vh;
}

/* === MAIN GRID === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    grid-template-rows: 1fr;
    gap: 16px;
    padding: 20px 24px;
    min-height: 500px;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.6);
}

.card:hover {
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.6);
    border-color: var(--card-border-strong);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.card-header h2 {
    font-size: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.badge-danger {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
}

.badge-success {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
}

/* --- Issues Card (Left Column — Hero) --- */
.card-issues {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    max-height: 560px;
}

.card-issues .insights-list {
    flex: 1;
    min-height: 80px;
    max-height: none;
    overflow-y: auto;
}

.card-issues .card-header-sub {
    border-top: 1px solid var(--card-border);
    padding-top: 12px;
}

.insights-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    gap: 8px;
}

.insights-empty-icon {
    font-size: 28px;
    opacity: 0.4;
}

.insights-empty p {
    font-size: 13px;
}

/* --- Feed (now in tab panel) --- */
.feed-tab-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.feed-container {
    max-height: 450px;
    overflow-y: auto;
    padding: 0 4px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feed-empty, .personas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    gap: 12px;
}

.feed-empty-icon, .personas-empty-icon {
    font-size: 32px;
    opacity: 0.5;
}

.feed-empty p, .personas-empty p {
    font-size: 13px;
}

/* --- Activity Entry --- */
.activity-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-1);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.45;
    animation: slideInRight 0.35s var(--spring) both;
    transition: background var(--transition);
}

.activity-entry:hover {
    background: var(--surface-2);
}

.entry-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.entry-persona {
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}

.entry-text {
    flex: 1;
    min-width: 0;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

.entry-text em {
    color: var(--accent);
    font-style: normal;
    font-weight: 500;
}

.entry-reason {
    color: var(--text-tertiary);
    font-size: 12px;
}

.entry-time {
    color: var(--text-tertiary);
    font-size: 11px;
    font-family: var(--font-mono);
    flex-shrink: 0;
    margin-top: 2px;
}

/* --- Funnel Card --- */
.card-funnel {
    grid-column: 2;
    grid-row: 1;
}

.card-funnel #funnel-chart {
    width: 100%;
    height: 280px;
    padding: 0 12px 12px;
}

/* --- Persona Cards --- */
.card-personas {
    grid-column: 3;
    grid-row: 1;
}

/* === PERSONA CARDS (Uxia-inspired) === */
.persona-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px;
    overflow-y: auto;
    max-height: 500px;
}

.persona-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: all 0.25s ease;
    animation: slideInUp 0.35s var(--spring) both;
    box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.6);
}

.persona-card.active {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.persona-card.completed {
    opacity: 0.85;
}

.persona-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.persona-avatar-lg {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: white;
    flex-shrink: 0;
    position: relative;
}

.persona-avatar-lg .play-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    cursor: pointer;
    transition: opacity var(--transition);
}

.persona-avatar-lg:hover .play-overlay {
    opacity: 1;
}

.persona-name-block {
    flex: 1;
    min-width: 0;
}

.persona-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.persona-demo {
    font-size: 11px;
    color: var(--text-tertiary);
}

.persona-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.persona-status-badge.running {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
}

.persona-status-badge.completed {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-tertiary);
}

.persona-status-badge.purchased {
    background: rgba(5, 150, 105, 0.12);
    color: var(--success);
}

.persona-status-badge.abandoned {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
}

.persona-status-badge.frustrated {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning);
}

.persona-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.persona-tag {
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
}

.persona-tag.intent {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(13, 148, 136, 0.2);
}

.persona-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.persona-live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 11px;
}

.persona-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.persona-live-dot.active { background: var(--success); animation: dotPulse 1.5s ease infinite; }
.persona-live-dot.done { background: var(--text-tertiary); }

.persona-current-page {
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 10px;
}

.persona-frustration {
    font-weight: 600;
    font-size: 10px;
    flex-shrink: 0;
}

.persona-frustration.low { color: var(--success); }
.persona-frustration.medium { color: var(--warning); }
.persona-frustration.high { color: var(--danger); }

/* --- Insights Lists (inside Issues Card) --- */
.insights-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px 12px;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-1);
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
    animation: slideInUp 0.3s ease both;
}

.insight-item > span:last-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.insight-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.insight-dot.pain {
    background: var(--danger);
}

.insight-dot.win {
    background: var(--success);
}

.insight-persona {
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

/* === BOTTOM PANEL (Tabs) === */
.bottom-panel {
    margin: 0 24px 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: visible;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.6);
}

.tab-bar {
    display: flex;
    gap: 2px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--card-border);
    background: var(--surface-3);
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

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

.tab-btn.active {
    color: var(--accent);
    background: var(--accent-glow);
    font-weight: 600;
}

.tab-panels {
    padding: 16px;
    position: relative;
    min-height: 250px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* --- Heatmap --- */
.heatmap-wrapper {
    position: relative;
    width: 100%;
    min-height: 400px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#heatmap-canvas {
    display: block;
    width: 100%;
    height: 400px;
}

.heatmap-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: var(--text-tertiary);
    font-size: 13px;
}

.heatmap-wrapper.has-data .heatmap-empty-state {
    display: none;
}

/* Chart tab has-chart class hides empty state */
.tab-panel.has-chart .chart-empty-state,
.tab-panel.has-chart .tab-empty {
    display: none;
}

.chart-empty-state {
    color: var(--text-tertiary);
    text-align: center;
    padding: 60px 20px;
    font-size: 13px;
}

/* Chart containers */
.chart-container {
    width: 100%;
    min-height: 300px;
}

/* When chart renders, hide empty state and ensure chart is visible */
.chart-container.js-plotly-plot + .chart-empty-state {
    display: none;
}

.chart-container.chart-lg {
    min-height: 400px;
}

/* --- Success Banner --- */
.success-banner {
    position: fixed;
    top: 56px;
    left: 56px;
    right: 0;
    padding: 12px 24px;
    background: rgba(5, 150, 105, 0.08);
    border-bottom: 1px solid rgba(5, 150, 105, 0.15);
    color: var(--success);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    z-index: 99;
    animation: bannerSlide 0.5s var(--spring) both;
    display: none;
}

/* --- CRO Scorecard (Traffic-Light Grid) --- */
.scorecard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
    padding: 0 4px;
}

.score-card {
    text-align: center;
    padding: 14px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    transition: all var(--transition);
}

.score-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--card-border-strong);
}

.score-card .score-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 auto 6px;
}

.score-card.score-green .score-dot { background: var(--success); box-shadow: 0 0 8px rgba(5, 150, 105, 0.3); }
.score-card.score-amber .score-dot { background: var(--warning); box-shadow: 0 0 8px rgba(217, 119, 6, 0.3); }
.score-card.score-red .score-dot { background: var(--danger); box-shadow: 0 0 8px rgba(220, 38, 38, 0.3); }

.score-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.score-value {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.score-card.score-green .score-value { color: var(--success); }
.score-card.score-amber .score-value { color: var(--warning); }
.score-card.score-red .score-value { color: var(--danger); }

.score-reason {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    line-height: 1.3;
}

/* --- Analysis Report --- */
.analysis-container {
    padding: 0 8px;
    max-height: 500px;
    overflow-y: auto;
}

.analysis-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.btn-download {
    background: var(--accent);
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-download:hover {
    opacity: 0.9;
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: wait;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-share:hover {
    background: var(--accent);
    color: white;
}

/* --- Compare --- */
.compare-check { width: 16px; height: 16px; cursor: pointer; margin-right: 8px; flex-shrink: 0; }
.compare-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card-bg); border: 1px solid var(--accent); border-radius: var(--radius-md); margin-bottom: 12px; }
.compare-toolbar span { font-size: 13px; color: var(--text-secondary); }
.btn-compare { padding: 6px 16px; background: var(--accent); color: white; border: none; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-compare:disabled { opacity: 0.4; cursor: default; }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; margin: 16px 0; }
.compare-col { padding: 16px; background: var(--card-bg); border-radius: var(--radius-md); border: 1px solid var(--card-border); }
.compare-col h4 { font-size: 13px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-stat { font-size: 14px; margin: 4px 0; }
.compare-delta { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.delta-good { color: #059669; }
.delta-bad { color: #ef4444; }
.compare-winner { text-align: center; font-size: 15px; margin-top: 12px; }
#compare-results { margin-top: 20px; }

.analysis-report {
    color: var(--text-secondary);
    line-height: 1.7;
    animation: fadeIn 0.5s ease;
}

.analysis-report h2.analysis-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.3px;
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analysis-report h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--card-border);
}

.analysis-report h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin: 14px 0 6px;
}

.analysis-report ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.analysis-report li {
    padding: 6px 0 6px 16px;
    position: relative;
    font-size: 13px;
}

.analysis-report li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.analysis-report strong {
    color: var(--text-primary);
}

.analysis-report p {
    margin: 8px 0;
    font-size: 13px;
}

.analysis-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

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

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.metric-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.analysis-funnel {
    margin: 12px 0;
}

.funnel-step {
    margin: 4px 0;
}

.funnel-bar {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.12), rgba(13, 148, 136, 0.06));
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 60px;
    transition: width 0.5s ease;
}

.analysis-persona {
    margin: 6px 0;
}

.analysis-persona-header {
    padding: 8px 12px;
    background: var(--surface-1);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.analysis-note {
    margin-top: 20px;
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

.analysis-note code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.analysis-loading-detail {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* Feed sample cards (AI reasoning section) */
.analysis-feed-samples {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}

.feed-sample {
    padding: 10px 14px;
    background: var(--surface-1);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feed-sample strong {
    color: var(--text-primary);
}

.feed-sample em {
    color: var(--text-secondary);
    font-style: italic;
}

.feed-feedback {
    color: var(--text-tertiary);
    font-size: 12px;
    font-style: italic;
}

/* Horizontal rule in analysis */
.analysis-report hr {
    border: none;
    height: 1px;
    background: var(--card-border);
    margin: 20px 0;
}

/* Ordered list numbers */
.analysis-report ol {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    counter-reset: analysis-counter;
}

.analysis-report ol li {
    counter-increment: analysis-counter;
}

.analysis-report ol li::before {
    content: counter(analysis-counter) '.';
    font-weight: 600;
    color: var(--accent);
    width: 20px;
    display: inline-block;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
}

.analysis-table th {
    background: rgba(13, 148, 136, 0.06);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.analysis-table td {
    padding: 10px 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--surface-2);
    vertical-align: top;
}

.analysis-table tr:hover td {
    background: var(--surface-3);
}

.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-tertiary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.success-banner.visible {
    display: block;
}

/* --- A/B Test View --- */
.ab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ab-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.winner-badge {
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.winner-a { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.winner-b { background: rgba(248, 113, 113, 0.1); color: var(--danger); }
.winner-tie { background: rgba(251, 191, 36, 0.1); color: var(--warning); }

.ab-split {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin: 20px 0;
}

.ab-side {
    padding: 20px;
    background: var(--surface-1);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.ab-side h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.ab-divider {
    width: 1px;
    background: var(--card-border);
}

.ab-metric {
    font-size: 14px;
    margin: 8px 0;
    color: var(--text-secondary);
}

.ab-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.ab-table th,
.ab-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--surface-2);
    font-size: 13px;
}

.ab-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ab-table td {
    color: var(--text-primary);
}

.friction-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.friction-col h4 {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pain-point,
.win {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface-1);
    margin-bottom: 4px;
}

.pain-point {
    border-left: 3px solid var(--danger);
}

.win {
    border-left: 3px solid var(--success);
}

.pain-point.shared {
    border-left-color: var(--warning);
}

/* === MODE TOGGLE === */
.mode-toggle {
    display: flex;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    padding: 3px;
    border: 1px solid var(--card-border);
    gap: 2px;
}

.mode-btn {
    padding: 5px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.sub-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === AUDIT VIEW === */
.audit-view {
    padding: 20px 24px;
}

.audit-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.audit-stat {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}

.audit-stat:hover {
    box-shadow: var(--shadow-sm);
}

.audit-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.audit-stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 500;
}

.audit-stat.severity-critical .audit-stat-value { color: var(--danger); }
.audit-stat.severity-warning .audit-stat-value { color: var(--warning); }
.audit-stat.severity-info .audit-stat-value { color: var(--accent); }

.audit-download-stat {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.3);
    white-space: nowrap;
}

.btn-download:hover {
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.4);
    transform: translateY(-1px);
}

.btn-download:active {
    transform: scale(0.96);
}

/* Audit Filters */
.audit-tab-bar {
    display: flex;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 12px;
}
.audit-tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.audit-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.audit-tab-btn:hover {
    color: var(--text-primary);
}

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
}

.audit-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.audit-filter-btn:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.audit-filter-btn.active {
    background: var(--accent-glow);
    border-color: rgba(13, 148, 136, 0.3);
    color: var(--accent);
    font-weight: 600;
}

.filter-count {
    font-size: 10px;
    font-weight: 700;
    background: var(--border-light);
    color: var(--text-secondary);
    padding: 1px 6px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}

.audit-filter-btn.active .filter-count {
    background: rgba(13, 148, 136, 0.15);
    color: var(--accent);
}

/* Audit Issue Cards */
.audit-issues-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.audit-issue-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-xs);
    animation: slideInUp 0.3s ease both;
    transition: all var(--transition);
    border-left: 4px solid transparent;
}

.audit-issue-card:hover {
    box-shadow: var(--shadow-sm);
}

.audit-issue-card.severity-critical {
    border-left-color: var(--danger);
}

.audit-issue-card.severity-warning {
    border-left-color: var(--warning);
}

.audit-issue-card.severity-info {
    border-left-color: var(--accent);
}

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

.audit-severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-severity-badge.severity-critical {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
}

.audit-severity-badge.severity-warning {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning);
}

.audit-severity-badge.severity-info {
    background: var(--accent-glow);
    color: var(--accent);
}

.audit-category-badge {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.audit-issue-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.audit-issue-detail {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 6px;
}

.audit-issue-url {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.audit-issue-url:hover {
    text-decoration: underline;
}

.audit-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
    gap: 12px;
}

.audit-empty-icon {
    font-size: 36px;
    opacity: 0.4;
}

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

/* --- Responsive (1280px+) --- */
@media (max-width: 1400px) {
    .dashboard-grid {
        gap: 12px;
        padding: 16px;
    }

    .input-url {
        width: 260px;
    }

    .audit-stats {
        flex-wrap: wrap;
    }
}

/* ============================================
   Shared — Nav Links, Page Layout, History, Login
   ============================================ */

/* --- Nav Links (history topnav) --- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-glow);
}

/* --- Page Content --- */
.page-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
    letter-spacing: -0.3px;
}

/* --- Section --- */
.section {
    margin-bottom: 40px;
}

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

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--radius-pill);
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
}

/* --- Table Card --- */
.table-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-tertiary);
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    background: var(--bg);
}

.history-table tbody tr {
    transition: background var(--transition);
    cursor: pointer;
}

.history-table tbody tr:hover {
    background: var(--card-hover);
}

.history-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.history-table td {
    padding: 12px 16px;
    font-size: 13px;
    vertical-align: middle;
}

.url-cell {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-cell {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.id-cell {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* --- Status Badge --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-completed {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
}
.status-completed::before { background: var(--success); }

.status-failed {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
}
.status-failed::before { background: var(--danger); }

.status-running {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning);
}
.status-running::before {
    background: var(--warning);
    animation: dotPulse 1.4s ease-in-out infinite;
}

.status-pending {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-tertiary);
}
.status-pending::before { background: var(--text-tertiary); }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 56px 24px;
}

.empty-state-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.empty-state-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.empty-state-text a:hover {
    text-decoration: underline;
}

/* --- Loading Skeleton --- */
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
}

.skeleton-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* Persona skeleton card */
.skeleton-persona {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.skeleton-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-2) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 8px 0 4px;
    margin: 0;
}

.skeleton-bar {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-2) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* --- Error Banner --- */
.error-banner {
    padding: 12px 20px;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 24px;
    display: none;
}

/* --- Fade In Animation --- */
@keyframes fadeInUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeInUp 0.3s ease forwards;
}

/* --- Login Page --- */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.brand-icon svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.brand p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn-google:hover {
    background: var(--surface-1);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.btn-google:active {
    background: var(--surface-2);
}

.btn-google svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.divider span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-magic {
    width: 100%;
    padding: 11px 16px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

.btn-magic:hover {
    opacity: 0.92;
}

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

.btn-magic:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.message {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: none;
}

.message.success {
    display: block;
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.message.error {
    display: block;
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* --- Responsive — Login --- */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 16px;
    }

    .login-card {
        padding: 24px;
    }

    .brand h1 {
        font-size: 20px;
    }
}

/* --- Responsive — History --- */
@media (max-width: 768px) {
    .page-content { padding: 20px 16px; }
    .url-cell { max-width: 200px; }
    .topnav { padding: 10px 16px; }
}

/* === LAUNCH CONFIRMATION MODAL === */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 8500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.confirm-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 380px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.confirm-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.confirm-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.confirm-preview {
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 20px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 0;
}

.confirm-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.confirm-label { color: var(--text-secondary); }
.confirm-value { font-weight: 600; color: var(--text-primary); }

.confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.confirm-btn.secondary {
    background: var(--surface-2);
    color: var(--text-secondary);
}

.confirm-btn.secondary:hover { background: var(--border-light); }

.confirm-btn.primary {
    background: var(--accent);
    color: white;
}

.confirm-btn.primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* === WELCOME MODAL === */
.welcome-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.welcome-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease;
}

.welcome-logo {
    font-size: 36px;
    margin-bottom: 8px;
}

.welcome-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

.welcome-steps {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.welcome-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
}

.welcome-step-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.welcome-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.welcome-btn {
    padding: 10px 32px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.welcome-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* === HISTORY CARDS === */
.history-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.history-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.history-type-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.history-type-icon.sim { background: rgba(13, 148, 136, 0.1); }
.history-type-icon.audit { background: rgba(124, 58, 237, 0.1); }

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

.history-card-url {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-card-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 3px;
}

.history-avatars {
    display: flex;
    flex-shrink: 0;
}

.history-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: white;
    margin-left: -6px;
}

.history-avatar:first-child { margin-left: 0; }

/* ============================================
   Wizard — Split Layout with Context Panel
   ============================================ */

.wizard-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    background: var(--bg);
    background-image: var(--bg-gradient-1), var(--bg-gradient-2);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.wizard-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 32px;
    gap: 48px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

/* --- Context Panel (left) --- */
.wizard-context {
    padding-top: 16px;
}

.wizard-context-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 24px;
}

.wizard-context-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wizard-context-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

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

.wizard-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeInUp 0.5s ease both;
}

.wizard-feature:nth-child(1) { animation-delay: 0.1s; }
.wizard-feature:nth-child(2) { animation-delay: 0.2s; }
.wizard-feature:nth-child(3) { animation-delay: 0.3s; }
.wizard-feature:nth-child(4) { animation-delay: 0.4s; }

.wizard-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}

.wizard-feature-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.wizard-feature-text span {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.wizard-recent {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.wizard-recent-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

/* --- Wizard Card (right) --- */
.wizard-card-wrap {
    animation: scaleIn 0.4s ease both;
    animation-delay: 0.1s;
}

.wizard-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl, var(--radius-lg));
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

/* Signature: animated gradient top bar */
.wizard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-end), var(--accent));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

/* Step Bar */
.wizard-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 32px 24px 0;
}

.wizard-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.wizard-step-indicator.active {
    color: var(--text-primary);
}

.wizard-step-indicator.done {
    color: var(--accent);
}

.wizard-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--card-bg);
    transition: all 0.3s ease;
}

.wizard-step-indicator.active .wizard-step-num {
    border-color: var(--accent);
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 0 0 4px var(--accent-glow);
    animation: pulseRing 2s ease infinite;
}

.wizard-step-indicator.done .wizard-step-num {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.wizard-step-line {
    width: 48px;
    height: 2px;
    background: var(--card-border);
    margin: 0 12px;
    border-radius: 1px;
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wizard-step-line.done {
    background: var(--accent);
}

.wizard-step-line.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    background: var(--accent-gradient);
    border-radius: 1px;
}

/* Panels */
.wizard-panel {
    padding: 32px 28px;
    min-height: 200px;
}

.wizard-panel-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

/* Mode Cards — confident selection */
.wizard-mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.wizard-mode-card {
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    background: var(--card-bg);
}

.wizard-mode-card:hover {
    border-color: var(--card-border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wizard-mode-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(13,148,136,0.04) 0%, rgba(6,182,212,0.04) 100%);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px) scale(1.01);
}

.wizard-mode-card.selected::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gradient);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    animation: checkPop 0.3s var(--spring);
}

.wizard-mode-cards:has(.wizard-mode-card.selected) .wizard-mode-card:not(.selected) {
    opacity: 0.6;
}

.wizard-mode-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: all 0.25s ease;
}

.wizard-mode-card:nth-child(1) .wizard-mode-icon {
    background: rgba(13,148,136,0.08);
    color: var(--accent);
}

.wizard-mode-card:nth-child(2) .wizard-mode-icon {
    background: rgba(99,102,241,0.08);
    color: #6366f1;
}

.wizard-mode-card.selected .wizard-mode-icon {
    transform: scale(1.05);
}

.wizard-mode-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wizard-mode-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* URL input with icon */
.wizard-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.wizard-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition);
}

.wizard-input-wrap .wizard-input {
    padding-left: 42px;
}

.wizard-input-wrap:focus-within .wizard-input-icon {
    color: var(--accent);
}

.wizard-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 0 0 0px transparent;
    transition: all 0.25s ease;
}

.wizard-input::placeholder {
    color: var(--text-tertiary);
    font-family: var(--font-body);
}

.wizard-input:focus {
    border-color: var(--accent);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 0 0 1px var(--accent);
}

.wizard-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-bg), 0 0 0 1px var(--danger);
}

/* Pro Tip */
.wizard-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(13,148,136,0.04);
    border: 1px solid rgba(13,148,136,0.08);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 20px;
}

.wizard-tip-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Wizard select (keep for step 2) */
.wizard-select {
    width: 100%;
    padding: 10px 16px;
    padding-right: 36px;
    background: var(--bg);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color var(--transition);
}

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

.wizard-field {
    margin-bottom: 14px;
}

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

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

.wizard-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.wizard-note {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.wizard-review .confirm-preview {
    margin: 0;
}

/* Footer */
.wizard-footer {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    border-top: 1px solid var(--card-border);
    background: rgba(246,247,249,0.5);
    gap: 12px;
}

.wizard-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.wizard-btn-back:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text-primary);
}

.wizard-progress-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
}

.wizard-progress {
    flex: 1;
    height: 4px;
    background: var(--card-border);
    border-radius: 2px;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    width: 33%;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    animation: gradientShift 2s ease infinite;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.wizard-btn-next,
.wizard-btn-launch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 2px 12px rgba(13,148,136,0.3);
}

.wizard-btn-next:hover,
.wizard-btn-launch:hover {
    box-shadow: 0 4px 20px rgba(13,148,136,0.4);
    transform: translateY(-1px);
}

.wizard-btn-next:active,
.wizard-btn-launch:active {
    transform: translateY(0) scale(0.98);
}

.wizard-btn-next:disabled,
.wizard-btn-launch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive: hide context panel on smaller screens */
@media (max-width: 1024px) {
    .wizard-layout {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 24px;
    }
    .wizard-context { display: none; }
}

@media (max-width: 768px) {
    .wizard-overlay {
        padding-bottom: 64px; /* clear bottom tab bar */
    }

    .wizard-layout {
        padding: 16px;
        gap: 16px;
    }

    .wizard-card {
        border-radius: var(--radius-lg);
    }

    .wizard-steps-bar {
        padding: 24px 16px 0;
    }

    .wizard-step-indicator span:not(.wizard-step-num) {
        display: none; /* hide step labels, show only numbers */
    }

    .wizard-step-line {
        width: 32px;
        margin: 0 8px;
    }

    .wizard-panel {
        padding: 20px 16px;
        min-height: 160px;
    }

    .wizard-panel-title {
        font-size: 17px;
        margin-bottom: 16px;
    }

    .wizard-mode-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .wizard-mode-card {
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .wizard-mode-icon {
        width: 40px;
        height: 40px;
        margin: 0;
        flex-shrink: 0;
    }

    .wizard-mode-card.selected::after {
        top: 8px;
        right: 8px;
        width: 18px;
        height: 18px;
    }

    .wizard-footer {
        padding: 12px 16px;
        gap: 8px;
    }

    .wizard-btn-next,
    .wizard-btn-launch {
        padding: 10px 20px;
        font-size: 13px;
    }

    .wizard-progress-label {
        display: none; /* progress bar is enough on mobile */
    }

    .wizard-tip {
        margin-top: 16px;
    }
}

/* "New Simulation" button in toolbar */
.btn-new-sim {
    padding: 6px 14px;
    font-size: 12px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet: 2-column grid */
@media (max-width: 1280px) {
    .sidebar { width: 56px; }
    .app-main { margin-left: 56px; }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .card-issues { grid-column: 1; grid-row: 1; }
    .card-funnel { grid-column: 2; grid-row: 1; }
    .card-personas { grid-column: 1 / -1; grid-row: 2; }

    .persona-cards {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        max-height: none;
    }

    .input-url { width: 240px; }
}

/* Mobile: bottom tab bar + single column */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 56px;
        flex-direction: row;
        justify-content: space-around;
        border-right: none;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        padding: 0 8px;
        z-index: 200;
    }

    .sidebar-logo { display: none; }
    .sidebar-spacer { display: none; }
    .sidebar-avatar { display: none; }
    .sidebar-plan { display: none; }

    .sidebar-nav {
        flex-direction: row;
        gap: 0;
        width: 100%;
        justify-content: space-around;
    }

    .sidebar-icon[title]::after { display: none; }

    .app-main {
        margin-left: 0;
        padding-bottom: 64px;
    }

    .topnav {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 16px;
    }

    .topnav-right { flex-shrink: 1; flex-wrap: wrap; justify-content: flex-end; }
    .topnav-center { order: 3; width: 100%; }
    .topnav-center .control-group { flex-wrap: wrap; width: 100%; }
    .input-url { width: 100%; }
    html { overflow-x: hidden; }

    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 12px 12px;
        gap: 12px;
        min-height: auto;
    }

    .card-issues { grid-column: 1; grid-row: 1; max-height: 400px; }
    .card-funnel { grid-column: 1; grid-row: 2; }
    .card-personas { grid-column: 1; grid-row: 3; }

    .persona-cards { grid-template-columns: 1fr; }

    .bottom-panel { margin: 0 12px; }

    .tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-content { padding: 20px 16px; }
    .scorecard-grid { grid-template-columns: repeat(2, 1fr); }
    .success-banner { left: 0; }
}

/* === VIDEO PLAYBACK MODAL === */
.video-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.video-modal {
    background: #1a1b1e;
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 900px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    animation: scaleIn 0.25s ease;
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #2d2e32;
}

.video-modal-title {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
}

.video-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.video-speed-controls {
    display: flex;
    gap: 4px;
}

.video-speed-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.video-speed-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

.video-speed-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.video-modal video {
    width: 100%;
    display: block;
}

/* --- Video Gallery Tab --- */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 4px;
}

.video-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.video-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.video-card-preview {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 32px 16px;
    cursor: pointer;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.video-card-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: background var(--transition);
}

.video-card-preview:hover .video-card-play {
    background: var(--accent);
}

.video-card-persona {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 600;
}

.video-card-info {
    padding: 12px 14px;
}

.video-card-funnel {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.video-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Wizard Persona Selection --- */
#wizard-persona-grid {
    min-height: 120px;
}

.wizard-persona-loading {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wizard-persona-loading p {
    margin-top: 12px;
    font-size: 13px;
}

.wizard-site-summary {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface-hover, rgba(255,255,255,0.04));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.wizard-site-summary .wss-icon {
    flex-shrink: 0;
    color: var(--accent, #0d9488);
    margin-top: 1px;
}
.wizard-site-summary .wss-text {
    flex: 1;
}

.wizard-persona-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.wizard-persona-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    max-height: 450px;
    overflow-y: auto;
}

.wizard-persona-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.wizard-persona-card:hover {
    border-color: var(--border-medium);
    background: rgba(0,0,0,0.015);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.wizard-persona-card.selected {
    border-color: var(--accent);
    background: rgba(13, 148, 136, 0.04);
}

.wizard-persona-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    flex-shrink: 0;
    transition: all var(--transition);
    background: white;
}

.wizard-persona-card.selected .wizard-persona-check {
    background: var(--accent);
    border-color: var(--accent);
}

.wizard-persona-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wizard-persona-header-text {
    flex: 1;
    min-width: 0;
}

.wizard-persona-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.wizard-persona-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.wizard-persona-style {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
}

.wizard-persona-goal {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.wizard-persona-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}

.wp-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary);
    white-space: nowrap;
}

.wizard-persona-personality {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
    line-height: 1.3;
}

.wizard-persona-count {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 12px;
}

.wizard-persona-intent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin: 4px 0;
}

.wizard-persona-intent:hover {
    transform: scale(1.05);
}

.intent-cycle-hint {
    font-size: 9px;
    opacity: 0.5;
    margin-left: 2px;
}

/* ---------------------------------------------------------------------------
   CRO Advisor Chat Panel
   --------------------------------------------------------------------------- */

.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(13, 148, 136, 0.35);
    transition: all 0.25s ease;
    z-index: 1000;
}

.chat-fab:hover {
    box-shadow: 0 6px 32px rgba(13, 148, 136, 0.45);
    transform: translateY(-2px);
}

.chat-fab svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg);
}

.chat-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.chat-panel.open {
    display: flex;
}

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

.chat-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-panel-context {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.chat-panel-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.chat-panel-close:hover {
    color: var(--text-primary);
    background: var(--bg);
}

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

.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-msg-user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

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

.chat-msg-assistant h1, .chat-msg-assistant h2, .chat-msg-assistant h3 {
    margin: 12px 0 6px;
    font-size: 14px;
    font-weight: 700;
}
.chat-msg-assistant h1 { font-size: 16px; }
.chat-msg-assistant h2 { font-size: 15px; }

.chat-msg-assistant ul, .chat-msg-assistant ol {
    padding-left: 18px;
    margin: 6px 0;
}

.chat-msg-assistant code {
    background: rgba(0,0,0,0.06);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12.5px;
}

.chat-msg-assistant pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
}

.chat-msg-assistant pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.chat-msg-assistant strong {
    font-weight: 700;
}

.chat-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

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

.chat-starters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px 16px;
}

.chat-starter {
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition), color var(--transition);
    font-family: var(--font-body);
}

.chat-starter:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--card-border);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition);
    background: var(--bg);
    color: var(--text-primary);
}

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

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.chat-send {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.chat-send:hover {
    background: var(--accent);
    filter: brightness(0.9);
    transform: scale(1.05);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 70px;
        height: 60vh;
    }
    .chat-fab span { display: none; }
    .chat-fab { padding: 14px; }
}

/* --- Custom Persona Form --- */
.wizard-persona-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.wizard-add-persona-btn {
    background: none;
    border: 2px dashed var(--card-border);
    border-radius: var(--radius-sm);
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition);
}

.wizard-add-persona-btn:hover {
    border-color: var(--accent);
    background: rgba(13, 148, 136, 0.04);
}

.custom-persona-form {
    background: var(--card-bg);
    border: 2px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 12px;
}

.cpf-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.cpf-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.cpf-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-3);
}

.cpf-input:focus {
    outline: none;
    border-color: var(--accent);
}

.cpf-short {
    flex: 0 0 80px;
}

.cpf-full {
    width: 100%;
    margin-bottom: 8px;
}

.cpf-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.cpf-cancel {
    padding: 6px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.cpf-add {
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.cpf-add:hover {
    opacity: 0.9;
}

/* --- Chat Panel Tabs --- */
.chat-panel-tabs {
    display: flex;
    gap: 0;
}

.chat-tab {
    padding: 6px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}

.chat-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.chat-tab:hover:not(.active) {
    color: var(--text-primary);
}

.chat-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Feedback Form --- */
.feedback-form {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.feedback-greeting {
    margin-bottom: 16px;
}

.feedback-greeting strong {
    font-size: 14px;
    color: var(--text-primary);
}

.feedback-greeting p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.feedback-field {
    margin-bottom: 12px;
}

.feedback-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.feedback-select,
.feedback-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-3);
    resize: vertical;
}

.feedback-select:focus,
.feedback-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.feedback-dropzone {
    border: 2px dashed var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.feedback-dropzone:hover {
    border-color: var(--accent);
    background: rgba(13, 148, 136, 0.03);
}

.feedback-submit {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.feedback-submit:hover {
    opacity: 0.9;
}

.feedback-status {
    text-align: center;
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
}

.feedback-status.success { color: var(--success); }
.feedback-status.error { color: var(--danger); }
