/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg-base: #0a0a0a;
  --bg-surface: #111111;
  --bg-elevated: #191919;
  --bg-hover: #222222;
  --bg-selected: #1a1a2e;

  --fg-default: #ededed;
  --fg-muted: #888888;
  --fg-subtle: #555555;

  --border-default: #2a2a2a;
  --border-subtle: #1a1a1a;

  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --yellow: #eab308;
  --yellow-dim: rgba(234, 179, 8, 0.15);
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.15);
  --purple: #a855f7;
  --purple-dim: rgba(168, 85, 247, 0.15);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.15);

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  --shadow-1: 0 6px 18px rgba(0, 0, 0, 0.35);

  --z-sidebar: 100;
  --z-scrim: 90;
  --z-modal: 120;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Smooth scrolling for all scrollable areas */
.overview-main,
.overview-side,
.list-content,
.detail-content,
.project-main,
.agent-sidebar,
.tab-content,
.sidebar-content {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Prevent body scroll when sidebar is open on mobile */

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-default);
  background: var(--bg-base);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

.focusable:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ============================================
   LAYOUT
   ============================================ */
.app {
  display: flex;
  height: 100vh;
  padding-bottom: 32px; /* Space for mock footer */
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.logo-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.logo-text {
  font-weight: 600;
  font-size: 16px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-item:hover {
  background: var(--bg-elevated);
  color: var(--fg-default);
}

.sidebar-item:active {
  transform: scale(0.98);
}

.sidebar-item.active {
  background: var(--bg-selected);
  color: var(--fg-default);
}

.sidebar-item-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-item-icon svg {
  display: block;
  color: currentColor;
}

.sidebar-item-label {
  flex: 1;
}

.sidebar-item-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-item-badge.orange {
  background: var(--orange);
  color: #000;
}

.sidebar-item-badge.green {
  background: var(--green-dim);
  color: var(--green);
}

.sidebar-item-badge.muted {
  background: var(--bg-elevated);
  color: var(--fg-muted);
}

.sidebar-item-badge.zero {
  background: var(--green);
  color: #000;
}

.agent-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-status.green {
  background: var(--green);
}
.agent-status.yellow {
  background: var(--yellow);
}
.agent-status.red {
  background: var(--red);
}
.agent-status.gray {
  background: var(--fg-subtle);
}

.agent-status.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--fg-muted);
}

.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.sidebar-stat {
  display: flex;
  justify-content: space-between;
}

.sidebar-stat-value {
  color: var(--fg-default);
  font-weight: 500;
}

/* Main Area */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--fg-default);
  cursor: pointer;
  font-size: 18px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.icon-btn:active {
  transform: scale(0.95);
  background: var(--bg-selected);
}

.icon-btn svg {
  pointer-events: none;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: var(--z-scrim);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.right-sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: var(--z-scrim);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* Overview Page */
.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 24px;
  padding: 24px 32px;
  flex: 1;
  overflow: visible;
  align-items: start;
}

.overview-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  min-height: 0;
  min-width: 0;
}

.overview-metrics {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metric-card,
.overview-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-title {
  font-size: 12px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-default);
}

.overview-summary-card {
  gap: 16px;
  width: 100%;
}

.overview-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.overview-status-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.overview-status-label {
  font-size: 11px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.overview-status-value {
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
}

.overview-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.overview-split-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overview-split-col + .overview-split-col {
  border-left: 1px solid var(--border-subtle);
  padding-left: 16px;
}

.overview-action-btn {
  width: 100%;
  justify-content: center;
}

.metric-meta {
  font-size: 12px;
  color: var(--fg-muted);
}

.fleet-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.fleet-seg {
  height: 100%;
}

.fleet-seg.working {
  background: var(--green);
}
.fleet-seg.blocked {
  background: var(--red);
}
.fleet-seg.pending {
  background: var(--yellow);
}
.fleet-seg.idle {
  background: var(--fg-subtle);
}

.fleet-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--fg-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Overview Page (v2) */
.ov-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 32px;
  flex: 1;
  min-width: 0;
}

.ov-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ov-combined {
  padding: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: stretch;
}

.ov-section {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  width: 100%;
  flex: 0 0 auto;
}

.ov-inbox-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--fg-muted);
  cursor: pointer;
  border-radius: 8px;
  transition:
    background 0.15s,
    color 0.15s;
}

.ov-inbox-hint:hover {
  background: var(--bg-elevated);
  color: var(--fg);
}

.ov-inbox-hint-arrow {
  opacity: 0.5;
}

.ov-inbox-hint:hover .ov-inbox-hint-arrow {
  opacity: 1;
}

.ov-combined .ov-section + .ov-section {
  border-left: 1px solid var(--border-subtle);
}

.ov-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ov-card-title {
  font-size: 12px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ov-card-meta {
  font-size: 12px;
  color: var(--fg-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ov-metric {
  font-size: 22px;
  font-weight: 600;
  color: var(--fg-default);
}

.ov-action-btn {
  width: 100%;
  justify-content: center;
}

.ov-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ov-status-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.ov-status-label {
  font-size: 11px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ov-status-value {
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
}

.ov-project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ov-project-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) minmax(
      0,
      160px
    );
  gap: 12px;
  align-items: center;
  padding: 12px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  transition:
    background 0.12s ease,
    transform 0.1s ease,
    border-color 0.12s ease;
  min-width: 0;
}

.ov-project-row:hover {
  background: var(--bg-hover);
}

.ov-project-row:active {
  transform: scale(0.99);
  border-color: var(--border-default);
}

.ov-project-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--fg-muted);
}

.ov-project-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-default);
  gap: 8px;
}

.ov-project-icon {
  font-size: 16px;
}

.ov-project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-project-progress {
  flex-direction: column;
  align-items: flex-start;
}

.ov-progress-text {
  font-size: 11px;
  color: var(--fg-muted);
}

.ov-muted {
  color: var(--fg-subtle);
}

@media (max-width: 1200px) {
  .ov-project-row {
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) minmax(
        0,
        120px
      );
  }
}

@media (max-width: 1024px) {
  .ov-combined {
    flex-direction: column;
  }

  .ov-combined .ov-section + .ov-section {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

@media (min-width: 1025px) {
  .ov-combined {
    flex-direction: row;
  }

  .ov-section {
    flex: 1;
  }
}

@media (max-width: 820px) {
  .ov-project-list {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .ov-project-row {
    min-width: 640px;
  }
}

.project-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr 140px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition:
    background 0.12s ease,
    transform 0.1s ease,
    border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}

.project-row > * {
  min-width: 0;
}

.project-row:hover {
  background: var(--bg-hover);
}

.project-row:active {
  transform: scale(0.99);
  border-color: var(--border-default);
}

.project-row-header {
  font-size: 11px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 14px;
}

.project-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  min-width: 0;
}

.project-row-title span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-row-meta {
  font-size: 11px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.project-row-label {
  display: none;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-subtle);
}

.project-row-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-muted);
}

.project-row-progress .progress-bar {
  width: 100%;
}

@media (max-width: 1200px) {
  .project-row {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)) 120px;
  }
}

@media (max-width: 1100px) {
  .overview-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .overview-metrics {
    flex-direction: column;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .project-row-label {
    display: inline-flex;
  }

  .project-row-meta,
  .project-row-progress {
    justify-content: space-between;
  }

  /* Work columns already hidden at 900px */

  /* Options full width */
  .option {
    padding: 14px;
  }

  .option-key {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 540px) {
  .filter-bar {
    gap: 6px;
    flex-wrap: wrap;
  }

  .filter-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
  }

  .overview-layout,
  .project-layout {
    padding: 12px;
  }

  .page-header {
    padding: 12px;
  }

  /* Metric cards tighter */
  .metric-card {
    padding: 12px;
  }

  .metric-value {
    font-size: 18px;
  }

  /* Agent context bar single column */
  .agent-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 12px 4px;
  }

  .agent-context-item {
    padding: 8px 10px;
  }

  /* Archive grid single column */
  .archive-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  /* Card content tighter */
  .card-header,
  .card-content {
    padding: 12px 14px;
  }

  /* Detail sections */
  .detail-header,
  .detail-content {
    padding: 14px;
  }

  .detail-section {
    margin-bottom: 20px;
  }

  /* Modal takes full width */
  .command-palette-overlay {
    padding-top: 60px;
    align-items: flex-start;
  }

  .command-palette {
    width: 100%;
    max-width: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .request-modal {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
}

@media (max-width: 400px) {
  /* Extra small phones (iPhone SE, etc.) */
  .sidebar {
    width: 100%;
  }

  .page-title {
    font-size: 16px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .project-row {
    padding: 12px;
  }

  .item {
    padding: 12px;
  }

  .detail-title {
    font-size: 16px;
  }

  .metric-card {
    padding: 10px 12px;
  }

  .metric-value {
    font-size: 16px;
  }

  .metric-title {
    font-size: 11px;
  }

  /* Full width filter buttons */
  .filter-bar {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  .action-bar {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .sidebar-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .mock-footer {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(32px + env(safe-area-inset-bottom));
  }
}

.overview-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  min-height: 0;
  min-width: 0;
}

/* Page Header */
.page-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.page-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 12px;
}

.page-header-top .sidebar-toggle {
  display: none;
}

.page-header-top .right-sidebar-toggle {
  display: none;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}

.breadcrumb-link {
  color: var(--fg-muted);
  text-decoration: none;
  cursor: pointer;
}

.breadcrumb-link:hover {
  color: var(--fg-default);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--fg-subtle);
}

.page-title {
  font-size: 20px;
  font-weight: 600;
}

.page-subtitle {
  font-size: 13px;
  color: var(--fg-muted);
}

.page-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Page Content */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
}

/* Two-panel layout for inbox */
.panel-layout {
  display: flex;
  flex: 1;
}

.list-panel {
  width: 380px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.list-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-title {
  font-size: 15px;
  font-weight: 600;
}

.list-progress {
  font-size: 12px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  width: 60px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  transition: width 0.3s ease;
}

.list-content {
  flex: 1;
  overflow-y: auto;
}

.list-group {
  border-bottom: 1px solid var(--border-subtle);
}

.list-group:last-child {
  border-bottom: none;
}

.list-group-header {
  padding: 8px 20px;
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-group-count {
  color: var(--fg-muted);
  font-weight: 400;
}

/* Individual Items */
.item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition:
    background 0.12s ease,
    transform 0.1s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.item:hover {
  background: var(--bg-hover);
}

.item:active {
  background: var(--bg-elevated);
}

.item.selected {
  background: var(--bg-selected);
  border-left: 3px solid var(--blue);
  padding-left: 17px;
}

.item.exiting {
  animation: itemExit 0.3s ease-out forwards;
}

@keyframes itemExit {
  0% {
    opacity: 1;
    transform: translateX(0);
    max-height: 120px;
  }
  50% {
    opacity: 0.5;
    transform: translateX(30px);
  }
  100% {
    opacity: 0;
    transform: translateX(60px);
    max-height: 0;
    padding: 0 20px;
    border-bottom-width: 0;
  }
}

.item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.item-action {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.item-action.decision {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.item-action.artifact {
  background: var(--blue-dim);
  color: var(--blue);
}

.item-time {
  font-size: 11px;
  color: var(--fg-subtle);
  margin-left: auto;
}

.item-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.4;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.item-sep {
  color: var(--fg-subtle);
}

.item-project {
  color: var(--fg-subtle);
}

.item-agent {
  color: var(--fg-muted);
}

.item-category {
  font-size: 9px;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: 6px;
}

.artifact-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: var(--bg-elevated);
  color: var(--fg-default);
}

.artifact-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.artifact-chip.neutral {
  background: var(--bg-elevated);
  color: var(--fg-muted);
}
.artifact-chip.ready {
  background: var(--green-dim);
  color: var(--green);
}
.artifact-chip.review {
  background: var(--blue-dim);
  color: var(--blue);
}
.artifact-chip.tests {
  background: var(--purple-dim);
  color: var(--purple);
}

.artifact-card {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.artifact-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-muted);
  flex-wrap: wrap;
}

.artifact-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-default);
}

.item-resolution {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.resolution-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resolution-pill.neutral {
  background: var(--bg-elevated);
  color: var(--fg-muted);
}
.resolution-pill.info {
  background: var(--blue-dim);
  color: var(--blue);
}
.resolution-pill.danger {
  background: var(--red-dim);
  color: var(--red);
}
.resolution-pill.success {
  background: var(--green-dim);
  color: var(--green);
}

/* Detail Panel */
.detail-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-base);
}

.detail-header {
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--radius-md);
  transition: background 0.1s;
}

.detail-meta-item:hover {
  background: var(--bg-elevated);
}

.agent-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-default);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.agent-avatar.small {
  width: 20px;
  height: 20px;
  font-size: 10px;
  border-radius: 6px;
}

.detail-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.detail-section {
  margin-bottom: 28px;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.detail-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-muted);
}

/* Context Card */
.context-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.context-card-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.context-card-header:hover {
  background: var(--bg-hover);
}

.context-card-header:active {
  background: var(--bg-elevated);
}

.context-card-title {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-card-expand {
  font-size: 12px;
  color: var(--fg-subtle);
  transition: transform 0.2s;
}

.context-card.expanded .context-card-expand {
  transform: rotate(180deg);
}

.context-card-body {
  padding: 0 16px 16px;
  display: none;
}

.context-card.expanded .context-card-body {
  display: block;
}

.context-list {
  list-style: none;
  font-size: 13px;
  color: var(--fg-muted);
}

.context-list li {
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.context-list li::before {
  content: ">";
  color: var(--fg-subtle);
  flex-shrink: 0;
}

.context-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.context-file {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--blue);
}

.recommendation {
  margin-top: 12px;
  padding: 12px;
  background: var(--green-dim);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--green);
  font-size: 13px;
}

.recommendation-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.resolution-card {
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--fg-default);
}

.resolution-card.neutral {
  border-left-color: var(--fg-subtle);
}
.resolution-card.info {
  border-left-color: var(--blue);
}
.resolution-card.danger {
  border-left-color: var(--red);
}
.resolution-card.success {
  border-left-color: var(--green);
}

.resolution-card .resolution-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

/* Decision Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.option:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.option:active {
  transform: scale(0.98);
  background: var(--bg-elevated);
}

.option.recommended {
  border-color: var(--green);
}

.option-key {
  width: 28px;
  height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.option:hover .option-key {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.option-content {
  flex: 1;
}

.option-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.option-desc {
  font-size: 12px;
  color: var(--fg-muted);
}

.option-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--green-dim);
  color: var(--green);
  text-transform: uppercase;
}

.option-badge.selected {
  background: var(--blue-dim);
  color: var(--blue);
}

/* Diff Preview */
.diff-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
}

.diff-header {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  color: var(--fg-muted);
}

.diff-stats {
  display: flex;
  gap: 12px;
}

.diff-add {
  color: var(--green);
}
.diff-remove {
  color: var(--red);
}

.diff-content {
  max-height: 300px;
  overflow-y: auto;
}

.diff-line {
  padding: 2px 14px;
  white-space: pre;
}

.diff-line.add {
  background: var(--green-dim);
  color: var(--green);
}

.diff-line.remove {
  background: var(--red-dim);
  color: var(--red);
}

.diff-line.context {
  color: var(--fg-subtle);
}

.diff-line.header {
  background: var(--blue-dim);
  color: var(--blue);
}

/* Action Bar */
.action-bar {
  padding: 16px 32px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg-default);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--fg-subtle);
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.btn.primary:hover {
  background: #2563eb;
}

.btn.success {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.btn.success .kbd {
  background: rgba(0, 0, 0, 0.2);
  color: #000;
}

.btn.neutral {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--fg-muted);
}

.btn.info {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
}

.btn.danger {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

.btn .kbd {
  font-size: 11px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  font-family: var(--font-mono);
}

.action-hints {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--fg-subtle);
}

.action-hint {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

@media (max-width: 540px) {
  .empty-state {
    padding: 40px 24px;
  }
}

.empty-icon {
  width: 72px;
  height: 72px;
  background: var(--bg-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
}

@media (max-width: 540px) {
  .empty-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
    margin-bottom: 16px;
  }
}

.empty-icon.success {
  background: var(--green-dim);
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

@media (max-width: 540px) {
  .empty-title {
    font-size: 18px;
  }
}

.empty-subtitle {
  font-size: 14px;
  color: var(--fg-muted);
  max-width: 280px;
}

@media (max-width: 540px) {
  .empty-subtitle {
    font-size: 13px;
    max-width: 260px;
  }
}

/* Toast */
.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  transform: translateY(-20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.toast-icon.success {
  background: var(--green);
  color: #000;
}

/* Command Palette */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.command-palette-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.command-palette {
  width: 560px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Request Changes Modal */
.request-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.request-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.request-modal {
  width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.request-modal:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.request-title {
  font-size: 14px;
  font-weight: 600;
}

.request-textarea {
  min-height: 120px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--fg-default);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.request-textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.command-input-wrapper {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.command-input-icon {
  color: var(--fg-muted);
  font-size: 16px;
}

.command-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--fg-default);
  font-family: var(--font-sans);
}

.command-input::placeholder {
  color: var(--fg-subtle);
}

.command-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.command-section {
  padding: 8px 0;
}

.command-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px 8px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.1s;
}

.command-item:hover,
.command-item.selected {
  background: var(--bg-hover);
}

.command-item-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.command-item-content {
  flex: 1;
}

.command-item-title {
  font-size: 13px;
  font-weight: 500;
}

.command-item-desc {
  font-size: 11px;
  color: var(--fg-muted);
}

.command-item-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--fg-muted);
}

/* Mock Footer */
.mock-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: #1a1a2e;
  border-top: 1px solid var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  color: var(--purple);
  z-index: 100;
}

.mock-footer-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock-footer-btn {
  background: transparent;
  border: 1px solid var(--purple);
  color: var(--purple);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.1s;
}

.mock-footer-btn:hover {
  background: var(--purple);
  color: #000;
}

/* ============================================
   PROJECT PAGE
   ============================================ */
.project-layout {
  display: flex;
  gap: 32px;
  padding: 24px 32px 64px;
  flex: 1;
  min-height: min-content;
  width: 100%;
  justify-content: center;
}

.project-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: min-content;
  padding-bottom: 24px;
  width: 100%;
  max-width: 1200px;
}

.project-status-sentence {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.project-status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--bg-base);
}

.project-status-dot.red {
  background: var(--red);
}
.project-status-dot.yellow {
  background: var(--yellow);
}
.project-status-dot.gray {
  background: var(--fg-subtle);
}

.project-status-text {
  font-size: 14px;
  color: var(--fg-default);
}

.overall-progress {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.overall-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.overall-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.overall-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
}

.work-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.work-column {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 140px;
}

.work-column-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
  display: flex;
  justify-content: space-between;
}

.work-column-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.work-column-item {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--fg-default);
}

.work-column-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mobile task summary - replaces work columns on small screens */
.task-summary-mobile {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.task-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--fg-muted);
}

.task-summary-chip .count {
  font-weight: 600;
  color: var(--fg-default);
}

.task-summary-chip.done .count {
  color: var(--green);
}
.task-summary-chip.progress .count {
  color: var(--blue);
}
.task-summary-chip.pending .count {
  color: var(--fg-muted);
}

.project-deliverables {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-deliverable {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  cursor: pointer;
  transition:
    background 120ms ease-out,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.project-deliverable:hover {
  background: var(--bg-hover);
}

.project-deliverable:active {
  transform: scale(0.98);
}

.project-deliverable-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-default);
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-deliverable-meta {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
}

.card-content {
  padding: 14px 18px;
}

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.agent-card {
  padding: 14px 18px;
  background: var(--bg-base);
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition:
    background 0.12s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.agent-card:hover {
  background: var(--bg-hover);
}

.agent-card:active {
  transform: scale(0.98);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  min-width: 0;
}

.agent-card-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.agent-card-task {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.agent-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  row-gap: 6px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--fg-subtle);
}

.agent-card-stats span {
  white-space: nowrap;
}

.project-card-deliverables .card-content {
  min-height: 112px;
}

.project-card-agents .card-content {
  width: 100%;
  min-width: 0;
}

.work-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.work-item:last-child {
  border-bottom: none;
}

.work-item-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.work-item-status.done {
  background: var(--green);
}
.work-item-status.progress {
  background: var(--blue);
}
.work-item-status.blocked {
  background: var(--red);
}
.work-item-status.pending {
  background: var(--fg-subtle);
}

.work-item-content {
  flex: 1;
}

.work-item-title {
  font-size: 13px;
  margin-bottom: 2px;
}

.work-item-meta {
  font-size: 11px;
  color: var(--fg-muted);
}

/* ============================================
   AGENT PAGE
   ============================================ */
.agent-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

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

.agent-sidebar {
  width: 300px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agent-context-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 32px 6px;
}

.agent-context-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--fg-muted);
}

.agent-context-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-default);
  margin-top: 4px;
}

.timeline {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-default);
}

.timeline-meta {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

/* Fill remaining space in tabs bar */
.tabs::after {
  content: "";
  flex: 1;
}

.tab {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition:
    color 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover {
  color: var(--fg-default);
}

.tab:active {
  background: var(--bg-elevated);
}

.tab.active {
  color: var(--fg-default);
  border-bottom-color: var(--blue);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
}

/* Conversation View */
.conversation {
  padding: 20px 24px;
}

.message {
  margin-bottom: 20px;
}

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

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.message-avatar.system {
  background: var(--bg-elevated);
}
.message-avatar.agent {
  background: var(--blue-dim);
}
.message-avatar.user {
  background: var(--purple-dim);
}
.message-avatar.waiting {
  background: var(--yellow-dim);
}

.message-author {
  font-size: 13px;
  font-weight: 500;
}

.message-time {
  font-size: 11px;
  color: var(--fg-subtle);
}

.message-content {
  margin-left: 38px;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.6;
}

.message-tools {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-call {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
}

.tool-header {
  padding: 8px 12px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.tool-name {
  color: var(--cyan);
  font-weight: 500;
}

.tool-args {
  color: var(--fg-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-result {
  padding: 8px 12px;
  color: var(--fg-subtle);
  display: none;
}

.tool-call.expanded .tool-result {
  display: block;
}

.message.waiting .message-content {
  color: var(--yellow);
  font-style: italic;
}

.message.decision {
  background: var(--orange-dim);
  margin-left: -24px;
  margin-right: -24px;
  padding: 16px 24px;
  border-radius: 0;
}

/* Debug View */
.debug-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.debug-section:last-child {
  border-bottom: none;
}

.debug-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.debug-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
}

.debug-stat-label {
  color: var(--fg-muted);
}

.debug-stat-value {
  color: var(--fg-default);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.debug-stat-value.good {
  color: var(--green);
}
.debug-stat-value.warning {
  color: var(--yellow);
}
.debug-stat-value.danger {
  color: var(--red);
}

.context-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.context-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.process-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.process-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 11px;
}

.process-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.process-status.running {
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.process-status.stopped {
  background: var(--fg-subtle);
}

.process-name {
  flex: 1;
  color: var(--fg-muted);
}

.process-pid {
  color: var(--fg-subtle);
}

/* Files View */
.file-list {
  padding: 8px 0;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.1s;
}

.file-item:hover {
  background: var(--bg-hover);
}

.file-icon {
  font-size: 14px;
}

.file-icon.created {
  color: var(--green);
}
.file-icon.modified {
  color: var(--yellow);
}
.file-icon.flagged {
  color: var(--red);
}

.file-info {
  flex: 1;
}

.file-path {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-default);
}

.file-meta {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 2px;
}

/* Archive Page */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  padding: 24px 32px;
}

.archive-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.archive-item:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
}

.archive-item:active {
  transform: scale(0.98);
}

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

.archive-item-title {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.archive-item-decision {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--green-dim);
  color: var(--green);
}

.archive-item-preview {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.archive-item-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--fg-subtle);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-btn {
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--fg-muted);
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn:hover {
  border-color: var(--border-default);
  color: var(--fg-default);
}

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

.filter-btn.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
}

.filter-count {
  margin-left: 6px;
  background: var(--bg-base);
  color: var(--fg-subtle);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Freeform Input */
.freeform-container {
  margin-top: 12px;
  display: none;
}

.freeform-container.show {
  display: block;
}

.freeform-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  margin-top: 8px;
}

.freeform-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--fg-subtle);
  color: var(--fg-default);
}

.freeform-toggle .kbd {
  margin-left: auto;
}

.freeform-input-wrapper {
  margin-top: 12px;
}

.freeform-input {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--fg-default);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.freeform-input:focus {
  outline: none;
  border-color: var(--blue);
}

.freeform-input::placeholder {
  color: var(--fg-subtle);
}

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

.freeform-hint {
  font-size: 11px;
  color: var(--fg-subtle);
  margin-top: 8px;
}

/* Model Badge */
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}

.model-badge.opus {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--purple);
}

.model-badge.sonnet {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
}

.model-badge.haiku {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

/* Test Results Styling */
.test-results {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.test-summary {
  padding: 14px 18px;
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.test-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.test-stat-value {
  font-size: 20px;
  font-weight: 600;
}

.test-stat-value.pass {
  color: var(--green);
}
.test-stat-value.fail {
  color: var(--red);
}
.test-stat-value.skip {
  color: var(--yellow);
}

.test-stat-label {
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: uppercase;
}

.test-suite {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.test-suite:last-child {
  border-bottom: none;
}

.test-suite-name {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--fg-muted);
}

.test-case {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
}

.test-case-icon {
  font-size: 12px;
}

.test-case-icon.pass {
  color: var(--green);
}
.test-case-icon.fail {
  color: var(--red);
}
.test-case-icon.skip {
  color: var(--yellow);
}

/* Markdown Content */
.markdown-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-muted);
}

.markdown-content h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-default);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.markdown-content h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-default);
  margin: 20px 0 12px 0;
}

.markdown-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-default);
  margin: 16px 0 8px 0;
}

.markdown-content p {
  margin: 0 0 12px 0;
}

.markdown-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--cyan);
}

.markdown-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 12px 0;
  overflow-x: auto;
}

.markdown-content pre code {
  padding: 0;
  background: none;
  color: var(--fg-muted);
}

.markdown-content ul,
.markdown-content ol {
  margin: 0 0 12px 0;
  padding-left: 24px;
}

.markdown-content li {
  margin: 4px 0;
}

.markdown-content strong {
  color: var(--fg-default);
  font-weight: 600;
}

.markdown-content blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--blue);
  background: var(--blue-dim);
  color: var(--fg-muted);
}

/* Multi-file Diff */
.multi-diff {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   FEATURE: Glanceable System Status
   ============================================ */
.system-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator .dot.green {
  background: var(--green);
}
.status-indicator .dot.red {
  background: var(--red);
}
.status-indicator .dot.orange {
  background: var(--orange);
}

.status-indicator.has-blocked .dot.red {
  animation: pulseBlocked 1.5s ease-in-out infinite;
}

/* ============================================
   FEATURE: Blocked Agent Indicators
   ============================================ */
.blocked-indicator {
  font-size: 9px;
  padding: 1px 5px;
  background: var(--red);
  color: #000;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 4px;
}

.agent-status.red {
  animation: pulseBlocked 1.2s ease-in-out infinite;
}

@keyframes pulseBlocked {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
    transform: scale(1.15);
  }
}

.item-blocked-badge {
  font-size: 9px;
  padding: 1px 4px;
  background: var(--red-dim);
  color: var(--red);
  border-radius: 2px;
  margin-left: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-chip {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-chip.blocked {
  background: var(--red-dim);
  color: var(--red);
}

.status-chip.pending {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.status-chip.decision {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.status-chip.artifact {
  background: var(--blue-dim);
  color: var(--blue);
}

.status-chip.working {
  background: var(--green-dim);
  color: var(--green);
}

.status-chip.idle,
.status-chip.neutral {
  background: var(--bg-elevated);
  color: var(--fg-muted);
}

/* ============================================
   FEATURE: Debug Tab
   ============================================ */
.tool-history-item {
  display: flex;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.tool-history-item:last-child {
  border-bottom: none;
}

.tool-history-name {
  color: var(--cyan);
  font-weight: 500;
  min-width: 60px;
}

.tool-history-args {
  color: var(--fg-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-history-time {
  color: var(--fg-subtle);
  font-size: 10px;
}

.log-entry {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.log-entry:last-child {
  margin-bottom: 0;
}

.log-entry.info {
  background: var(--bg-elevated);
  color: var(--fg-muted);
}

.log-entry.warning {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.log-entry.error {
  background: var(--red-dim);
  color: var(--red);
}

.log-entry-time {
  color: var(--fg-subtle);
  margin-right: 8px;
}

.error-state {
  padding: 12px;
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
}

.error-state-title {
  font-weight: 600;
  color: var(--red);
  margin-bottom: 6px;
  font-size: 12px;
}

.error-state-message {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.debug-tab-content {
  padding: 24px;
}

.debug-tab-section {
  margin-bottom: 28px;
}

.debug-tab-section:last-child {
  margin-bottom: 0;
}

.debug-tab-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-default);
  margin-bottom: 14px;
}

.debug-empty-state {
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
}

.context-summary {
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 12px;
}

.context-summary-used {
  color: var(--fg-default);
  font-weight: 600;
}

.context-summary-separator {
  color: var(--fg-subtle);
  margin: 0 2px;
}

.context-summary-total {
  color: var(--fg-muted);
}

.context-summary-percent {
  color: var(--fg-subtle);
  margin-left: 8px;
}

.context-visual-bar {
  display: flex;
  height: 12px;
  background: var(--bg-elevated);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}

.context-visual-segment {
  height: 100%;
  min-width: 2px;
}

.context-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.context-breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.context-breakdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.context-breakdown-row .context-breakdown-label {
  flex: 1;
  color: var(--fg-muted);
}

.context-breakdown-row .context-breakdown-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-default);
  min-width: 50px;
  text-align: right;
}

.context-breakdown-row .context-breakdown-percent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  min-width: 50px;
}

.tool-calls-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tool-calls-list .tool-history-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.tool-calls-list .tool-history-item:last-child {
  border-bottom: none;
}

.logs-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.logs-list .log-entry {
  margin-bottom: 6px;
}

.logs-list .log-entry:last-child {
  margin-bottom: 0;
}

/* ============================================
   RESPONSIVE: <= 900px
   ============================================ */
@media (max-width: 900px) {
  /* Mobile sidebar drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-sidebar);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body.right-sidebar-open .right-sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  /* Larger touch targets for sidebar items */
  .sidebar-item {
    padding: 12px 14px;
    min-height: 44px;
  }

  .sidebar-content {
    padding: 8px;
  }

  /* Enlarge hamburger button touch target */
  .icon-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .page-header {
    padding: 14px 16px;
  }

  .page-header-top {
    justify-content: flex-start;
  }

  .page-title {
    font-size: 18px;
  }

  .page-header-top .sidebar-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .page-header-top .right-sidebar-toggle {
    display: flex;
    flex-shrink: 0;
    margin-left: auto;
  }

  .page-header-top .page-actions {
    margin-left: auto;
  }

  .overview-layout,
  .project-layout {
    padding: 14px 16px;
    gap: 16px;
  }

  .panel-layout {
    flex-direction: column;
  }

  .list-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    max-height: 40vh;
    min-height: 200px;
  }

  .detail-panel {
    flex: 1;
    max-height: none;
  }

  /* Tighter detail padding on mobile */
  .detail-header {
    padding: 16px;
  }

  .detail-content {
    padding: 16px;
  }

  .detail-title {
    font-size: 17px;
    line-height: 1.35;
  }

  /* Allow project page to scroll on mobile */
  .page-content {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
  }

  .project-layout,
  .agent-layout {
    flex-direction: column;
    gap: 16px;
    overflow: visible;
    height: auto;
    flex: none;
  }

  .agent-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    transform: translateX(100%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-modal);
    border-left: 1px solid var(--border-subtle);
  }

  body.right-sidebar-open .agent-sidebar {
    transform: translateX(0);
  }

  /* Project page mobile: simpler vertical flow */
  .project-main {
    overflow: visible;
    gap: 12px;
    flex: none;
    height: auto;
    min-height: 0;
  }

  .project-status-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .agent-main {
    overflow: visible;
    flex: none;
    height: auto;
    min-height: 0;
    width: 100%;
  }

  .tab-content {
    overflow: visible;
    width: 100%;
  }

  .agent-layout {
    width: 100%;
  }

  .project-main > .card {
    flex: none;
  }

  /* Hide work columns on mobile - replaced by summary chips */
  .work-columns {
    display: none;
  }

  .agent-card {
    padding: 14px;
  }

  .overview-side {
    order: -1;
  }

  .overview-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-split {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .overview-split-col + .overview-split-col {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
  }

  /* Action bar mobile optimization */
  .action-bar {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .action-buttons {
    flex: 1;
    flex-wrap: wrap;
    gap: 8px;
  }

  .action-hints {
    display: none;
  }

  /* Larger button touch targets */
  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Show task summary instead of work columns */

  /* Agent context bar: 2x2 grid */
  .agent-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 16px 6px;
  }

  /* Modal dialogs */
  .command-palette {
    width: calc(100vw - 32px);
    max-width: 560px;
  }

  .request-modal {
    width: calc(100vw - 32px);
    max-width: 520px;
    margin: 16px;
  }

  /* Tabs scrollable */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: 14px 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* List items larger touch targets */
  .item {
    padding: 14px 16px;
  }

  .list-header {
    padding: 14px 16px;
  }

  .list-group-header {
    padding: 8px 16px;
  }

  .conversation,
  .timeline {
    padding: 16px;
  }

  .message-content {
    margin-left: 0;
    padding-left: 38px;
  }

  .debug-tab-content {
    padding: 16px;
  }

  .file-item {
    padding: 10px 16px;
  }

  /* Archive grid */
  .archive-grid {
    padding: 16px;
    gap: 12px;
  }

  /* Timeline padding */
  .timeline {
    padding: 16px;
  }

  /* Conversation padding */
  .conversation {
    padding: 16px;
  }

  .message.decision {
    margin-left: -16px;
    margin-right: -16px;
    padding: 14px 16px;
  }
}

/* ============================================
   RESPONSIVE: <= 900px (supplemental)
   ============================================ */
@media (max-width: 900px) {
  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  .task-summary-mobile {
    display: block;
  }
}
