:root {
  --bg: #0a0a0b;
  --surface: #141415;
  --surface-2: #1c1c1e;
  --border: rgba(255,255,255,0.06);
  --border-heavy: rgba(255,255,255,0.12);
  --text: #ededef;
  --text-dim: #6e6e80;
  --accent: #8b8bf5;
  --accent-glow: rgba(139,139,245,0.10);
  --green: #45d483;
  --green-glow: rgba(69,212,131,0.08);
  --red: #f55353;
  --red-glow: rgba(245,83,83,0.08);
  --orange: #f0a050;
  --yellow: #ebd464;
  --blue: #6cb4ee;
  --purple: #bf8bff;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-accent: 0 0 0 2px var(--accent), 0 0 12px var(--accent-glow);
  --radius: 10px;
  --radius-sm: 6px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; overflow-wrap: break-word; word-wrap: break-word; }

/* Custom scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--blue); text-decoration: none; }

/* Stagger fade-in for cards */
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card, .action-card { animation: card-in 0.4s var(--ease) both; }
.container > :nth-child(1) { animation-delay: 0s; }
.container > :nth-child(2) { animation-delay: 0.06s; }
.container > :nth-child(3) { animation-delay: 0.12s; }
.container > :nth-child(4) { animation-delay: 0.18s; }
.container > :nth-child(5) { animation-delay: 0.24s; }
.container > :nth-child(6) { animation-delay: 0.30s; }
.container > :nth-child(7) { animation-delay: 0.36s; }
.container > :nth-child(8) { animation-delay: 0.42s; }

/* ===== LAYOUT ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(10,10,11,0.80);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar .logo {
  font-family: var(--sans);
  font-size: 16px; font-weight: 800; letter-spacing: 2px;
  color: var(--text);
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar .meta {
  display: flex; gap: 18px; align-items: center;
  font-size: 12px; color: var(--text-dim); font-family: var(--mono);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.container {
  max-width: 1320px; margin: 0 auto; padding: 24px;
  display: grid; gap: 18px;
  grid-template-columns: 1fr 1fr;
}
/* Responsive breakpoints are at end of file */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
  position: relative;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card::before {
  content: '';
  position: absolute; inset: -1px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(139,139,245,0.15), rgba(191,139,255,0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  z-index: -1;
  pointer-events: none;
}
.card:hover {
  border-color: rgba(139,139,245,0.2);
  box-shadow: var(--shadow-lg);
}
.card:hover::before { opacity: 1; }
.card.full { grid-column: 1 / -1; }
.card h2 {
  font-family: var(--sans);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-dim); margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card h2::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== REVENUE ===== */
.progress-bar {
  width: 100%; height: 20px; background: var(--border); border-radius: 99px;
  overflow: hidden; margin: 8px 0;
  border: none;
}
.progress-bar .fill {
  height: 100%; background: var(--accent); border-radius: 99px;
  transition: width 0.5s;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--bg);
  font-family: var(--mono);
  min-width: 36px;
}
.revenue-stats { display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.revenue-stats .stat { text-align: center; }
.revenue-stats .stat .val { font-size: 22px; font-weight: 900; font-family: var(--mono); }
.revenue-stats .stat .lbl { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* ===== TABLES ===== */
/* Scrollable container with edge fade hints */
.table-wrap {
  overflow-x: auto; margin: 0 -2px; padding: 0 2px;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
th {
  text-align: left; color: var(--text-dim); font-weight: 700;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  white-space: normal; word-break: break-word;
}
td:first-child { white-space: nowrap; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr { transition: background 0.2s var(--ease); }
tr:hover td { background: var(--surface-2); }
/* Data-change flash */
@keyframes data-pulse {
  0% { background: rgba(139,139,245,0.08); box-shadow: inset 0 0 0 1px rgba(139,139,245,0.15); }
  100% { background: transparent; box-shadow: none; }
}
.data-changed { animation: data-pulse 1.5s var(--ease); border-radius: var(--radius-sm); }

/* ===== DECISIONS ===== */
.decision-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.decision-card.decided { opacity: 0.35; }
.decision-card.pending { border-color: var(--blue); }
.decision-card.in_attesa { border-color: var(--orange); opacity: 0.7; }

/* Header strip -- always visible */
.dec-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.dec-header:hover { background: var(--surface-2); }
.dec-id-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 900;
  letter-spacing: 1px; padding: 2px 7px;
  background: var(--border-heavy); color: var(--text-dim);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.dec-status-chip {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 2px 8px; flex-shrink: 0;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}
.dec-status-chip.pending  { background: var(--blue);   color: #000; }
.dec-status-chip.decided  { background: var(--green);  color: #000; }
.dec-status-chip.in_attesa{ background: var(--orange); color: #000; }
.dec-title-text {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  flex: 1; min-width: 0;
  white-space: normal; word-break: break-word;
}
.dec-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.dec-chevron { font-size: 11px; color: var(--text-dim); flex-shrink: 0; transition: transform 0.2s; }
.dec-header.open .dec-chevron { transform: rotate(180deg); }

/* Body -- collapsible */
.dec-body { padding: 14px 16px; display: none; }
.dec-body.open { display: block; }
.dec-context {
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 12px; line-height: 1.5;
}

/* Options */
.dec-options { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.option-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer; transition: all 0.15s;
}
.option-row:hover { background: var(--accent); }
.option-row:hover .option-name { color: var(--bg); }
.option-row:hover .option-detail-text { color: var(--bg); opacity: 0.8; }
.option-row.chosen { background: var(--green); border-color: var(--green); cursor: default; }
.option-row.chosen .option-name,
.option-row.chosen .option-detail-text { color: var(--bg); }
.option-name {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--accent); white-space: nowrap;
}
.option-detail-text {
  font-size: 11px; color: var(--text-dim);
  flex: 1; line-height: 1.4;
}

.dec-recommendation {
  font-size: 12px; color: var(--green); margin-top: 10px;
  padding: 6px 10px; border-left: 3px solid var(--green);
  font-family: var(--mono);
}
.dec-decided-label {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--green); padding: 6px 0;
}
.attesa-row {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--orange);
  font-weight: 700;
}
.attesa-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--orange); border-top-color: transparent;
  border-radius: 50%; animation: spin 1s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== CYCLE ACTIVITY FEED ===== */
.cycle-entry {
  padding: 14px 12px; border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease);
  border-left: 2px solid transparent;
  margin-bottom: 2px;
}
.cycle-entry:hover { background: rgba(255,255,255,0.02); border-left-color: var(--accent); }
.cycle-entry:last-child { border-bottom: none; }
.cycles-pager {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 14px 0 4px; border-top: 1px solid var(--border); margin-top: 4px;
}
.pager-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12px; font-family: var(--sans); transition: all 0.15s;
}
.pager-btn:hover:not(:disabled) { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.pager-btn:disabled { opacity: 0.3; cursor: default; }
.pager-info { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.cycle-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.cycle-num {
  font-weight: 700; font-size: 14px; color: var(--text);
}
.cycle-engine {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: var(--radius-sm); text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cycle-engine.claude { background: rgba(180,208,255,0.15); color: var(--accent); }
.cycle-engine.kimi { background: rgba(111,207,124,0.15); color: var(--green); }
.cycle-duration {
  font-size: 11px; color: var(--text-dim); font-family: var(--mono);
}
.cycle-warning {
  font-size: 10px; color: var(--red); font-weight: 700;
  padding: 2px 6px; background: rgba(255,107,107,0.1);
  border-radius: var(--radius-sm);
}
.cycle-timestamp {
  font-size: 11px; color: var(--text-dim); margin-left: auto;
}
.cycle-tools {
  font-size: 12px; color: var(--text-dim); margin-bottom: 4px;
  font-family: var(--mono);
}
.cycle-files {
  font-size: 11px; color: var(--accent); margin-bottom: 4px;
  font-family: var(--mono);
}
.cycle-summary {
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
  margin-bottom: 4px;
}
.cycle-meta {
  font-size: 11px; color: var(--text-dim);
}

/* ===== QUEUE ===== */
.queue-section { margin-bottom: 16px; }
.queue-section h3 {
  font-family: var(--sans);
  font-size: 12px; font-weight: 600; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim);
}
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 900; padding: 0 6px;
  font-family: var(--mono);
}
.badge.urgent { background: var(--red); color: #000; }
.badge.high { background: var(--orange); color: #000; }
.badge.normal { background: var(--border-heavy); color: var(--text); }
.badge.waiting { background: var(--blue); color: #000; }
.task-item {
  font-size: 13px; padding: 7px 10px;
  display: flex; gap: 8px; align-items: baseline;
  font-family: var(--sans);
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease);
}
.task-item:hover { background: rgba(255,255,255,0.02); }
.task-id { color: var(--accent); font-weight: 700; white-space: nowrap; font-size: 12px; font-family: var(--mono); }
.task-state { font-size: 11px; }
.task-state.pending { color: var(--text-dim); }
.task-state.failed { color: var(--red); font-weight: 900; }
.task-state.done { color: var(--green); }
.task-state.in_progress { color: var(--orange); }
.task-cat {
  font-size: 10px; color: var(--purple); background: rgba(196,160,255,0.08);
  padding: 1px 6px; border-radius: var(--radius-sm); border: 1px solid rgba(196,160,255,0.2);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* Task animations */
.task-spinner {
  display: inline-block; width: 10px; height: 10px;
  border: 2px solid var(--orange); border-top-color: transparent;
  border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle;
}
.task-item.in_progress { background: rgba(240,160,80,0.06); border-left: 2px solid var(--orange); }
.task-item.failed { background: rgba(245,83,83,0.06); border-left: 2px solid var(--red); }
.task-failed-icon { animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Daemon indicator */
.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.dot.red { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }

/* Error card */
.error-alert { animation: error-fade-in 0.3s ease-out; }
@keyframes error-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ===== LOGS ===== */
.log-viewer {
  background: #08080a; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  font-family: var(--mono); font-size: 11px;
  line-height: 1.8;
  max-height: 360px; overflow-y: auto;
  white-space: pre-wrap; color: var(--text-dim);
}
.log-viewer .log-line { display: block; padding: 1px 0; border-radius: 2px; }
.log-viewer .log-line:hover { background: rgba(255,255,255,0.03); }
.log-viewer .log-ts { color: var(--text-dim); opacity: 0.6; }
.log-viewer .log-ok { color: var(--green); }
.log-viewer .log-err { color: var(--red); }
.log-viewer .log-warn { color: var(--orange); }
.log-viewer .log-cycle { color: var(--accent); font-weight: 600; }
.log-viewer .log-pause { color: var(--text-dim); opacity: 0.35; }

/* ===== ERRORS ===== */
.error-alert {
  background: var(--red-glow); border: 1px solid var(--red);
  border-radius: var(--radius-sm); padding: 12px 16px;
  margin-bottom: 8px; font-size: 12px; font-family: var(--mono);
  box-shadow: 0 0 12px var(--red-glow);
}
.error-source { font-weight: 700; color: var(--red); }

/* ===== EMPTY STATE ===== */
.empty {
  color: var(--text-dim); font-size: 12px; font-style: normal;
  font-family: var(--sans); letter-spacing: 0.3px;
  padding: 20px 0;
  text-align: center;
  opacity: 0.6;
}

/* Refresh indicator */
.refresh-info { font-size: 10px; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0.5px; }

/* ===== AZIONE RICHIESTA ===== */
@keyframes action-glow {
  0%, 100% { box-shadow: var(--shadow), 0 0 15px rgba(240,208,96,0.05); }
  50% { box-shadow: var(--shadow), 0 0 20px rgba(240,208,96,0.1); }
}
.action-card {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 20px;
  animation: action-glow 3s ease-in-out infinite, card-in 0.35s var(--ease) both;
}
.action-card h2 {
  font-family: var(--sans);
  font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0;
  color: var(--yellow); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.action-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 900; padding: 0 6px;
  background: var(--yellow); color: #000;
  font-family: var(--mono);
}
.human-task {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 8px;
  transition: border-color 0.15s;
  background: var(--surface-2);
}
.human-task:hover { border-color: var(--border-heavy); }
.human-task-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.human-task-header .task-id { color: var(--accent); font-weight: 700; font-size: 12px; }
.human-task-header .task-desc { flex: 1; font-size: 12px; font-family: var(--sans); }
.human-task-header .badge-urgent {
  background: transparent; color: var(--red);
  font-size: 9px; font-weight: 900; text-transform: uppercase;
  padding: 1px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--red); letter-spacing: 1px;
}
.human-task-instruction { font-size: 11px; color: var(--text-dim); margin: 4px 0 8px; }
.action-btn {
  display: inline-block; padding: 6px 14px; margin: 0 6px 0 0;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); cursor: pointer;
  font-size: 11px; font-family: var(--sans); font-weight: 600;
  transition: all 0.2s var(--ease); text-transform: uppercase; letter-spacing: 0.5px;
}
.action-btn:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: translateY(-1px);
}
.action-btn:active { transform: translateY(0); }
.action-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-color: transparent; color: var(--bg); font-weight: 700;
  box-shadow: 0 2px 6px rgba(124,172,248,0.2);
}
.action-btn.primary:hover {
  box-shadow: 0 4px 12px rgba(124,172,248,0.3);
  transform: translateY(-1px);
}
.action-btn.copy-success {
  background: var(--green) !important; border-color: var(--green) !important; color: var(--bg) !important;
  transition: none;
}
.proposal-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
}
.proposal-panel.open { max-height: 600px; }
.proposal-content {
  font-family: var(--mono); font-size: 12px; white-space: pre-wrap;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; margin-top: 8px;
  max-height: 300px; overflow-y: auto;
  color: var(--text-dim); line-height: 1.7;
}
.proposal-actions { margin-top: 8px; padding-bottom: 4px; }
.archive-btn {
  border-color: var(--text-dim) !important; color: var(--text-dim) !important;
  font-size: 10px !important;
}
.archive-btn:hover {
  border-color: var(--green) !important; color: var(--green) !important;
}

/* Task done feedback */
.done-row {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-top: 8px;
}
.done-notes {
  flex: 1; min-width: 180px; padding: 6px 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 11px;
  font-family: var(--mono); outline: none;
}
.done-notes:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.done-notes::placeholder { color: var(--text-dim); }
.done-btn {
  padding: 6px 14px; background: var(--green); border: 1px solid var(--green);
  color: var(--bg); border-radius: var(--radius-sm); cursor: pointer;
  font-size: 11px; font-family: var(--sans); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.2s var(--ease);
  white-space: nowrap;
  box-shadow: 0 2px 6px var(--green-glow);
}
.done-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(111,207,124,0.25);
}
.done-btn:active { transform: translateY(0); }
.done-btn:disabled { opacity: 0.4; cursor: default; }
.task-link {
  display: inline-block; padding: 5px 12px;
  background: var(--surface); border: 1px solid var(--accent);
  color: var(--accent); border-radius: var(--radius-sm); cursor: pointer;
  font-size: 11px; font-family: var(--sans); font-weight: 600;
  transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.5px;
  text-decoration: none;
}
.task-link:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* Queue: toggle completed + human indicator */
.toggle-completed {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 3px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 10px; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 12px; transition: all 0.15s;
}
.toggle-completed:hover { border-color: var(--accent); color: var(--text); }
.task-item.done-hidden { display: none; }
.needs-human { color: var(--yellow); margin-right: 2px; font-size: 11px; }

/* Topbar action badge */
.topbar-action-badge {
  background: transparent; color: var(--yellow);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--yellow);
  font-family: var(--mono); letter-spacing: 0.5px;
}

/* ===== LOGIN ===== */
@keyframes login-appear {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes login-bg-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
#login-overlay {
  position: fixed; inset: 0;
  background: #050506;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border-heavy);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  animation: login-appear 0.5s var(--ease-bounce);
}
.login-box .logo {
  font-family: var(--sans);
  font-size: 32px; font-weight: 800; letter-spacing: 4px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-box .subtitle {
  color: var(--text-dim); font-size: 11px; margin-bottom: 36px;
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 3px;
}
.login-box input {
  width: 100%; padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border-heavy);
  border-radius: 8px;
  color: var(--text); font-size: 14px;
  font-family: var(--sans);
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.login-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-box button {
  width: 100%; padding: 14px;
  background: var(--accent);
  border: none; border-radius: 8px;
  color: #fff; font-size: 13px; font-weight: 600;
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 1.5px;
  cursor: pointer; transition: all 0.2s var(--ease);
  box-shadow: 0 2px 12px rgba(139,139,245,0.25);
}
.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124,172,248,0.35);
}
.login-box button:active { transform: translateY(0); }
.login-box .error {
  color: var(--red); font-size: 12px; margin-top: 12px; font-family: var(--sans);
}
#logout-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); padding: 4px 12px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 10px; font-family: var(--sans);
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.2s var(--ease);
}
#logout-btn:hover { color: var(--red); border-color: var(--red); }
#app-content { display: none; }

/* ===== TAB BAR ===== */
.tab-bar {
  display: flex; gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.tab-bar .tab {
  padding: 10px 20px;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  transition: all 0.2s var(--ease);
  margin-bottom: -2px;
  position: relative;
}
.tab-bar .tab:hover { color: var(--text); }
.tab-bar .tab.active {
  color: var(--text); border-bottom-color: var(--accent);
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 24px;
  max-width: 1600px; margin: 0 auto;
}

/* ===== PROJECT CARD ===== */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer; user-select: none;
  transition: all 0.25s var(--ease);
  overflow: hidden;
  min-width: 0;
  border-left: 3px solid var(--green);
}
.project-card:hover {
  border-color: var(--border-heavy);
  border-left-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.project-card.expanded {
  border-color: var(--accent);
  cursor: default;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-glow);
}
.project-card.dragging { opacity: 0.5; border-color: var(--accent); }
.pc-header {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px 6px;
  cursor: pointer;
}
.pc-chevron {
  font-size: 10px; color: var(--text-dim); flex-shrink: 0;
  margin-top: 4px; transition: transform 0.2s;
}
.project-card.expanded .pc-chevron { transform: rotate(180deg); }
.pc-dot {
  width: 8px; height: 8px; flex-shrink: 0; margin-top: 5px;
  border-radius: 50%;
}
.pc-dot.live { background: var(--green); }
.pc-dot.deploy_ready { background: var(--yellow); }
.pc-dot.built { background: var(--blue); }
.pc-dot.idea { background: var(--text-dim); }
.pc-dot.monitoring { background: var(--purple); }
.pc-name {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  flex: 1; min-width: 0;
  line-height: 1.4;
  word-break: break-word;
}
.pc-score {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--accent); flex-shrink: 0; margin-top: 2px;
}
.pc-meta {
  padding: 0 12px 8px;
  font-family: var(--sans); font-size: 11px;
}
.pc-meta-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 4px; color: var(--text-dim);
  flex-wrap: wrap;
  min-width: 0;
}
.pc-stage-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 1px 6px;
  font-family: var(--mono);
  border-radius: var(--radius-sm);
}
.pc-stage-badge.live { background: var(--green); color: #000; }
.pc-stage-badge.deploy_ready { background: var(--yellow); color: #000; }
.pc-stage-badge.built { background: var(--blue); color: #000; }
.pc-stage-badge.idea { background: var(--border-heavy); color: var(--text-dim); }
.pc-stage-badge.monitoring { background: var(--purple); color: #000; }
.pc-progress-bar {
  flex: 1; height: 6px; background: var(--border);
  overflow: hidden;
  border-radius: 99px;
}
.pc-progress-bar .fill {
  height: 100%; background: var(--green);
  transition: width 0.3s;
  border-radius: 99px;
}
.pc-progress-label {
  font-size: 10px; color: var(--text-dim); flex-shrink: 0;
}
.pc-url-row {
  font-size: 10px; color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.pc-url-row a { font-size: 10px; }
/* Prominent URL in card */
.pc-url-row-prominent {
  margin-bottom: 10px;
}
.pc-url-row-prominent a {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--accent);
  word-break: break-all;
}
.pc-url-row-prominent a:hover { color: var(--text); }
/* Info line: status + stack */
.pc-info-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.pc-status-chip {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 3px 10px;
  border-radius: var(--radius-sm); text-transform: uppercase;
}
.pc-status-chip.ok { background: var(--green); color: #000; }
.pc-status-chip.blocked { background: rgba(240,160,80,0.15); color: var(--orange); border: 1px solid rgba(240,160,80,0.3); }
.pc-stack-text {
  font-size: 12px; color: var(--text-dim);
  line-height: 1.4;
}
.pc-health-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; }
.pc-health-dot.ok { background: var(--green); }
.pc-health-dot.down { background: var(--red); }
.pc-health-dot.unknown { background: var(--text-dim); }

/* ===== PROJECT CARD META ===== */
.pc-description {
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
  margin-bottom: 8px;
}
.pc-description-full {
  font-size: 13px; color: var(--text-dim); line-height: 1.6;
  margin-bottom: 12px;
}
.pc-stack-badge {
  font-size: 10px; padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(126,184,255,0.1); color: var(--blue);
  white-space: normal; word-break: break-word;
  max-width: 60%; flex-shrink: 1;
}
.pc-stage-detail {
  font-size: 11px; color: var(--text-dim);
  white-space: normal; word-break: break-word;
  flex: 1; min-width: 0;
}
.pc-container-info {
  font-size: 11px; color: var(--text-dim); font-family: var(--mono);
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.pc-port-badge {
  font-size: 10px; font-family: var(--mono); color: var(--accent);
  font-weight: 700;
}

/* ===== EXPANDED CARD ===== */
.pc-detail { display: none; padding: 0 12px 12px; }
.pc-detail.open { display: block; }
.pc-traits { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.pc-trait {
  font-size: 10px; color: var(--purple); background: rgba(196,160,255,0.08);
  padding: 1px 6px; border: 1px solid rgba(196,160,255,0.2);
  border-radius: var(--radius-sm);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-family: var(--mono);
}
.pc-pipeline { margin-bottom: 10px; }
.pc-pipeline-label {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 6px; font-family: var(--mono);
}
.pc-steps { display: flex; flex-direction: column; gap: 4px; }
.pc-step {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px;
  padding: 4px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pc-step-icon { font-size: 12px; flex-shrink: 0; }
.pc-step-icon.done { color: var(--green); }
.pc-step-icon.pending { color: var(--text-dim); }
.pc-step-name { font-weight: 700; flex-shrink: 0; }
.pc-step-run {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--accent); border: none;
  border-radius: var(--radius-sm);
  color: var(--bg); cursor: pointer;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.pc-step-run:hover { opacity: 0.8; }
.pc-step-rerun {
  margin-left: auto;
  padding: 2px 8px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.pc-step-rerun:hover { border-color: var(--accent); color: var(--accent); }
.pc-step.step-success { background: rgba(0,255,136,0.06); border-color: var(--green); }
.pc-step.step-fail { background: rgba(255,85,85,0.06); border-color: var(--red); }
@keyframes step-flash { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
.pc-step.step-running { animation: step-flash 1s infinite; }
.pc-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 16px; margin-bottom: 10px;
  font-family: var(--sans); font-size: 11px;
}
.pc-info-item { display: flex; gap: 6px; }
.pc-info-label { color: var(--text-dim); white-space: nowrap; }
.pc-info-value { color: var(--text); font-weight: 600; word-break: break-all; }
.pc-score-gauge { margin-bottom: 10px; }
.pc-score-gauge-label {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 4px; font-family: var(--mono);
}
.pc-score-bar {
  height: 8px; background: var(--border); position: relative; overflow: hidden;
  border-radius: 99px;
}
.pc-score-fill { height: 100%; transition: width 0.3s; border-radius: 99px; }
.pc-score-text {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  margin-top: 2px; display: flex; justify-content: space-between;
}
.pc-step-cmd {
  font-size: 9px; color: var(--text-dim); margin-left: 20px;
  word-break: break-all; opacity: 0.7; margin-top: 1px;
}
.pc-queue-tasks { margin-bottom: 10px; }
.pc-queue-label {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 6px; font-family: var(--mono);
}
.pc-queue-task {
  display: flex; align-items: flex-start; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  padding: 3px 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.pc-queue-task-id { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.pc-queue-task-desc { color: var(--text-dim); }
.pc-queue-task-status { flex-shrink: 0; margin-left: auto; }
.pc-queue-task-status.pending { color: var(--yellow); }
.pc-queue-task-status.done { color: var(--green); }
.pc-queue-task-status.in_progress { color: var(--blue); }
.pc-section-sep {
  border: none; border-top: 1px solid var(--border);
  margin: 8px 0;
}
.pc-health-info {
  font-family: var(--sans); font-size: 11px; color: var(--text-dim);
  margin-bottom: 10px;
}
.pc-health-row { display: flex; gap: 12px; margin-bottom: 2px; }
.pc-health-label { color: var(--text-dim); }
.pc-health-value { font-weight: 700; }
.pc-actions {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.pc-actions button, .pc-actions a {
  padding: 4px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.15s; text-decoration: none;
}
.pc-actions button:hover, .pc-actions a:hover {
  border-color: var(--accent); color: var(--accent);
}

/* ===== INLINE TERMINAL ===== */
.pc-terminal {
  display: none; margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 11px;
  overflow: hidden;
}
.pc-terminal.open { display: block; animation: term-slide 0.2s ease-out; }
@keyframes term-slide { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 400px; } }
.pc-terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: #1a1a1a; border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
}
.pc-terminal-bar .term-dots {
  display: flex; gap: 4px;
}
.pc-terminal-bar .term-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.pc-terminal-bar .term-dot:nth-child(1) { background: #ff5f57; }
.pc-terminal-bar .term-dot:nth-child(2) { background: #febc2e; }
.pc-terminal-bar .term-dot:nth-child(3) { background: #28c840; }
.pc-terminal-bar .term-title { flex: 1; }
.pc-terminal-bar .term-close {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 12px; font-family: var(--mono); padding: 0 2px;
}
.pc-terminal-bar .term-close:hover { color: var(--text); }
.pc-terminal-output {
  padding: 10px 12px; white-space: pre-wrap;
  color: #c8e6c8; line-height: 1.6;
  background: #0a0a0a;
  max-height: 220px; overflow-y: auto;
  font-size: 11px;
}
.pc-terminal-output .term-cmd {
  color: var(--accent); font-weight: 700;
}
.pc-terminal-output .term-stderr {
  color: var(--orange);
}
.pc-terminal-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #111; border-top: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
}
.pc-terminal-status .term-spinner {
  display: inline-block; width: 10px; height: 10px;
  border: 2px solid var(--accent); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.pc-terminal-status.success { color: var(--green); }
.pc-terminal-status.success::before { content: '\2713  '; }
.pc-terminal-status.error { color: var(--red); }
.pc-terminal-status.error::before { content: '\2717  '; }

/* ===== LOG TAB BUTTONS ===== */
.log-tab-btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent; color: var(--text-dim);
  cursor: pointer; font-size: 10px;
  font-family: var(--sans); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.15s var(--ease);
}
.log-tab-btn:hover { color: var(--text); border-color: var(--border-heavy); }
.log-tab-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* ===== RESPONSIVE: WIDE DESKTOP (min-width: 1600px) ===== */
@media (min-width: 1600px) {
  .container { max-width: 1520px; }
  .projects-grid { max-width: 1800px; }
}

/* ===== RESPONSIVE: SMALL LAPTOP (max-width: 1200px) ===== */
@media (max-width: 1200px) {
  .container { max-width: 100%; padding: 16px; }
  .projects-grid { padding: 16px; }
}

/* ===== RESPONSIVE: TABLETS (max-width: 1024px) ===== */
@media (max-width: 1024px) {
  .container { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .pc-meta { font-size: 10px; }
}

/* ===== RESPONSIVE: SMALL TABLETS (max-width: 768px) ===== */
@media (max-width: 768px) {
  .topbar { padding: 10px 16px; }
  .refresh-info { display: none; }
  .tab-bar { padding: 0 16px; }
  .tab-bar .tab { padding: 10px 14px; font-size: 11px; letter-spacing: 0.5px; }
  .container { padding: 14px; }
  .projects-grid { padding: 12px; grid-template-columns: 1fr; }
}

/* ===== RESPONSIVE: PHONES (max-width: 480px) ===== */
@media (max-width: 480px) {
  /* Base font */
  body {
    font-size: 14px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  /* --- 1. Topbar: compact single row ~44px --- */
  .topbar {
    flex-wrap: nowrap; padding: 8px 12px; gap: 8px;
    min-height: 44px;
  }
  .topbar .logo { font-size: 15px; letter-spacing: 3px; }
  .topbar .meta {
    gap: 8px; font-size: 11px;
    justify-content: flex-end;
    flex-shrink: 1; min-width: 0;
  }
  /* Hide last-run timestamp and daemon text on mobile */
  #last-run { display: none; }
  #daemon-status { font-size: 0; } /* hide text, keep dot visible */
  #daemon-status .dot { font-size: 0; width: 10px; height: 10px; }

  /* --- 5. Bottom tab bar on mobile --- */
  .tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 20;
    padding: 0;
    border-bottom: none;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tab-bar .tab {
    flex: 1; text-align: center;
    padding: 14px 8px; font-size: 11px;
    letter-spacing: 1px;
    min-height: 48px;
    display: flex; align-items: center; justify-content: center;
  }

  /* Grid */
  .container { padding: 12px; gap: 12px; }

  /* Cards */
  .card { padding: 14px; overflow-x: auto; }
  .card h2 { margin-bottom: 10px; }

  /* Revenue stats -- 2x2 grid */
  .revenue-stats {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .revenue-stats .stat .val { font-size: 18px; }

  /* Tables -- smaller on phone, reduce min-width from tablet */
  table { font-size: 11px; min-width: 320px; }
  th, td { padding: 6px 8px; }
  th { font-size: 9px; letter-spacing: 0.5px; }

  /* --- 4. Decision cards: better mobile layout --- */
  .dec-header {
    min-height: 44px;
    flex-wrap: wrap; gap: 6px;
    padding: 10px 12px;
  }
  .dec-title-text {
    white-space: normal;
    flex-basis: 100%; order: 3;
    font-size: 12px;
  }
  .dec-id-badge { order: 1; }
  .dec-status-chip { order: 1; }
  .dec-date { order: 2; font-size: 10px; }
  .dec-chevron { order: 2; margin-left: auto; }
  .option-row { min-height: 44px; align-items: center; }

  /* Kanban -- single column on phone */
  .projects-grid { padding: 12px; gap: 12px; }
  .pc-url-row { white-space: normal; word-break: break-all; }

  /* Task items -- prevent horizontal overflow */
  .task-item { word-break: break-word; }
  .human-task-header .task-desc { word-break: break-word; }

  /* Cards -- prevent content blowout */
  .card { max-width: 100vw; }

  /* Project cards -- info grid single column */
  .pc-info-grid { grid-template-columns: 1fr; }
  .pc-actions button, .pc-actions a { min-height: 44px; padding: 8px 12px; }
  .pc-step-run, .pc-step-rerun { min-height: 44px; padding: 6px 10px; }

  /* Terminal */
  .pc-terminal-output { max-height: 180px; overflow-x: auto; }
  .pc-terminal-bar .term-close { font-size: 16px; padding: 4px 8px; }

  /* --- 2. Action cards: collapsed by default (JS adds .mobile-collapsed) --- */
  .human-task.mobile-collapsed .human-task-instruction,
  .human-task.mobile-collapsed .done-row,
  .human-task.mobile-collapsed .proposal-panel,
  .human-task.mobile-collapsed > div:not(.human-task-header) {
    display: none;
  }
  .human-task.mobile-collapsed .human-task-header {
    cursor: pointer;
  }
  .human-task.mobile-collapsed .task-desc {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: calc(100vw - 120px);
  }

  /* --- 6. General mobile polish --- */
  /* Stack action header vertically: ID on top, description below */
  .human-task-header {
    flex-direction: column; align-items: flex-start; gap: 4px;
  }
  .human-task.mobile-collapsed .human-task-header {
    flex-direction: row; align-items: center; gap: 8px;
  }
  /* Stack done-row */
  .done-row { flex-direction: column; }
  .done-notes { min-width: 0; width: 100%; }
  .done-btn { width: 100%; min-height: 44px; }
  .action-btn { min-height: 44px; padding: 8px 14px; }
  .task-link { min-height: 44px; display: inline-flex; align-items: center; }
  .toggle-completed { min-height: 44px; padding: 8px 12px; }
  /* Ensure all clickable elements are tappable */
  .option-row, .dec-header, .project-card .pc-header,
  .log-tab-btn, #logout-btn {
    min-height: 44px;
  }
  #logout-btn { padding: 6px 12px; }

  /* Login */
  .login-box { padding: 28px 20px; margin: 0 12px; }

  /* Log viewer */
  .log-viewer { max-height: 200px; font-size: 10px; }
  .log-tab-btn { flex: 1; text-align: center; }
}

/* ---- Notification bell & panel ---- */
.notif-bell {
  position: relative;
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.notif-bell:hover, .notif-bell.has-unread { color: var(--accent); }
@keyframes bell-shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(8deg); } 75% { transform: rotate(-8deg); } }
.notif-bell.has-unread svg { animation: bell-shake 0.5s ease-in-out; }
.notif-badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; padding: 0 4px;
}
@keyframes badge-pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.notif-badge.pop { animation: badge-pop 0.3s ease-out; }
@keyframes notif-slide-down {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 420px; }
}
.notif-panel {
  background: var(--surface); border-bottom: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 420px; overflow-y: auto;
  animation: notif-slide-down 0.25s var(--ease);
  box-shadow: var(--shadow-lg);
}
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.notif-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 0 4px;
  transition: color 0.15s;
}
.notif-close:hover { color: var(--text); }
.notif-list { padding: 0; }
.notif-item {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.read { opacity: 0.45; }
.notif-item.notif-critical { border-left-color: var(--red); }
.notif-item.notif-warning { border-left-color: var(--yellow); }
.notif-item.notif-info { border-left-color: var(--accent); }
.notif-item-header {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.notif-title { font-weight: 600; flex: 1; }
.notif-ts { color: var(--text-dim); font-size: 11px; font-family: var(--mono); }
.notif-body {
  margin-top: 8px; padding-left: 20px;
  font-size: 12px; color: var(--text-dim); line-height: 1.6;
  white-space: pre-wrap;
}
.dot.yellow { background: var(--yellow); }
.dot.dim { background: var(--text-dim); }
/* Status dot pulse for running daemon */
@keyframes dot-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.dot.green { animation: dot-pulse 2s ease-in-out infinite; }
/* SSE connection indicator */
.sse-indicator {
  font-size: 9px; color: var(--text-dim); margin-left: 4px;
  padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--border);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px;
  transition: all 0.3s var(--ease);
}
.sse-indicator.connected {
  color: var(--green); border-color: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
}
/* Hide columns on mobile */
@media (max-width: 768px) {
  .hide-mobile { display: none; }
}

/* Analytics page */
.stat-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.stat-item { flex: 1; min-width: 100px; text-align: center; padding: 12px; background: var(--surface-2); border-radius: 8px; }
.stat-value { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.tool-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tool-bar-label { width: 80px; font-size: 13px; color: var(--text-dim); text-align: right; flex-shrink: 0; }
.tool-bar-wrap { flex: 1; height: 20px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.tool-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.tool-bar-count { width: 50px; font-size: 13px; color: var(--text-dim); }
.error-row { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.error-count { font-weight: 700; color: var(--accent); min-width: 40px; }
.error-msg { font-size: 13px; color: var(--text-dim); word-break: break-all; }
