:root {
  --bg: #0e0f11;
  --surface: #16171b;
  --surface2: #1e1f25;
  --border: #2a2b33;
  --border-light: #35363f;
  --text: #e2e4e9;
  --text-dim: #8b8d98;
  --text-faint: #5c5e6a;
  --accent: #6e56cf;
  --accent-dim: #6e56cf33;
  --green: #30a46c;
  --green-dim: #30a46c22;
  --green-text: #4cc38a;
  --red: #e5484d;
  --red-dim: #e5484d22;
  --red-text: #ff6369;
  --yellow: #f5a623;
  --yellow-dim: #f5a62322;
  --yellow-text: #ffcf4a;
  --blue: #3b82f6;
  --blue-dim: #3b82f622;
  --blue-text: #60a5fa;
  --orange: #f97316;
  --orange-dim: #f9731622;
  --orange-text: #fb923c;
  --purple: #8b5cf6;
  --purple-dim: #8b5cf622;
  --purple-text: #a78bfa;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.container-narrow { max-width: 640px; margin: 0 auto; padding: 24px 20px; }

/* --- Nav --- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.nav-brand { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  font-size: 0.82rem; font-weight: 500; color: var(--text-dim); padding: 6px 12px;
  border-radius: 0; transition: color 0.15s;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface2); }

/* --- Buttons --- */
.btn {
  font-family: 'DM Sans', sans-serif; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  padding: 8px 16px; border-radius: 0; cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--border-light); background: var(--border); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.15); background: var(--accent); }
.btn-green { border-color: var(--green); color: var(--green-text); }
.btn-green:hover { background: var(--green-dim); }
.btn-red { border-color: var(--red); color: var(--red-text); }
.btn-red:hover { background: var(--red-dim); }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* --- Forms --- */
input[type="text"], input[type="password"], input[type="search"], textarea, select {
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 0;
  color: var(--text); padding: 8px 12px; outline: none; width: 100%;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
label { font-size: 0.82rem; color: var(--text-dim); display: block; margin-bottom: 4px; }

/* --- Summary bar --- */
.summary-bar {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.summary-item {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  padding: 4px 10px; border-radius: 0; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); cursor: pointer;
  transition: all 0.15s;
}
.summary-item:hover, .summary-item.active { background: var(--surface2); color: var(--text); border-color: var(--border-light); }
.summary-count { font-weight: 700; color: var(--text); }

/* --- Verdict badges --- */
.badge {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; font-weight: 600;
  padding: 3px 8px; border-radius: 0; display: inline-block; letter-spacing: 0.02em;
}
.badge-unmarked { background: var(--surface2); color: var(--text-faint); border: 1px solid var(--border); }
.badge-action { background: var(--yellow-dim); color: var(--yellow-text); border: 1px solid var(--yellow); }
.badge-in_progress { background: var(--blue-dim); color: var(--blue-text); border: 1px solid var(--blue); }
.badge-awaiting { background: var(--orange-dim); color: var(--orange-text); border: 1px solid var(--orange); }
.badge-ai_reviewing { background: var(--purple-dim); color: var(--purple-text); border: 1px solid var(--purple); }
.badge-ai_approved { background: var(--accent-dim); color: #a78bfa; border: 1px solid var(--accent); }
.badge-approved { background: var(--green-dim); color: var(--green-text); border: 1px solid var(--green); }
.badge-rejected { background: var(--red-dim); color: var(--red-text); border: 1px solid var(--red); }
.badge-blocked { background: #78716c22; color: #a8a29e; border: 1px solid #78716c; }
.badge-not_action { background: var(--surface2); color: var(--text-faint); border: 1px solid var(--border); }
.badge-unclear { background: var(--purple-dim); color: var(--purple-text); border: 1px solid var(--purple); }

/* --- Priority badges --- */
.priority-critical { color: var(--red-text); }
.priority-high { color: var(--orange-text); }
.priority-medium { color: var(--yellow-text); }
.priority-low { color: var(--text-dim); }

/* --- Feature table --- */
.feature-table { width: 100%; border-collapse: collapse; }
.feature-table th {
  text-align: left; font-size: 0.72rem; color: var(--text-faint); font-weight: 600;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.feature-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.85rem; vertical-align: top; }
.feature-table tr { cursor: pointer; transition: background 0.1s; }
.feature-table tr:hover { background: var(--surface); }
.feature-text { max-width: 500px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feature-meta { font-size: 0.72rem; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; }

/* --- Feature detail --- */
.detail-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: 0;
  padding: 20px; margin-bottom: 16px;
}
.detail-section h3 {
  font-size: 0.78rem; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px;
}
.detail-text { font-size: 0.92rem; line-height: 1.7; white-space: pre-wrap; }
.detail-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* --- Rounds --- */
.round {
  background: var(--surface); border: 1px solid var(--border); border-radius: 0;
  padding: 16px; margin-bottom: 12px;
}
.round.dimmed { opacity: 0.5; }
.round-header {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  color: var(--text-faint); margin-bottom: 12px; font-weight: 600;
}
.round-field { margin-bottom: 10px; }
.round-field-label {
  font-size: 0.72rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px;
}
.round-field-value { font-size: 0.85rem; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.round-field-empty { font-size: 0.82rem; color: var(--text-faint); font-style: italic; }

/* --- Comments --- */
.comment {
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-author { font-weight: 700; font-size: 0.85rem; }
.comment-author-paul { color: var(--red-text); }
.comment-author-michael { color: var(--accent); }
.comment-author-cc { color: var(--text-faint); font-weight: 400; }
.comment-time { font-size: 0.72rem; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; }
.comment-body { font-size: 0.85rem; line-height: 1.6; white-space: pre-wrap; }
.comment-images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.comment-images img {
  max-width: 200px; max-height: 150px; border: 1px solid var(--border);
  cursor: pointer; transition: opacity 0.15s;
}
.comment-images img:hover { opacity: 0.8; }
.comment-delete {
  font-size: 0.72rem; color: var(--text-faint); cursor: pointer;
  background: none; border: none; padding: 0;
}
.comment-delete:hover { color: var(--red-text); }

/* --- Notes --- */
.note {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  color: var(--blue-text); background: var(--blue-dim);
  padding: 6px 10px; border-radius: 0; margin-bottom: 6px;
  word-break: break-word; line-height: 1.5;
}

/* --- Review mode --- */
.review-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 0;
  padding: 24px; animation: cardIn 0.25s ease;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.progress-track { height: 4px; background: var(--surface2); border-radius: 0; overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; background: var(--green); transition: width 0.4s ease; }

.review-actions { display: flex; gap: 8px; margin-top: 20px; }
.review-actions .btn { flex: 1; padding: 12px; justify-content: center; font-size: 0.88rem; }

kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
  background: var(--surface2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 0; color: var(--text-faint);
}

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  font-size: 0.82rem; padding: 8px 16px; border-radius: 0; z-index: 600;
  opacity: 0; transition: transform 0.3s, opacity 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Login --- */
.login-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-box {
  background: var(--surface); border: 1px solid var(--border);
  padding: 32px; width: 360px; max-width: 90vw;
}
.login-box h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.02em; }

/* --- Image lightbox --- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lightbox img { max-width: 90vw; max-height: 90vh; }

/* --- Done screen --- */
.done-screen { text-align: center; padding: 48px 0; }
.done-screen h2 { font-size: 1.3rem; margin-bottom: 8px; }
.done-screen p { color: var(--text-dim); font-size: 0.9rem; }
.done-stats {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  color: var(--text-faint); margin: 20px 0; line-height: 2;
}

/* --- Filters bar --- */
.filters-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filters-bar select, .filters-bar input[type="search"] { width: auto; min-width: 140px; }
.filters-bar input[type="search"] { min-width: 200px; }

/* --- Misc --- */
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
