    /* =============================================
       Live Insight Widget
       ============================================= */
    .live-insight {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.2rem 0.5rem;
      border-radius: 20px;
      background: rgba(99, 102, 241, 0.06);
      border: 1px solid rgba(99, 102, 241, 0.12);
      cursor: pointer;
      transition: all var(--transition-fast);
      max-width: 42px;
      overflow: hidden;
      position: relative;
      height: 34px;
      flex-shrink: 0;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
    .live-insight:hover { background: rgba(99, 102, 241, 0.12); }
    .live-insight.active {
      max-width: 340px;
      padding: 0.2rem 0.65rem 0.2rem 0.45rem;
      background: rgba(99, 102, 241, 0.1);
      border-color: rgba(99, 102, 241, 0.3);
      box-shadow: 0 0 12px rgba(99,102,241,0.15);
    }
    .live-insight-icon {
      font-size: 0.85rem;
      flex-shrink: 0;
      width: 20px;
      text-align: center;
      line-height: 1;
    }
    @keyframes insightPulse {
      0%, 100% { filter: drop-shadow(0 0 3px rgba(99, 102, 241, 0.4)); }
      50% { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.8)); }
    }
    .live-insight.active .live-insight-icon {
      animation: insightPulse 4s ease-in-out infinite;
    }
    .live-insight-content {
      display: none;
      flex-direction: column;
      min-width: 0;
      gap: 1px;
    }
    .live-insight.active .live-insight-content { display: flex; }
    .live-insight-project {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
    }
    .live-insight-project .model-badge {
      font-size: 0.6rem;
      font-weight: 700;
      padding: 1px 5px;
      border-radius: 4px;
      letter-spacing: 0.3px;
      white-space: nowrap;
    }
    .model-badge.opus { background: rgba(168, 85, 247, 0.25); color: #c084fc; }
    .model-badge.sonnet { background: rgba(6, 182, 212, 0.25); color: #22d3ee; }
    .live-insight-thought {
      font-size: 0.65rem;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 240px;
      font-style: italic;
    }
    .live-insight-thought.action {
      font-style: normal;
      color: var(--amber);
      font-family: 'SF Mono', 'Fira Code', monospace;
      font-size: 0.62rem;
    }

    /* Dropdown panel */
    .live-insight-panel {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 340px;
      max-height: 420px;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-lg), var(--shadow-glow);
      z-index: 200;
      overflow: hidden;
      flex-direction: column;
      backdrop-filter: blur(var(--glass-blur));
      -webkit-backdrop-filter: blur(var(--glass-blur));
    }
    .live-insight-panel.open { display: flex; }
    .live-insight-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.6rem 0.75rem;
      border-bottom: 1px solid var(--border-color);
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    .insight-elapsed {
      font-size: 0.7rem;
      color: var(--text-muted);
      font-variant-numeric: tabular-nums;
    }
    .insight-timeline {
      padding: 0.5rem 0.75rem;
      overflow-y: auto;
      max-height: 220px;
    }
    .insight-timeline-item {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      padding: 0.3rem 0;
      position: relative;
      font-size: 0.72rem;
      color: var(--text-secondary);
    }
    .insight-timeline-item + .insight-timeline-item::before {
      content: '';
      position: absolute;
      left: 5px;
      top: -4px;
      height: 10px;
      width: 1px;
      background: var(--border-light);
    }
    .insight-dot {
      width: 11px; height: 11px;
      border-radius: 50%;
      border: 2px solid var(--border-light);
      flex-shrink: 0;
      margin-top: 2px;
      background: transparent;
    }
    .insight-timeline-item.completed .insight-dot {
      background: var(--emerald);
      border-color: var(--emerald);
      box-shadow: 0 0 6px rgba(16,185,129,0.4);
    }
    .insight-timeline-item.active .insight-dot {
      border-color: var(--indigo);
      box-shadow: 0 0 8px rgba(99, 102, 241, 0.6), 0 0 16px rgba(99, 102, 241, 0.2);
    }
    @keyframes dotPulse {
      0%, 100% { box-shadow: 0 0 4px rgba(99, 102, 241, 0.4); }
      50% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.8); }
    }
    .insight-timeline-item.active .insight-dot { animation: dotPulse 2s ease-in-out infinite; }
    .insight-timeline-item.completed .insight-title {
      text-decoration: line-through;
      opacity: 0.5;
    }
    .insight-timeline-item.active .insight-title {
      color: var(--text-primary);
      font-weight: 600;
    }
    .insight-title { line-height: 1.3; }
    .insight-phase-tag {
      font-size: 0.58rem;
      color: var(--text-muted);
      display: block;
    }

    /* Live stream section */
    .insight-live-section {
      border-top: 1px solid var(--border-color);
      padding: 0.55rem 0.75rem;
    }
    .insight-live-label {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 0.6rem;
      font-weight: 700;
      letter-spacing: 0.5px;
      color: var(--rose);
      margin-bottom: 0.35rem;
      text-transform: uppercase;
    }
    .insight-live-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--rose);
      animation: insightPulse 4s ease infinite;
    }
    .insight-live-text {
      font-size: 0.7rem;
      color: var(--text-secondary);
      line-height: 1.4;
      max-height: 80px;
      overflow-y: auto;
      word-break: break-word;
    }
    .insight-live-text.thinking { font-style: italic; color: var(--text-muted); }
    .insight-live-text.action { color: var(--amber); font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.65rem; }

    /* Responsive: compact on mobile */
    @media (max-width: 768px) {
      .live-insight { max-width: 36px; height: 30px; padding: 0.15rem 0.4rem; }
      .live-insight.active { max-width: 36px; padding: 0.15rem 0.4rem; }
      .live-insight.active .live-insight-content { display: none; }
    }
    @media (max-width: 1024px) {
      .live-insight.active { max-width: 200px; }
      .live-insight-thought { max-width: 120px; }
    }

    /* Emma profile card (expandable from header) */
    .emma-profile-card {
      display: none;
      flex-direction: column;
      gap: 0.6rem;
      padding: 0.85rem;
      background: rgba(8, 9, 13, 0.7);
      border-bottom: 1px solid var(--glass-border);
      animation: emmaSlideDown 0.2s ease;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      position: relative;
      overflow-y: auto;
      flex-shrink: 0;
      max-height: 25vh;
    }

    .emma-profile-card::after {
      content: '';
      position: absolute;
      inset: 0;
      background: var(--glass-shine);
      pointer-events: none;
    }
    .emma-profile-card.open { display: flex; }
    @keyframes emmaSlideDown {
      from { opacity: 0; max-height: 0; padding: 0 0.85rem; }
      to { opacity: 1; max-height: 300px; padding: 0.85rem; }
    }
    .emma-profile-top {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .emma-profile-avatar {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: linear-gradient(135deg, #ef4444, #dc2626);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      font-weight: 700;
      color: white;
      flex-shrink: 0;
      overflow: hidden;
      background-size: cover;
      background-position: center;
      border: 2px solid rgba(168,85,247,0.3);
    }
    .emma-profile-info { flex: 1; min-width: 0; }
    .emma-profile-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
    .emma-profile-title { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
    .emma-profile-traits {
      display: flex;
      flex-wrap: wrap;
      gap: 0.3rem;
      margin-top: 0.1rem;
    }
    .emma-profile-trait {
      font-size: 0.6rem;
      padding: 0.1rem 0.4rem;
      border-radius: 8px;
      background: rgba(168,85,247,0.1);
      color: var(--purple);
      font-weight: 500;
    }
    .emma-profile-notes {
      font-size: 0.75rem;
      color: var(--text-secondary);
      line-height: 1.5;
      padding: 0.5rem 0.6rem;
      background: var(--bg-tertiary);
      border-radius: 6px;
      border-left: 3px solid var(--purple);
      max-height: 80px;
      overflow-y: auto;
    }
    .emma-profile-actions {
      display: flex;
      gap: 0.4rem;
    }
    .emma-profile-actions button {
      flex: 1;
      padding: 0.3rem;
      font-size: 0.7rem;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-secondary);
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }
    .emma-profile-actions button:hover {
      background: rgba(168,85,247,0.1);
      color: var(--purple);
      border-color: var(--purple);
    }

    /* Orchestrator Bar */
    .emma-orchestrator-bar { flex-shrink: 0; border-bottom: 1px solid rgba(139,92,246,0.2); background: rgba(15,15,20,0.6); backdrop-filter: blur(8px); max-height: 200px; overflow-y: auto; transition: max-height 0.15s ease; }
    .emma-orchestrator-bar.collapsed { max-height: 32px; overflow: hidden; }
    .orchestrator-header { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; font-size: 12px; color: #a1a1aa; }
    .orchestrator-task { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: 12px; cursor: pointer; transition: background 0.15s ease; }
    .orchestrator-task:hover { background: rgba(139,92,246,0.1); }
    .orchestrator-task .status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .orchestrator-task .task-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e4e4e7; }
    .orchestrator-task .task-stage { padding: 2px 8px; border-radius: 10px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
    .orchestrator-task .task-time { color: #71717a; font-size: 11px; min-width: 30px; text-align: right; }

    /* Automation Hub */
    .automation-hub { flex-shrink: 0; border-bottom: 1px solid rgba(139,92,246,0.2); background: rgba(10,10,15,0.9); overflow: hidden; }
    .automation-hub.collapsed .ah-body { display: none; }
    .ah-header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; user-select: none; }
    .ah-header .ah-title { font-size: 12px; font-weight: 600; color: #e4e4e7; letter-spacing: 0.3px; }
    .ah-header .ah-chevron { font-size: 10px; color: #71717a; transition: transform 0.2s; }
    .automation-hub.collapsed .ah-chevron { transform: rotate(-90deg); }
    .ah-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
    .ah-btn { border: none; border-radius: 4px; padding: 3px 10px; font-size: 11px; cursor: pointer; font-weight: 600; transition: opacity 0.15s; }
    .ah-btn:hover { opacity: 0.85; }
    .ah-btn-start { background: rgba(34,197,94,0.15); color: #22c55e; }
    .ah-btn-stop { background: rgba(239,68,68,0.15); color: #f87171; }
    .ah-duration-select { background: rgba(255,255,255,0.06); color: #a1a1aa; border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; padding: 2px 6px; font-size: 11px; cursor: pointer; }
    .ah-duration-select option { background: #1a1a2e; }
    .ah-current { font-size: 11px; color: #a1a1aa; }
    .ah-current b { color: #e4e4e7; }
    .ah-body { padding: 8px 12px 12px; }
    .ah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
    .ah-card { background: rgba(20,20,30,0.8); border: 1px solid rgba(139,92,246,0.15); border-radius: 8px; padding: 10px 12px; transition: border-color 0.2s; }
    .ah-card:hover { border-color: rgba(139,92,246,0.35); }
    .ah-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .ah-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .ah-card-name { font-size: 13px; font-weight: 600; color: #e4e4e7; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ah-card-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
    .ah-badge-running { background: rgba(34,197,94,0.12); color: #22c55e; }
    .ah-badge-blocked { background: rgba(239,68,68,0.12); color: #ef4444; }
    .ah-badge-idle { background: rgba(107,114,128,0.12); color: #6b7280; }
    .ah-badge-completed { background: rgba(139,92,246,0.12); color: #ef4444; }
    .ah-badge-locked { background: rgba(249,115,22,0.12); color: #f97316; }
    .ah-badge-paused { background: rgba(245,158,11,0.12); color: #f59e0b; }
    .ah-progress { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; margin-bottom: 8px; overflow: hidden; }
    .ah-progress-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
    .ah-progress-label { font-size: 10px; color: #71717a; margin-bottom: 8px; }
    .ah-phase-segment { position: relative; display: inline-block; }
    .ah-phase-tooltip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.95); color: #fff; padding: 6px 10px; border-radius: 4px; font-size: 10px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 20; border: 1px solid rgba(255,255,255,0.1); }
    .ah-phase-segment:hover .ah-phase-tooltip { opacity: 1; }
    .ah-toggles { display: flex; align-items: center; gap: 12px; }
    .ah-toggle-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #a1a1aa; }
    .ah-toggle-row .toggle-switch { width: 32px; height: 18px; }
    .ah-toggle-row .toggle-slider::before { width: 14px; height: 14px; }
    .ah-toggle-row .toggle-switch input:checked + .toggle-slider::before { transform: translateX(14px); }

    /* =============================================
       App Rework Hub tile
       ============================================= */
    .rework-hub-section {
      margin-top: 1.5rem;
      padding-top: 1.5rem;
      border-top: 1px solid var(--border-color);
    }
    .rework-hub-section .rw-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 10px;
    }
    .rework-hub-section .rw-card {
      background: rgba(20,20,30,0.8);
      border: 1px solid rgba(139,92,246,0.15);
      border-radius: 8px;
      padding: 10px 12px;
      transition: border-color 0.2s;
    }
    .rework-hub-section .rw-card:hover { border-color: rgba(139,92,246,0.35); }
    .rework-hub-section .rw-card-header {
      display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
    }
    .rework-hub-section .rw-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .rework-hub-section .rw-card-name { font-size: 13px; font-weight: 600; color: #e4e4e7; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rework-hub-section .rw-card-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
    .rw-badge-active { background: rgba(34,197,94,0.12); color: #22c55e; }
    .rw-badge-done { background: rgba(139,92,246,0.12); color: #a78bfa; }
    .rw-badge-pending { background: rgba(107,114,128,0.12); color: #6b7280; }
    /* 8-stage rework progress bar */
    .rw-stage-bar {
      display: flex; gap: 2px; margin-bottom: 6px; height: 6px;
    }
    .rw-stage-seg {
      flex: 1; border-radius: 2px; position: relative; overflow: visible;
      background: rgba(255,255,255,0.06);
      transition: background 0.3s ease;
    }
    .rw-stage-seg.done { background: var(--seg-color); }
    .rw-stage-seg.active {
      background: rgba(255,255,255,0.06);
      position: relative;
    }
    .rw-stage-seg.active::after {
      content: '';
      display: block;
      width: 50%;
      height: 100%;
      background: var(--seg-color);
      border-radius: 2px;
      animation: rw-pulse 1.5s ease-in-out infinite;
    }
    @keyframes rw-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.4; }
    }
    .rw-stage-seg .rw-stage-tip {
      position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
      background: rgba(0,0,0,0.92); color: #fff; padding: 4px 8px; border-radius: 4px;
      font-size: 10px; white-space: nowrap; opacity: 0; pointer-events: none;
      transition: opacity 0.2s; z-index: 20; border: 1px solid rgba(255,255,255,0.08);
    }
    .rw-stage-seg:hover .rw-stage-tip { opacity: 1; }
    .rw-stage-labels {
      display: flex; gap: 2px; margin-bottom: 8px;
    }
    .rw-stage-label {
      flex: 1; font-size: 8px; text-align: center; color: #52525b;
      overflow: hidden; text-overflow: clip; white-space: nowrap;
    }
    .rw-stage-label.active { color: #a1a1aa; font-weight: 700; }
    .rw-stage-label.done { color: #52525b; }
    .rw-card-footer { font-size: 10px; color: #71717a; display: flex; align-items: center; justify-content: space-between; }
    .rw-empty { font-size: 12px; color: #52525b; padding: 12px 0; text-align: center; }
    .rw-add-btn { font-size: 11px; padding: 4px 12px; background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.2); border-radius: 6px; color: #a78bfa; cursor: pointer; transition: background 0.15s; }
    .rw-add-btn:hover { background: rgba(139,92,246,0.2); }
    .rw-add-modal-backdrop { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
    .rw-add-modal { background: rgba(15,15,22,0.98); border: 1px solid rgba(139,92,246,0.2); border-radius: 12px; width: 420px; max-width: 95vw; padding: 20px 24px; box-shadow: 0 24px 48px rgba(0,0,0,0.6); }

    /* Expanded card modal */
    .ah-card-expanded { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s ease; pointer-events: none; }
    .ah-card-expanded.visible { opacity: 1; pointer-events: auto; }
    .ah-card-expanded-content { background: rgba(15,15,20,0.95); border: 1px solid rgba(139,92,246,0.2); border-radius: 12px; width: 90%; max-width: 700px; max-height: 80vh; overflow-y: auto; backdrop-filter: blur(12px); box-shadow: 0 24px 48px rgba(0,0,0,0.5); }
    .ah-card-expanded-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(139,92,246,0.15); position: sticky; top: 0; background: rgba(15,15,20,0.98); }
    .ah-card-expanded-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #e4e4e7; }
    .ah-card-expanded-close { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #a1a1aa; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all 0.15s ease; }
    .ah-card-expanded-close:hover { background: rgba(255,255,255,0.12); color: #e4e4e7; }
    .ah-card-expanded-body { padding: 20px; }
    .ah-phase-item { margin-bottom: 16px; padding: 12px; background: rgba(139,92,246,0.06); border: 1px solid rgba(139,92,246,0.15); border-radius: 6px; }
    .ah-phase-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
    .ah-phase-name { font-size: 14px; font-weight: 600; color: #f87171; }
    .ah-phase-progress { font-size: 12px; color: #71717a; }
    .ah-phase-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
    .ah-phase-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
    .ah-card-expanded-footer { padding: 16px 20px; border-top: 1px solid rgba(139,92,246,0.15); background: rgba(10,10,15,0.8); display: flex; gap: 12px; flex-wrap: wrap; }
    .ah-card-expanded-footer button { flex: 1; min-width: 140px; }

    /* Briefing Section */
    .emma-briefing { flex-shrink: 0; border-bottom: 1px solid rgba(139,92,246,0.2); background: rgba(10,10,15,0.8); max-height: 400px; overflow-y: auto; transition: max-height 0.2s ease; padding: 0; }
    .emma-briefing.collapsed { max-height: 0; padding: 0; overflow: hidden; }
    .briefing-status { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 12px; color: #a1a1aa; border-bottom: 1px solid rgba(139,92,246,0.1); flex-wrap: wrap; }
    .briefing-status .status-pill { padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
    .briefing-status .status-pill.running { background: rgba(34,197,94,0.15); color: #22c55e; }
    .briefing-status .status-pill.paused { background: rgba(245,158,11,0.15); color: #f59e0b; }
    .briefing-status .status-pill.stopped { background: rgba(113,113,122,0.15); color: #71717a; }
    .blocker-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 10px 12px; }
    .blocker-tile { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.2); border-radius: 8px; padding: 10px 12px; }
    .blocker-tile .bt-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
    .blocker-tile .bt-project { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(139,92,246,0.15); color: #f87171; }
    .blocker-tile .bt-type { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(239,68,68,0.15); color: #f87171; }
    .blocker-tile .bt-title { font-size: 13px; color: #e4e4e7; margin-bottom: 4px; }
    .blocker-tile .bt-context { font-size: 11px; color: #71717a; max-height: 60px; overflow-y: auto; white-space: pre-wrap; margin-bottom: 8px; line-height: 1.4; }
    .blocker-tile .bt-resolve { display: flex; gap: 6px; }
    .blocker-tile .bt-resolve input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; padding: 5px 8px; color: #fff; font-size: 12px; }
    .blocker-tile .bt-resolve input::placeholder { color: #52525b; }
    .blocker-tile .bt-resolve button { background: #ef4444; color: #fff; border: none; border-radius: 4px; padding: 5px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
    .blocker-tile .bt-resolve button:hover { background: #7c3aed; }
    .blocker-tile .bt-resolve .dismiss-btn { background: rgba(255,255,255,0.08); color: #a1a1aa; }
    .briefing-log { padding: 6px 12px 10px; }
    .briefing-log-title { font-size: 11px; color: #71717a; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
    .briefing-log-entry { font-size: 11px; color: #a1a1aa; padding: 2px 0; display: flex; gap: 8px; }
    .briefing-log-entry .log-time { color: #52525b; min-width: 40px; }
    .briefing-log-entry .log-project { color: #f87171; min-width: 100px; }
    .briefing-log-entry .log-status { min-width: 16px; }
    .blocker-badge { display: inline-flex; align-items: center; justify-content: center; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; }
    .automation-pulse { animation: automationPulse 2s ease-in-out infinite; }
    @keyframes automationPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

    /* Onboarding Wizard Modal */
    .onboarding-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s ease; }
    .onboarding-overlay.visible { opacity: 1; }
    .onboarding-modal { background: rgba(15,15,20,0.95); border: 1px solid rgba(139,92,246,0.2); border-radius: 12px; width: 90%; max-width: 680px; max-height: 85vh; overflow-y: auto; backdrop-filter: blur(12px); box-shadow: 0 24px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.1); font-family: monospace; }
    .onboarding-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid rgba(139,92,246,0.15); }
    .onboarding-modal-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: #e4e4e7; }
    .onboarding-close-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #a1a1aa; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.15s ease; }
    .onboarding-close-btn:hover { background: rgba(255,255,255,0.12); color: #e4e4e7; }
    .onboarding-modal-body { padding: 18px; }
    .onboarding-spinner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 0; color: #a1a1aa; font-size: 13px; }
    .onboarding-spinner .spin-ring { width: 32px; height: 32px; border: 3px solid rgba(139,92,246,0.2); border-top-color: #ef4444; border-radius: 50%; animation: onboardSpin 0.8s linear infinite; }
    @keyframes onboardSpin { to { transform: rotate(360deg); } }
    .onboarding-type-badge { display: inline-block; background: rgba(139,92,246,0.15); color: #f87171; border: 1px solid rgba(139,92,246,0.25); border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
    .onboarding-section { margin-bottom: 16px; }
    .onboarding-section-title { font-size: 11px; color: #71717a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; font-weight: 600; }
    .onboarding-tags { display: flex; flex-wrap: wrap; gap: 5px; }
    .onboarding-tag { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 4px; padding: 2px 8px; font-size: 11px; color: #a1a1aa; }
    .onboarding-list { list-style: none; padding: 0; margin: 0; }
    .onboarding-list li { font-size: 12px; color: #d4d4d8; padding: 3px 0; display: flex; align-items: center; gap: 6px; }
    .onboarding-list li::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
    .onboarding-scripts-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .onboarding-scripts-table th { text-align: left; color: #71717a; font-weight: 600; font-size: 11px; padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .onboarding-scripts-table td { color: #d4d4d8; padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
    .onboarding-scripts-table td:first-child { color: #f87171; font-weight: 600; }
    .onboarding-stats { display: flex; gap: 12px; flex-wrap: wrap; }
    .onboarding-stat { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; padding: 8px 12px; text-align: center; min-width: 80px; }
    .onboarding-stat .stat-value { font-size: 18px; font-weight: 700; color: #e4e4e7; }
    .onboarding-stat .stat-label { font-size: 10px; color: #71717a; text-transform: uppercase; letter-spacing: 0.5px; }
    .onboarding-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(139,92,246,0.1); }
    .onboarding-btn-primary { background: #ef4444; color: #fff; border: none; border-radius: 6px; padding: 8px 18px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: monospace; transition: background 0.15s ease; }
    .onboarding-btn-primary:hover { background: #7c3aed; }
    .onboarding-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
    .onboarding-error { color: #f87171; font-size: 12px; padding: 12px 0; text-align: center; }
    .tile-onboard-btn { background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.25); color: #f87171; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; cursor: pointer; transition: all 0.15s ease; font-family: monospace; letter-spacing: 0.3px; }
    .tile-onboard-btn:hover { background: rgba(139,92,246,0.25); color: #c4b5fd; }

    /* Preview Available bar — full-width bottom footer on the tile. Daniel's
       HARD rule: every project with a preview URL (design or live, auto-detected
       from filesystem) must surface it via a prominent Preview Available button.
       This supersedes the old .tile-preview-btn meta-row chip. */
    .project-tile.has-preview {
      /* Make room for the bottom preview bar and hint that the tile has one. */
      padding-bottom: 0;
    }
    .tile-preview-bar {
      display: flex;
      align-items: stretch;
      width: calc(100% + 2rem);
      margin: 0.75rem -1rem -1rem -1rem;
      background: linear-gradient(180deg, rgba(16,185,129,0.15) 0%, rgba(16,185,129,0.27) 100%);
      border-top: 1px solid rgba(16,185,129,0.42);
      border-bottom-left-radius: inherit;
      border-bottom-right-radius: inherit;
      overflow: hidden;
      transition: background 0.2s ease;
    }
    .tile-preview-bar:hover {
      background: linear-gradient(180deg, rgba(16,185,129,0.27) 0%, rgba(16,185,129,0.43) 100%);
    }
    .tile-preview-bar-link {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      padding: 10px 12px;
      color: #6ee7b7;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      text-decoration: none;
      cursor: pointer;
      transition: color 0.2s ease;
    }
    .tile-preview-bar-link:hover { color: #d1fae5; }
    .tile-preview-bar-link svg { flex-shrink: 0; color: inherit; }
    .tile-preview-bar-label { letter-spacing: 0.6px; }
    /* Pipeline source tag on project tile header. */
    .tile-source-badge {
      margin-left: auto;
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      padding: 2px 6px;
      border-radius: 3px;
      font-family: monospace;
      border: 1px solid transparent;
    }
    .tile-source-app-factory {
      background: rgba(168,85,247,0.12);
      border-color: rgba(168,85,247,0.35);
      color: #c4b5fd;
    }
    .tile-source-goldmine {
      background: rgba(234,179,8,0.12);
      border-color: rgba(234,179,8,0.4);
      color: #fde047;
    }

    /* Metrics Panel */
    .emma-metrics-panel { flex-shrink: 0; border-bottom: 1px solid rgba(139,92,246,0.15); background: rgba(8,8,14,0.8); max-height: 300px; overflow-y: auto; transition: max-height 0.2s ease; }
    .emma-metrics-panel.collapsed { max-height: 28px; overflow: hidden; }
    .metrics-header { display: flex; align-items: center; gap: 8px; padding: 5px 12px; cursor: pointer; font-size: 12px; color: #71717a; }
    .metrics-header:hover { color: #a1a1aa; }
    .metrics-body { padding: 6px 12px 10px; }
    .metric-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
    .metric-label { color: #71717a; min-width: 90px; font-weight: 600; }
    .metric-value { color: #d4d4d8; }
    .metric-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; max-width: 140px; }
    .metric-bar-sm { max-width: 80px; height: 4px; }
    .metric-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
    .metrics-projects { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.04); }
    .metric-project { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 11px; }
    .metric-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
    .metric-proj-name { color: #a1a1aa; min-width: 100px; }
    .metric-proj-pct { color: #71717a; font-size: 10px; }

    /* Decision Banner */
    .emma-decision-banner { position: sticky; top: 0; z-index: 100; background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(59,130,246,0.15)); border: 1px solid rgba(139,92,246,0.3); border-radius: 8px; margin: 8px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; animation: bannerPulse 2s ease-in-out infinite; }
    @keyframes bannerPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.85; } }
    .decision-banner-text { flex: 1; font-size: 13px; color: #e4e4e7; }
    .decision-banner-actions { display: flex; gap: 6px; }
    .decision-banner-actions button { padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; border: none; transition: opacity 0.15s ease; }
    .decision-banner-actions button:hover { opacity: 0.85; }

    /* Agent Activity (collapsed) */
    .emma-agent-activity { background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.15); border-radius: 8px; margin: 4px 0; padding: 6px 10px; cursor: pointer; font-size: 12px; color: #f87171; transition: all 0.15s ease; }
    .emma-agent-activity:hover { background: rgba(139,92,246,0.12); }
    .emma-agent-activity.expanded { padding: 10px; background: rgba(139,92,246,0.06); }

    /* Tool Use Summary */
    .emma-tool-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; font-size: 12px; color: #71717a; }
    .emma-tool-summary .tool-badge { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 4px; padding: 2px 8px; }

    /* =============================================
       Emma Terminal-like Activity Stream
       ============================================= */

    /* Tool activity items — always visible, compact inline */
    .emma-activity {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      padding: 0.1rem 0;
      font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
      font-size: 0.65rem;
      line-height: 1.2;
      color: var(--text-secondary);
      animation: emmaFadeIn 0.15s ease;
    }
    .emma-activity-group {
      padding: 0.1rem 0;
      font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
      font-size: 0.68rem;
      line-height: 1.3;
      color: var(--text-secondary);
    }
    .emma-activity-group-header {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      cursor: pointer;
      padding: 0.1rem 0;
    }
    .emma-activity-group-header:hover { color: var(--text-primary); }
    .emma-activity-group-header .emma-activity-icon { flex-shrink: 0; width: 16px; text-align: center; }
    .emma-activity-group-items {
      display: none;
      padding-left: 1.2rem;
    }
    .emma-activity-group-items.open { display: block; }
    .emma-activity-group-items .emma-activity { padding: 0.05rem 0; font-size: 0.65rem; }
    .emma-activity-count {
      color: var(--text-muted);
      font-size: 0.62rem;
      opacity: 0.7;
    }

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

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

    .emma-activity-icon {
      flex-shrink: 0;
      width: 16px;
      text-align: center;
      margin-top: 1px;
    }

    .emma-activity-icon.spinning {
      animation: emmaSpin 1s linear infinite;
      color: var(--purple);
    }

    .emma-activity-icon.done { color: var(--emerald); }
    .emma-activity-icon.error { color: var(--rose); }

    .emma-activity-body {
      flex: 1;
      min-width: 0;
      overflow-wrap: break-word;
      word-break: break-word;
    }

    .emma-activity-label {
      color: var(--indigo-light);
      font-weight: 500;
    }

    .emma-activity-path {
      color: var(--amber);
      word-break: break-all;
    }

    .emma-activity-path.clickable,
    .emma-ref-link {
      cursor: pointer;
      text-decoration: underline;
      text-decoration-style: dotted;
      text-underline-offset: 2px;
    }

    .emma-activity-path.clickable:hover,
    .emma-ref-link:hover {
      color: var(--indigo-light);
      text-decoration-style: solid;
    }

    /* Clickable file paths in Emma's text output */
    .emma-msg .chat-bubble-assistant .emma-ref-link {
      color: var(--amber);
      font-family: 'Fira Code', monospace;
      font-size: 0.9em;
      background: rgba(245, 158, 11, 0.08);
      padding: 0.05rem 0.25rem;
      border-radius: 3px;
      transition: all 0.15s;
      cursor: pointer;
      -webkit-tap-highlight-color: rgba(245, 158, 11, 0.3);
    }

    .emma-msg .chat-bubble-assistant .emma-ref-link:hover,
    .emma-msg .chat-bubble-assistant .emma-ref-link:active {
      background: rgba(245, 158, 11, 0.18);
      color: var(--indigo-light);
    }

    /* Mobile: larger tap targets for file refs & links */
    @media (pointer: coarse) {
      .emma-msg .chat-bubble-assistant .emma-ref-link {
        padding: 0.25rem 0.45rem;
        font-size: 0.85em;
        display: inline-block;
        margin: 0.1rem 0;
        text-decoration: underline;
        text-decoration-style: dotted;
        text-underline-offset: 3px;
        min-height: 32px;
        line-height: 1.6;
      }
      .emma-msg .chat-bubble-assistant a {
        padding: 0.15rem 0.1rem;
        min-height: 32px;
        display: inline-block;
        line-height: 1.6;
      }
      .emma-activity-path.clickable {
        padding: 0.2rem 0.3rem;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
      }
    }

    .emma-activity-cmd {
      color: var(--emerald);
      word-break: break-all;
    }

    .emma-activity-detail {
      display: none;
      margin-top: 0.2rem;
      padding: 0.3rem 0.5rem;
      background: rgba(0, 0, 0, 0.25);
      border-radius: 4px;
      color: var(--text-muted);
      font-size: 0.68rem;
      max-height: 120px;
      overflow-y: auto;
      white-space: pre-wrap;
      word-break: break-all;
      border-left: 2px solid var(--border-color);
    }

    .emma-activity-detail.open { display: block; }

    .emma-activity-detail.result-ok { border-left-color: var(--emerald); }
    .emma-activity-detail.result-err { border-left-color: var(--rose); }

    .emma-activity-toggle {
      cursor: pointer;
      opacity: 0.5;
      font-size: 0.6rem;
      transition: opacity 0.15s, transform 0.15s;
      display: inline-block;
      margin-left: 0.25rem;
    }

    .emma-activity-toggle:hover { opacity: 1; }
    .emma-activity-toggle.open { transform: rotate(90deg); }

    /* Interactive question buttons (AskUserQuestion) */
    .emma-question-block {
      margin: 0.5rem 0;
      padding: 0.6rem;
      background: rgba(99, 102, 241, 0.06);
      border: 1px solid rgba(99, 102, 241, 0.15);
      border-radius: 8px;
    }
    .emma-question-header {
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--purple);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 0.15rem;
    }
    .emma-question-text {
      font-size: 0.82rem;
      color: var(--text-primary);
      margin-bottom: 0.5rem;
      line-height: 1.4;
    }
    .emma-question-options {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }
    .emma-question-opt {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      padding: 0.45rem 0.65rem;
      background: rgba(168, 85, 247, 0.06);
      border: 1px solid rgba(168, 85, 247, 0.18);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s;
      text-align: left;
      font-family: inherit;
      color: var(--text-primary);
      width: 100%;
    }
    .emma-question-opt:hover {
      background: rgba(168, 85, 247, 0.14);
      border-color: rgba(168, 85, 247, 0.35);
      transform: translateY(-1px);
    }
    .emma-question-opt:active {
      transform: translateY(0);
    }
    .emma-question-opt.selected {
      background: rgba(168, 85, 247, 0.18);
      border-color: var(--purple);
      box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
    }
    .emma-question-opt.disabled {
      opacity: 0.5;
      cursor: default;
      pointer-events: none;
    }
    .emma-question-opt-label {
      font-size: 0.82rem;
      font-weight: 600;
    }
    .emma-question-opt-desc {
      font-size: 0.72rem;
      color: var(--text-secondary);
      margin-top: 2px;
    }
    .emma-question-multi-actions {
      display: flex;
      gap: 0.4rem;
      margin-top: 0.4rem;
      justify-content: flex-end;
    }
    .emma-question-submit {
      padding: 0.3rem 0.8rem;
      background: var(--purple);
      color: white;
      border: none;
      border-radius: 4px;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
    }
    .emma-question-submit:hover {
      opacity: 0.9;
    }

    /* Thinking block — collapsible, streamed */
    .emma-think-block {
      margin: 0.25rem 0;
      border-left: 2px solid rgba(168, 85, 247, 0.3);
      padding-left: 0.6rem;
      animation: emmaFadeIn 0.15s ease;
    }

    .emma-think-header {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      font-size: 0.7rem;
      color: var(--purple);
      cursor: pointer;
      user-select: none;
      padding: 0.15rem 0;
    }

    .emma-think-header:hover { color: var(--indigo-light); }

    .emma-think-chevron {
      font-size: 0.6rem;
      transition: transform 0.15s;
      display: inline-block;
    }

    .emma-think-chevron.open { transform: rotate(90deg); }

    .emma-think-content {
      display: none;
      font-size: 0.72rem;
      font-family: 'Fira Code', monospace;
      color: var(--text-muted);
      line-height: 1.5;
      padding: 0.3rem 0;
      max-height: 200px;
      overflow-y: auto;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .emma-think-content.open { display: block; }

    .emma-think-dots {
      display: inline-flex;
      gap: 2px;
      margin-left: 0.3rem;
    }

    .emma-think-dots span {
      width: 3px;
      height: 3px;
      background: var(--purple);
      border-radius: 50%;
      animation: chatDot 1.2s infinite;
    }

    .emma-think-dots span:nth-child(2) { animation-delay: 0.2s; }
    .emma-think-dots span:nth-child(3) { animation-delay: 0.4s; }

    /* Waiting indicator (replaces old emma-thinking) */
    .emma-thinking {
      align-self: flex-start;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.3rem 0.4rem;
      font-size: 0.72rem;
      color: var(--text-muted);
      font-family: 'Fira Code', monospace;
    }

    .emma-thinking .dots {
      display: flex;
      gap: 3px;
    }

    .emma-thinking .dots span {
      width: 4px;
      height: 4px;
      background: var(--purple);
      border-radius: 50%;
      animation: chatDot 1.2s infinite;
    }

    .emma-thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
    .emma-thinking .dots span:nth-child(3) { animation-delay: 0.4s; }

    /* Persistent working dots — visible for the entire duration Emma is processing */
    #emma-working-indicator {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.6rem;
      margin-top: 0.25rem;
    }
    #emma-working-indicator .chat-avatar {
      width: 28px;
      height: 28px;
      min-width: 28px;
      font-size: 0.7rem;
    }
    #emma-working-indicator .dots {
      display: flex;
      gap: 4px;
    }
    #emma-working-indicator .dots span {
      width: 6px;
      height: 6px;
      background: var(--purple);
      border-radius: 50%;
      animation: chatDot 1.2s infinite;
    }
    #emma-working-indicator .dots span:nth-child(2) { animation-delay: 0.2s; }
    #emma-working-indicator .dots span:nth-child(3) { animation-delay: 0.4s; }

    /* Message queue — compact chip above input */
    .emma-queue-bar {
      display: none;
      flex-direction: column;
      font-family: 'Fira Code', monospace;
      padding: 0 0.75rem 0.5rem 0.75rem;
      position: relative;
    }

    .emma-queue-bar.visible { display: flex; }

    /* Collapsed chip row */
    .emma-queue-chip {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.35rem 0.65rem;
      background: rgba(139, 92, 246, 0.08);
      border: 1px solid rgba(139, 92, 246, 0.18);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.15s ease;
      position: relative;
    }
    .emma-queue-chip:hover {
      background: rgba(139, 92, 246, 0.14);
      border-color: rgba(139, 92, 246, 0.3);
    }

    .emma-queue-chip-icon {
      font-size: 0.72rem;
      flex-shrink: 0;
    }

    .emma-queue-chip-text {
      flex: 1;
      min-width: 0;
      font-size: 0.68rem;
      color: var(--text-secondary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .emma-queue-chip-badge {
      background: var(--purple);
      color: white;
      border-radius: 10px;
      padding: 0.05rem 0.4rem;
      font-size: 0.58rem;
      font-weight: 700;
      flex-shrink: 0;
      min-width: 18px;
      text-align: center;
      line-height: 1.4;
      box-shadow: 0 0 8px rgba(168, 85, 247, 0.35);
    }

    .emma-queue-chip-expand {
      font-size: 0.6rem;
      color: var(--purple);
      opacity: 0.6;
      flex-shrink: 0;
      transition: transform 0.2s ease;
    }
    .emma-queue-bar.expanded .emma-queue-chip-expand {
      transform: rotate(180deg);
    }

    .emma-queue-chip-clear {
      font-size: 0.58rem;
      color: var(--text-muted);
      cursor: pointer;
      opacity: 0.5;
      flex-shrink: 0;
      padding: 0.1rem 0.3rem;
      border-radius: 3px;
      transition: all 0.15s;
    }
    .emma-queue-chip-clear:hover {
      opacity: 1;
      color: var(--rose);
      background: rgba(239, 68, 68, 0.1);
    }

    /* Expanded items dropdown */
    .emma-queue-dropdown {
      display: none;
      flex-direction: column;
      gap: 0.2rem;
      margin-top: 0.3rem;
      max-height: 160px;
      overflow-y: auto;
      animation: queueSlideDown 0.15s ease;
    }
    .emma-queue-bar.expanded .emma-queue-dropdown { display: flex; }

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

    .emma-queue-item {
      display: flex; align-items: center; gap: 0.35rem;
      padding: 0.3rem 0.45rem; border-radius: 6px;
      background: rgba(139,92,246,0.05); border: 1px solid rgba(139,92,246,0.1);
      transition: background 0.1s;
    }
    .emma-queue-item:hover { background: rgba(139,92,246,0.1); }

    .emma-queue-item-num {
      font-size: 0.55rem; font-weight: 700; color: var(--purple); opacity: 0.4;
      width: 14px; text-align: center; flex-shrink: 0;
    }
    .emma-queue-item-text {
      flex: 1; min-width: 0; font-size: 0.65rem; color: var(--text-secondary);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .emma-queue-push-now {
      font-size: 0.56rem; font-weight: 600; padding: 0.12rem 0.4rem;
      border-radius: 4px; border: none; cursor: pointer; white-space: nowrap;
      background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
      flex-shrink: 0; transition: all 0.15s;
      display: flex; align-items: center; gap: 0.2rem;
    }
    .emma-queue-push-now:hover { opacity: 0.9; box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
    .emma-queue-send-now {
      font-size: 0.56rem; font-weight: 600; padding: 0.12rem 0.4rem;
      border-radius: 4px; border: none; cursor: pointer; white-space: nowrap;
      background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff;
      flex-shrink: 0; transition: opacity 0.15s;
    }
    .emma-queue-send-now:hover { opacity: 0.85; }
    .emma-queue-remove {
      font-size: 0.55rem; padding: 0.1rem 0.3rem; border-radius: 3px;
      border: 1px solid rgba(239,68,68,0.2); background: transparent;
      color: #f87171; cursor: pointer; flex-shrink: 0; opacity: 0.5;
    }
    .emma-queue-remove:hover { opacity: 1; background: rgba(239,68,68,0.1); }

    /* Emma Settings Tabs */
    .emma-settings-tab {
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      padding: 0.5rem 1rem;
      color: var(--text-muted);
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      transition: all var(--transition-fast);
    }

    .emma-settings-tab:hover {
      color: var(--text-primary);
      background: rgba(99, 102, 241, 0.05);
    }

    .emma-settings-tab.active {
      color: var(--indigo);
      border-bottom-color: var(--indigo);
    }

    .emma-settings-content {
      animation: fadeIn 0.2s ease;
    }

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

    /* Emma Fullscreen Mode */
    .emma-panel.fullscreen {
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
      min-width: unset !important;
      border-left: none;
      border-radius: 0;
      z-index: 1000;
    }
    .emma-panel.fullscreen .emma-resize-handle { display: none; }

    @media (max-width: 768px) {
      .emma-panel {
        width: 100%;
        box-shadow: none;
      }
      /* On mobile, collapsed panel must stay off-screen */
      .emma-panel.collapsed {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
      }
    }

    /* =============================================
       Checkpoints / Timeline
       ============================================= */
    .checkpoints-toolbar {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 1rem;
      padding: 0 0.5rem;
    }

    .checkpoints-toolbar input {
      flex: 1;
      max-width: 300px;
    }

    .timeline-container {
      flex: 1;
      overflow-y: auto;
      padding: 0 0.5rem;
    }

    .timeline {
      position: relative;
      padding-left: 24px;
    }

    .timeline::before {
      content: '';
      position: absolute;
      left: 7px;
      top: 0;
      bottom: 0;
      width: 2px;
      background: linear-gradient(180deg, var(--purple), var(--cyan), var(--purple));
      opacity: 0.4;
    }

    .timeline-date {
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted);
      padding: 0.75rem 0 0.35rem;
      position: relative;
    }

    .timeline-item {
      position: relative;
      padding: 0.5rem 0 0.85rem;
    }

    .tl-dot {
      position: absolute;
      left: -21px;
      top: 0.65rem;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 2px solid var(--bg-primary);
      z-index: 1;
    }

    .tl-dot-checkpoint {
      background: var(--cyan);
      box-shadow: 0 0 8px rgba(6, 182, 212, 0.5), 0 0 16px rgba(6, 182, 212, 0.2);
    }

    .tl-dot-commit {
      background: var(--border-light);
      width: 8px;
      height: 8px;
      left: -19px;
      top: 0.75rem;
    }

    .tl-content {
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      border-radius: var(--radius-sm);
      padding: 0.75rem 1rem;
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .tl-checkpoint .tl-content {
      border-left: 3px solid var(--cyan);
      box-shadow: -2px 0 10px rgba(6, 182, 212, 0.1);
    }

    .tl-content:hover {
      border-color: var(--border-light);
      box-shadow: var(--shadow-sm);
    }

    .tl-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
    }

    .tl-label {
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }

    .tl-time {
      font-size: 0.7rem;
      color: var(--text-muted);
      flex-shrink: 0;
    }

    .tl-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      margin-top: 0.35rem;
    }

    .tl-badge {
      font-size: 0.65rem;
      padding: 0.1rem 0.45rem;
      border-radius: 8px;
      background: rgba(255,255,255,0.06);
      color: var(--text-secondary);
    }

    .tl-badge-git {
      background: rgba(99, 102, 241, 0.15);
      color: var(--indigo-light);
      font-family: 'Fira Code', monospace;
    }

    .tl-changes {
      margin-top: 0.5rem;
      border-top: 1px solid var(--border-color);
      padding-top: 0.4rem;
    }

    .tl-change {
      font-size: 0.72rem;
      font-family: 'Fira Code', monospace;
      color: var(--text-secondary);
      padding: 0.12rem 0;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ch-icon {
      width: 14px;
      text-align: center;
      font-weight: 700;
      flex-shrink: 0;
    }

    .ch-add .ch-icon { color: var(--emerald); }
    .ch-mod .ch-icon { color: var(--amber); }
    .ch-del .ch-icon { color: var(--rose); }

    .tl-actions {
      display: flex;
      gap: 0.4rem;
      margin-top: 0.5rem;
    }

    .tl-commit .tl-label {
      font-size: 0.8rem;
      font-weight: 400;
      color: var(--text-secondary);
    }

    /* =============================================
       Notes Tab (project notes)
       ============================================= */
    .notes-toolbar {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 1rem;
      flex-wrap: wrap;
    }

    .notes-toolbar textarea {
      flex: 1;
      min-width: 200px;
      min-height: 60px;
      resize: vertical;
    }

    .color-picker-row {
      display: flex;
      gap: 0.35rem;
      align-items: center;
    }

    .color-swatch {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      border: 2px solid transparent;
      cursor: pointer;
      transition: border-color var(--transition-fast), transform var(--transition-fast);
    }

    .color-swatch:hover { transform: scale(1.15); }
    .color-swatch.selected { border-color: white; transform: scale(1.15); }

    /* =============================================
       Sidebar (project detail — right)
       ============================================= */
    .detail-body {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    .detail-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* =============================================
       Modal / Dialog
       ============================================= */
    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.5);
      z-index: 500;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .modal-backdrop.open {
      display: flex;
    }

    .modal {
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      border-radius: var(--radius-lg);
      padding: 1.75rem;
      width: 95%;
      max-width: 480px;
      box-shadow: var(--shadow-lg), 0 0 30px rgba(139,92,246,0.1);
      animation: modal-enter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      backdrop-filter: blur(var(--glass-blur));
      -webkit-backdrop-filter: blur(var(--glass-blur));
      position: relative;
      overflow: hidden;
    }

    .modal::after {
      content: '';
      position: absolute;
      inset: 0;
      background: var(--glass-shine);
      pointer-events: none;
      border-radius: inherit;
    }

    @keyframes modal-enter {
      from { opacity: 0; transform: scale(0.95) translateY(8px); filter: blur(4px); }
      to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
    }

    .modal-title {
      font-size: 1.1rem;
      font-weight: 600;
      margin-bottom: 1rem;
    }

    .modal-field {
      margin-bottom: 0.85rem;
    }

    .modal-field label {
      display: block;
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--text-secondary);
      margin-bottom: 0.3rem;
    }

    .modal-field input, .modal-field textarea {
      width: 100%;
    }

    .modal-actions {
      display: flex;
      gap: 0.5rem;
      justify-content: flex-end;
      margin-top: 1.25rem;
    }

    .modal-color-picker {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .modal-color-swatch {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      border: 3px solid transparent;
      cursor: pointer;
      transition: border-color var(--transition-fast), transform var(--transition-fast);
    }

    .modal-color-swatch:hover { transform: scale(1.1); }
    .modal-color-swatch.selected { border-color: white; }

    /* =============================================
       Empty States
       ============================================= */
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 3rem 1rem;
      color: var(--text-muted);
      text-align: center;
    }

    .empty-state svg {
      width: 48px; height: 48px;
      fill: var(--text-muted);
      margin-bottom: 0.75rem;
      opacity: 0.4;
    }

    .empty-state p {
      font-size: 0.9rem;
      max-width: 300px;
    }

    /* =============================================
       Toast Notifications
       ============================================= */
    .toast-container {
      position: fixed;
      bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
      right: 1rem;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .toast {
      padding: 0.65rem 1rem;
      border-radius: var(--radius-sm);
      font-size: 0.85rem;
      color: white;
      box-shadow: var(--shadow-md);
      animation: toast-in 0.25s ease;
      max-width: 350px;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .toast-success { background: rgba(5,150,105,0.85); border: 1px solid rgba(16,185,129,0.3); box-shadow: var(--shadow-md), 0 0 12px rgba(16,185,129,0.2); }
    .toast-error { background: rgba(225,29,72,0.85); border: 1px solid rgba(244,63,94,0.3); box-shadow: var(--shadow-md), 0 0 12px rgba(244,63,94,0.2); }
    .toast-info { background: rgba(109,40,217,0.85); border: 1px solid rgba(124,58,237,0.3); box-shadow: var(--shadow-md), 0 0 12px rgba(124,58,237,0.2); }

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

    /* =============================================
       Emma Error Bubble
       ============================================= */
    .emma-error-bubble {
      position: fixed;
      top: 60px;
      right: 460px;
      z-index: 950;
      display: none;
      flex-direction: column;
      gap: 0.5rem;
      max-height: calc(100vh - 80px);
      overflow-y: auto;
      pointer-events: none;
    }
    .emma-error-bubble.panel-collapsed {
      right: 80px;
    }
    .emma-error-card {
      pointer-events: all;
      background: rgba(20, 16, 28, 0.92);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(239, 68, 68, 0.4);
      border-left: 3px solid #ef4444;
      border-radius: 12px;
      padding: 0.75rem 1rem;
      width: 340px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 16px rgba(239,68,68,0.15);
      animation: emmaErrorSlideIn 0.35s ease-out;
      transition: opacity 0.3s ease, transform 0.3s ease;
    }
    .emma-error-card.dismissing {
      opacity: 0;
      transform: translateX(40px);
    }
    .emma-error-card-header {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
    }
    .emma-error-card-avatar {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: linear-gradient(135deg, #ef4444, #dc2626);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      font-weight: 700;
      color: white;
      flex-shrink: 0;
    }
    .emma-error-card-name {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-primary);
      flex: 1;
    }
    .emma-error-card-time {
      font-size: 0.65rem;
      color: var(--text-muted);
    }
    .emma-error-card-body {
      margin-bottom: 0.6rem;
    }
    .emma-error-severity {
      display: inline-block;
      font-size: 0.6rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 0.1rem 0.4rem;
      border-radius: 4px;
      margin-bottom: 0.35rem;
    }
    .emma-error-severity.critical {
      background: rgba(239,68,68,0.2);
      color: #f87171;
    }
    .emma-error-severity.error {
      background: rgba(249,115,22,0.2);
      color: #fb923c;
    }
    .emma-error-severity.warning {
      background: rgba(234,179,8,0.2);
      color: #facc15;
    }
    .emma-error-card-title {
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 0.25rem;
      line-height: 1.3;
    }
    .emma-error-card-summary {
      font-size: 0.72rem;
      color: var(--text-secondary);
      font-family: 'JetBrains Mono', monospace;
      line-height: 1.4;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .emma-error-card-actions {
      display: flex;
      gap: 0.5rem;
    }
    .emma-error-btn-fix {
      flex: 1;
      padding: 0.35rem 0.7rem;
      font-size: 0.75rem;
      font-weight: 600;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      background: linear-gradient(135deg, #ef4444, #dc2626);
      color: white;
      transition: opacity 0.15s;
    }
    .emma-error-btn-fix:hover { opacity: 0.85; }
    .emma-error-btn-dismiss {
      padding: 0.35rem 0.7rem;
      font-size: 0.75rem;
      font-weight: 500;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      cursor: pointer;
      background: transparent;
      color: var(--text-secondary);
      transition: background 0.15s;
    }
    .emma-error-btn-dismiss:hover { background: rgba(255,255,255,0.05); }

    @keyframes emmaErrorSlideIn {
      from { opacity: 0; transform: translateX(40px); }
      to { opacity: 1; transform: translateX(0); }
    }

    .emma-error-dot {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #ef4444;
      animation: emmaErrorPulse 4s ease-in-out infinite;
      pointer-events: none;
    }
    @keyframes emmaErrorPulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.6; transform: scale(1.3); }
    }

