  :root {
    --navy: #0B1F3A;
    --blue: #2D63C8;
    --blue-light: #EEF3FC;
    --blue-lighter: #F5F8FD;
    --gold: #C9A227;
    --bg: #F7F9FC;
    --card: #FFFFFF;
    --border: #E5E9F0;
    --border-strong: #D4DAE4;
    --text: #1A2332;
    --text-muted: #5A6478;
    --text-light: #8A93A5;
    --success: #1EA88C;
    --warning: #E6A23C;
    --danger: #D9463E;
    --shadow-sm: 0 1px 2px rgba(11,31,58,.04), 0 1px 3px rgba(11,31,58,.06);
    --shadow: 0 4px 12px rgba(11,31,58,.06), 0 2px 4px rgba(11,31,58,.04);
    --shadow-lg: 0 16px 40px rgba(11,31,58,.12);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; }
  body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-feature-settings: "palt";
    font-size: 14px;
    line-height: 1.6;
  }

  /* App shell */
  .app { display: grid; grid-template-columns: 240px 1fr 450px; height: 100vh; }
  .app.chat-expanded { grid-template-columns: 240px 1fr 480px; }

  /* Sidebar */
  .sidebar { background: var(--navy); color: white; padding: 20px 0; display: flex; flex-direction: column; min-height: 0; }
  .sidebar .sb-scrollable { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
  .sidebar .brand {
    font-size: 16px; font-weight: 900; padding: 4px 22px 20px; letter-spacing: .02em;
    display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .sidebar .brand-icon { width: 28px; height: 28px; background: var(--gold); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--navy); font-weight: 900; }
  .sidebar .brand span { color: rgba(255,255,255,.6); font-size: 11px; font-weight: 500; margin-left: auto; }
  .sidebar .sb-section { padding: 18px 16px 8px; font-size: 11px; color: rgba(255,255,255,.5); letter-spacing: .1em; font-weight: 700; text-transform: uppercase; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 22px; color: rgba(255,255,255,.8);
    text-decoration: none; font-size: 14px; border-left: 3px solid transparent; transition: all .15s;
  }
  .sidebar nav a:hover { background: rgba(255,255,255,.05); color: white; }
  .sidebar nav a.active { background: rgba(45,99,200,.15); color: white; border-left-color: var(--blue); }
  .sidebar nav a .sb-count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.1); padding: 2px 8px; border-radius: 8px; }
  .sidebar nav a.active .sb-count { background: var(--blue); }
  .sidebar .sb-bottom { flex: 0 0 auto; padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.6); background: var(--navy); }
  .sidebar .sb-bottom-user { display: flex; align-items: center; gap: 10px; }
  .sidebar .user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--gold)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--navy); font-size: 13px; }

  /* Main content */
  .main { padding: 24px 28px; overflow-y: auto; border-right: 1px solid var(--border); }
  .topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
  .topbar h1 { font-size: 22px; font-weight: 900; color: var(--navy); letter-spacing: -.01em; }
  .topbar .subtitle { color: var(--text-muted); font-size: 13px; }
  .topbar .spacer { flex: 1; }
  .topbar .kbd-hint { font-size: 11px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
  .kbd { background: var(--card); border: 1px solid var(--border-strong); padding: 2px 7px; border-radius: 4px; font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text); box-shadow: 0 1px 0 var(--border); }
  .search-bar {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 8px 14px; display: flex; align-items: center; gap: 10px; min-width: 240px;
    box-shadow: var(--shadow-sm); cursor: text;
  }
  .search-bar input { border: none; outline: none; flex: 1; font-size: 13px; font-family: inherit; color: var(--text); background: transparent; }
  .search-bar .search-icon { color: var(--text-light); }

  /* KPI strip */
  /* Phase 2.0a: 秘書AIから一言 */
  .ai-digest { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; margin: 0 0 16px; background: linear-gradient(135deg, #6B5B95 0%, #88799C 100%); border-radius: 10px; color: white; box-shadow: 0 2px 8px rgba(107, 91, 149, 0.2); }
  .ai-digest-icon { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
  .ai-digest-body { flex: 1; font-size: 13px; line-height: 1.7; }
  .ai-digest-line { margin: 2px 0; }
  .ai-digest-line strong { color: #fff; font-weight: 700; }
  .ai-digest-link { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); text-underline-offset: 3px; cursor: pointer; }
  .ai-digest-link:hover { text-decoration-color: #fff; }
  .ai-digest-loading, .ai-digest-error { color: rgba(255,255,255,0.7); font-size: 12px; }

  /* Phase 2.0b: 各タスクのAIアドバイス chip */
  .advice-chip { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
  .advice-chip.warn { background: rgba(217, 70, 62, 0.12); color: #B83A30; }
  .advice-chip.info { background: rgba(45, 99, 200, 0.12); color: #2D63C8; }
  .advice-chip.muted { background: rgba(138, 147, 165, 0.18); color: #6E7783; }

  .kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
  .kpi { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
  .kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: .05em; }
  .kpi-value { font-size: 24px; font-weight: 900; color: var(--navy); letter-spacing: -.02em; margin-top: 4px; }
  .kpi-value .unit { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-left: 3px; }
  .kpi.danger .kpi-value { color: var(--danger); }
  .kpi.warn .kpi-value { color: var(--warning); }
  .kpi.good .kpi-value { color: var(--success); }
  .kpi-trend { font-size: 11px; color: var(--success); margin-top: 4px; }
  .kpi-trend.down { color: var(--danger); }

  /* Section tabs */
  .section-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
  .sec-tab { padding: 8px 16px; font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; font-weight: 500; transition: all .12s; }
  .sec-tab:hover { color: var(--text); }
  .sec-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }

  /* Task list */
  .task-group-label { font-size: 12px; color: var(--text-muted); font-weight: 700; letter-spacing: .08em; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
  .task-group-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
  .task-list { display: flex; flex-direction: column; gap: 8px; }
  .settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; padding: 0 24px 24px; }
  .conn-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
  .conn-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
  .conn-icon { font-size: 24px; }
  .conn-name { font-size: 16px; font-weight: 700; color: var(--navy); }
  .conn-status { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; margin-left: auto; }
  .conn-status.connected { background: rgba(30,168,140,.15); color: #1EA88C; }
  .conn-status.disconnected { background: rgba(217,70,62,.15); color: var(--danger); }
  .conn-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }
  .conn-btn { display: inline-block; padding: 8px 18px; background: var(--blue); color: #fff; border: none; border-radius: 7px; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
  .conn-btn:hover { opacity: 0.9; }
  .conn-btn.reconnect { background: var(--card); color: var(--blue); border: 1px solid var(--blue); }
  /* Team Pane (C案: メンバーチップ + リスト) */
  .team-filter { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 14px; }
  .team-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; transition: all .15s; }
  .team-chip:hover { border-color: var(--blue); color: var(--blue); }
  .team-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
  .team-chip-count { background: rgba(0,0,0,.08); border-radius: 9px; padding: 0 7px; font-size: 11px; font-weight: 700; }
  .team-chip.active .team-chip-count { background: rgba(255,255,255,.25); color: #fff; }
  .team-list { display: flex; flex-direction: column; gap: 16px; padding: 0 24px 24px; }
  .team-section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
  .team-section-header { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--navy); }
  .team-section-count { margin-left: auto; background: var(--blue-light); color: var(--blue); padding: 1px 9px; border-radius: 9px; font-size: 11px; font-weight: 700; }
  .team-section-tasks { display: flex; flex-direction: column; gap: 8px; }
  .team-task { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: 4px 1fr; gap: 10px; align-items: center; }
  .team-task-prio { width: 4px; height: 24px; border-radius: 2px; background: var(--border); }
  .team-task-prio.p1 { background: var(--danger); }
  .team-task-prio.p2 { background: var(--warning); }
  .team-task-prio.p3 { background: var(--blue); }
  .team-task-prio.p4 { background: var(--border-strong); }
  .team-task-title { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .team-task-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .team-empty { color: var(--text-muted); font-size: 12px; padding: 16px; text-align: center; }
  .task-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .task-column { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 16px; }
  .task-column-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: var(--navy);
    padding: 4px 6px 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  }
  .task-column-icon { font-size: 14px; }
  .task-column-icon.meeting { color: var(--blue); }
  .task-column-icon.work { color: var(--success, #1EA88C); }
  .task-column-count { margin-left: auto; background: var(--blue-light); color: var(--blue); padding: 1px 9px; border-radius: 9px; font-size: 11px; font-weight: 700; }
  @media (max-width: 1100px) {
    .task-columns { grid-template-columns: 1fr; }
  }
  .task {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; cursor: pointer; transition: all .12s;
    display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center;
    position: relative;
  }
  .task:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-1px); }
  .task.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45,99,200,.1), var(--shadow); background: var(--blue-lighter); }
  .task-prio {
    width: 6px; height: 28px; border-radius: 3px; background: var(--border);
  }
  .task-prio.p1 { background: var(--danger); }
  .task-prio.p2 { background: var(--warning); }
  .task-prio.p3 { background: var(--blue); }
  .task-prio.p4 { background: var(--border-strong); }
  .task-main { min-width: 0; }
  .task-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .task-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .task-meta .project-tag { background: var(--blue-light); color: var(--blue); padding: 1px 8px; border-radius: 8px; font-weight: 700; font-size: 10px; }
  .task-meta .due { color: var(--text-muted); }
  .task-meta .due.overdue { color: var(--danger); font-weight: 700; }
  .task-meta .due.soon { color: var(--warning); font-weight: 700; }
  .task-side { display: flex; align-items: center; gap: 10px; }
  .task-archive-btn {
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px 9px; font-size: 16px; line-height: 1;
    border-radius: 6px; opacity: 0; transition: opacity .12s, background .12s, color .12s;
  }
  .task:hover .task-archive-btn { opacity: 0.55; }
  .task-archive-btn:hover { opacity: 1; color: var(--danger); background: rgba(217,70,62,.08); }
  .task-sources { display: flex; gap: -4px; }
  .task-source-icon {
    width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--card);
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text-muted);
    margin-left: -6px;
  }
  .task-source-icon:first-child { margin-left: 0; }
  .task-source-icon.g { background: #4285F4; color: white; }
  .task-source-icon.s { background: #611F69; color: white; }
  .task-source-icon.m { background: #DB4437; color: white; }
  .task-source-icon.d { background: #1FA463; color: white; }
  .task-ai-hint { font-size: 11px; color: var(--blue); font-weight: 700; display: flex; align-items: center; gap: 3px; }

  /* Task tooltip */
  .task-tooltip {
    position: absolute; z-index: 50; background: var(--navy); color: white;
    padding: 10px 14px; border-radius: 8px; font-size: 12px; max-width: 280px;
    box-shadow: var(--shadow-lg); pointer-events: none;
    opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s;
  }
  .task-tooltip.visible { opacity: 1; transform: translateY(0); }
  .task-tooltip .tt-row { display: flex; gap: 10px; margin-top: 4px; font-size: 11px; color: rgba(255,255,255,.7); }
  .task-tooltip .tt-row strong { color: white; margin-right: 4px; }

  /* Companion panel (right) */
  .companion { background: var(--card); display: flex; flex-direction: column; overflow: hidden; }
  .companion-header {
    padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
  }
  .companion-header .ch-label { font-size: 11px; color: var(--text-muted); letter-spacing: .1em; font-weight: 700; }
  .companion-header .ch-close { margin-left: auto; color: var(--text-light); cursor: pointer; padding: 4px; }
  .companion-content { flex: 1; overflow-y: auto; padding: 20px 22px; }

  .cp-title { font-size: 18px; font-weight: 900; color: var(--navy); margin-bottom: 8px; line-height: 1.4; }
  .cp-meta-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
  .cp-chip { font-size: 11px; background: var(--bg); border: 1px solid var(--border); padding: 4px 10px; border-radius: 12px; color: var(--text); font-weight: 500; }
  .cp-chip.p1 { background: #FDEBE9; border-color: var(--danger); color: var(--danger); font-weight: 700; }
  .cp-chip.p2 { background: #FEF5E6; border-color: var(--warning); color: var(--warning); font-weight: 700; }

  .cp-description {
    font-size: 13px; color: var(--text); background: var(--bg); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px;
    line-height: 1.8;
  }

  /* AI Chips section */
  .cp-section { margin-bottom: 22px; }
  .cp-section-title {
    font-size: 11px; color: var(--text-muted); letter-spacing: .08em; font-weight: 700; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
  }
  .cp-section-title .ai-badge { background: linear-gradient(135deg, var(--blue), var(--gold)); color: white; padding: 1px 8px; border-radius: 8px; font-size: 9px; letter-spacing: .08em; }

  .ai-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
  .ai-chip {
    background: var(--card); border: 1.5px solid var(--blue); color: var(--blue);
    padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 6px;
  }
  .ai-chip:hover { background: var(--blue); color: white; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(45,99,200,.2); }
  .ai-chip.loading { opacity: .5; pointer-events: none; }

  .ai-result {
    background: linear-gradient(135deg, var(--blue-lighter) 0%, #FFFFFF 100%);
    border: 1px solid var(--blue-light); border-radius: 10px; padding: 14px 16px;
    font-size: 13px; color: var(--text); line-height: 1.7;
    animation: slideIn .25s ease-out;
  }
  @keyframes slideIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }
  .ai-result ol, .ai-result ul { margin-left: 20px; margin-top: 6px; }
  .ai-result li { margin-bottom: 4px; }
  .ai-result .ai-footer { margin-top: 10px; font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }
  .ai-result .ai-footer button { background: none; border: 1px solid var(--border); padding: 3px 10px; border-radius: 12px; font-size: 11px; color: var(--text-muted); cursor: pointer; font-family: inherit; }
  .ai-result .ai-footer button:hover { border-color: var(--blue); color: var(--blue); }

  /* Phase 1.7: キーワード調整 UI */
  .kw-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: white; border: 1px solid var(--border); border-radius: 14px;
    padding: 3px 4px 3px 10px; font-size: 11px; color: var(--text);
  }
  .kw-chip button {
    background: none; border: none; cursor: pointer; color: var(--text-muted);
    font-size: 14px; padding: 0 4px; line-height: 1; font-family: inherit;
  }
  .kw-chip button:hover { color: #e74c3c; }
  .kw-add-chip {
    background: var(--bg); border: 1px dashed var(--border); border-radius: 14px;
    padding: 3px 10px; font-size: 11px; color: var(--text-muted);
    cursor: pointer; font-family: inherit;
  }
  .kw-add-chip:hover { border-color: var(--blue); color: var(--blue); }
  .kw-input {
    border: 1px solid var(--blue); border-radius: 14px;
    padding: 3px 10px; font-size: 11px; font-family: inherit;
    outline: none; min-width: 120px;
  }

  /* Related resources */
  .resources-list { display: flex; flex-direction: column; gap: 6px; }
  .resource-item {
    display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
    padding: 10px 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; transition: all .12s;
  }
  .resource-item:hover { background: var(--bg); border-color: var(--border); }
  .resource-icon {
    width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: white;
  }
  .resource-icon.drive { background: #1FA463; }
  .resource-icon.slack { background: #611F69; }
  .resource-icon.gmail { background: #DB4437; }
  .resource-icon.calendar { background: #4285F4; }
  .resource-icon.task { background: var(--navy); }
  .resource-label { font-size: 13px; color: var(--text); font-weight: 500; line-height: 1.4; }
  .resource-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
  .resource-score {
    font-size: 10px; color: var(--text-light); font-family: 'SF Mono', monospace;
    background: var(--bg); padding: 2px 6px; border-radius: 4px;
  }

  /* Chat floating */
  .chat-fab {
    position: fixed; right: calc(450px + 24px); bottom: 24px; z-index: 40;
    width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 100%);
    color: white; display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: var(--shadow-lg); transition: all .2s; font-size: 22px; border: none;
  }
  .chat-fab:hover { transform: translateY(-3px) scale(1.05); }
  .chat-fab .chat-badge { position: absolute; top: -2px; right: -2px; background: var(--gold); color: var(--navy); font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 10px; }
  .chat-fab.hidden { display: none; }

  .chat-panel {
    position: fixed; right: 0; top: 0; height: 100vh; width: 420px; background: var(--card);
    border-left: 1px solid var(--border); box-shadow: -8px 0 32px rgba(11,31,58,.08);
    z-index: 50; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  }
  .chat-panel.open { transform: translateX(0); }
  .chat-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
  .chat-header .ch-title { font-weight: 700; color: var(--navy); }
  .chat-header .ch-sub { font-size: 11px; color: var(--text-muted); }
  .chat-header .close-btn { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
  .chat-header .close-btn:hover { border-color: var(--danger); color: var(--danger); }

  .chat-context-row {
    padding: 10px 20px; background: var(--blue-lighter); border-bottom: 1px solid var(--border);
    display: flex; gap: 8px; align-items: center; font-size: 12px;
  }
  .chat-context-row label { color: var(--text-muted); font-size: 11px; font-weight: 600; }
  .chat-context-row select {
    background: white; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 10px; font-size: 12px; font-family: inherit; color: var(--navy); font-weight: 600;
  }

  .chat-messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
  .msg { max-width: 85%; font-size: 13px; line-height: 1.7; }
  .msg.user { align-self: flex-end; background: var(--blue); color: white; padding: 10px 14px; border-radius: 14px 14px 2px 14px; }
  .msg.ai { align-self: flex-start; background: var(--bg); color: var(--text); padding: 10px 14px; border-radius: 14px 14px 14px 2px; border: 1px solid var(--border); }
  .msg.ai .msg-cite { margin-top: 8px; font-size: 11px; color: var(--text-muted); padding-top: 8px; border-top: 1px dashed var(--border); }
  .msg.ai .msg-cite a { color: var(--blue); font-weight: 600; }
  .msg-ghost { align-self: flex-start; color: var(--text-muted); font-size: 12px; font-style: italic; }

  .chat-input-wrap { border-top: 1px solid var(--border); padding: 14px 20px 18px; }
  .chat-input-mention {
    font-size: 11px; color: var(--text-muted); margin-bottom: 6px;
  }
  .chat-input-mention .mention-chip {
    display: inline-flex; align-items: center; gap: 4px; background: var(--blue-light); color: var(--blue);
    padding: 2px 8px; border-radius: 10px; font-weight: 600; margin-right: 4px;
  }
  .chat-input-mention .mention-chip .close-x { cursor: pointer; font-size: 14px; line-height: 1; }
  .chat-input-box {
    display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  }
  .chat-input-box:focus-within { border-color: var(--blue); background: white; }
  .chat-input-box textarea {
    border: none; background: transparent; outline: none; resize: none;
    font-family: inherit; font-size: 13px; min-height: 24px; max-height: 120px; width: 100%; color: var(--text);
  }
  .chat-input-box textarea::placeholder { color: var(--text-light); }
  .chat-send-btn {
    width: 34px; height: 34px; border-radius: 8px; border: none; background: var(--blue); color: white;
    cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
  }
  .chat-send-btn:hover { background: var(--navy); }
  .chat-send-btn:disabled { background: var(--border-strong); cursor: not-allowed; }
  .chat-suggestions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
  .chat-sug { font-size: 11px; background: var(--card); border: 1px solid var(--border); padding: 4px 10px; border-radius: 10px; cursor: pointer; color: var(--text-muted); }
  .chat-sug:hover { border-color: var(--blue); color: var(--blue); }

  /* Peek modal */
  .peek-backdrop {
    position: fixed; inset: 0; background: rgba(11,31,58,.4); backdrop-filter: blur(2px);
    z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .peek-backdrop.open { opacity: 1; pointer-events: auto; }
  .peek-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.95);
    width: 640px; max-height: 80vh; background: var(--card); border-radius: 16px;
    box-shadow: var(--shadow-lg); z-index: 81; opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s; overflow: hidden; display: flex; flex-direction: column;
  }
  .peek-modal.open { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
  .peek-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
  .peek-header .peek-title { font-size: 18px; font-weight: 900; color: var(--navy); flex: 1; }
  .peek-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
  .peek-body h4 { font-size: 12px; color: var(--text-muted); letter-spacing: .08em; margin: 20px 0 8px; font-weight: 700; }
  .peek-body h4:first-child { margin-top: 0; }

  /* Help toast */
  .toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--navy); color: white; padding: 10px 18px; border-radius: 24px;
    font-size: 13px; box-shadow: var(--shadow-lg); z-index: 200;
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .toast.show { opacity: 1; }

  /* Scrollbars */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

  /* Small banner */
  .demo-banner {
    background: linear-gradient(90deg, var(--gold) 0%, #E0B844 100%);
    color: var(--navy); padding: 6px 20px; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; gap: 10px; justify-content: center;
  }
  .demo-banner a { color: var(--navy); font-weight: 700; text-decoration: underline; }

  /* Command Palette (Phase 1.3) */
  .cmd-backdrop { position: fixed; inset: 0; background: rgba(11,31,58,.35); z-index: 99; display: none; }
  .cmd-backdrop.open { display: block; }
  .cmd-palette {
    position: fixed; top: 15%; left: 50%;
    transform: translateX(-50%) scale(.97);
    width: 620px; max-width: calc(100% - 32px);
    background: var(--card); border-radius: 14px;
    box-shadow: 0 32px 64px rgba(11,31,58,.32), 0 8px 16px rgba(11,31,58,.12);
    z-index: 100; display: none; opacity: 0;
    transition: opacity .12s ease, transform .12s ease;
  }
  .cmd-palette.open { display: flex; flex-direction: column; opacity: 1; transform: translateX(-50%) scale(1); }
  .cmd-search-wrap { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
  .cmd-search-icon { color: var(--text-light); font-size: 16px; }
  .cmd-input { flex: 1; border: none; outline: none; font-family: inherit; font-size: 15px; color: var(--text); background: transparent; }
  .cmd-input::placeholder { color: var(--text-light); }
  .cmd-list { max-height: 420px; overflow-y: auto; padding: 6px 0 10px; }
  .cmd-section-label { padding: 10px 18px 4px; font-size: 10px; color: var(--text-muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .cmd-item { display: flex; align-items: center; gap: 12px; padding: 9px 18px; cursor: pointer; border-left: 3px solid transparent; font-size: 14px; }
  .cmd-item.active, .cmd-item:hover { background: var(--blue-light); border-left-color: var(--blue); }
  .cmd-item-icon { width: 22px; text-align: center; flex-shrink: 0; font-size: 15px; }
  .cmd-item-main { flex: 1; min-width: 0; }
  .cmd-item-title { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cmd-item-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cmd-item-kbd { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--text-muted); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; background: var(--bg); }
  .cmd-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; }
  .cmd-footer { border-top: 1px solid var(--border); padding: 8px 18px; display: flex; gap: 16px; font-size: 11px; color: var(--text-muted); }
  .cmd-footer .cmd-item-kbd { font-size: 10px; }
