:root {
  --bg: #0d0f12;
  --surface: #13161b;
  --surface-2: #1a1e25;
  --border: #232830;
  --text: #d8dde6;
  --muted: #9ba5b5;
  --accent: #4a9eff;
  --accent-green: #00d4aa;
  --status-pending: #f0c674;
  --status-done: #00d4aa;
  --status-failed: #ff6b6b;
  --status-hitl: #ff9f43;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.app { display: grid; grid-template-columns: 280px 1fr; height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace; font-weight: 600;
  letter-spacing: 0.04em; color: var(--accent);
}
.sidebar-header small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.sidebar-footer { margin-top: auto; padding: 10px 12px; border-top: 1px solid var(--border); }
.sidebar-stop-btn {
  width: 100%; padding: 7px 10px; background: none;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); cursor: pointer; font-size: 11px;
  font-family: 'IBM Plex Mono', monospace; text-align: left;
}
.sidebar-stop-btn:hover { border-color: var(--status-failed); color: var(--status-failed); }
#update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10000;
  background: #7c3aed; color: #fff;
  padding: 8px 16px; font-size: 12px; font-family: 'IBM Plex Mono', monospace;
  text-align: center;
}
#api-warn {
  margin: 10px; padding: 8px 10px;
  background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3);
  border-radius: 4px; color: var(--status-failed); font-size: 11px;
  display: none;
}
.projects-label {
  padding: 10px 16px 4px; color: var(--muted); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}
.project-list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.project-switcher {
  width: calc(100% - 16px);
  margin: 4px 8px 6px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}
.project-item {
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.project-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.project-item:hover { background: var(--surface-2); }
.project-item .id { color: var(--muted); font-size: 10px; margin-left: 8px; }

.new-project {
  padding: 8px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 6px;
}
.new-project input:first-child { flex: 1; min-width: 0; }
.new-project input:last-of-type { flex: 0 0 72px; min-width: 0; }

.main { display: flex; flex-direction: column; min-width: 0; }
.tabs {
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: stretch; overflow-x: auto; min-height: 40px;
}
.tab {
  padding: 10px 14px; border-right: 1px solid var(--border);
  cursor: pointer; display: flex; gap: 8px; align-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  background: var(--surface); color: var(--muted);
  white-space: nowrap;
}
.tab.active { background: var(--bg); color: var(--text); border-bottom: 2px solid var(--accent); }
.tab .close {
  color: var(--muted); border: none; background: transparent;
  cursor: pointer; padding: 0 2px; font-size: 14px;
}
.tab .close:hover { color: var(--status-failed); }
.tab-kebab {
  color: var(--muted); border: none; background: transparent;
  cursor: pointer; padding: 0 2px; font-size: 13px; opacity: 0;
  transition: opacity 0.15s; font-family: inherit;
}
.tab:hover .tab-kebab, .tab.active .tab-kebab { opacity: 1; }
.tab-kebab:hover { color: var(--text); }
.tab-overflow { color: var(--accent); font-size: 11px; }
.tab-bodies { flex: 1; overflow: hidden; position: relative; }
.tab-body {
  position: absolute; inset: 0;
  display: none; flex-direction: row; overflow: hidden;
}
.tab-body.active { display: flex; }

.vtab-strip {
  width: 44px; flex-shrink: 0; background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding-top: 6px; gap: 2px; z-index: 20; position: relative;
}
.vtab-btn {
  width: 36px; height: 36px; border-radius: 6px;
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.vtab-btn:hover { background: var(--surface-2); color: var(--text); }
.vtab-btn.active { background: var(--surface-2); color: var(--accent); }

.vtab-drawer {
  flex: 1; min-width: 0;
  background: var(--bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}

.project-fetch-alert {
  display: none;
  flex-shrink: 0;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 107, 107, 0.28);
  background: rgba(255, 107, 107, 0.09);
}
.project-fetch-alert__title {
  color: var(--status-failed);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.project-fetch-alert__summary {
  margin-top: 4px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}
.project-fetch-alert__list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-fetch-alert__item {
  padding: 7px 9px;
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.14);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}
.project-fetch-alert__endpoint {
  color: var(--text);
  word-break: break-all;
}
.project-fetch-alert__meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.project-fetch-alert__actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* G1.5 — caret indicator for collapsible disclosures (matches the
   ▶/▼ pattern used elsewhere in the dashboard). The browser default
   triangle is hidden via list-style:none + summary::-webkit-details-marker
   so the inline span is the only indicator. */
.meridian-disclosure > summary {
  list-style: none;
}
.meridian-disclosure > summary::-webkit-details-marker { display: none; }
.meridian-disclosure[open] > summary .meridian-caret {
  transform: rotate(90deg);
}
.project-load-error {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 107, 107, 0.28);
  border-radius: 4px;
  background: rgba(255, 107, 107, 0.08);
}
.project-load-error__title {
  color: var(--status-failed);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.project-load-error__meta {
  margin-top: 4px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  word-break: break-all;
}
.project-load-error__body {
  margin-top: 6px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}
.project-load-error__actions {
  margin-top: 8px;
}

.drawer-panel { display: none; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }
.drawer-panel.active { display: flex; }
.drawer-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0; gap: 6px;
}
.chat-full {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0; background: var(--surface);
}
.file-list { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; }
.file-item {
  padding: 7px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  cursor: pointer; color: var(--text);
}
.file-item:hover { border-color: var(--accent); color: var(--accent); }

.empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--muted);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}

.panel { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.panel.left { border-right: 1px solid var(--border); background: var(--bg); }
.panel.right { background: var(--surface); }
.panel-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.panel-header .ws-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--status-failed); display: inline-block;
}
.panel-header .ws-dot.connected { background: var(--status-done); }
.chat-mode { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.chat-mode .mode-btn {
  background: transparent; color: var(--muted); border: none; padding: 3px 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; cursor: pointer;
}
.chat-mode .mode-btn:hover { color: var(--text); }
.chat-mode .mode-btn.active { background: var(--accent); color: #001020; }

.section {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.section h3 {
  margin: 0 0 8px; font-size: 11px; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace; font-weight: 600;
}
.goal-area {
  width: 100%; min-height: 200px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 8px; color: var(--text);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  resize: vertical;
}
.goal-area.readonly { background: var(--surface-1); color: var(--muted); cursor: default; }
.goal-area.sprint { min-height: 100px; }
.goal-area.dirty { border-color: var(--accent) !important; }
.goal-label { font-size: 10px; font-family: 'IBM Plex Mono', monospace; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.goal-label .goal-ts { font-weight: 400; opacity: 0.6; margin-left: 6px; text-transform: none; letter-spacing: 0; }
.goal-section { display: flex; flex-direction: column; flex-shrink: 0; }
.goal-actions { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.goal-version { color: var(--muted); font-size: 11px; font-family: 'IBM Plex Mono', monospace; }

button.primary, button.secondary, button.danger {
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); padding: 6px 12px; border-radius: 4px;
  cursor: pointer; font-family: 'IBM Plex Mono', monospace; font-size: 11px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #001020; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button.secondary:hover { background: var(--border); }
button.danger { background: rgba(255,107,107,0.15); border-color: var(--status-failed); color: var(--status-failed); }
button.danger:hover { background: rgba(255,107,107,0.25); }
button.execute { background: var(--status-hitl); border-color: var(--status-hitl); color: #1a0f00; font-weight: 700; }
button.execute:hover { filter: brightness(1.1); }

input[type=text] {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 6px 8px; border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}

.sessions-list { display: flex; flex-direction: column; gap: 4px; }
#project-list { flex: 1; overflow-y: auto; min-height: 0; }
.session-row {
  padding: 4px 8px; background: var(--surface-2); border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  display: flex; justify-content: space-between;
}
.session-row .name { color: var(--text); }
.session-row .meta { color: var(--muted); }

.scroll-area { flex: 1; overflow-y: auto; }

.task-list { display: flex; flex-direction: column; }
.task {
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace; font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start;
}
.task .status-badge {
  font-size: 10px; padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.task.pending .status-badge { background: rgba(240,198,116,0.15); color: var(--status-pending); }
.task.done .status-badge    { background: rgba(0,212,170,0.15); color: var(--status-done); }
.task.failed .status-badge  { background: rgba(255,107,107,0.15); color: var(--status-failed); }
.task.in_progress .status-badge { background: rgba(133,77,14,0.2); color: #fef08a; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }
.task.pending-hitl {
  background: rgba(255,159,67,0.08);
  border-left: 3px solid var(--status-hitl);
}
.task.pending-hitl .status-badge { background: rgba(255,159,67,0.2); color: var(--status-hitl); }
.task.pending-hitl .desc { font-weight: 600; }
.task .desc { flex: 1; word-break: break-word; }
.claim-badge {
  display: inline-block; margin-left: 6px; padding: 1px 5px;
  border-radius: 3px; background: rgba(74,158,255,0.15);
  color: var(--accent); font-size: 10px; font-weight: 600;
}
.task .meta { font-size: 10px; color: var(--muted); }

.hitl-banner {
  margin: 0; padding: 10px 14px;
  background: rgba(255,159,67,0.1); border-bottom: 1px solid var(--status-hitl);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--status-hitl); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.hitl-row {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: rgba(255,159,67,0.04);
}
.hitl-row .prompt {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  margin-bottom: 8px; word-break: break-word;
}
.hitl-row .controls { display: flex; gap: 6px; align-items: center; }
.hitl-row input[type=text] { flex: 1; }

/* v1.1.1 — Activity Timeline */
.timeline-wrap { position: relative; min-width: 100%; }
.timeline-axis {
  display: grid; grid-template-columns: 120px 1fr; align-items: center;
  border-bottom: 1px dashed var(--border); padding-bottom: 4px;
  margin-bottom: 8px; font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--muted);
}
.timeline-axis .ticks { display: flex; justify-content: space-between; }
.timeline-row {
  display: grid; grid-template-columns: 120px 1fr;
  border-bottom: 1px solid var(--border); padding: 6px 0;
  min-height: 28px;
}
.timeline-row .label {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding-right: 8px;
}
.timeline-track {
  position: relative; height: 22px; background: var(--surface-2);
  border-radius: 4px;
}
.timeline-pill {
  position: absolute; top: 3px; height: 16px; border-radius: 3px;
  min-width: 6px; cursor: pointer; box-shadow: 0 0 0 1px var(--bg);
}
.timeline-pill.done       { background: var(--status-done); }
.timeline-pill.failed     { background: var(--status-failed); }
.timeline-pill.pending    { background: var(--status-pending); }
.timeline-pill.in_progress { background: #fef08a; animation: pulse 1.5s infinite; }
.timeline-pill.pending-hitl { background: var(--accent); }
.timeline-event-line {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1px dashed var(--accent); opacity: 0.6;
  pointer-events: none;
}
.timeline-empty {
  color: var(--muted); font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; padding: 20px;
}

/* Timeline sub-tabs: [Heatmap] [Detail] */
.tl-subtabs {
  display: flex; gap: 4px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.tl-subtab {
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  padding: 3px 12px; cursor: pointer;
}
.tl-subtab:hover { color: var(--text); }
.tl-subtab.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.tl-pane { width: 100%; }
.tl-heat-detail { font-family: 'IBM Plex Mono', monospace; }
.tl-heat-detail-head {
  color: var(--text); font-size: 11px; font-weight: 700;
  margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tl-heat-sess {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; padding: 2px 0;
}
.tl-heat-sess-name {
  color: var(--accent); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.tl-heat-sess-count { color: var(--muted); flex-shrink: 0; }

.timeline-tooltip { max-width: 320px; white-space: pre-wrap; word-break: break-word; }
.timeline-tooltip-desc {
  display: block; margin-top: 4px;
  max-height: 200px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}

.live-body {
  flex: 1; display: flex; flex-direction: column;
  overflow-y: auto; padding: 14px; gap: 14px;
}
.live-section { display: flex; flex-direction: column; gap: 8px; }
.live-section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.live-divider {
  border: 0; border-top: 1px solid var(--border); margin: 6px 0;
}
.live-empty {
  color: var(--muted); font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; padding: 6px 0;
}
.live-sessions, .live-queue {
  display: flex; flex-direction: column; gap: 6px;
}
.live-session-row, .live-task-row {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}
.live-session-head {
  display: flex; align-items: center; gap: 8px;
}
.live-session-name { color: var(--text); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-session-age { color: var(--muted); font-size: 10px; }
.live-session-task {
  color: var(--muted); font-size: 10px; margin-top: 4px;
  padding-left: 22px; line-height: 1.4;
}
.live-task-row {
  display: flex; align-items: flex-start; gap: 8px;
}
.live-task-body { flex: 1; min-width: 0; }
.live-task-desc {
  color: var(--text); line-height: 1.4; word-wrap: break-word;
}
.live-task-meta {
  color: var(--muted); font-size: 10px; margin-top: 3px;
  display: flex; gap: 8px;
}
.live-task-claim { color: var(--accent); }
.live-task-cancel {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px;
}
.live-task-cancel:hover { color: var(--status-failed); }
.live-dot { font-size: 12px; flex-shrink: 0; }
.live-sprint-progress { font-size: 12px; color: var(--muted); }
.live-sprint-bar { display: flex; gap: 8px; align-items: center; font-family: monospace; }
.live-sprint-bar-track { color: var(--accent); letter-spacing: 1px; }
.live-sprint-bar-count { color: var(--fg); font-weight: 600; }
.live-sprint-bar-pct { color: var(--muted); }
/* Sprint board (v1.9x) */
.sprint-group-header {
  font-size: 10px; font-family: 'IBM Plex Mono', monospace;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin: 8px 0 3px; padding: 2px 0;
  border-bottom: 1px solid var(--border);
}
.sprint-item-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; border-bottom: 1px solid var(--border);
  font-size: 12px; min-height: 28px;
}
.sprint-item-icon { flex-shrink: 0; width: 14px; text-align: center; font-size: 11px; }
.sprint-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sprint-item-ver { color: var(--muted); font-size: 10px; flex-shrink: 0; }
.sprint-item-meta { color: var(--muted); font-size: 10px; flex-shrink: 0;
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sprint-item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.sprint-btn {
  background: none; border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; font-size: 11px; cursor: pointer;
  color: var(--muted); line-height: 1.4;
}
.sprint-btn:hover { color: var(--accent-green); border-color: var(--accent-green); }
.sprint-btn-fail:hover { color: #e05; border-color: #e05; }
.sprint-btn-push:hover { color: var(--accent); border-color: var(--accent); }
.sprint-footer {
  margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.sprint-pct { font-size: 11px; color: var(--muted); font-family: monospace; }
.sprint-add-row { display: flex; gap: 4px; align-items: center; }
.live-add-row { display: flex; gap: 6px; }
.live-add-input {
  flex: 1; padding: 8px 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}
.live-add-input::placeholder { color: var(--muted); }

.claude-handoff-panel {
  width: 300px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
}
.claude-launch-body {
  flex: 1; display: flex; flex-direction: column;
  padding: 14px; gap: 12px; overflow-y: auto;
}
.claude-section {
  display: flex; flex-direction: column; gap: 8px;
}
.claude-section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.claude-section-btn {
  width: 100%; padding: 8px 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  border-radius: 4px; cursor: pointer;
}
.claude-divider {
  border: 0; border-top: 1px solid var(--border);
  margin: 4px 0;
}
.claude-session-select {
  width: 100%; padding: 6px 8px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}

/* Global select/dropdown styling — dark bg, white text, consistent across all dropdowns */
select {
  background: #1a1a1a;
  color: #f0f0f0;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  appearance: auto;
}
select:focus {
  outline: 1px solid var(--accent, #a8ff78);
  border-color: var(--accent, #a8ff78);
}
select option {
  background: #1a1a1a;
  color: #f0f0f0;
}
.claude-worker-result { display: flex; flex-direction: column; gap: 8px; }
.claude-worker-xml {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  color: var(--text); max-height: 180px; overflow: auto;
  white-space: pre-wrap; word-break: break-all; margin: 0;
}
.claude-handoff-ts {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  color: var(--muted);
}
.claude-hint {
  margin: 0; font-size: 10px; color: var(--muted);
  line-height: 1.4; font-family: 'IBM Plex Sans', sans-serif;
}
.claude-section-narrow { padding-top: 2px; }
.claude-cta-secondary-btn {
  display: inline-block; padding: 6px 12px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  text-decoration: none; text-align: center;
  align-self: flex-start;
}
.claude-cta-secondary-btn:hover {
  border-color: var(--accent); color: var(--text);
}
.server-version-pill {
  color: var(--muted); font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
}
.preview-toggle-row {
  display: flex; gap: 6px; margin-bottom: 6px; align-items: center;
}
.preview-toggle-row .preview-btn {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 8px; font-size: 10px; cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
}
.preview-toggle-row .preview-btn.active {
  background: var(--surface-2); color: var(--text);
  border-color: var(--accent);
}
.goal-preview {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px 14px; min-height: 120px;
  color: var(--text); font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.55; overflow-y: auto; overflow-x: auto; word-break: break-word;
}
.goal-preview h1, .goal-preview h2, .goal-preview h3 {
  margin-top: 0.6em; color: var(--accent);
}
.goal-preview code {
  background: var(--surface); padding: 1px 5px; border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace; font-size: 90%;
}
.goal-preview ul, .goal-preview ol { padding-left: 1.4em; }

.chat-history {
  flex: 1; overflow-y: auto; padding: 14px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg {
  padding: 10px 12px; border-radius: 6px; max-width: 90%;
  font-size: 13px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap;
}
.msg.user { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-end; }
.msg.assistant { background: rgba(74,158,255,0.07); border: 1px solid rgba(74,158,255,0.25); align-self: flex-start; }
.msg.system { background: rgba(0,212,170,0.05); border: 1px dashed var(--accent-green); color: var(--muted); font-size: 11px; align-self: stretch; font-family: 'IBM Plex Mono', monospace; }

/* v1.1.0 — chat row removed; chat markup is gone. Defensive
   JS handlers stay for older bundles but no styles are needed. */

.toast {
  position: fixed; bottom: 16px; right: 16px; z-index: 100;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 4px; font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  display: none;
}
.toast.show { display: block; }
.toast.error { border-color: var(--status-failed); color: var(--status-failed); }

/* v1.4.0 — vertical timeline log (newest first) */
.timeline-log { display: flex; flex-direction: column; }
.timeline-log-entry {
  display: grid; grid-template-columns: 80px 110px 1fr;
  gap: 8px; padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  align-items: baseline;
}
.timeline-log-entry:hover { background: var(--surface-2); }
.timeline-log-ts { color: var(--muted); }
.timeline-log-actor { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-log-desc { color: var(--text); }

/* v1.4.0 — work queue panel */
/* The queue-scroll wrapper is the single scroll container for the tab.
   min-height:0 on the inline style lets this flex child shrink below content
   height so the entire queue column scrolls as one surface. */
.queue-scroll { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.queue-scroll::-webkit-scrollbar { width: 10px; }
.queue-scroll::-webkit-scrollbar-track { background: transparent; }
.queue-scroll::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 5px;
  border: 2px solid var(--bg);
}
.queue-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.queue-section { padding: 0; border-bottom: 1px solid var(--border); }
.queue-section-header {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-family: 'IBM Plex Mono', monospace;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 14px; cursor: pointer; user-select: none;
}
.queue-section-header:hover { background: var(--hover); }
.queue-section-header:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.queue-section-header-label { display: inline-flex; align-items: center; gap: 6px; }
.queue-section-count { color: var(--accent); }
.queue-section-chevron { color: var(--muted); font-size: 10px; transition: transform .15s ease; }
.queue-section[data-collapsed="false"] .queue-section-chevron { transform: rotate(90deg); }
.queue-section-body { overflow: hidden; height: auto; transition: height .18s ease; }
.queue-section[data-collapsed="true"] .queue-section-body { height: 0px; }
.queue-section-body-inner { padding: 0 14px 10px; }
.queue-section-body-inner > .queue-empty { margin-top: 2px; }
.queue-item {
  padding: 5px 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  margin-bottom: 3px;
}
.queue-item-session { color: var(--muted); font-size: 10px; margin-top: 2px; }
.queue-item-ts { color: var(--muted); font-size: 10px; margin-left: 6px; font-family: 'IBM Plex Mono', monospace; }
.queue-empty { color: var(--muted); font-size: 11px; font-family: 'IBM Plex Mono', monospace; padding: 2px 0; }

/* v1.3.0 — Rewind tab.
   Day-window buttons live in the drawer header; the .active variant
   highlights the currently-loaded window so users always know which
   period they're staring at. The rewind body uses the same monospace
   stack as the rest of the drawer so the timeline reads as a log. */
.rewind-day-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.rewind-wrap section { line-height: 1.45; }

/* v1.9x — rewind 3 subtabs */
.rewind-subtab-bar {
  display: flex; flex-shrink: 0; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.rewind-subtab-btn {
  padding: 5px 12px; background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  white-space: nowrap;
}
.rewind-subtab-btn:hover { color: var(--text); }
.rewind-subtab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.rewind-subtab-pane { line-height: 1.45; }

/* v1.4.1 — goal subtab bar */
.goal-subtab-strip {
  display: flex; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.goal-subtab-btn {
  padding: 8px 14px; background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  white-space: nowrap;
}
.goal-subtab-btn:hover { color: var(--text); }
.goal-subtab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.goal-subtab-body {
  flex: 1; position: relative; overflow: hidden; min-height: 0;
}
.goal-subtab-panel {
  display: none; flex-direction: column;
  position: absolute; inset: 0; padding: 12px 14px; gap: 8px; overflow-y: auto;
}
.goal-subtab-panel.active { display: flex; }
/* version goal + north star: textareas grow with content, no scrollbars */
.goal-area.goal-full {
  min-height: 0; resize: none; flex-shrink: 0;
  overflow-y: hidden; height: auto;
}

/* v1.4.1 — sidebar is always visible on desktop; hamburger only on mobile */
#sidebar-toggle { display: none; }
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -280px; top: 0; bottom: 0; width: 280px;
    z-index: 200; transition: left 0.18s ease; box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.mobile-open { left: 0; }
  #sidebar-toggle {
    display: flex; position: fixed; top: 10px; left: 10px; z-index: 300;
    width: 36px; height: 36px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 6px;
    align-items: center; justify-content: center; cursor: pointer;
    color: var(--text); font-size: 18px; font-family: monospace;
  }
}

.tab-context-menu div:hover { background: var(--hover); cursor: pointer; }
