        :root {
            --bg-dark: #0f0f1a;
            --bg-card: #1a1a2e;
            --bg-input: #252540;
            --accent: #e94560;
            --accent-hover: #ff6b6b;
            --text: #eaeaea;
            --text-dim: #888;
            --success: #4ade80;
            --warning: #fbbf24;
            --error: #f87171;
            --error-strong: #ef4444;
            --error-dark: #dc2626;
            --warning-dim: #f59e0b;
            --info: #3b82f6;
            --info-light: #60a5fa;
            --accent-violet: #8b5cf6;
            --border: #333;
            /* Email semantic colors */
            --email-urgent: #f38ba8;
            --email-action: #f9e2af;
            --email-info: #89b4fa;
            --email-vip: #fbbf24;
            --email-flag: #f87171;
            --email-learned: #4ade80;
            --email-sent: #a6e3a1;
        }
        
        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-dark);
            color: var(--text);
            min-height: 100vh;
        }
        
        /* Layout */
        .app {
            display: grid;
            grid-template-columns: 240px 1fr 320px;
            grid-template-rows: 64px 1fr;
            height: 100vh;
        }
        
        @media (max-width: 1200px) {
            .app { grid-template-columns: 240px 1fr; }
            .right-panel { display: none; }
        }
        
        @media (max-width: 768px) {
            .app { grid-template-columns: 1fr; }
            .sidebar { display: none; }
            .modal { max-width: 95vw !important; margin: 8px; max-height: 90vh; overflow-y: auto; }
            .ws-overview-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 8px !important; }
            .ws-pipeline { grid-template-columns: 1fr !important; }
            .ws-pipeline-column { min-width: 0 !important; }
            .np-detail-panel { width: 100vw !important; max-width: 100vw !important; }
            .np-detail-actions { flex-direction: column; }
            .np-detail-actions .btn { width: 100%; justify-content: center; }
        }
        
        /* Header */
        header {
            grid-column: 1 / -1;
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
        }
        
        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 1.25rem;
            font-weight: 700;
        }
        
        .logo i { color: var(--accent); }
        
        .status-badge {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: var(--bg-input);
            border-radius: 20px;
            font-size: 0.875rem;
        }
        
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        /* Sidebar */
        .sidebar {
            background: var(--bg-card);
            border-right: 1px solid var(--border);
            padding: 20px 12px;
            overflow-y: auto;
            min-height: 0;
        }
        
        .nav-section {
            margin-bottom: 8px;
        }
        .nav-section h4 {
            font-size: 0.7rem;
            text-transform: uppercase;
            color: var(--text-dim);
            padding: 8px 12px;
            margin-bottom: 0;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-radius: 6px;
            transition: background 0.15s;
            user-select: none;
        }
        .nav-section h4:hover { background: rgba(255,255,255,0.04); }
        .nav-section h4::after {
            content: '\f078'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
            font-size: 0.55rem; transition: transform 0.2s; color: var(--text-dim); opacity: 0.5;
        }
        .nav-section.collapsed h4::after { transform: rotate(-90deg); }
        .nav-section .nav-section-items {
            overflow: hidden; max-height: 2000px; transition: max-height 0.25s ease, opacity 0.2s;
            opacity: 1; padding-top: 4px;
        }
        .nav-section.collapsed .nav-section-items {
            max-height: 0; opacity: 0; padding-top: 0;
        }
        
        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            color: var(--text-dim);
        }
        
        .nav-item:hover {
            background: var(--bg-input);
            color: var(--text);
        }
        
        .nav-item.active {
            background: var(--accent);
            color: white;
        }
        
        .nav-item i { width: 20px; text-align: center; }
        
        /* Main content */
        main {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
        .panel {
            flex: 1;
            padding: 24px;
            overflow-y: auto;
            display: none;
        }
        
        .panel.active { display: block; }
        
        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }
        
        .panel-header h2 {
            font-size: 1.5rem;
        }

        .panel-intro {
            background: var(--bg-card);
            border-radius: 10px;
            padding: 14px 18px;
            margin-bottom: 16px;
            font-size: 0.9rem;
            line-height: 1.5;
            color: var(--text-dim);
            border-left: 3px solid var(--accent, #708090);
        }
        
        /* Chat */
        #chat-panel {
            display: none;
            flex-direction: column;
        }
        
        #chat-panel.active { display: flex; }
        
        .messages {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        
        .message {
            max-width: 75%;
            padding: 14px 18px;
            border-radius: 16px;
            line-height: 1.5;
        }
        
        .message.user {
            align-self: flex-end;
            background: var(--accent);
            border-bottom-right-radius: 4px;
        }
        
        .message.assistant {
            align-self: flex-start;
            background: var(--bg-card);
            border-bottom-left-radius: 4px;
            color: var(--familiar-voice, #e94560);
        }
        
        .message pre {
            background: var(--bg-dark);
            padding: 12px;
            border-radius: 8px;
            margin-top: 8px;
            overflow-x: auto;
            font-size: 0.875rem;
        }
        
        /* Old .chat-input-wrap, .chat-input, .send-btn removed — replaced by fi-bar/fi-input/fi-send */

        /* Panel inline chat */
        .panel-chat {
            border-top: 1px solid var(--border);
            margin-top: 16px;
            padding-top: 12px;
        }
        .panel-chat-messages {
            max-height: 300px;
            overflow-y: auto;
            display: none;
            flex-direction: column;
            gap: 10px;
            padding: 8px 0;
        }
        .panel-chat-messages.has-messages {
            display: flex;
        }
        /* Old .panel-chat-input-wrap, .panel-chat-input, .panel-chat-send removed — replaced by fi-bar/fi-input/fi-send */

        /* Briefing panel */
        .briefing-summary {
            background: var(--bg-card);
            border-left: 3px solid var(--accent);
            border-radius: 8px;
            padding: 14px 16px;
            margin-bottom: 14px;
            font-size: 0.95rem;
            line-height: 1.5;
        }
        .briefing-section {
            background: var(--bg-card);
            border-radius: 10px;
            margin-bottom: 10px;
            overflow: hidden;
        }
        .briefing-section-hdr {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--text-dim, #aaa);
            user-select: none;
        }
        .briefing-section-hdr .toggle { transition: transform 0.2s; font-size: 0.7rem; }
        .briefing-section-hdr.collapsed .toggle { transform: rotate(-90deg); }
        .briefing-section-hdr .badge {
            background: var(--accent);
            color: #fff;
            border-radius: 10px;
            padding: 1px 7px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-left: auto;
        }
        .briefing-section-hdr .link-btn {
            margin-left: auto;
            font-size: 0.8rem;
            color: var(--accent);
            cursor: pointer;
            font-weight: 500;
        }
        .briefing-section-body { padding: 0 14px 12px; }
        .briefing-section-body.hidden { display: none; }
        .briefing-event {
            padding: 8px 0;
            border-bottom: 1px solid var(--border, #333);
        }
        .briefing-event:last-child { border-bottom: none; }
        .briefing-event-time {
            font-size: 0.85rem;
            color: var(--accent);
            font-weight: 600;
        }
        .briefing-event-title { font-weight: 500; margin: 2px 0; }
        .briefing-event-meta {
            font-size: 0.8rem;
            color: var(--text-dim, #aaa);
            display: flex;
            gap: 12px;
            margin-top: 2px;
        }
        .briefing-event-actions {
            display: flex;
            gap: 6px;
            margin-top: 6px;
        }
        .briefing-action-btn {
            padding: 4px 10px;
            border: 1px solid var(--border, #444);
            border-radius: 6px;
            background: transparent;
            color: var(--text);
            font-size: 0.78rem;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .briefing-action-btn:hover {
            background: var(--bg-input, #2a2a2a);
            border-color: var(--accent);
        }
        .briefing-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .briefing-action-btn.sent { color: var(--success, #a6e3a1); border-color: var(--success, #a6e3a1); }
        .briefing-text-content {
            font-size: 0.9rem;
            line-height: 1.5;
            color: var(--text);
        }
        .briefing-timestamp {
            font-size: 0.78rem;
            color: var(--text-dim, #666);
            text-align: right;
            margin-top: 8px;
        }

        /* Cards */
        .card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 16px;
        }
        
        .card h3 {
            font-size: 0.875rem;
            color: var(--text-dim);
            margin-bottom: 12px;
        }
        
        .stat-row {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid var(--border);
        }
        
        .stat-row:last-child { border-bottom: none; }
        
        .stat-value { color: var(--accent); font-weight: 600; }
        
        /* Lists */
        .list-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 14px;
            background: var(--bg-card);
            border-radius: 10px;
            margin-bottom: 10px;
        }
        
        .list-item .icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: var(--bg-input);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        
        .list-item .content { flex: 1; }
        .list-item .title { font-weight: 500; }
        .list-item .meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }
        
        /* Skill badges */
        .skill-badge { font-size: 1rem; }
        .skill-connected { color: #4caf50; }
        .skill-setup { color: #ff9800; }
        .skill-optional { color: var(--text-dim); }

        /* Skill detail modal — extends .modal-overlay/.modal with higher z-index + scroll */
        .skill-modal-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.6);
            display: flex; align-items: center; justify-content: center; z-index: 9999;
        }
        .skill-modal {
            background: var(--bg-card); border-radius: 12px; padding: 20px;
            max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        }

        /* Task specific */
        .task-checkbox {
            width: 22px;
            height: 22px;
            border: 2px solid var(--accent);
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        
        .task-checkbox.done {
            background: var(--success);
            border-color: var(--success);
        }
        
        .task-checkbox.done i { color: white; }
        
        .priority-urgent { color: var(--error); }
        .priority-high { color: var(--warning); }
        .priority-normal { color: var(--success); }
        
        /* Toggle */
        .toggle {
            width: 48px;
            height: 26px;
            background: var(--bg-input);
            border-radius: 13px;
            cursor: pointer;
            position: relative;
            transition: background 0.3s;
        }
        
        .toggle.on { background: var(--success); }
        
        .toggle::after {
            content: '';
            position: absolute;
            width: 22px;
            height: 22px;
            background: white;
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: left 0.3s;
        }
        
        .toggle.on::after { left: 24px; }

        /* Color swatches (Familiar card) */
        .color-swatches { display:flex; flex-wrap:wrap; gap:6px; max-width:220px; }
        .color-swatch {
            width:22px; height:22px; border-radius:50%; cursor:pointer;
            border:2px solid transparent; transition:border-color 0.15s;
        }
        .color-swatch:hover { border-color: var(--text-dim); }
        .color-swatch.selected { border-color: var(--accent); box-shadow:0 0 0 2px var(--accent); }

        /* Job class cards */
        .jc-card {
            border: 2px solid var(--border); border-radius: 10px; padding: 14px;
            cursor: pointer; transition: all 0.2s; text-align: center;
        }
        .jc-card:hover { border-color: var(--accent); transform: translateY(-2px); }
        .jc-card.active { border-color: var(--accent); box-shadow: 0 0 12px rgba(99,102,241,0.3); }
        .jc-card .jc-icon { font-size: 1.8em; margin-bottom: 6px; }
        .jc-card .jc-name { font-weight: 700; font-size: 1em; }
        .jc-card .jc-desc { color: var(--text-dim); font-size: 0.8em; margin-top: 4px; }

        /* Workspace panel */
        .workspace-tabs { display:flex; gap:4px; padding:8px 16px; border-bottom:1px solid var(--border); overflow-x:auto; }
        .workspace-tab { padding:8px 16px; border-radius:6px 6px 0 0; cursor:pointer; font-size:0.85rem; color:var(--text-dim); border:1px solid transparent; border-bottom:none; white-space:nowrap; transition:all 0.2s; }
        .workspace-tab:hover { color:var(--text); background:var(--bg-input); }
        .workspace-tab.active { color:var(--accent); background:var(--bg-card); border-color:var(--border); font-weight:600; }
        .workspace-tab i { margin-right:6px; }
        .ws-overview-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:14px; padding:16px; }
        .ws-stat-card { background:var(--bg-input); border-radius:10px; padding:16px; cursor:pointer; transition:all 0.2s; border:1px solid var(--border); }
        .ws-stat-card:hover { transform:translateY(-2px); border-color:var(--accent); }
        .ws-stat-card .ws-stat-icon { font-size:1.4em; margin-bottom:8px; }
        .ws-stat-card .ws-stat-value { font-size:1.6em; font-weight:700; margin-bottom:4px; }
        .ws-stat-card .ws-stat-label { font-size:0.8rem; color:var(--text-dim); }
        /* CTA banner card — onboarding prompts */
        .ws-cta-card { grid-column:1 / -1; background:linear-gradient(135deg, var(--bg-input) 0%, color-mix(in srgb, var(--accent) 8%, var(--bg-input)) 100%); border:1px solid var(--accent); border-radius:12px; padding:24px 28px; display:flex; align-items:center; gap:20px; }
        .ws-cta-icon { font-size:2.2em; opacity:0.9; flex-shrink:0; }
        .ws-cta-body { flex:1; }
        .ws-cta-title { font-size:1.1em; font-weight:700; margin-bottom:6px; }
        .ws-cta-message { font-size:0.9rem; color:var(--text-dim); line-height:1.5; }
        .ws-cta-btn { padding:10px 22px; border-radius:8px; border:none; background:var(--accent); color:#fff; font-weight:600; font-size:0.9rem; cursor:pointer; white-space:nowrap; flex-shrink:0; transition:all 0.2s; }
        .ws-cta-btn:hover { filter:brightness(1.15); transform:translateY(-1px); }
        /* Service status card — inline service badges */
        .ws-svc-card { grid-column:1 / -1; background:var(--bg-input); border:1px solid var(--border); border-radius:12px; padding:16px 20px; }
        .ws-svc-title { font-size:0.85rem; font-weight:600; color:var(--text-dim); margin-bottom:10px; text-transform:uppercase; letter-spacing:0.5px; }
        .ws-svc-grid { display:flex; flex-wrap:wrap; gap:10px; }
        .ws-svc-badge { display:flex; align-items:center; gap:8px; padding:8px 14px; background:var(--bg); border:1px solid var(--border); border-radius:8px; font-size:0.85rem; transition:all 0.2s; }
        .ws-svc-badge.online { border-color:#22c55e40; }
        .ws-svc-badge.online:hover { border-color:#22c55e; background:color-mix(in srgb, #22c55e 5%, var(--bg)); }
        .ws-svc-badge.needs-setup { border-color:#f59e0b40; }
        .ws-svc-badge.needs-setup:hover { border-color:var(--warning-dim); background:color-mix(in srgb, #f59e0b 5%, var(--bg)); }
        .ws-svc-badge.offline { opacity:0.6; }
        .ws-svc-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
        .ws-svc-dot.green { background:#22c55e; box-shadow:0 0 6px #22c55e80; }
        .ws-svc-dot.amber { background:#f59e0b; box-shadow:0 0 6px #f59e0b80; }
        .ws-svc-dot.red { background:#ef4444; }
        .ws-svc-dot.gray { background:#6b7280; }
        .ws-svc-name { font-weight:500; }
        .ws-svc-url { font-size:0.75rem; color:var(--accent); text-decoration:none; margin-left:4px; }
        .ws-svc-url:hover { text-decoration:underline; }

        /* Setup Wizard cards */
        .swiz-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; padding:16px; }
        .swiz-card { background:var(--bg-input); border:1px solid var(--border); border-radius:10px; padding:18px; display:flex; flex-direction:column; gap:10px; }
        .swiz-card.swiz-done { opacity:0.6; }
        .swiz-card-head { display:flex; align-items:center; gap:10px; }
        .swiz-card-head i { font-size:1.3em; width:24px; text-align:center; }
        .swiz-card-head .swiz-name { font-weight:600; font-size:0.95rem; }
        .swiz-card-status { font-size:0.8rem; display:flex; align-items:center; gap:6px; }
        .swiz-card-status .swiz-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
        .swiz-card-status .swiz-dot.green { background:#4ade80; }
        .swiz-card-status .swiz-dot.red { background:#ef4444; }
        .swiz-card-cat { font-size:0.75rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.5px; }
        .swiz-card .btn { margin-top:auto; align-self:flex-start; font-size:0.8rem; padding:6px 14px; }
        .swiz-summary { padding:0 16px 8px; display:flex; gap:16px; font-size:0.85rem; color:var(--text-dim); }
        .swiz-summary b { color:var(--text); }
        .ws-table { width:100%; border-collapse:collapse; }
        .ws-table th { text-align:left; padding:10px 12px; font-size:0.8rem; color:var(--text-dim); border-bottom:2px solid var(--border); cursor:pointer; user-select:none; white-space:nowrap; }
        .ws-table th:hover { color:var(--text); }
        .ws-table th .sort-arrow { margin-left:4px; font-size:0.7em; }
        .ws-table td { padding:10px 12px; border-bottom:1px solid var(--border); font-size:0.9rem; }
        .ws-table tr:hover { background:var(--bg-input); }
        .ws-table .ws-badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:0.75rem; font-weight:600; background:var(--bg-dark); color:var(--accent); }
        .ws-table .ws-row-actions { display:flex; gap:6px; }
        .ws-table .ws-row-action { padding:4px 10px; border-radius:4px; border:1px solid var(--border); background:var(--bg-dark); color:var(--text-dim); cursor:pointer; font-size:0.75rem; transition:all 0.15s; }
        .ws-table .ws-row-action:hover { border-color:var(--accent); color:var(--accent); }
        .ws-table .ws-row-action i { margin-right:4px; }
        .ws-pipeline { display:flex; gap:12px; padding:16px; overflow-x:auto; min-height:200px; }
        .ws-pipeline-column { flex:1; min-width:180px; background:var(--bg-input); border-radius:8px; padding:10px; }
        .ws-pipeline-column h4 { font-size:0.8rem; color:var(--text-dim); text-transform:capitalize; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid var(--border); }
        .ws-pipeline-column h4 .ws-count { background:var(--bg-dark); border-radius:10px; padding:1px 7px; font-size:0.7rem; margin-left:6px; }
        .ws-pipeline-card { background:var(--bg-card); border:1px solid var(--border); border-radius:6px; padding:10px; margin-bottom:8px; }
        .ws-pipeline-card .ws-card-title { font-weight:600; font-size:0.85rem; margin-bottom:4px; }
        .ws-pipeline-card .ws-card-subtitle { font-size:0.75rem; color:var(--text-dim); }
        .ws-pipeline-card .ws-card-badge { display:inline-block; margin-top:6px; padding:2px 8px; border-radius:4px; font-size:0.75rem; font-weight:600; background:var(--bg-dark); color:var(--success); }
        .ws-empty { text-align:center; padding:40px 20px; color:var(--text-dim); font-size:0.9rem; }
        .ws-action-bar { display:flex; gap:8px; padding:12px 16px; flex-wrap:wrap; }
        .ws-action-bar button { padding:6px 14px; border-radius:6px; border:1px solid var(--border); background:var(--bg-input); color:var(--text); cursor:pointer; font-size:0.8rem; transition:all 0.15s; }
        .ws-action-bar button:hover { border-color:var(--accent); color:var(--accent); }
        .ws-action-bar button i { margin-right:6px; }
        .ws-section-wrap { padding:0 16px 16px; }

        /* Donor detail slide-out panel */
        .np-detail-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:90; display:none; }
        .np-detail-overlay.show { display:block; }
        .np-detail-panel { position:fixed; top:0; right:-480px; width:460px; max-width:90vw; height:100vh; background:var(--bg-secondary); border-left:1px solid var(--border); z-index:91; transition:right 0.3s ease; overflow-y:auto; padding:0; }
        .np-detail-panel.show { right:0; }
        .np-detail-header { display:flex; align-items:center; justify-content:space-between; padding:20px 24px 16px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg-secondary); z-index:1; }
        .np-detail-header h3 { margin:0; font-size:1.2rem; }
        .np-detail-close { background:none; border:none; color:var(--text-dim); font-size:1.4rem; cursor:pointer; padding:4px 8px; }
        .np-detail-close:hover { color:var(--text); }
        .np-detail-body { padding:20px 24px; }
        .np-detail-section { margin-bottom:24px; }
        .np-detail-section h4 { font-size:0.85rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.05em; margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid var(--border); }
        .np-detail-field { display:flex; justify-content:space-between; padding:6px 0; font-size:0.9rem; }
        .np-detail-field .np-field-label { color:var(--text-dim); }
        .np-detail-field .np-field-value { font-weight:500; text-align:right; max-width:60%; }
        .np-detail-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
        .np-detail-tag { display:inline-block; padding:2px 10px; border-radius:12px; font-size:0.75rem; background:rgba(96,165,250,0.15); color:#60a5fa; }
        .np-timeline { list-style:none; padding:0; margin:0; position:relative; padding-left:20px; }
        .np-timeline::before { content:''; position:absolute; left:6px; top:0; bottom:0; width:2px; background:var(--border); }
        .np-timeline li { position:relative; padding:8px 0 8px 12px; font-size:0.85rem; }
        .np-timeline li::before { content:''; position:absolute; left:-17px; top:12px; width:10px; height:10px; border-radius:50%; background:var(--accent); border:2px solid var(--bg-secondary); }
        .np-timeline .np-tl-date { font-size:0.75rem; color:var(--text-dim); }
        .np-timeline .np-tl-gift::before { background:#4ade80; }
        .np-timeline .np-tl-thanks::before { background:#fbbf24; }
        .np-timeline .np-tl-call::before, .np-timeline .np-tl-meeting::before { background:#60a5fa; }
        .np-detail-actions { display:flex; gap:8px; flex-wrap:wrap; padding:16px 24px; border-top:1px solid var(--border); position:sticky; bottom:0; background:var(--bg-secondary); }

        /* Media panel */
        .media-tab-bar { display:flex; gap:4px; padding:8px 16px; border-bottom:1px solid var(--border); }
        .media-tab { padding:8px 16px; border-radius:6px 6px 0 0; cursor:pointer; font-size:0.85rem; color:var(--text-dim); border:1px solid transparent; border-bottom:none; white-space:nowrap; transition:all 0.2s; }
        .media-tab:hover { color:var(--text); background:var(--bg-input); }
        .media-tab.active { color:var(--accent); background:var(--bg-card); border-color:var(--border); font-weight:600; }
        .media-tab i { margin-right:6px; }
        .media-search-bar { display:flex; gap:8px; padding:12px 16px; flex-wrap:wrap; align-items:center; }
        .media-search-bar input { flex:1; min-width:140px; padding:8px 12px; border-radius:6px; border:1px solid var(--border); background:var(--bg-input); color:var(--text); font-size:0.9rem; }
        .media-search-bar select { padding:8px 12px; border-radius:6px; border:1px solid var(--border); background:var(--bg-input); color:var(--text); font-size:0.9rem; cursor:pointer; }
        .media-search-bar button { padding:8px 16px; border-radius:6px; border:none; background:var(--accent); color:#fff; cursor:pointer; font-size:0.9rem; font-weight:600; transition:background 0.2s; }
        .media-search-bar button:hover { background:var(--accent-hover); }
        .media-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:12px; padding:12px 16px; }
        .media-card { display:flex; gap:12px; padding:12px; background:var(--bg-input); border-radius:8px; border:1px solid var(--border); transition:all 0.2s; cursor:default; }
        .media-card:hover { border-color:var(--accent); }
        .media-card.playing { border-color:var(--success); box-shadow:0 0 8px rgba(74,222,128,0.2); }
        .media-card-art { width:56px; height:56px; border-radius:6px; background:var(--bg-dark); display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
        .media-card-art img { width:100%; height:100%; object-fit:cover; }
        .media-card-art i { font-size:1.4em; color:var(--text-dim); }
        .media-card-info { flex:1; min-width:0; }
        .media-card-info h4 { font-size:0.9rem; margin:0 0 4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .media-card-info p { font-size:0.75rem; color:var(--text-dim); margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .media-card-actions { display:flex; flex-direction:column; gap:6px; align-items:center; justify-content:center; }
        .media-card-actions button { width:32px; height:32px; border-radius:50%; border:1px solid var(--border); background:var(--bg-dark); color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all 0.15s; font-size:0.8rem; }
        .media-card-actions button:hover { border-color:var(--accent); color:var(--accent); }
        .media-card-actions button.fav-active { color:var(--accent); border-color:var(--accent); }
        .media-card-actions .play-btn:hover { border-color:var(--success); color:var(--success); }
        .episode-list { padding:0 16px 16px; }
        .episode-item { display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px solid var(--border); font-size:0.85rem; }
        .episode-item:hover { background:var(--bg-input); }
        .episode-item .ep-play { width:28px; height:28px; border-radius:50%; border:1px solid var(--border); background:var(--bg-dark); color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:0.7rem; }
        .episode-item .ep-play:hover { border-color:var(--success); color:var(--success); }
        .episode-item .ep-title { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .episode-item .ep-meta { font-size:0.75rem; color:var(--text-dim); white-space:nowrap; }
        .media-section-header { padding:12px 16px 4px; font-size:0.8rem; font-weight:600; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.5px; }

        /* Webamp container */
        #webamp-container { position:fixed; bottom:20px; right:20px; z-index:1000; }
        #webamp-container > div { position:relative !important; }

        /* Music library tab */
        .music-dropzone { margin:0 16px; padding:24px; border:2px dashed var(--border); border-radius:8px; text-align:center; color:var(--text-dim); cursor:pointer; transition:all 0.2s; }
        .music-dropzone.drag-over { border-color:var(--accent); background:rgba(233,69,96,0.05); }
        .music-dropzone i { font-size:2rem; margin-bottom:8px; }
        .music-track-duration { font-size:0.75rem; color:var(--text-dim); }
        .music-upload-progress { padding:8px 16px; font-size:0.8rem; color:var(--text-dim); display:none; }

        /* Webamp launcher card in sidebar */
        #webamp-launcher { transition:all 0.2s; }
        #webamp-launcher:hover { border-color:var(--accent); }

        /* Right panel */
        .right-panel {
            background: var(--bg-card);
            border-left: 1px solid var(--border);
            padding: 20px;
            overflow-y: auto;
        }
        .right-panel .card h3 {
            cursor: pointer; user-select: none; display: flex;
            align-items: center; justify-content: space-between;
        }
        .right-panel .card h3::after {
            content: '\f078'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
            font-size: 0.55rem; transition: transform 0.2s; color: var(--text-dim); opacity: 0.5;
        }
        .right-panel .card h3:hover { opacity: 0.85; }
        .right-panel .card.rp-collapsed h3::after { transform: rotate(-90deg); }
        .right-panel .card .rp-body {
            overflow: hidden; max-height: 500px; transition: max-height 0.25s ease, opacity 0.2s;
            opacity: 1;
        }
        .right-panel .card.rp-collapsed .rp-body { max-height: 0; opacity: 0; }

        /* Node item */
        .node-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: var(--bg-input);
            border-radius: 8px;
            margin-bottom: 8px;
        }
        
        .node-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--success);
        }
        
        .node-dot.offline { background: var(--error); }

        /* Mesh panel */
        .mesh-section { margin-bottom: 20px; }
        .mesh-section h3 { margin-bottom: 12px; font-size: 1rem; }
        .mesh-transport-row {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 14px; background: var(--bg-input); border-radius: 8px;
            margin-bottom: 6px; font-size: 0.9rem;
        }
        .mesh-transport-dot {
            width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
        }
        .mesh-transport-dot.green { background: var(--success); }
        .mesh-transport-dot.yellow { background: #f59e0b; }
        .mesh-transport-dot.red { background: var(--error); }
        .mesh-transport-row .label { flex: 1; font-weight: 500; }
        .rdv-server-item {
            display: flex; align-items: center; gap: 8px; padding: 5px 0;
            border-bottom: 1px solid var(--border);
        }
        .rdv-server-url { flex: 1; font-size: 0.82rem; font-family: monospace; }
        .mesh-transport-row .detail { color: var(--text-dim); font-size: 0.8rem; margin-right: 8px; }
        .mesh-node-card {
            display: flex; align-items: center; gap: 12px;
            padding: 12px; background: var(--bg-input); border-radius: 8px; margin-bottom: 8px;
        }
        .mesh-node-card .icon { font-size: 1.2rem; color: var(--text-dim); }
        .mesh-node-card .info { flex: 1; }
        .mesh-node-card .info .name { font-weight: 500; }
        .mesh-node-card .info .meta { font-size: 0.8rem; color: var(--text-dim); }
        .trust-badge {
            display: inline-block; padding: 2px 8px; border-radius: 10px;
            font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
        }
        .trust-badge.trusted { background: rgba(34,197,94,0.15); color: var(--success); }
        .trust-badge.pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
        .trust-badge.blocked { background: rgba(239,68,68,0.15); color: var(--error); }
        .trust-badge.unknown { background: rgba(148,163,184,0.15); color: var(--text-dim); }
        .mesh-onion-addr {
            font-family: monospace; font-size: 0.75rem; word-break: break-all;
            padding: 6px 10px; background: var(--bg-input); border-radius: 6px;
            cursor: pointer; user-select: all;
        }
        .mesh-verification-code {
            font-family: monospace; font-size: 1.4rem; letter-spacing: 4px;
            text-align: center; padding: 8px; color: var(--accent);
        }
        .mesh-perm-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 6px 0; font-size: 0.85rem; border-bottom: 1px solid var(--border);
        }
        .mesh-perm-row:last-child { border-bottom: none; }
        .mesh-dross-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
        }
        .mesh-dross-stat {
            padding: 12px; background: var(--bg-input); border-radius: 8px; text-align: center;
        }
        .mesh-dross-stat .value { font-size: 1.3rem; font-weight: 600; }
        .mesh-dross-stat .label { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }
        .mesh-toggle {
            position: relative; width: 36px; height: 20px; cursor: pointer;
        }
        .mesh-toggle input { opacity: 0; width: 0; height: 0; }
        .mesh-toggle .slider {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: var(--bg-input); border-radius: 10px; transition: 0.3s;
        }
        .mesh-toggle .slider::before {
            content: ''; position: absolute; width: 16px; height: 16px;
            left: 2px; bottom: 2px; background: var(--text-dim);
            border-radius: 50%; transition: 0.3s;
        }
        .mesh-toggle input:checked + .slider { background: var(--accent); }
        .mesh-toggle input:checked + .slider::before { transform: translateX(16px); background: #fff; }
        .mesh-topic-item {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 12px; background: var(--bg-input); border-radius: 6px;
            margin-bottom: 4px; font-size: 0.85rem;
        }
        .mesh-topic-item .topic-name { flex: 1; font-weight: 500; }
        .mesh-topic-item .topic-meta { color: var(--text-dim); font-size: 0.75rem; }
        .mesh-topic-item .topic-tag {
            display: inline-block; padding: 1px 6px; border-radius: 4px;
            background: rgba(99,102,241,0.12); color: var(--accent); font-size: 0.65rem;
            margin-left: 2px;
        }
        .mesh-topic-item .topic-words {
            font-size: 0.75rem; color: var(--text-dim); min-width: 60px; text-align: right;
        }
        .mesh-topic-item .topic-rev {
            font-size: 0.7rem; color: var(--text-dim); min-width: 30px; text-align: center;
        }
        .mesh-knowledge-header {
            display: flex; align-items: center; justify-content: space-between;
            margin: 14px 0 8px; cursor: pointer; user-select: none;
        }
        .mesh-knowledge-header h4 { margin: 0; font-size: 0.9rem; }
        .mesh-knowledge-header .count { font-size: 0.8rem; color: var(--text-dim); }
        .mesh-origin-badge {
            display: inline-block; padding: 1px 6px; border-radius: 4px;
            background: rgba(34,197,94,0.12); color: var(--success); font-size: 0.65rem;
        }

        /* Mesh Topology Map */
        #mesh-topology {
            width: 100%; min-height: 300px; background: var(--bg-input);
            border-radius: 12px; overflow: hidden; margin-bottom: 20px;
        }
        #mesh-topo-svg { width: 100%; height: 340px; display: block; }
        .topo-center-circle {
            fill: var(--accent); cursor: default;
            filter: url(#topo-glow);
        }
        .topo-center-label {
            fill: var(--text); font-size: 13px; font-weight: 600;
            text-anchor: middle; pointer-events: none;
        }
        .topo-center-sub {
            fill: var(--text-dim); font-size: 10px;
            text-anchor: middle; pointer-events: none;
        }
        .topo-peer-circle { cursor: pointer; transition: transform 0.2s; }
        .topo-peer-circle:hover { filter: url(#topo-glow); }
        .topo-peer-circle.trust-trusted { fill: var(--success); }
        .topo-peer-circle.trust-pending { fill: #f59e0b; }
        .topo-peer-circle.trust-blocked { fill: var(--error); }
        .topo-peer-circle.trust-unknown { fill: var(--text-dim); }
        .topo-peer-circle.stale { opacity: 0.4; }
        .topo-label {
            fill: var(--text); font-size: 11px;
            text-anchor: middle; pointer-events: none;
        }
        .topo-meta {
            fill: var(--text-dim); font-size: 9px;
            text-anchor: middle; pointer-events: none;
        }
        .topo-link { fill: none; stroke-linecap: round; }
        .topo-link.trust-trusted { stroke: var(--success); stroke-width: 2; }
        .topo-link.trust-pending { stroke: #f59e0b; stroke-width: 1.5; stroke-dasharray: 4 4; }
        .topo-link.trust-blocked { stroke: var(--error); stroke-width: 1; stroke-dasharray: 2 4; }
        .topo-link.trust-unknown { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 6 3; }
        .topo-link.stale { stroke-dasharray: 3 5; opacity: 0.4; }
        .topo-transport-icon {
            fill: var(--text-dim); font-size: 10px;
            text-anchor: middle; dominant-baseline: central; pointer-events: none;
        }
        .topo-empty-text {
            fill: var(--text-dim); font-size: 13px;
            text-anchor: middle; pointer-events: none;
        }
        .topo-highlight {
            border: 2px solid var(--accent) !important;
            transition: border-color 0.3s;
        }
        @keyframes topo-dash {
            to { stroke-dashoffset: -12; }
        }
        @keyframes topo-pulse {
            0%, 100% { opacity: 0.6; r: 40; }
            50% { opacity: 0.15; r: 55; }
        }
        @keyframes topo-ripple {
            0% { r: 40; opacity: 0.4; }
            100% { r: 120; opacity: 0; }
        }

        /* Mesh — extended classes */
        .mesh-btn-sm { padding: 4px 10px; font-size: 0.75rem; }
        .mesh-btn-md { padding: 6px 12px; font-size: 0.8rem; }
        .mesh-btn-lg { padding: 8px 14px; font-size: 0.82rem; }
        .mesh-btn-xs { padding: 2px 8px; font-size: 0.72rem; }
        .mesh-section-gap { margin-bottom: 12px; }
        .mesh-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
        .mesh-card-header .mesh-spacer { flex: 1; }
        .mesh-desc { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 10px; }
        .mesh-info { font-size: 0.75rem; color: var(--text-dim); }
        .mesh-info-pad { font-size: 0.75rem; color: var(--text-dim); padding: 4px 14px; }
        .mesh-label { font-size: 0.82rem; font-weight: 500; margin-bottom: 4px; }
        .mesh-input { flex: 1; padding: 6px 10px; font-size: 0.82rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary); color: var(--text); }
        .mesh-input-group { display: flex; gap: 6px; align-items: center; }
        .mesh-input-group + .mesh-input-group { margin-top: 8px; }
        .mesh-quickstart { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
        .mesh-community-badge { font-size: 0.7rem; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
        .mesh-status-box { margin-top: 10px; padding: 8px 12px; background: var(--bg-secondary); border-radius: 8px; font-size: 0.82rem; }
        .mesh-dross-table { width: 100%; margin-top: 12px; font-size: 0.85rem; }
        .mesh-dross-table th { text-align: left; padding: 4px 8px; }
        .mesh-dross-table th.right { text-align: right; }
        .mesh-dross-table td { padding: 4px 8px; }
        .mesh-dross-table td.right { text-align: right; }
        .mesh-dross-earned .value { color: var(--success); }
        .mesh-dross-spent .value { color: var(--error); }
        .mesh-hipaa-warning { margin-top: 8px; font-size: 0.8rem; color: #f59e0b; }
        .mesh-btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
        .mesh-name-label { font-size: 0.85rem; font-weight: 500; }
        .mesh-fingerprint { margin-bottom: 12px; font-size: 0.85rem; }
        .mesh-stale { color: var(--error); }

        /* Buttons */
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.2s;
        }
        
        .btn-primary {
            background: var(--accent);
            color: white;
        }
        
        .btn-primary:hover { background: var(--accent-hover); }
        
        .btn-secondary {
            background: var(--bg-input);
            color: var(--text);
        }
        
        .btn-secondary:hover { background: var(--border); }
        
        /* Inputs */
        input, select, textarea {
            padding: 12px 16px;
            border: none;
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text);
            font-size: 1rem;
            width: 100%;
        }
        
        input:focus, select:focus, textarea:focus {
            outline: 2px solid var(--accent);
        }
        
        /* Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 100;
        }
        
        .modal-overlay.show { display: flex; }
        
        .modal {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 24px;
            width: 90%;
            max-width: 500px;
        }
        
        .modal-sm { max-width: 440px; }
        .modal-md { max-width: 600px; }
        .modal-lg { max-width: 700px; }
        .modal-scroll { max-height: 85vh; overflow-y: auto; }
        .modal h3 { margin-bottom: 20px; }

        .modal .form-group {
            margin-bottom: 16px;
        }
        
        .modal .form-group label {
            display: block;
            margin-bottom: 6px;
            font-size: 0.875rem;
            color: var(--text-dim);
        }
        
        .modal .actions {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            margin-top: 24px;
        }
        
        /* Loading */
        .loading {
            text-align: center;
            padding: 40px;
            color: var(--text-dim);
        }
        
        .spinner {
            display: inline-block;
            width: 30px;
            height: 30px;
            border: 3px solid var(--bg-input);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Typing indicator */
        .typing-indicator {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 12px 16px;
            background: var(--bg-card);
            border-radius: 16px 16px 16px 4px;
            width: fit-content;
            margin: 8px 0;
            animation: fadeIn 0.3s ease;
        }
        .typing-indicator .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--text-dim);
            animation: bounce 1.2s infinite ease-in-out;
        }
        .typing-indicator .dot:nth-child(2) { animation-delay: 0.15s; }
        .typing-indicator .dot:nth-child(3) { animation-delay: 0.3s; }
        @keyframes bounce {
            0%, 60%, 100% { transform: translateY(0); }
            30% { transform: translateY(-8px); }
        }
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .activity-idle { color: var(--success); }
        .activity-processing { color: #f59e0b; animation: pulse 1.5s infinite; }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* Wizard card */
        .wizard-card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 16px;
        }

        .wizard-card-header {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 16px;
        }

        .wizard-tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 16px;
            border-bottom: 1px solid var(--border);
            padding-bottom: 8px;
        }

        .wizard-tab {
            padding: 8px 16px;
            border: none;
            border-radius: 8px 8px 0 0;
            background: transparent;
            color: var(--text-dim);
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        .wizard-tab:hover {
            background: var(--bg-input);
            color: var(--text);
        }

        .wizard-tab.active {
            background: var(--accent);
            color: white;
        }

        .wizard-tab-content {
            white-space: pre-line;
            line-height: 1.6;
            margin-bottom: 16px;
            font-size: 0.95rem;
        }

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

        .wizard-btn {
            padding: 10px 18px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text);
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

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

        .wizard-hat-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: transparent;
            border: 1px solid var(--accent);
            color: var(--accent);
            border-radius: 8px;
            padding: 8px 16px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.2s;
            margin-top: 12px;
        }
        .wizard-hat-btn:hover {
            background: var(--accent);
            color: white;
        }
        .wizard-hat-btn i {
            font-size: 1rem;
        }

        .wizard-text {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 16px 20px;
            margin-bottom: 12px;
            line-height: 1.6;
            color: var(--familiar-voice, #e94560);
        }

        .wizard-text a {
            color: var(--accent, #e94560);
            text-decoration: underline;
        }

        .wizard-loading {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 20px;
            justify-content: center;
        }
        .wizard-loading-dot {
            width: 8px; height: 8px;
            border-radius: 50%;
            background: var(--text-dim, #888);
            animation: wizardPulse 1.4s ease-in-out infinite;
        }
        .wizard-loading-dot:nth-child(2) { animation-delay: 0.2s; }
        .wizard-loading-dot:nth-child(3) { animation-delay: 0.4s; }
        @keyframes wizardPulse {
            0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
            40% { opacity: 1; transform: scale(1.2); }
        }

        .wizard-input-wrap {
            display: flex;
            gap: 8px;
            margin-top: 12px;
        }

        .wizard-input-wrap input {
            flex: 1;
        }

        /* Tarot spread */
        .tarot-spread {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
            margin: 16px 0;
        }

        .tarot-card-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 14px 16px;
            border: 2px solid var(--border);
            border-radius: 10px;
            background: var(--bg-input);
            color: var(--text);
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.3s;
            min-width: 100px;
        }

        .tarot-card-btn:hover {
            transform: scale(1.05);
            border-color: var(--accent);
            background: var(--bg-card);
        }

        .tarot-card-btn .tarot-icon {
            font-size: 1.6rem;
            margin-bottom: 6px;
        }

        .tarot-card-btn .tarot-name {
            font-weight: 600;
            margin-bottom: 2px;
        }

        .tarot-card-btn .tarot-status {
            font-size: 0.75rem;
            color: var(--text-dim);
        }

        .tarot-card-btn.done {
            opacity: 0.6;
            border-color: var(--success, #4caf50);
        }

        /* First-run tutorial */
        @keyframes tutorialFadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .tutorial-step {
            animation: tutorialFadeIn 0.4s ease-out;
            color: var(--familiar-voice, #e94560);
        }
        .tutorial-step p {
            line-height: 1.7;
            margin-bottom: 12px;
        }
        .tutorial-nav {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 16px;
        }
        .tutorial-next {
            padding: 8px 20px;
            background: var(--accent);
            color: #fff;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 600;
            transition: background 0.2s;
        }
        .tutorial-next:hover { background: var(--accent-hover); }
        .tutorial-skip {
            padding: 8px 16px;
            background: transparent;
            color: var(--text-dim);
            border: 1px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: color 0.2s;
        }
        .tutorial-skip:hover { color: var(--text); }
        .tutorial-progress {
            display: flex;
            gap: 8px;
            margin-top: 14px;
        }
        .tutorial-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--border);
            transition: background 0.3s;
        }
        .tutorial-dot.active { background: var(--accent); }
        .tutorial-dot.done { background: var(--success); }

        @keyframes tutorialPulse {
            0%, 100% { box-shadow: none; }
            50% { box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.3); }
        }
        .nav-item.tutorial-highlight,
        .right-panel .card.tutorial-highlight {
            animation: tutorialPulse 1.5s ease-in-out 3;
            border-radius: 8px;
        }

        /* Terminal Panel */
        #terminal-panel {
            display: none;
            flex-direction: column;
            padding: 0;
        }
        #terminal-panel.active { display: flex; }

        .terminal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 16px;
            background: #0d0d18;
            border-bottom: 1px solid #1e1e30;
            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
            font-size: 0.85rem;
        }
        .terminal-title { color: var(--accent); font-weight: 600; }
        .terminal-model { color: var(--text-dim); font-size: 0.75rem; }

        .terminal-output {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
            background: #0a0a12;
            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
            font-size: 0.875rem;
            line-height: 1.6;
        }

        .terminal-line { margin-bottom: 2px; white-space: pre-wrap; word-break: break-word; }
        .terminal-line.user { color: var(--accent); }
        .terminal-line.user::before { content: '\203A '; opacity: 0.6; }
        .terminal-line.assistant { color: #d0d0d8; }
        .terminal-line.tool { color: var(--warning); font-style: italic; font-size: 0.8rem; }
        .terminal-line.error { color: var(--error); }
        .terminal-line pre {
            background: #12121f;
            padding: 10px 12px;
            border-radius: 6px;
            margin: 4px 0;
            overflow-x: auto;
            font-size: 0.825rem;
        }

        .terminal-cursor {
            display: inline-block;
            width: 8px;
            height: 1.1em;
            background: var(--text);
            vertical-align: text-bottom;
            animation: term-blink 0.8s step-end infinite;
        }
        @keyframes term-blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0; }
        }

        .terminal-input-bar {
            display: flex;
            align-items: center;
            padding: 10px 16px;
            background: #0d0d18;
            border-top: 1px solid #1e1e30;
            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
        }
        .terminal-prompt {
            color: var(--accent);
            font-size: 1.1rem;
            margin-right: 10px;
            user-select: none;
        }
        .terminal-input {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--text);
            font-family: inherit;
            font-size: 0.875rem;
            outline: none;
            padding: 4px 0;
        }
        /* Shell Panel */
        #shell-panel {
            display: none;
            flex-direction: column;
            padding: 0;
        }
        #shell-panel.active { display: flex; }

        .shell-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 16px;
            background: #0d0d18;
            border-bottom: 1px solid #1e1e30;
            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
            font-size: 0.85rem;
        }
        .shell-title { color: var(--warning); font-weight: 600; }
        .shell-status { color: var(--text-dim); font-size: 0.75rem; }
        .shell-kill-btn {
            display: none;
            background: var(--error);
            color: #fff;
            border: none;
            border-radius: 4px;
            padding: 3px 10px;
            font-size: 0.75rem;
            cursor: pointer;
            font-family: inherit;
        }
        .shell-kill-btn:hover { opacity: 0.85; }

        .shell-output {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
            background: #0a0a12;
            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
            font-size: 0.875rem;
            line-height: 1.6;
        }

        .shell-line { margin-bottom: 1px; white-space: pre-wrap; word-break: break-word; }
        .shell-line.command { color: var(--warning); }
        .shell-line.command::before { content: '$ '; opacity: 0.6; }
        .shell-line.output { color: #d0d0d8; }
        .shell-line.exit-ok { color: var(--success); font-size: 0.8rem; font-style: italic; }
        .shell-line.exit-fail { color: var(--error); font-size: 0.8rem; font-style: italic; }
        .shell-line.error { color: var(--error); }

        .shell-input-bar {
            display: flex;
            align-items: center;
            padding: 10px 16px;
            background: #0d0d18;
            border-top: 1px solid #1e1e30;
            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
        }
        .shell-prompt {
            color: var(--warning);
            font-size: 1.1rem;
            margin-right: 10px;
            user-select: none;
        }
        .shell-input {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--text);
            font-family: inherit;
            font-size: 0.875rem;
            outline: none;
            padding: 4px 0;
        }

        .shell-nav-badge {
            font-size: 0.55rem;
            background: var(--warning);
            color: #000;
            padding: 1px 5px;
            border-radius: 3px;
            margin-left: 6px;
            font-weight: 700;
            letter-spacing: 0.5px;
        }

        /* Model Routing Card */
        .routing-toggle-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
        }
        .routing-toggle-bar .label {
            font-size: 0.875rem;
            color: var(--text-secondary);
        }
        .routing-toggle-bar .mode-value {
            font-weight: 600;
            color: var(--text);
            margin-left: 6px;
        }
        .routing-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
            table-layout: fixed;
            border: 1px solid var(--border);
            border-radius: 6px;
            overflow: hidden;
        }
        .routing-table th {
            text-align: left;
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--text-secondary);
            padding: 8px 10px;
            border: 1px solid var(--border);
            background: var(--surface);
        }
        .routing-table td {
            padding: 8px 10px;
            border: 1px solid var(--border);
            vertical-align: middle;
        }
        .routing-table .col-cat { width: 25%; font-weight: 500; }
        .routing-table .col-desc { width: 40%; color: var(--text-secondary); font-size: 0.75rem; }
        .routing-table .col-model { width: 35%; }
        .routing-table select {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 4px;
            color: var(--text);
            padding: 3px 6px;
            font-size: 0.75rem;
            font-family: inherit;
            width: 100%;
            display: block;
        }
        .routing-table .auto-label {
            color: var(--accent);
            font-size: 0.75rem;
        }
        .routing-note {
            font-size: 0.8rem;
            color: var(--text-secondary);
            padding: 10px 0;
        }

        /* Ollama Loaded Models */
        .olm-bar { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
        .olm-bar .olm-total {
            margin-left:auto; font-size:0.8rem; color:var(--text-secondary);
        }
        .olm-model {
            display:flex; align-items:center; gap:10px;
            padding:8px 10px; border-radius:6px;
            background:var(--bg-secondary); margin-bottom:6px;
        }
        .olm-model .olm-name { font-weight:600; min-width:140px; }
        .olm-model .olm-size {
            font-size:0.85rem; color:var(--accent); min-width:70px; text-align:right;
        }
        .olm-model .olm-params {
            font-size:0.75rem; color:var(--text-secondary); min-width:60px;
        }
        .olm-model .olm-quant {
            font-size:0.7rem; color:var(--text-secondary);
            background:var(--bg-primary); padding:2px 6px; border-radius:3px;
        }
        .olm-model .olm-ctx {
            font-size:0.75rem; color:var(--text-secondary); margin-left:auto;
        }
        .olm-meter {
            width:100%; height:6px; border-radius:3px;
            background:var(--bg-primary); margin-top:6px; overflow:hidden;
        }
        .olm-meter-fill {
            height:100%; border-radius:3px;
            background:linear-gradient(90deg, var(--accent), var(--success, #4caf50));
            transition: width 0.5s ease;
        }
        .olm-empty { font-size:0.85rem; color:var(--text-secondary); padding:10px 0; }

        /* Routing Presets */
        .preset-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 8px;
            background: var(--bg-input);
            margin-bottom: 6px;
        }
        .preset-name {
            flex: 1;
            background: none;
            border: none;
            color: var(--text);
            font-size: 0.85rem;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            font-family: inherit;
        }
        .preset-name:focus {
            background: var(--bg-card);
            outline: 1px solid var(--accent);
        }
        .preset-btn {
            background: none;
            border: 1px solid var(--border);
            color: var(--text-dim);
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 0.75rem;
            cursor: pointer;
        }
        .preset-btn:hover {
            border-color: var(--accent);
            color: var(--text);
        }
        .preset-btn.active-default { color: var(--warning); }
        .preset-empty .preset-name { color: var(--text-dim); font-style: italic; }
        .preset-empty .preset-btn.load-btn { opacity: 0.3; pointer-events: none; }

        /* Voice controls */
        /* Old .voice-btn, .attach-btn, .chat-input-col removed — replaced by fi-voice/fi-attach/fi-input-col */
        .chat-file-chips {
            display: none;
            flex-wrap: wrap;
            gap: 6px;
            padding: 0 2px;
        }
        .chat-file-chips.visible { display: flex; }
        .file-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            background: var(--bg-input);
            border-radius: 8px;
            font-size: 0.8rem;
            color: var(--text);
            max-width: 200px;
        }
        .file-chip img {
            width: 24px;
            height: 24px;
            border-radius: 4px;
            object-fit: cover;
        }
        .file-chip .chip-name {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .file-chip .chip-remove {
            cursor: pointer;
            color: var(--text-dim);
            font-size: 0.7rem;
            padding: 2px;
        }
        .file-chip .chip-remove:hover { color: var(--error); }
        .chat-drop-overlay {
            position: absolute;
            inset: 0;
            border: 2px dashed var(--accent);
            border-radius: 12px;
            background: rgba(var(--accent-rgb, 99,102,241), 0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            color: var(--accent);
            pointer-events: none;
            z-index: 10;
        }
        /* Old .tts-toggle removed — replaced by fi-tts */

        /* ── Unified Input Bar (FamiliarInput) ────────────────── */
        /* Prefix: fi- — replaces .chat-input, .panel-chat-input, .msg-input, .voice-btn, etc. */
        .fi-bar {
            display: flex;
            align-items: flex-end;
            gap: 8px;
            padding: 12px 16px;
            background: var(--bg-card);
            border-top: 1px solid var(--border);
        }
        .fi-input {
            flex: 1;
            padding: 10px 14px;
            border: none;
            border-radius: 10px;
            background: var(--bg-input);
            color: var(--text);
            font-family: inherit;
            font-size: 0.95rem;
            line-height: 1.4;
            resize: none;
            overflow-y: hidden;
            min-height: 40px;
            max-height: 160px;
            transition: height 0.1s ease;
        }
        .fi-input:focus {
            outline: 2px solid var(--accent);
            outline-offset: -2px;
        }
        .fi-input::placeholder { color: var(--text-dim); }
        .fi-input.fi-scrollable { overflow-y: auto; }

        /* Full variant — main chat */
        .fi-full { padding: 16px 20px; gap: 10px; }
        .fi-full .fi-input {
            font-size: 1rem;
            padding: 12px 16px;
            border-radius: 12px;
        }

        /* Chat variant — panels, Round Table, peer messages */
        .fi-chat .fi-input { font-size: 0.9rem; }

        /* Search variant — no border-top, transparent bg */
        .fi-search {
            border-top: none;
            padding: 0;
            background: transparent;
            position: relative;
        }
        .fi-search .fi-input {
            padding-left: 32px;
            font-size: 0.85rem;
            min-height: 34px;
            max-height: 34px;
            overflow-y: hidden;
        }
        .fi-search-icon {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-dim);
            font-size: 0.8rem;
            pointer-events: none;
        }

        /* Compose variant — email reply, social posts */
        .fi-compose {
            border-top: none;
            padding: 0;
            background: transparent;
            flex-direction: column;
        }
        .fi-compose .fi-input {
            min-height: 120px;
            max-height: 300px;
            border: 1px solid var(--border);
            border-radius: 8px;
        }

        /* Send button */
        .fi-send {
            padding: 10px 18px;
            border: none;
            border-radius: 10px;
            background: var(--accent);
            color: white;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: background 0.2s;
            flex-shrink: 0;
            min-height: 40px;
        }
        .fi-send:hover { background: var(--accent-hover); }
        .fi-send:disabled { opacity: 0.5; cursor: not-allowed; }
        .fi-full .fi-send {
            padding: 12px 22px;
            border-radius: 12px;
            font-size: 1rem;
        }

        /* Voice, attach, TTS buttons */
        .fi-voice, .fi-attach, .fi-tts {
            padding: 10px;
            border: none;
            border-radius: 10px;
            background: var(--bg-input);
            color: var(--text-dim);
            cursor: pointer;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            width: 40px;
            height: 40px;
            flex-shrink: 0;
        }
        .fi-voice:hover, .fi-attach:hover, .fi-tts:hover {
            background: var(--border);
            color: var(--text);
        }
        .fi-attach.has-files { color: var(--accent); }
        .fi-full .fi-voice, .fi-full .fi-attach, .fi-full .fi-tts {
            width: 46px;
            height: 46px;
            border-radius: 12px;
            font-size: 1rem;
        }

        /* Recording state */
        .fi-voice.fi-recording {
            background: var(--error);
            color: white;
            animation: fi-pulse 1s ease-in-out infinite;
        }
        @keyframes fi-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }

        /* TTS active */
        .fi-tts.fi-on {
            color: var(--accent);
            background: color-mix(in srgb, var(--accent) 15%, transparent);
        }

        /* File chips (full variant) */
        .fi-input-col { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
        .fi-file-chips { display: flex; flex-wrap: wrap; gap: 4px; }
        .fi-file-chips:empty { display: none; }
        .fi-file-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            background: color-mix(in srgb, var(--accent) 15%, transparent);
            border-radius: 6px;
            font-size: 0.78rem;
            color: var(--text);
        }
        .fi-file-chip .fi-chip-remove {
            cursor: pointer;
            opacity: 0.6;
            font-size: 0.7rem;
        }
        .fi-file-chip .fi-chip-remove:hover { opacity: 1; }

        /* ── Email class family (em-) ── */
        .em-summary { margin-bottom: 12px; color: var(--text-dim); font-size: 13px; }
        .em-summary .em-urgent { color: var(--email-urgent); }
        .em-summary .em-action { color: var(--email-action); }
        .em-row {
            display: flex; flex-wrap: nowrap; align-items: center; gap: 6px;
            padding: 8px 14px; cursor: pointer;
            border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
            transition: background 0.15s, opacity 0.3s, max-height 0.3s;
        }
        .em-row:hover { background: rgba(255,255,255,0.05); }
        .em-row:last-child { border-bottom: none; }
        .em-row-dim { opacity: 0.6; }
        .em-row-inner { display: contents; }
        .em-sender { font-weight: 500; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
        .em-subject { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
        .em-date { color: var(--text-dim); font-size: 11px; margin-left: auto; white-space: nowrap; }
        .em-index { color: var(--text-dim); font-size: 12px; }
        .em-priority { font-size: 12px; flex-shrink: 0; }
        .em-category-hdr {
            cursor: pointer; padding: 10px 14px; display: flex;
            justify-content: space-between; align-items: center;
            background: var(--bg-card-header, rgba(255,255,255,0.03));
        }
        .em-category-label { font-weight: 600; }
        .em-category-label.em-promo { color: var(--text-dim); }
        .em-category-label.em-notif { color: var(--email-info); }
        .em-category-action { font-size: 12px; color: var(--email-action); }
        .em-trash {
            background: none; border: none; flex-shrink: 0;
            color: var(--text-dim); cursor: pointer; padding: 2px 6px;
            font-size: 13px; border-radius: 4px; transition: color 0.15s;
        }
        .em-trash:hover { color: var(--email-urgent); }
        .em-reply-icon { color: var(--accent); font-size: 11px; }
        .em-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 1000; overflow-y: auto;
        }
        .em-detail {
            max-width: 700px; margin: 40px auto; background: var(--bg-card, #1e1e2e);
            border-radius: 12px; padding: 24px; position: relative;
            max-height: 85vh; overflow-y: auto;
        }
        .em-detail-close {
            position: absolute; top: 12px; right: 16px;
            background: none; border: none; color: var(--text-dim);
            font-size: 20px; cursor: pointer;
        }
        .em-detail-close:hover { color: var(--text); }
        .em-detail-subject { margin: 0 0 4px; padding-right: 30px; }
        .em-detail-meta { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
        .em-detail-body {
            white-space: pre-wrap; font-size: 14px; line-height: 1.6;
            border-top: 1px solid var(--border, #333); padding-top: 12px;
        }
        .em-detail-actions { margin-top: 16px; display: flex; gap: 8px; }
        .em-sent-badge {
            margin-bottom: 12px; padding: 6px 10px;
            background: rgba(166,227,161,0.08); border-radius: 6px;
            font-size: 0.8rem; color: var(--email-sent);
        }
        .em-error { color: var(--email-urgent); }
        .em-connect-prompt { text-align: center; padding: 32px 20px; }
        .em-connect-prompt i { font-size: 32px; color: var(--text-dim); margin-bottom: 12px; }
        .em-connect-prompt p { margin-bottom: 16px; color: var(--text-dim); }
        .em-connect-prompt .em-hint { margin-top: 12px; font-size: 12px; color: var(--text-dim); }
        .em-badge {
            background: var(--email-urgent); color: #fff;
            font-size: 0.65rem; font-weight: 700;
            padding: 1px 5px; border-radius: 8px; margin-left: 4px;
        }
        .em-settings-panel {
            background: var(--bg-input); border-radius: 10px;
            padding: 16px; border: 1px solid var(--border);
        }
        .em-settings-panel h4 { margin: 0 0 8px; font-size: 0.85rem; color: var(--text); }
        .em-settings-panel p { font-size: 0.8em; color: var(--text-dim); margin: 0 0 12px; }
        .em-vip-icon { color: var(--email-vip); margin-right: 6px; }
        .em-flag-icon { color: var(--email-flag); margin-right: 6px; }
        .em-stat-accent .ws-stat-value { color: var(--accent); }
        .em-stat-learned .ws-stat-value { color: var(--email-learned); }
        .em-stat-vip .ws-stat-value { color: var(--email-vip); }
        .em-stat-flag .ws-stat-value { color: var(--email-flag); }
        .em-bar {
            display: flex; align-items: center; gap: 8px;
            padding: 3px 0; font-size: 0.85em;
        }
        .em-bar-label { width: 120px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .em-bar-track { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
        .em-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s; }
        .em-bar-fill.em-bar-urgent { background: var(--email-urgent); }
        .em-bar-count { width: 50px; text-align: right; color: var(--text-dim); font-size: 0.85em; }
        .em-ws-tab {
            padding: 8px 16px; font-size: 0.8rem; border: none;
            background: transparent; color: var(--text-dim);
            cursor: pointer; border-bottom: 2px solid transparent;
        }
        .em-ws-tab.active { background: var(--bg-input); color: var(--accent); border-bottom-color: var(--accent); }
        .em-ws-category-hdr {
            font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.05em;
            color: var(--text-dim); padding: 6px 0; border-bottom: 1px solid var(--border);
        }
        .em-ws-category-count { opacity: 0.6; }
        .em-ws-row {
            display: flex; align-items: center; gap: 8px;
            padding: 6px 4px; border-bottom: 1px solid var(--border-dim);
            cursor: pointer; transition: background 0.15s;
        }
        .em-ws-row:hover { background: rgba(255,255,255,0.05); }
        .em-ws-sender {
            flex-shrink: 0; width: 120px; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap;
            color: var(--text-dim); font-size: 0.85em;
        }
        .em-ws-subject {
            flex: 1; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; font-size: 0.9em;
        }
        .em-ws-trash {
            flex-shrink: 0; background: none; border: none;
            color: var(--text-dim); cursor: pointer; padding: 4px 6px;
            font-size: 0.85em; border-radius: 4px; opacity: 0.5;
            transition: opacity 0.15s, color 0.15s;
        }
        .em-ws-trash:hover { opacity: 1; color: var(--email-flag); }
        /* Briefing email bars */
        .em-briefing-grid {
            display: grid; grid-template-columns: 110px 1fr 28px;
            gap: 4px 8px; align-items: center; font-size: 0.82rem;
        }
        .em-briefing-label {
            color: var(--text-dim); white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis;
        }
        .em-briefing-bar { background: rgba(255,255,255,0.07); border-radius: 4px; height: 8px; overflow: hidden; }
        .em-briefing-fill { height: 100%; border-radius: 4px; transition: width 0.4s; }
        .em-briefing-count { color: var(--text-primary); text-align: right; }
        /* New sender / top sender rows */
        .em-sender-row {
            display: flex; align-items: center; gap: 8px;
            padding: 5px 0; border-bottom: 1px solid var(--border-dim); font-size: 0.85em;
        }
        .em-sender-email { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .em-sender-count { color: var(--text-dim); font-size: 0.85em; }
        /* Density modes */
        .em-density-compact .em-row { padding: 4px 14px; min-height: 36px; }
        .em-density-compact .em-sender { font-size: 13px; }
        .em-density-compact .em-subject { font-size: 12px; }
        .em-density-comfortable .em-row { padding: 8px 14px; min-height: 44px; }
        .em-density-spacious .em-row { padding: 12px 14px; min-height: 52px; }
        .em-density-spacious .em-subject { /* inline with sender */ }
        .em-density-compact .em-ws-row { padding: 3px 4px; }
        .em-density-spacious .em-ws-row { padding: 10px 4px; }
        /* Density toggle */
        .em-density-toggle { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-left: 8px; }
        .em-density-toggle button {
            background: none; border: none; color: var(--text-dim);
            padding: 4px 8px; cursor: pointer; font-size: 11px; transition: all 0.15s;
        }
        .em-density-toggle button:not(:last-child) { border-right: 1px solid var(--border); }
        .em-density-toggle button.active { background: var(--bg-input); color: var(--accent); }
        /* Keyboard focus */
        .em-row.em-focused { outline: 2px solid var(--accent); outline-offset: -2px; }
        .em-ws-row.em-focused { outline: 2px solid var(--accent); outline-offset: -2px; }
        /* Keyboard shortcut help */
        .em-kbd-help {
            position: fixed; bottom: 16px; right: 16px; z-index: 900;
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: 8px; padding: 12px 16px; font-size: 12px;
            color: var(--text-dim); box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }
        .em-kbd-help kbd {
            display: inline-block; background: var(--bg-input); border: 1px solid var(--border);
            border-radius: 3px; padding: 1px 5px; font-family: monospace; font-size: 11px;
            color: var(--text); margin-right: 4px;
        }

        /* Connect Browse */
        .browse-services { display: flex; flex-direction: column; gap: 16px; }
        .browse-service-card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 16px;
            border: 1px solid var(--border);
        }
        .browse-service-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }
        .browse-service-header .icon {
            width: 36px; height: 36px; border-radius: 8px;
            background: var(--bg-input);
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0; font-size: 1rem;
        }
        .browse-service-header .name { font-weight: 600; flex: 1; }
        .browse-service-header .summary { font-size: 0.8rem; color: var(--text-dim); }
        .browse-service-card .browse-item {
            padding: 8px 0;
            border-top: 1px solid var(--bg-input);
        }
        .browse-service-card .browse-item:first-child { border-top: none; }
        .browse-item { display: flex; align-items: center; gap: 8px; }
        .browse-item .item-content { flex: 1; min-width: 0; }
        .browse-item .item-name { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .browse-item .item-name a { color: var(--accent); text-decoration: none; }
        .browse-item .item-name a:hover { text-decoration: underline; }
        .browse-item .item-detail { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
        .browse-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
        .browse-item-action { background: none; border: 1px solid var(--border, rgba(255,255,255,0.1)); color: var(--text-dim); cursor: pointer; padding: 2px 8px; font-size: 0.72rem; border-radius: 4px; white-space: nowrap; transition: color 0.15s, border-color 0.15s; }
        .browse-item-action:hover { color: var(--accent); border-color: var(--accent); }
        .browse-item-action.danger:hover { color: var(--error, #e74c3c); border-color: var(--error, #e74c3c); }
        .browse-btn-configure {
            display: inline-block; margin-top: 12px; padding: 8px 16px;
            background: var(--bg-input); color: var(--text);
            border: 1px solid var(--border); border-radius: 8px;
            cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
        }
        .browse-btn-configure:hover { background: var(--border); }
        .browse-empty {
            text-align: center; padding: 40px 20px; color: var(--text-dim);
        }
        .browse-error { font-size: 0.8rem; color: var(--error); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .browse-fix-btn { font-size: 0.75rem; padding: 3px 10px; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 4px; cursor: pointer; white-space: nowrap; }
        .browse-fix-btn:hover { background: var(--accent); color: #000; }

        /* Google OAuth cards */
        .google-oauth-card {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: 10px; padding: 14px 16px; margin: 10px 0;
            display: grid;
            grid-template-columns: 1fr auto auto;
            align-items: center; gap: 12px;
        }
        .google-oauth-card-header { font-size: 0.95rem; }
        .google-oauth-card-header i { margin-right: 6px; color: var(--accent); }
        .google-oauth-desc { font-size: 0.8rem; color: var(--text-dim); margin-left: 8px; }
        .google-oauth-status { min-width: 130px; text-align: center; }
        .google-oauth-action { min-width: 120px; text-align: right; }
        .google-oauth-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; }
        .google-badge {
            display: inline-block; padding: 3px 10px; border-radius: 12px;
            font-size: 0.8rem; background: var(--bg-input); color: var(--text-dim);
        }
        .google-badge.connected { background: #1a3a1a; color: #6fcf7a; }
        .google-badge.waiting   { background: #2a2a1a; color: #e6c84a; }
        .google-badge.error     { background: #3a1a1a; color: #e66a6a; }
        .google-auth-btn, .google-reauth-btn {
            padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border);
            cursor: pointer; font-size: 0.82rem; transition: all 0.15s;
        }
        .google-auth-btn { background: var(--accent); color: #000; border-color: var(--accent); }
        .google-auth-btn:hover { opacity: 0.85; }
        .google-reauth-btn { background: var(--bg-input); color: var(--text); }
        .google-reauth-btn:hover { background: var(--border); }
        .google-open-btn {
            display: inline-block; text-decoration: none;
            background: var(--accent) !important; color: #000 !important;
        }
        .browse-url-bar {
            display: flex; gap: 8px; margin-top: 10px;
        }
        .browse-url-bar input {
            flex: 1; padding: 8px 12px; border-radius: 8px;
            border: 1px solid var(--border); background: var(--bg-input);
            color: var(--text); font-size: 0.85rem; outline: none;
        }
        .browse-url-bar input:focus { border-color: var(--accent); }
        .browse-url-bar button {
            padding: 8px 16px; border-radius: 8px; border: none;
            background: var(--accent); color: #fff; cursor: pointer;
            font-size: 0.85rem; font-weight: 600; transition: background 0.2s;
        }
        .browse-url-bar button:hover { background: var(--accent-hover); }
        .browse-page-preview {
            margin-top: 10px; padding: 12px; border-radius: 8px;
            background: var(--bg-input); font-size: 0.82rem;
            max-height: 200px; overflow-y: auto; white-space: pre-wrap;
            line-height: 1.4;
        }
        .browse-page-preview .preview-title {
            font-weight: 600; margin-bottom: 4px;
        }
        .browse-page-preview .preview-url {
            font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px;
        }
        /* Video action buttons */
        .video-actions {
            display: flex; gap: 8px; margin: 10px 0;
        }
        .video-play-btn, .video-download-btn {
            padding: 8px 16px; border-radius: 8px; border: none;
            font-size: 0.82rem; font-weight: 600; cursor: pointer;
            display: inline-flex; align-items: center; gap: 6px;
            transition: background 0.2s;
        }
        .video-play-btn {
            background: var(--accent); color: #fff;
        }
        .video-play-btn:hover { background: var(--accent-hover); }
        .video-download-btn {
            background: var(--bg-input); color: var(--text);
            border: 1px solid var(--border);
        }
        .video-download-btn:hover { background: var(--border); }
        .video-quality-select {
            padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
            background: var(--bg-input); color: var(--text); font-size: 0.8rem;
        }
        #video-player-area, .video-result-player { margin-top: 10px; position: relative; }
        #video-player-area iframe, #video-player-area video,
        .video-result-player iframe, .video-result-player video {
            border-radius: 8px; max-width: 100%;
        }
        .video-close-btn {
            position: absolute; top: 4px; right: 4px; z-index: 10;
            background: rgba(0,0,0,0.7); color: #fff; border: none;
            border-radius: 50%; width: 28px; height: 28px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.85rem; transition: background 0.2s;
        }
        .video-close-btn:hover { background: rgba(0,0,0,0.9); }
        .video-download-status {
            margin-top: 6px; font-size: 0.8rem; color: var(--text-dim);
        }
        /* Online video search results */
        .video-online-search { margin-top: 10px; }
        .video-online-search .browse-url-bar { margin-top: 8px; }
        .video-search-result {
            display: flex; gap: 10px; padding: 8px; border-radius: 6px;
            background: var(--bg-input); margin-bottom: 6px; align-items: center;
        }
        .video-search-result:hover { background: var(--border); }
        .video-thumbnail {
            width: 80px; height: 45px; border-radius: 4px;
            object-fit: cover; flex-shrink: 0; background: #000;
        }
        .video-search-result .item-name {
            font-size: 0.82rem; font-weight: 500;
        }
        .video-search-result .item-detail {
            font-size: 0.72rem; color: var(--text-dim);
        }
        .video-search-result .video-actions {
            margin: 4px 0 0 0; gap: 6px;
        }
        .video-search-result .video-play-btn,
        .video-search-result .video-download-btn {
            padding: 4px 10px; font-size: 0.75rem;
        }
        /* Video tab cards */
        #media-video .video-card { display:flex; gap:12px; padding:10px; background:var(--bg-input); border-radius:8px; margin-bottom:8px; align-items:flex-start; }
        #media-video .video-card:hover { background:var(--border); }
        #media-video .video-thumbnail { width:120px; height:68px; border-radius:6px; object-fit:cover; flex-shrink:0; background:#000; cursor:pointer; }
        #media-video .video-info { flex:1; min-width:0; }
        #media-video .video-title { font-size:0.85rem; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        #media-video .video-detail { font-size:0.75rem; color:var(--text-dim); margin-top:2px; }
        #media-video .video-card-actions { display:flex; gap:6px; margin-top:6px; }
        #media-video .video-card-actions button { padding:4px 10px; font-size:0.75rem; border-radius:6px; border:none; cursor:pointer; display:inline-flex; align-items:center; gap:4px; }
        #media-video .btn-play { background:var(--accent); color:#fff; }
        #media-video .btn-play:hover { background:var(--accent-hover); }
        #media-video .btn-download { background:var(--bg-card); color:var(--text); border:1px solid var(--border); }
        #media-video .btn-download:hover { background:var(--border); }
        #media-video .video-player-inline { margin:8px 0; border-radius:8px; overflow:hidden; position:relative; display:none; }
        #media-video .video-player-close { position:absolute; top:8px; right:8px; z-index:10; background:rgba(0,0,0,0.7); color:#fff; border:none; border-radius:50%; width:28px; height:28px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
        .video-platform-bar { display:flex; gap:6px; padding:8px 0; flex-wrap:wrap; }
        .video-platform-chip { display:inline-flex; align-items:center; gap:5px; padding:5px 12px; border-radius:16px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-dim); cursor:pointer; font-size:0.78rem; transition:all 0.2s; user-select:none; }
        .video-platform-chip:hover:not(.active) { border-color:var(--text-dim); color:var(--text); }
        .video-platform-chip.active { background:var(--accent); color:#fff; border-color:var(--accent); }
        /* Model Library */
        .model-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 16px;
        }
        .model-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 18px;
            transition: border-color 0.3s, box-shadow 0.3s;
        }
        .model-card.installed { border-color: var(--success); }
        .model-card.active { border-color: var(--accent); box-shadow: 0 0 12px rgba(233, 69, 96, 0.25); }
        .model-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
        .model-name { font-weight: 600; font-size: 1rem; }
        .model-size { font-size: 0.8rem; color: var(--text-dim); }
        .model-desc { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 12px; line-height: 1.4; }
        .model-status { font-size: 0.75rem; margin-bottom: 10px; }
        .model-actions { display: flex; gap: 8px; }
        .model-actions button {
            padding: 8px 16px; border: none; border-radius: 8px;
            cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: all 0.2s;
        }
        .model-actions .btn-download { background: var(--accent); color: white; }
        .model-actions .btn-download:hover { background: var(--accent-hover); }
        .model-actions .btn-activate { background: var(--bg-input); color: var(--text); }
        .model-actions .btn-activate:hover { background: var(--border); }
        .model-actions .btn-active { background: var(--success); color: white; opacity: 0.7; cursor: default; }
        .model-actions .btn-remove { background: transparent; color: var(--error); border: 1px solid var(--error); }
        .model-actions .btn-remove:hover { background: var(--error); color: white; }
        .model-progress { height: 6px; background: var(--bg-input); border-radius: 3px; margin-top: 10px; overflow: hidden; display: none; }
        .model-progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; width: 0%; }
        .ollama-offline-banner {
            background: var(--bg-card); border: 1px solid var(--warning); border-radius: 12px;
            padding: 24px; text-align: center; color: var(--text-dim);
        }
        .ollama-offline-banner a { color: var(--accent); text-decoration: underline; }

        /* Marketplace */
        /* ── Unified Tab Bar (pill pattern) ──────────────────── */
        .tab-bar, .mp-tab-bar, .sv-tab-bar, .set-tab-bar, .sc-tab-bar, .tr-tab-bar {
            display: flex; gap: 4px; margin-bottom: 18px; background: var(--bg-input); border-radius: 10px; padding: 4px;
        }
        .tab-btn, .mp-tab, .sv-tab, .set-tab, .sc-tab, .tr-tab {
            flex: 1; text-align: center; padding: 10px 16px; border-radius: 8px;
            cursor: pointer; font-weight: 500; font-size: 0.9rem; color: var(--text-dim);
            transition: all 0.2s; border: none; background: transparent;
        }
        .tab-btn.active, .mp-tab.active, .sv-tab.active, .set-tab.active, .sc-tab.active, .tr-tab.active {
            background: var(--bg-card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.15);
        }
        .tab-btn:hover:not(.active), .mp-tab:hover:not(.active), .sv-tab:hover:not(.active),
        .set-tab:hover:not(.active), .sc-tab:hover:not(.active), .tr-tab:hover:not(.active) { color: var(--text); }
        .mp-stats-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
        .mp-stat {
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
            padding: 8px 14px; font-size: 0.85rem; color: var(--text-dim);
        }
        .mp-stat strong { color: var(--text); margin-right: 4px; }
        .mp-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
        .mp-filter-btn {
            padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
            background: var(--bg-card); color: var(--text-dim); cursor: pointer;
            font-size: 0.8rem; transition: all 0.2s;
        }
        .mp-filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
        .mp-filter-btn:hover:not(.active) { border-color: var(--text-dim); color: var(--text); }
        .mp-search {
            padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
            background: var(--bg-input); color: var(--text); font-size: 0.85rem;
            outline: none; min-width: 180px;
        }
        .mp-search:focus { border-color: var(--accent); }
        .mp-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 16px;
        }
        .mp-card {
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
            padding: 18px; transition: border-color 0.3s, box-shadow 0.3s; cursor: pointer;
            border-left: 3px solid var(--border);
        }
        .mp-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
        .mp-card.builtin { border-left-color: var(--success); }
        .mp-card.custom { border-left-color: var(--warning); }
        .mp-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
        .mp-card-name { font-weight: 600; font-size: 1rem; }
        .mp-card-type {
            font-size: 0.7rem; padding: 2px 8px; border-radius: 10px;
            background: var(--bg-input); color: var(--text-dim); text-transform: uppercase;
        }
        .mp-card-desc { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 10px; line-height: 1.4; }
        .mp-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
        .mp-card-tag {
            font-size: 0.7rem; padding: 2px 8px; border-radius: 8px;
            background: var(--bg-input); color: var(--text-dim);
        }
        .mp-card-meta { font-size: 0.75rem; color: var(--text-dim); }
        .mp-plugin-actions { display: flex; gap: 8px; margin-top: 12px; }
        .mp-btn-install {
            padding: 6px 16px; border: none; border-radius: 8px;
            background: var(--accent); color: white; cursor: pointer; font-size: 0.85rem;
            font-weight: 500; transition: all 0.2s;
        }
        .mp-btn-install:hover { background: var(--accent-hover); }
        .mp-btn-uninstall {
            padding: 6px 16px; border: 1px solid var(--error); border-radius: 8px;
            background: transparent; color: var(--error); cursor: pointer; font-size: 0.85rem;
            transition: all 0.2s;
        }
        .mp-btn-uninstall:hover { background: var(--error); color: white; }
        .mp-btn-update {
            padding: 6px 16px; border: 1px solid var(--success); border-radius: 8px;
            background: transparent; color: var(--success); cursor: pointer; font-size: 0.85rem;
            transition: all 0.2s;
        }
        .mp-btn-update:hover { background: var(--success); color: white; }
        .mp-btn-installed {
            padding: 6px 16px; border: none; border-radius: 8px;
            background: var(--success); color: white; font-size: 0.85rem;
            opacity: 0.7; cursor: default;
        }
        .mp-import-btn {
            padding: 6px 16px; border-radius: 20px; border: 1px dashed var(--accent);
            background: transparent; color: var(--accent); cursor: pointer;
            font-size: 0.8rem; transition: all 0.2s; margin-left: auto;
        }
        .mp-import-btn:hover { background: var(--accent); color: white; border-style: solid; }
        .mp-empty { text-align: center; padding: 40px; color: var(--text-dim); font-size: 0.9rem; }

        /* Server panel */
        /* .sv-tab-bar / .sv-tab — unified in .tab-bar / .tab-btn above */
        .sv-runtime-banner {
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
            padding: 14px 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 12px;
        }
        .sv-runtime-banner .sv-rt-icon { font-size: 1.4rem; color: var(--accent); }
        .sv-runtime-banner .sv-rt-label { font-weight: 600; font-size: 0.95rem; }
        .sv-runtime-banner .sv-rt-detail { font-size: 0.82rem; color: var(--text-dim); }
        .upd-banner { background: var(--bg-card); border: 1px solid var(--accent); border-radius: 10px; padding: 12px 18px; display: flex; align-items: center; gap: 12px; margin: 10px 18px 0 18px; }
        .upd-banner .upd-label { font-weight: 600; font-size: 0.93rem; }
        .upd-banner .upd-detail { font-size: 0.82rem; color: var(--text-dim); }
        .upd-banner .upd-close { margin-left: auto; cursor: pointer; color: var(--text-dim); font-size: 1.1rem; }
        .upd-banner .upd-close:hover { color: var(--text); }
        .sv-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 14px; margin-top: 10px;
        }
        .sv-card {
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
            padding: 16px; transition: border-color 0.2s;
        }
        .sv-card:hover { border-color: var(--accent); }
        .sv-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
        .sv-card-header i { font-size: 1.3rem; color: var(--accent); width: 24px; text-align: center; }
        .sv-card-header .sv-name { font-weight: 600; font-size: 0.95rem; }
        .sv-card-desc { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 12px; line-height: 1.4; }
        .sv-card-status { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
        .sv-badge {
            display: inline-block; padding: 3px 10px; border-radius: 12px;
            font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
        }
        .sv-badge.running { background: rgba(46,204,113,0.15); color: var(--success); }
        .sv-badge.stopped { background: rgba(241,196,15,0.15); color: #f1c40f; }
        .sv-badge.not_installed { background: rgba(149,165,166,0.15); color: var(--text-dim); }
        .sv-badge.error { background: rgba(231,76,60,0.15); color: var(--error); }
        .sv-badge.pulling, .sv-badge.starting { background: rgba(52,152,219,0.15); color: var(--accent); }
        .sv-card-url { font-size: 0.8rem; color: var(--accent); word-break: break-all; margin-bottom: 8px; }
        .sv-card-url a { color: var(--accent); text-decoration: none; }
        .sv-card-url a:hover { text-decoration: underline; }

        /* ── Apps panel ───────────────────────────────────────────── */
        .ap-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 16px; margin-top: 10px;
        }
        .ap-card {
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
            padding: 20px; text-align: center; transition: border-color 0.2s, box-shadow 0.2s;
            position: relative;
        }
        .ap-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
        .ap-card-icon { font-size: 2rem; color: var(--accent); margin-bottom: 10px; }
        .ap-card-name { font-weight: 600; font-size: 1rem; margin-bottom: 6px; }
        .ap-card-status {
            display: inline-flex; align-items: center; gap: 5px;
            font-size: 0.75rem; color: var(--success); margin-bottom: 12px;
        }
        .ap-card-status .ap-dot {
            width: 8px; height: 8px; border-radius: 50%;
            background: var(--success); display: inline-block;
        }
        .ap-card-actions { display: flex; gap: 8px; justify-content: center; }
        .ap-btn-open {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 8px 20px; border-radius: 8px; border: none;
            background: var(--accent); color: #fff; font-size: 0.85rem;
            font-weight: 600; cursor: pointer; text-decoration: none;
            transition: opacity 0.2s;
        }
        .ap-btn-open:hover { opacity: 0.85; }
        .ap-btn-gear {
            position: absolute; top: 10px; right: 10px;
            background: none; border: none; color: var(--text-dim);
            cursor: pointer; font-size: 0.85rem; padding: 4px;
            border-radius: 4px; transition: color 0.2s;
        }
        .ap-btn-gear:hover { color: var(--accent); }
        .ap-btn-docs {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
            background: transparent; color: var(--text-dim); font-size: 0.82rem;
            cursor: pointer; text-decoration: none; transition: border-color 0.2s, color 0.2s;
        }
        .ap-btn-docs:hover { border-color: var(--accent); color: var(--accent); }
        .ap-empty {
            text-align: center; padding: 60px 20px; color: var(--text-dim);
            grid-column: 1 / -1;
        }
        .ap-empty i { font-size: 3rem; margin-bottom: 16px; display: block; color: var(--border); }
        .ap-empty p { font-size: 0.95rem; line-height: 1.6; }
        .ap-empty a { color: var(--accent); cursor: pointer; text-decoration: none; }
        .ap-empty a:hover { text-decoration: underline; }

        /* ── Settings tab bar + Credential cards ──────────────────── */
        /* .set-tab-bar / .set-tab — unified in .tab-bar / .tab-btn above */
        .cred-filter-bar { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
        .cred-filter {
            padding: 5px 12px; border-radius: 16px; font-size: 0.78rem; font-weight: 500;
            border: 1px solid var(--border); background: transparent; color: var(--text-dim);
            cursor: pointer; transition: all 0.2s;
        }
        .cred-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
        .cred-filter:hover:not(.active) { border-color: var(--text-dim); color: var(--text); }
        #cred-cards-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 12px;
        }
        .cred-card {
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
            padding: 14px 16px; transition: border-color 0.2s;
        }
        .cred-card:hover { border-color: var(--accent); }
        .cred-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
        .cred-card-head .cred-name { font-weight: 600; font-size: 0.9rem; flex: 1; }
        .cred-badge {
            display: inline-block; padding: 2px 10px; border-radius: 12px;
            font-size: 0.72rem; font-weight: 600; text-transform: uppercase; white-space: nowrap;
        }
        .cred-badge.valid { background: rgba(46,204,113,0.15); color: var(--success); }
        .cred-badge.attention { background: rgba(245,158,11,0.15); color: #f59e0b; }
        .cred-badge.unconfigured { background: rgba(149,165,166,0.15); color: var(--text-dim); }
        .cred-badge.untested { background: rgba(52,152,219,0.15); color: var(--accent); }
        .cred-card-detail { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 8px; line-height: 1.4; }
        .cred-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
        .cred-card-actions button { font-size: 0.76rem; padding: 4px 10px; }
        .cred-card-actions a { font-size: 0.76rem; color: var(--accent); text-decoration: none; }
        .cred-card-actions a:hover { text-decoration: underline; }
        .cred-card-icon { color: var(--accent); font-size: 1.1rem; width: 20px; text-align: center; }
        .cred-error-detail { color: #f59e0b; }
        .cred-attention-count { color: #f59e0b; }
        .cred-empty { color: var(--text-dim); text-align: center; padding: 20px; }
        .cred-empty-lg { text-align: center; color: var(--text-dim); padding: 40px; }
        .cred-alert-banner {
            background: linear-gradient(135deg, #78350f, #92400e); color: #fef3c7;
            padding: 10px 14px; border-radius: 8px; margin: 0 0 8px 0;
            font-size: 0.85rem; line-height: 1.4;
        }
        .cred-alert-content { display: flex; align-items: center; gap: 8px; flex: 1; }
        .cred-alert-icon { font-size: 1rem; }
        .cred-alert-actions { display: flex; gap: 8px; margin-top: 6px; }
        .cred-alert-fix-btn {
            background: #fef3c7; color: #78350f; padding: 4px 12px; border-radius: 6px;
            font-size: 0.8rem; font-weight: 600; border: none; cursor: pointer;
        }
        .cred-alert-dismiss-btn {
            background: none; border: 1px solid #fef3c7; color: #fef3c7;
            padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; cursor: pointer;
        }
        .cred-modal-hint { font-size: 0.82rem; color: var(--text-dim); margin: 0 0 14px; }
        .cred-modal-error {
            display: none; color: #f59e0b; font-size: 0.82rem; margin: 8px 0;
            padding: 8px 12px; background: rgba(245,158,11,0.1); border-radius: 6px;
        }
        .cred-modal-success {
            display: none; color: var(--success); font-size: 0.82rem; margin: 8px 0;
            padding: 8px 12px; background: rgba(46,204,113,0.1); border-radius: 6px;
        }
        .cred-modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
        .cred-modal-docs {
            font-size: 0.8rem; align-self: center; margin-right: auto;
            color: var(--accent); display: none;
        }
        .cred-audit-entry {
            display: flex; align-items: center; gap: 10px; padding: 8px 12px;
            background: var(--bg-input); border-radius: 8px; font-size: 0.85rem;
        }
        .cred-audit-icon-validated { color: #22c55e; }
        .cred-audit-icon-refreshed { color: #3b82f6; }
        .cred-audit-icon-updated { color: #8b5cf6; }
        .cred-audit-icon-failed { color: #ef4444; }
        .cred-audit-icon-accessed { color: var(--text-dim); }
        .cred-audit-icon-invalidated { color: #f59e0b; }
        .cred-audit-icon-created { color: #22c55e; }
        .cred-audit-icon-deleted { color: #ef4444; }
        .cred-audit-icon-preflight_blocked { color: #f59e0b; }
        .cred-audit-icon-retry_refresh { color: #3b82f6; }
        .cred-audit-svc { min-width: 100px; font-weight: 600; }
        .cred-audit-type { min-width: 90px; }
        .cred-audit-detail { color: var(--text-dim); font-size: 0.78rem; margin-left: 8px; }
        .cred-audit-src { color: var(--text-dim); font-size: 0.72rem; margin-left: auto; white-space: nowrap; }
        .cred-audit-ts { color: var(--text-dim); font-size: 0.72rem; white-space: nowrap; }

        /* ── Login Overlay ──────────────────────────────────────── */
        .login-overlay {
            position: fixed; inset: 0; background: rgba(15,15,26,0.95);
            display: flex; align-items: center; justify-content: center; z-index: 9999;
        }
        .login-card {
            background: #1a1a2e; padding: 40px; border-radius: 12px;
            max-width: 520px; width: 90%; text-align: center;
        }
        .login-title { margin-bottom: 4px; color: #eaeaea; }
        .login-version { color: #555; font-size: 12px; font-family: monospace; }
        .login-hint { color: #888; margin-bottom: 24px; margin-top: 16px; font-size: 14px; }
        .login-input {
            width: 100%; padding: 12px; background: #252540; border: 1px solid #333;
            border-radius: 6px; color: #eaeaea; font-family: monospace;
            font-size: 14px; margin-bottom: 16px;
        }
        .login-btn {
            width: 100%; padding: 12px; background: #e94560; color: white;
            border: none; border-radius: 6px; cursor: pointer;
            font-size: 14px; font-weight: 600;
        }
        .login-error { color: #f87171; margin-top: 12px; font-size: 13px; display: none; }
        .login-troubleshoot-link {
            display: inline-block; margin-top: 16px; color: #666; font-size: 12px;
            text-decoration: none; border-bottom: 1px dashed #555;
        }
        .login-troubleshoot {
            display: none; text-align: left; margin-top: 16px; padding: 16px;
            background: #151528; border-radius: 8px; font-size: 13px;
            color: #ccc; line-height: 1.6;
        }
        .login-troubleshoot h4 { color: #e94560; margin: 0 0 12px 0; font-size: 14px; }
        .login-troubleshoot details { margin-bottom: 12px; }
        .login-troubleshoot details:last-child { margin-bottom: 0; }
        .login-troubleshoot summary { cursor: pointer; color: #eaeaea; font-weight: 600; }
        .login-troubleshoot p { margin: 8px 0 4px 0; color: #999; }
        .login-troubleshoot pre {
            background: #252540; padding: 10px; border-radius: 4px;
            overflow-x: auto; font-size: 12px; color: #a5b4fc; margin: 8px 0;
        }
        .login-troubleshoot code {
            background: #252540; padding: 2px 5px; border-radius: 3px;
        }

        /* ── Round Table ─────────────────────────────────────────── */
        .rt-tab {
            padding: 12px 16px; background: none; border: none;
            border-bottom: 2px solid transparent; color: var(--text-dim);
            font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
        }
        .rt-tab.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
        .rt-tab:hover:not(.active) { color: var(--text); }
        .rt-save-overlay {
            position: absolute; inset: 0; background: #0009; z-index: 100;
            align-items: center; justify-content: center; display: none;
        }
        .rt-save-overlay.show { display: flex; }
        .rt-save-card {
            background: var(--bg-dark); border: 1px solid var(--border);
            border-radius: 14px; padding: 24px; width: 360px; max-width: 90vw;
        }
        .rt-save-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
        .rt-save-label { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 14px; }
        .rt-save-input {
            width: 100%; box-sizing: border-box; background: var(--bg);
            border: 1px solid var(--border); color: var(--text); border-radius: 8px;
            padding: 9px 12px; font-size: 0.9rem; outline: none; margin-bottom: 14px;
        }
        .rt-seat {
            display: flex; align-items: center; gap: 7px;
            padding: 6px 12px; border-radius: 20px; cursor: pointer;
            border: 1.5px solid var(--border); background: var(--bg);
            color: var(--text-dim); font-size: 0.82rem; font-weight: 500;
            transition: border-color 0.15s, background 0.15s, color 0.15s;
            user-select: none;
        }
        .rt-seat:hover { border-color: var(--accent); color: var(--text); }
        .rt-seat.active {
            border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent);
            color: var(--text);
        }
        .rt-seat i { width: 16px; text-align: center; }
        .rt-card {
            background: var(--bg-dark); border: 1px solid var(--border);
            border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
            min-height: 180px;
        }
        .rt-card-header {
            display: flex; align-items: center; gap: 10px;
            padding: 12px 16px; border-bottom: 1px solid var(--border);
            background: var(--bg);
        }
        .rt-card-header i { font-size: 1rem; color: var(--accent); width: 18px; text-align: center; }
        .rt-card-header .rt-card-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
        .rt-card-body {
            flex: 1; padding: 14px 16px; font-size: 0.87rem; line-height: 1.6;
            color: var(--text); overflow-y: auto; white-space: pre-wrap;
        }
        .rt-card-body.loading { color: var(--text-dim); font-style: italic; }
        .rt-card-body.error { color: #f87171; }
        .rt-card .rt-spinner {
            display: inline-block; width: 12px; height: 12px;
            border: 2px solid var(--border); border-top-color: var(--accent);
            border-radius: 50%; animation: spin 0.7s linear infinite;
            margin-right: 6px; vertical-align: middle;
        }
        .sv-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
        .sv-btn {
            padding: 5px 14px; border-radius: 8px; border: 1px solid var(--border);
            background: var(--bg-input); color: var(--text); font-size: 0.8rem;
            cursor: pointer; transition: all 0.2s;
        }
        .sv-btn:hover { border-color: var(--accent); color: var(--accent); }
        .sv-btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
        .sv-btn.primary:hover { opacity: 0.85; }
        .sv-btn.danger { color: var(--error); border-color: var(--error); }
        .sv-btn.danger:hover { background: var(--error); color: white; }
        .sv-btn:disabled { opacity: 0.4; cursor: not-allowed; }

        /* ── Training / Corpus Panel ── */
        /* .tr-tab-bar / .tr-tab — unified in .tab-bar / .tab-btn above */
        .tr-consent-card { border:1px solid var(--border); border-radius:12px; padding:18px; margin-bottom:16px; background:var(--bg-card); }
        .tr-consent-header { display:flex; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
        .tr-consent-title { font-weight:600; font-size:0.95rem; flex:1; }
        .tr-consent-status { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px; font-size:0.78rem; font-weight:600; }
        .tr-consent-status.active { background:rgba(46,204,113,0.15); color:var(--success); }
        .tr-consent-status.inactive { background:rgba(231,76,60,0.15); color:var(--error); }
        .tr-consent-chain { font-size:0.75rem; color:var(--text-dim); margin-top:6px; font-family:monospace; }
        .tr-consent-actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
        .tr-stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; margin-bottom:16px; }
        .tr-stat-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:14px; text-align:center; }
        .tr-stat-num { font-size:1.6rem; font-weight:700; color:var(--accent); line-height:1; }
        .tr-stat-label { font-size:0.72rem; color:var(--text-dim); margin-top:4px; }
        .tr-stat-card.warn .tr-stat-num { color:#f1c40f; }
        .tr-stat-card.danger .tr-stat-num { color:var(--error); }
        .tr-section-title { font-weight:600; font-size:0.82rem; margin:18px 0 10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.05em; }
        .tr-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--text); cursor:pointer; font-size:0.83rem; transition:all 0.2s; }
        .tr-btn:hover { border-color:var(--accent); color:var(--accent); }
        .tr-btn.primary { background:var(--accent); color:white; border-color:var(--accent); }
        .tr-btn.primary:hover { opacity:0.85; }
        .tr-btn.danger { color:var(--error); border-color:var(--error); }
        .tr-btn.danger:hover { background:var(--error); color:white; }
        .tr-btn:disabled { opacity:0.4; cursor:not-allowed; }
        .tr-memory-list { display:flex; flex-direction:column; gap:6px; }
        .tr-memory-row { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--bg-card); border:1px solid var(--border); border-radius:10px; transition:border-color 0.2s; }
        .tr-memory-row:hover { border-color:var(--accent); }
        .tr-memory-name { font-size:0.85rem; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .tr-memory-topic { font-size:0.75rem; color:var(--text-dim); }
        .tr-memory-meta { display:flex; gap:6px; align-items:center; flex-shrink:0; }
        .tr-badge { padding:2px 8px; border-radius:10px; font-size:0.72rem; font-weight:600; }
        .tr-badge.eligible { background:rgba(46,204,113,0.15); color:var(--success); }
        .tr-badge.ineligible { background:rgba(149,165,166,0.15); color:var(--text-dim); }
        .tr-badge.phi { background:rgba(231,76,60,0.15); color:var(--error); }
        .tr-badge.domain { background:rgba(52,152,219,0.1); color:var(--accent); }
        .tr-entry-list { display:flex; flex-direction:column; gap:8px; }
        .tr-entry-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:14px; }
        .tr-entry-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
        .tr-entry-id { font-family:monospace; font-size:0.75rem; color:var(--text-dim); }
        .tr-entry-q { font-size:0.75rem; font-weight:600; }
        .tr-entry-instruction { font-size:0.83rem; color:var(--text-dim); margin-bottom:6px; font-style:italic; }
        .tr-entry-response { font-size:0.82rem; line-height:1.5; max-height:80px; overflow:hidden; position:relative; }
        .tr-entry-response::after { content:''; position:absolute; bottom:0; left:0; right:0; height:24px; background:linear-gradient(transparent, var(--bg-card)); }
        .tr-entry-footer { display:flex; align-items:center; gap:8px; margin-top:10px; flex-wrap:wrap; }
        .tr-entry-hash { font-size:0.72rem; color:var(--text-dim); font-family:monospace; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; }
        .tr-phi-list { display:flex; flex-direction:column; gap:4px; margin-top:8px; }
        .tr-phi-item { display:flex; align-items:center; gap:8px; padding:7px 12px; background:rgba(231,76,60,0.05); border:1px solid rgba(231,76,60,0.2); border-radius:8px; font-size:0.82rem; }
        .tr-phi-item i { color:var(--error); }
        .tr-empty { text-align:center; padding:32px 20px; color:var(--text-dim); }
        .tr-empty i { font-size:2rem; opacity:0.3; display:block; margin-bottom:10px; }
        .tr-filter-bar { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
        .tr-filter-bar input, .tr-filter-bar select { padding:6px 10px; border:1px solid var(--border); border-radius:8px; background:var(--bg-input); color:var(--text); font-size:0.82rem; min-width:0; flex:1; }
        .sv-log-box {
            background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
            padding: 14px; font-family: monospace; font-size: 0.8rem; white-space: pre-wrap;
            max-height: 400px; overflow-y: auto; color: var(--text-dim); line-height: 1.5;
        }
        .sv-log-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
        .sv-log-controls select {
            padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
            background: var(--bg-input); color: var(--text); font-size: 0.85rem;
        }
        .sv-no-runtime {
            text-align: center; padding: 60px 20px; color: var(--text-dim);
        }
        .sv-no-runtime i { font-size: 3rem; margin-bottom: 16px; color: var(--text-dim); opacity: 0.4; }
        .sv-no-runtime h3 { margin-bottom: 8px; color: var(--text); }
        .sv-no-runtime p { font-size: 0.9rem; max-width: 500px; margin: 0 auto; line-height: 1.5; }
        .sv-no-runtime a { color: var(--accent); }

        /* Credentials panel */
        .sv-cred-card {
            background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
            padding: 16px 20px; margin-bottom: 12px;
        }
        .sv-cred-header {
            display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
            font-weight: 600; font-size: 0.95rem;
        }
        .sv-cred-header i { color: var(--accent); }
        .sv-cred-header a { font-size: 0.8rem; font-weight: 400; color: var(--accent);
            text-decoration: none; margin-left: auto; }
        .sv-cred-header a:hover { text-decoration: underline; }
        .sv-cred-row {
            display: flex; align-items: center; gap: 10px; padding: 8px 0;
            border-top: 1px solid var(--border); font-size: 0.85rem;
        }
        .sv-cred-row:first-of-type { border-top: none; }
        .sv-cred-label { color: var(--text-dim); min-width: 100px; font-size: 0.8rem;
            text-transform: uppercase; letter-spacing: 0.3px; }
        .sv-cred-value {
            font-family: monospace; background: var(--bg); padding: 4px 10px;
            border-radius: 6px; border: 1px solid var(--border); user-select: all;
            word-break: break-all; flex: 1;
        }
        .sv-cred-value.masked { color: var(--text-dim); }
        .sv-cred-copy {
            background: none; border: 1px solid var(--border); border-radius: 6px;
            padding: 4px 8px; cursor: pointer; color: var(--text-dim); font-size: 0.8rem;
        }
        .sv-cred-copy:hover { border-color: var(--accent); color: var(--accent); }
        .sv-cred-notes {
            font-size: 0.82rem; color: var(--text-dim); margin-top: 10px;
            padding: 8px 12px; background: color-mix(in srgb, var(--accent) 5%, var(--bg));
            border-radius: 6px; line-height: 1.5;
        }
        .sv-cred-empty {
            text-align: center; padding: 40px 20px; color: var(--text-dim);
        }
        .sv-cred-empty i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }
        .sv-cred-warn {
            font-size: 0.8rem; color: var(--text-dim); padding: 10px 0;
            border-bottom: 1px solid var(--border); margin-bottom: 12px;
        }
        .sv-cred-warn i { color: #f59e0b; margin-right: 6px; }

        /* Calendar panel */
        .cal-sources {
            display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
            font-size: 0.85rem; color: var(--text-dim); flex-wrap: wrap;
        }
        .cal-source-tag {
            display: inline-flex; align-items: center; gap: 4px;
            background: var(--bg-input); border-radius: 6px; padding: 4px 10px;
            font-size: 0.8rem; color: var(--text);
        }
        .cal-source-tag i { font-size: 0.75rem; }
        .cal-source-tag.cal-google i { color: #4285F4; }
        .cal-source-tag.cal-caldav i { color: #FF9800; }

        /* Day view */
        .cal-day-grid {
            display: flex; flex-direction: column; gap: 0;
            border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
        }
        .cal-hour-row {
            display: flex; min-height: 48px; border-bottom: 1px solid var(--border);
        }
        .cal-hour-row:last-child { border-bottom: none; }
        .cal-hour-label {
            width: 60px; min-width: 60px; padding: 6px 8px; font-size: 0.75rem;
            color: var(--text-dim); text-align: right; border-right: 1px solid var(--border);
            background: var(--bg-dark);
        }
        .cal-hour-slot { flex: 1; padding: 4px 8px; position: relative; }

        /* Week view */
        .cal-week-grid {
            display: grid; grid-template-columns: repeat(7, 1fr);
            gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
        }
        .cal-week-col {
            border-right: 1px solid var(--border); min-height: 300px;
            display: flex; flex-direction: column;
        }
        .cal-week-col:last-child { border-right: none; }
        .cal-week-header {
            padding: 8px; text-align: center; font-weight: 600; font-size: 0.85rem;
            background: var(--bg-dark); border-bottom: 1px solid var(--border);
            color: var(--text);
        }
        .cal-week-header.cal-today { color: var(--accent); }
        .cal-week-events { padding: 4px; flex: 1; overflow-y: auto; }

        /* Month view */
        .cal-month-grid {
            display: grid; grid-template-columns: repeat(7, 1fr);
            gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
        }
        .cal-month-header {
            padding: 6px; text-align: center; font-weight: 600; font-size: 0.8rem;
            background: var(--bg-dark); border-bottom: 1px solid var(--border);
            color: var(--text-dim);
        }
        .cal-month-cell {
            min-height: 80px; padding: 4px 6px; border-right: 1px solid var(--border);
            border-bottom: 1px solid var(--border); position: relative;
        }
        .cal-month-cell:nth-child(7n) { border-right: none; }
        .cal-month-day-num {
            font-size: 0.8rem; font-weight: 500; color: var(--text-dim); margin-bottom: 2px;
        }
        .cal-month-day-num.cal-today { color: var(--accent); font-weight: 700; }
        .cal-month-cell.cal-other-month { opacity: 0.35; }

        /* Shared event chip */
        .cal-event {
            background: var(--accent); color: #fff; border-radius: 4px;
            padding: 3px 6px; margin-bottom: 3px; font-size: 0.75rem;
            cursor: default; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .cal-event.cal-allday {
            background: var(--bg-input); color: var(--text); border-left: 3px solid var(--accent);
        }
        .cal-event-time {
            font-size: 0.7rem; color: rgba(255,255,255,0.8); margin-right: 4px;
        }
        .cal-allday .cal-event-time { color: var(--text-dim); }
        .cal-no-events {
            color: var(--text-dim); font-size: 0.85rem; padding: 12px; text-align: center;
        }

        /* Messages panel (Phase 8) */
        .msg-container { display: flex; height: calc(100vh - 140px); gap: 0; }
        .msg-contacts {
            width: 280px; min-width: 220px; border-right: 1px solid var(--border);
            display: flex; flex-direction: column; overflow-y: auto;
        }
        .msg-contact-item {
            display: flex; align-items: center; gap: 10px; padding: 12px 16px;
            cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--border);
        }
        .msg-contact-item:hover { background: var(--bg-input); }
        .msg-contact-item.active { background: var(--bg-card); border-left: 3px solid var(--accent); }
        .msg-online-dot {
            width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
        }
        .msg-online-dot.online { background: var(--success, #4caf50); }
        .msg-online-dot.offline { background: var(--text-dim); opacity: 0.4; }
        .msg-contact-info { flex: 1; min-width: 0; }
        .msg-contact-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .msg-contact-preview { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
        .msg-contact-unread {
            background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
            border-radius: 10px; padding: 1px 7px; min-width: 18px; text-align: center;
        }
        .msg-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
        .msg-chat-header {
            padding: 12px 18px; border-bottom: 1px solid var(--border);
            display: flex; align-items: center; gap: 10px;
        }
        .msg-chat-name { font-weight: 600; font-size: 1rem; }
        .msg-chat-status { font-size: 0.78rem; color: var(--text-dim); }
        .msg-history {
            flex: 1; overflow-y: auto; padding: 16px 18px; display: flex;
            flex-direction: column; gap: 6px;
        }
        .msg-bubble {
            max-width: 70%; padding: 10px 14px; border-radius: 16px;
            font-size: 0.9rem; line-height: 1.45; word-wrap: break-word;
        }
        .msg-bubble.outgoing {
            align-self: flex-end; background: var(--accent); color: #fff;
            border-bottom-right-radius: 4px;
        }
        .msg-bubble.incoming {
            align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border);
            border-bottom-left-radius: 4px;
        }
        .msg-bubble-meta {
            font-size: 0.68rem; margin-top: 4px; opacity: 0.7;
            display: flex; align-items: center; gap: 4px; justify-content: flex-end;
        }
        .msg-bubble.incoming .msg-bubble-meta { justify-content: flex-start; }
        .msg-typing {
            padding: 4px 18px; font-size: 0.8rem; color: var(--text-dim); font-style: italic;
        }
        /* Old .msg-input-wrap, .msg-input, .msg-send-btn removed — replaced by fi-bar/fi-input/fi-send */
        .msg-badge {
            background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 700;
            border-radius: 8px; padding: 1px 5px; margin-left: 6px; vertical-align: top;
        }
        .msg-empty {
            display: flex; align-items: center; justify-content: center;
            height: 100%; color: var(--text-dim); font-size: 0.9rem;
            flex-direction: column; gap: 8px; text-align: center; padding: 20px;
        }
        .msg-empty a { color: var(--accent); text-decoration: underline; cursor: pointer; }
        .msg-contacts-header {
            padding: 14px 16px; font-weight: 600; font-size: 0.95rem;
            border-bottom: 1px solid var(--border); position: sticky; top: 0;
            background: var(--bg-main); z-index: 2;
            display: flex; align-items: center; justify-content: space-between;
        }
        .msg-new-btn {
            background: none; border: 1px solid var(--border); border-radius: 50%;
            width: 26px; height: 26px; cursor: pointer; color: var(--text);
            display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
            transition: background 0.15s, color 0.15s;
        }
        .msg-new-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
        .msg-picker-section {
            padding: 6px 16px 8px; font-size: 0.78rem; color: var(--text-dim);
            border-top: 1px solid var(--border); font-weight: 600;
        }
        .msg-picker-item {
            display: flex; align-items: center; gap: 10px; padding: 10px 16px;
            cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--border);
            font-size: 0.88rem;
        }
        .msg-picker-item:hover { background: var(--bg-input); }
        .msg-picker-empty {
            padding: 10px 16px; font-size: 0.82rem; color: var(--text-dim);
        }
        .msg-name-edit {
            display: flex; gap: 6px; align-items: center; margin-top: 10px;
        }
        .msg-name-edit input {
            padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
            background: var(--bg-input); color: var(--text); font-size: 0.85rem; width: 180px;
        }
        .msg-name-edit button {
            padding: 6px 10px; border: none; border-radius: 6px; cursor: pointer;
            background: var(--accent); color: #fff; font-size: 0.8rem;
        }
        @media (max-width: 768px) {
            .msg-container { flex-direction: column; height: auto; }
            .msg-contacts { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
            .msg-bubble { max-width: 85%; }
        }

        /* Social Dashboard */
        /* .sc-tab-bar / .sc-tab — unified in .tab-bar / .tab-btn above */
        .sc-filter-chips { display: flex; gap: 6px; margin-bottom: 14px; }
        .sc-chip {
            padding: 5px 14px; border-radius: 16px; font-size: 0.82rem; cursor: pointer;
            border: 1px solid var(--border); background: transparent; color: var(--text-dim);
            transition: all 0.15s;
        }
        .sc-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
        .sc-chip:hover:not(.active) { border-color: var(--text-dim); color: var(--text); }
        .sc-feed-panel { max-height: calc(100vh - 240px); overflow-y: auto; }
        .sc-post-card {
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
            padding: 14px 16px; margin-bottom: 10px; transition: border-color 0.15s;
        }
        .sc-post-card:hover { border-color: var(--text-dim); }
        .sc-post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
        .sc-post-avatar {
            width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
            background: var(--bg-input); flex-shrink: 0;
        }
        .sc-post-author-wrap { flex: 1; min-width: 0; }
        .sc-post-display-name { font-weight: 600; font-size: 0.9rem; }
        .sc-post-handle { font-size: 0.8rem; color: var(--text-dim); }
        .sc-platform-badge {
            font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; font-weight: 600;
            text-transform: uppercase; flex-shrink: 0;
        }
        .sc-platform-badge.bluesky { background: #0085ff20; color: #0085ff; }
        .sc-platform-badge.mastodon { background: #6364ff20; color: #6364ff; }
        .sc-post-text { font-size: 0.92rem; line-height: 1.5; margin-bottom: 8px; white-space: pre-wrap; word-break: break-word; }
        .sc-post-metrics {
            display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-dim);
        }
        .sc-post-metrics span { display: flex; align-items: center; gap: 4px; }
        .sc-post-time { font-size: 0.78rem; color: var(--text-dim); margin-left: auto; }
        .sc-compose-panel { max-width: 600px; }
        .sc-checkbox-row { display: flex; gap: 16px; margin-bottom: 12px; align-items: center; }
        .sc-checkbox-row label {
            display: flex; align-items: center; gap: 6px; font-size: 0.88rem; cursor: pointer;
        }
        .sc-checkbox-row input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
        .sc-compose-textarea {
            width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border);
            border-radius: 10px; background: var(--bg-input); color: var(--text);
            font-size: 0.92rem; resize: vertical; font-family: inherit; line-height: 1.5;
        }
        .sc-compose-textarea:focus { outline: none; border-color: var(--accent); }
        .sc-char-count { text-align: right; font-size: 0.78rem; color: var(--text-dim); margin: 4px 0 12px; }
        .sc-char-count.over { color: var(--danger, #e53935); font-weight: 600; }
        .sc-post-btn {
            padding: 10px 24px; border: none; border-radius: 8px; cursor: pointer;
            background: var(--accent); color: #fff; font-weight: 600; font-size: 0.9rem;
            transition: opacity 0.15s;
        }
        .sc-post-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .sc-post-btn:hover:not(:disabled) { opacity: 0.9; }
        .sc-notif-panel { max-height: calc(100vh - 240px); overflow-y: auto; }
        .sc-notif-card {
            display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
            border-bottom: 1px solid var(--border); transition: background 0.15s;
        }
        .sc-notif-card:hover { background: var(--bg-input); }
        .sc-notif-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
        .sc-notif-body { flex: 1; min-width: 0; }
        .sc-notif-author { font-weight: 600; font-size: 0.88rem; }
        .sc-notif-text { font-size: 0.85rem; color: var(--text-dim); margin-top: 2px; }
        .sc-notif-time { font-size: 0.75rem; color: var(--text-dim); margin-top: 3px; }
        .sc-notif-type { font-size: 0.72rem; text-transform: uppercase; font-weight: 600; margin-left: 4px; }
        .sc-empty-state {
            display: flex; align-items: center; justify-content: center; flex-direction: column;
            gap: 12px; padding: 60px 20px; color: var(--text-dim); text-align: center;
        }
        .sc-empty-state i { font-size: 2.5rem; opacity: 0.3; }
        .sc-empty-state a { color: var(--accent); text-decoration: underline; cursor: pointer; }
        .sc-load-more {
            display: block; margin: 10px auto; padding: 8px 20px; border: 1px solid var(--border);
            border-radius: 8px; background: transparent; color: var(--text-dim); cursor: pointer;
            font-size: 0.85rem; transition: all 0.15s;
        }
        .sc-load-more:hover { border-color: var(--accent); color: var(--accent); }
        .sc-error-banner {
            background: var(--danger, #e53935); color: #fff; padding: 8px 14px; border-radius: 8px;
            font-size: 0.82rem; margin-bottom: 12px; display: none;
        }
        .sc-badge {
            background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 700;
            border-radius: 8px; padding: 1px 5px; margin-left: 6px; vertical-align: top;
        }
        @media (max-width: 768px) {
            .sc-compose-panel { max-width: 100%; }
            .sc-post-metrics { gap: 10px; }
        }

        /* Tarot Panel (dedicated spread) */
        .tarot-panel-spread {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 16px;
        }
        .tarot-panel-card {
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: 12px;
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
        }
        .tarot-panel-card:hover { transform: translateY(-4px); border-color: var(--accent); }
        .tarot-panel-card.all-done { border-color: var(--success); }
        .tarot-panel-card .tarot-icon { font-size: 2.2rem; margin-bottom: 8px; }
        .tarot-panel-card .tarot-name { font-weight: 600; font-size: 1.05rem; margin-bottom: 2px; }
        .tarot-panel-card .tarot-numeral { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px; }
        .tarot-panel-card .tarot-desc { font-size: 0.8rem; color: var(--text-dim); line-height: 1.4; margin-bottom: 10px; }
        .tarot-panel-card .tarot-progress { font-size: 0.8rem; color: var(--accent); font-weight: 500; }
        .tarot-detail-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); display: none; align-items: center;
            justify-content: center; z-index: 200;
        }
        .tarot-detail-overlay.show { display: flex; }
        .tarot-detail-modal {
            background: var(--bg-card); border-radius: 16px; padding: 28px;
            width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto;
        }
        .tarot-detail-modal h3 { margin-bottom: 8px; }
        .tarot-detail-modal .tarot-flavor { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; margin-bottom: 16px; }
        .tarot-service-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px 0; border-bottom: 1px solid var(--border);
        }
        .tarot-service-row:last-child { border-bottom: none; }
        .tarot-service-row .svc-name { font-size: 0.9rem; }
        .tarot-service-row .svc-status { font-size: 0.8rem; }
        .tarot-service-row .svc-status.connected { color: var(--success); }
        .tarot-service-row .svc-status.pending { color: var(--text-dim); }
        .tarot-service-row button {
            padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
            background: var(--bg-input); color: var(--text); cursor: pointer;
            font-size: 0.8rem; transition: all 0.2s;
        }
        .tarot-service-row button:hover { background: var(--accent); color: white; border-color: var(--accent); }

        /* Custom color dropdown */
        .cdrop { position: relative; display: inline-block; width: 100%; }
        .cdrop-btn {
            width: 100%; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border);
            border-radius: 8px; color: var(--text); cursor: pointer; text-align: left; font-size: 0.85rem;
            display: flex; justify-content: space-between; align-items: center;
        }
        .cdrop-btn:hover { border-color: var(--accent); }
        .cdrop-btn::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 0.6rem; color: var(--text-dim); }
        .cdrop-list {
            display: none; position: fixed; z-index: 9999;
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
            max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        }
        .cdrop.open .cdrop-list { display: block; }
        .cdrop-item {
            padding: 8px 12px; cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; gap: 8px;
        }
        .cdrop-item:hover { background: var(--bg-input); }
        .cdrop-item.selected { background: rgba(233,69,96,0.15); }
        .cdrop-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

        /* Activity Monitor Panel */
        .activity-kpi-grid {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
        }
        .activity-kpi-grid .card { text-align: center; padding: 14px; }
        .activity-kpi-grid .kpi-value { font-size: 1.5rem; font-weight: 700; margin-bottom: 2px; }
        .activity-kpi-grid .kpi-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; }
        .activity-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
        .activity-table th { text-align: left; padding: 8px 10px; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 0.75rem; text-transform: uppercase; }
        .activity-table td { padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); }
        .activity-bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--accent); min-width: 2px; }
        .activity-status-ok { color: var(--success); }
        .activity-status-warn { color: var(--warning); }
        .activity-status-err { color: var(--error); }
        .activity-dep-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
        .activity-dep-row .dep-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .activity-progress-bar { width: 100%; height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
        .activity-progress-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
        .activity-badge { display: inline-block; background: var(--error); color: white; font-size: 0.65rem; padding: 1px 6px; border-radius: 10px; margin-left: 6px; font-weight: 700; }
        .activity-badge.amber { background: var(--warning); color: #000; }
        @media (max-width: 900px) { .activity-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

        /* Activity — act- class family */
        .act-header-meta { display: flex; align-items: center; gap: 12px; }
        .act-updated { font-size: 0.75rem; color: var(--text-dim); }
        .act-kpi-sub { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }
        .act-spend-card { padding: 16px; margin-bottom: 16px; }
        .act-spend-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
        .act-spend-title { font-weight: 600; font-size: 0.85rem; }
        .act-spend-content { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
        .act-spend-bar-wrap { flex: 1; min-width: 200px; }
        .act-spend-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg-input); margin-bottom: 6px; }
        .act-spend-bar-int { background: var(--accent); height: 100%; transition: width 0.3s; }
        .act-spend-bar-pro { background: #a78bfa; height: 100%; transition: width 0.3s; }
        .act-spend-legend { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-dim); }
        .act-spend-tokens { text-align: right; font-size: 0.75rem; color: var(--text-dim); min-width: 120px; }
        .act-spend-tokens span { color: var(--text); }
        .act-tab-content { overflow-x: auto; }
        .act-filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; padding: 4px 0; }
        .act-filter-select { font-size: 0.8rem; padding: 4px 8px; background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: 6px; }
        .act-filter-count { font-size: 0.75rem; color: var(--text-dim); }
        .act-td-nowrap { white-space: nowrap; font-size: 0.78rem; }
        .act-td-small { font-size: 0.78rem; }
        .act-td-ellipsis { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .act-td-error { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--error); }
        .act-trigger { font-size: 0.75rem; font-weight: 600; }
        .act-trigger-interactive { color: var(--accent); }
        .act-trigger-proactive { color: #a78bfa; }
        .act-rid { font-size: 0.7rem; color: var(--accent); }
        .act-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 10px; align-items: center; }
        .act-pagination .btn { font-size: 0.75rem; padding: 4px 10px; }
        .act-pagination-info { font-size: 0.75rem; color: var(--text-dim); }
        .act-empty { color: var(--text-dim); text-align: center; padding: 20px; }
        .act-alert { padding: 10px 14px; margin-bottom: 8px; background: var(--bg-input); border-radius: 0 8px 8px 0; border-left: 3px solid var(--text-dim); }
        .act-alert-critical { border-left-color: var(--error); }
        .act-alert-warning { border-left-color: var(--warning); }
        .act-alert-title { font-weight: 600; font-size: 0.85rem; }
        .act-alert-sev { font-size: 0.75rem; text-transform: uppercase; }
        .act-alert-msg { font-size: 0.8rem; color: var(--text-dim); margin-top: 3px; }
        .act-alert-threshold { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
        .act-section-title { margin: 16px 0 10px; font-size: 0.9rem; }
        .act-section-title:first-child { margin-top: 0; }
        .act-resource-row { margin-bottom: 8px; }
        .act-resource-label { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 3px; }
        .act-resource-meta { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 12px; }
        .act-dep-name { flex: 1; font-size: 0.85rem; }
        .act-dep-name-active { flex: 1; font-size: 0.85rem; font-weight: 600; }
        .act-dep-status { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
        .act-dep-latency { font-size: 0.75rem; color: var(--text-dim); margin-left: 8px; }
        .act-dep-error { font-size: 0.75rem; color: var(--error); margin-left: 8px; }
        .act-rate-badge { font-size: 0.7rem; margin-left: 8px; }
        .act-routing-info { font-size: 0.85rem; margin-bottom: 8px; }
        .act-routing-active { color: var(--success); font-weight: 600; }
        .act-routing-model { color: var(--text-dim); font-size: 0.75rem; }
        .act-routing-chain { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 12px; }
        .act-uptime { font-size: 0.8rem; color: var(--text-dim); margin-top: 12px; }
        .act-chart-wrap { display: flex; gap: 20px; flex-wrap: wrap; }
        .act-chart-col { flex: 1; min-width: 280px; }
        .act-chart-title { margin: 0 0 8px; font-size: 0.85rem; }
        .act-chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 100px; }
        .act-chart-bar { flex: 1; min-width: 6px; max-width: 20px; border-radius: 2px 2px 0 0; opacity: 0.8; }
        .act-chart-bar-accent { background: var(--accent); }
        .act-chart-bar-stacked { overflow: hidden; }
        .act-chart-axis { display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--text-dim); margin-top: 4px; }
        .act-chart-legend { font-size: 0.65rem; color: var(--text-dim); margin-top: 6px; }
        .act-cb-failures { font-size: 0.75rem; color: var(--text-dim); margin-left: 8px; }

        /* Gallery Vault */
        .gallery-tab-bar { display:flex; gap:4px; padding:8px 16px; border-bottom:1px solid var(--border); }
        .gallery-tab { padding:8px 16px; border-radius:6px 6px 0 0; cursor:pointer; font-size:0.85rem; color:var(--text-dim); border:1px solid transparent; border-bottom:none; white-space:nowrap; transition:all 0.2s; }
        .gallery-tab:hover { color:var(--text); background:var(--bg-input); }
        .gallery-tab.active { color:var(--accent); background:var(--bg-card); border-color:var(--border); font-weight:600; }
        .gallery-tab i { margin-right:6px; }
        .gallery-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:16px; padding:16px; }
        .gallery-card { position:relative; border-radius:10px; overflow:hidden; border:1px solid var(--border); background:var(--bg-input); cursor:pointer; transition:all 0.2s; }
        .gallery-card:hover { border-color:var(--accent); transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.3); }
        .gallery-card-img { width:100%; aspect-ratio:1; object-fit:cover; display:block; background:var(--bg-dark); }
        .gallery-card-overlay { position:absolute; bottom:0; left:0; right:0; padding:10px 12px; background:linear-gradient(transparent, rgba(0,0,0,0.8)); }
        .gallery-card-overlay .title { font-size:0.9rem; font-weight:600; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .gallery-card-overlay .artist { font-size:0.75rem; color:var(--text-dim); }
        .gallery-card-badge { position:absolute; top:8px; right:8px; display:flex; gap:4px; }
        .chain-badge { padding:3px 8px; border-radius:12px; font-size:0.65rem; font-weight:700; }
        .chain-badge.verified { background:rgba(74,222,128,0.2); color:var(--success); border:1px solid var(--success); }
        .chain-badge.unverified { background:rgba(251,191,36,0.2); color:var(--warning); border:1px solid var(--warning); }
        .wm-type-icon { width:20px; height:20px; border-radius:50%; background:var(--bg-card); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:0.55rem; color:var(--text-dim); }
        .gallery-detail { padding:16px; }
        .gallery-detail-header { display:flex; gap:24px; flex-wrap:wrap; margin-bottom:20px; }
        .gallery-detail-img { max-width:500px; max-height:500px; border-radius:10px; border:1px solid var(--border); }
        .gallery-detail-meta { flex:1; min-width:240px; }
        .gallery-detail-meta h3 { margin:0 0 8px; font-size:1.3rem; }
        .gallery-detail-meta .meta-row { display:flex; gap:8px; margin-bottom:6px; font-size:0.85rem; color:var(--text-dim); }
        .gallery-detail-meta .meta-row strong { color:var(--text); min-width:100px; }
        .gallery-upload-zone { border:2px dashed var(--border); border-radius:12px; padding:48px 24px; text-align:center; cursor:pointer; transition:all 0.2s; margin:16px; color:var(--text-dim); }
        .gallery-upload-zone:hover, .gallery-upload-zone.dragover { border-color:var(--accent); color:var(--accent); background:rgba(233,69,96,0.05); }
        .gallery-upload-zone i { font-size:2.5rem; margin-bottom:12px; display:block; }
        .gallery-form { padding:0 16px 16px; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
        .gallery-form label { font-size:0.8rem; color:var(--text-dim); margin-bottom:4px; display:block; }
        .gallery-form input, .gallery-form select, .gallery-form textarea { width:100%; padding:8px 12px; border-radius:6px; border:1px solid var(--border); background:var(--bg-input); color:var(--text); font-size:0.9rem; box-sizing:border-box; }
        .gallery-form textarea { min-height:60px; resize:vertical; }
        .gallery-form .full-width { grid-column:1/-1; }
        .gallery-wm-checks { display:flex; gap:16px; align-items:center; padding:4px 0; }
        .gallery-wm-checks label { display:flex; align-items:center; gap:6px; cursor:pointer; font-size:0.85rem; color:var(--text); margin-bottom:0; }
        .gallery-verify-result { padding:16px; }
        .gallery-verify-block { background:var(--bg-input); border-radius:8px; padding:16px; margin-top:12px; border:1px solid var(--border); font-family:monospace; font-size:0.8rem; }
        .gallery-verify-block .vr-row { display:flex; gap:8px; margin-bottom:6px; }
        .gallery-verify-block .vr-row strong { color:var(--text); min-width:120px; }
        .gallery-verify-block .vr-row span { color:var(--text-dim); word-break:break-all; }
        .gallery-empty { text-align:center; padding:48px 24px; color:var(--text-dim); }
        .gallery-empty i { font-size:3rem; margin-bottom:16px; display:block; opacity:0.3; }

