:root {
  --bg: #060711;
  --bg-alt: #0d101c;
  --card: #111527;
  --card-alt: #181d33;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent: #4fd1c5;
  --accent-soft: rgba(79, 209, 197, 0.18);
  --accent-strong: #63b3ed;
  --text-main: #f9fafb;
  --text-muted: #a0aec0;
  --danger: #f56565;
  --warning: #ecc94b;
  --success: #48bb78;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

/* Skip to main content (screen readers + keyboard users) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: var(--accent);
  color: #0a0d20;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 9999;
  text-decoration: none;
}

.skip-link:focus {
  position: fixed;
  left: 16px;
  width: auto;
  height: auto;
  overflow: visible;
}

/* Keyboard focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) { outline: none; }

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #14193b 0, #05040b 55%);
  color: var(--text-main);
  font-family: var(--font-main);
}

body { min-height: 100vh; }

/* Topbar */
.topbar {
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
    90deg,
    rgba(99, 179, 237, 0.1),
    transparent,
    rgba(79, 209, 197, 0.1)
  ), rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: hidden;
}

#tunnel-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fbd38d, #ed64a6);
  box-shadow: 0 0 18px rgba(237, 100, 166, 0.9);
}

.brand-text h1 { font-size: 18px; margin: 0; }
.brand-text p { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }

/* Identity chip — shows authenticated user email when CF Access is in front */
.identity-chip {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 209, 197, 0.3);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Session-expired / auth error banner */
.auth-expired-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(245, 101, 101, 0.15);
  border-bottom: 1px solid rgba(245, 101, 101, 0.4);
  color: var(--text-main);
  font-size: 14px;
  backdrop-filter: blur(8px);
}


.auth-refresh-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
}

.auth-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  margin-left: auto;
}

.top-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.stat-pill {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(6, 10, 28, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 72px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}

.stat-pill:hover {
  border-color: rgba(79, 209, 197, 0.4);
}

.stat-pill.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 209, 197, 0.35);
}

.stat-pill .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-pill .stat-value {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

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

.stat-pill--action {
  text-decoration: none;
  color: inherit;
  border-color: rgba(79, 209, 197, 0.25);
}
.stat-pill--action .stat-value { color: var(--accent); }
.stat-pill--action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Focus strip — current priority micro-task in the header (#106) */
.focus-strip {
  --focus-x: 50%;
  --focus-level: 0;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
}
.focus-strip[hidden] { display: none; }

.focus-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.focus-main:hover .focus-desc { color: var(--accent); }

.focus-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0a0d20;
  background: var(--accent-strong);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.focus-label--next { background: var(--text-muted); }

.focus-okr {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.focus-desc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}

.focus-elapsed {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.focus-elapsed::before { content: "· "; }

.focus-cycle { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.focus-count { font-size: 11px; color: var(--text-muted); min-width: 28px; text-align: center; }

.focus-btn {
  flex-shrink: 0;
  background: rgba(6, 10, 28, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-main);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.focus-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.focus-btn:disabled { opacity: 0.6; cursor: wait; }
.focus-advance { color: var(--accent); border-color: rgba(79, 209, 197, 0.35); }
.focus-mode-toggle { color: var(--text-muted); padding: 5px 8px; }

/* Interactive design: glow follows the pointer, strength = attention level */
.focus-strip--interactive::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    420px 80px at var(--focus-x) 50%,
    rgba(79, 209, 197, calc(0.05 + var(--focus-level) * 0.18)),
    transparent 70%
  );
  transition: background 0.2s;
}
.focus-strip--interactive .focus-label {
  box-shadow: 0 0 calc(4px + var(--focus-level) * 14px) rgba(99, 179, 237, 0.8);
}

/* Idle: the strip slowly breathes to pull attention back */
.focus-strip--drifting .focus-label { animation: focus-breathe 4s ease-in-out infinite; }
.focus-strip--drifting .focus-desc { animation: focus-shimmer 4s ease-in-out infinite; }

/* Returning to the tab after a while: one bright wave across the strip */
.focus-strip--welcome::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(99, 179, 237, 0.35), transparent);
  animation: focus-wave 1.4s ease-out forwards;
}

@keyframes focus-breathe {
  0%, 100% { box-shadow: 0 0 4px rgba(99, 179, 237, 0.5); transform: scale(1); }
  50%      { box-shadow: 0 0 22px rgba(236, 201, 75, 0.9); transform: scale(1.06); }
}
@keyframes focus-shimmer {
  0%, 100% { color: var(--text-main); }
  50%      { color: var(--warning); }
}
@keyframes focus-wave {
  from { transform: translateX(-100%); opacity: 1; }
  to   { transform: translateX(100%);  opacity: 0; }
}

@media (max-width: 640px) {
  .focus-inner { padding: 6px 12px; flex-wrap: wrap; }
  .focus-strip--interactive .focus-main { flex-basis: 100%; }
  .focus-okr { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .focus-strip--interactive::before { transition: none; }
  .focus-strip--drifting .focus-label,
  .focus-strip--drifting .focus-desc,
  .focus-strip--welcome::after { animation: none; }
}

/* Page layout */
.page { max-width: 1120px; margin: 0 auto; padding: 20px; }

/* Controls */
.controls { margin-bottom: 16px; }

.controls-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}

.control { display: flex; flex-direction: column; gap: 4px; }
.control label { font-size: 12px; color: var(--text-muted); }

.control input, .control select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 13, 32, 0.95);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

.control input:focus, .control select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 209, 197, 0.5);
}

/* Summary */
.summary { margin-bottom: 12px; }
#summary-text { font-size: 13px; color: var(--text-muted); }

/* Repo list */
.repo-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 881px) {
  .repo-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Repo card */
.repo-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, #202645 0, #0b0f20 60%);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.repo-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.repo-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.repo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.badge-health-green .badge-dot {
  background-color: var(--success);
  box-shadow: 0 0 8px rgba(72, 187, 120, 0.8);
}

.badge-health-yellow .badge-dot {
  background-color: var(--warning);
  box-shadow: 0 0 8px rgba(236, 201, 75, 0.8);
}

.badge-health-red .badge-dot {
  background-color: var(--danger);
  box-shadow: 0 0 8px rgba(245, 101, 101, 0.8);
}

.badge-language {
  border-color: rgba(99, 179, 237, 0.7);
  background: rgba(49, 130, 206, 0.18);
  color: #e2e8f0;
}

.badge-issues {
  border-color: rgba(237, 137, 54, 0.8);
  background: rgba(237, 137, 54, 0.12);
  color: #fbd38d;
  cursor: pointer;
  transition: background 0.15s;
}

.badge-issues:hover {
  background: rgba(237, 137, 54, 0.25);
  color: #fff;
}

.badge-issues.badge-issues-zero {
  border-color: rgba(160, 174, 192, 0.4);
  background: rgba(160, 174, 192, 0.08);
  color: #a0aec0;
}

.badge-issues.badge-issues-zero:hover {
  background: rgba(160, 174, 192, 0.18);
  color: #e2e8f0;
}

/* Topic chips */
.repo-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge-topic {
  border-color: rgba(79, 209, 197, 0.35);
  background: rgba(79, 209, 197, 0.08);
  color: var(--accent);
  font-size: 10px;
  padding: 2px 7px;
}

.badge-homepage {
  border-color: rgba(79, 209, 197, 0.6);
  background: rgba(79, 209, 197, 0.14);
  color: var(--accent);
  font-weight: 500;
}

.badge-site-error {
  border-color: rgba(251, 146, 60, 0.6);
  background: rgba(251, 146, 60, 0.14);
  color: #fb923c;
  font-weight: 600;
}

/* Description */
.repo-description { font-size: 13px; color: var(--text-muted); margin: 0; }

/* Meta row */
.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.repo-meta span { display: inline-flex; align-items: center; gap: 4px; }

.meta-stars { color: #d4a843; }
.meta-forks { color: var(--text-muted); }

/* ============================================================
   Tab navigation
   ============================================================ */
.tab-nav {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.4);
}

.tab-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-main);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover { color: var(--text-main); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   View sections
   ============================================================ */
.view.hidden { display: none; }

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.view-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-main);
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================================
   Work status badges
   ============================================================ */
.badge-work {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.badge-work-not_started {
  border-color: rgba(160, 174, 192, 0.5);
  background: rgba(160, 174, 192, 0.1);
  color: #a0aec0;
}

.badge-work-in_progress {
  border-color: rgba(66, 153, 225, 0.6);
  background: rgba(66, 153, 225, 0.14);
  color: #63b3ed;
}

.badge-work-blocked {
  border-color: rgba(214, 158, 46, 0.6);
  background: rgba(214, 158, 46, 0.12);
  color: #ecc94b;
}

.blocker-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-work-done {
  border-color: rgba(72, 187, 120, 0.5);
  background: rgba(72, 187, 120, 0.1);
  color: var(--success);
}

.badge-source-auto {
  border-color: rgba(159, 122, 234, 0.5);
  background: rgba(159, 122, 234, 0.1);
  color: #b794f4;
  font-size: 10px;
}

.badge-source-manual {
  border-color: rgba(160, 174, 192, 0.3);
  background: rgba(160, 174, 192, 0.06);
  color: #718096;
  font-size: 10px;
}

.badge-issue-link {
  border-color: rgba(99, 179, 237, 0.5);
  background: rgba(99, 179, 237, 0.1);
  color: #63b3ed;
  font-size: 10px;
  text-decoration: none;
}

.badge-issue-link:hover {
  background: rgba(99, 179, 237, 0.2);
  color: #90cdf4;
}

.agent-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ============================================================
   Load-error banner
   ============================================================ */
.load-error {
  border-left: 3px solid var(--danger);
  background: rgba(245, 101, 101, 0.08);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #fc8181;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.load-error-msg { flex: 1; }

/* ============================================================
   Dependency warning banner
   ============================================================ */
.dep-warning {
  border-left: 3px solid #d69e2e;
  background: rgba(214, 158, 46, 0.08);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #e2c87a;
  margin-bottom: 6px;
  line-height: 1.5;
}

/* ============================================================
   Active Work grouped rows
   ============================================================ */
.work-group {
  margin-bottom: 28px;
}

.work-group-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.work-row {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, #181d33 0, #0b0f20 70%);
  padding: 12px 14px;
  margin-bottom: 8px;
}

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

.work-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.work-repo {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: none;
}

.work-repo:hover { text-decoration: underline; }

.work-task {
  font-size: 13px;
  color: var(--text-main);
  flex: 1;
  min-width: 180px;
}

.work-dep {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.work-time {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.work-notes-inline {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  border-left: 2px solid var(--border-subtle);
  padding-left: 8px;
  line-height: 1.5;
}

/* Legacy checkbox toggle — kept for any remaining references */
.work-toggle-row {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

/* Segmented toggle: Active | Completed */
.work-view-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: 20px;
  gap: 2px;
}

.work-toggle-btn {
  padding: 6px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.work-toggle-btn:hover {
  color: var(--text-main);
}

.work-toggle-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Completed work item row */
.work-row-done {
  opacity: 0.82;
  border-left: 3px solid var(--success);
}

.work-row-done:hover {
  opacity: 1;
}

.work-completed-at {
  color: var(--success);
}

.work-duration {
  font-size: 12px;
  color: var(--text-muted);
}

/* OKR nudge on completed items */
.work-okr-nudge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.okr-nudge-icon {
  color: var(--success);
  font-weight: bold;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.work-assigned {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.badge-assigned-agent {
  background: rgba(79, 209, 197, 0.1);
  border-color: rgba(79, 209, 197, 0.4);
  color: var(--accent);
}

.badge-assigned-asia {
  background: rgba(237, 100, 166, 0.1);
  border-color: rgba(237, 100, 166, 0.4);
  color: #ed64a6;
}

/* ============================================================
   Work item forms
   ============================================================ */
.work-form {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  padding: 16px;
  margin-bottom: 16px;
}

.work-inline-form {
  margin-top: 10px;
  margin-bottom: 0;
}

.work-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.work-form-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0a0d20;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.85; }

.btn-ghost {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-main);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-ghost:hover { color: var(--text-main); border-color: rgba(255,255,255,0.25); }

.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ============================================================
   Agent tasks table + mobile cards
   ============================================================ */
.agent-table-wrap { display: block; }
.agent-cards { display: none; flex-direction: column; gap: 10px; }

.agent-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #181d33 0, #0b0f20 70%);
  padding: 12px 14px;
}

.agent-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.agent-card-header a {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: none;
}

.agent-card-header a:hover { text-decoration: underline; }

.agent-card-task {
  font-size: 13px;
  color: var(--text-main);
  margin: 0 0 6px;
}

.agent-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.agent-card-notes {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0;
  border-left: 2px solid var(--border-subtle);
  padding-left: 8px;
  line-height: 1.5;
}

.table-scroll { overflow-x: auto; }

.work-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.work-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.work-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
  color: var(--text-main);
}

.work-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.work-table td a { color: var(--accent-strong); text-decoration: none; }
.work-table td a:hover { text-decoration: underline; }

.notes-cell { color: var(--text-muted); font-size: 12px; max-width: 240px; }

.empty-state {
  color: var(--text-muted);
  padding: 40px 0;
  text-align: center;
  font-size: 14px;
}

/* ============================================================
   Tier badges (Priority tab)
   ============================================================ */
.badge-tier {
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.badge-tier-1 {
  background: rgba(245, 101, 101, 0.15);
  border-color: rgba(245, 101, 101, 0.6);
  color: #fc8181;
}

.badge-tier-2 {
  background: rgba(236, 201, 75, 0.12);
  border-color: rgba(236, 201, 75, 0.5);
  color: #f6e05e;
}

.badge-tier-3 {
  background: rgba(66, 153, 225, 0.14);
  border-color: rgba(66, 153, 225, 0.5);
  color: #63b3ed;
}

.badge-tier-4 {
  background: rgba(160, 174, 192, 0.08);
  border-color: rgba(160, 174, 192, 0.3);
  color: #a0aec0;
}

/* Domain label chips */
.badge-domain {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  vertical-align: middle;
  margin-left: 2px;
}

.badge-domain-legal {
  border-color: rgba(245, 101, 101, 0.4);
  background: rgba(245, 101, 101, 0.1);
  color: #fc8181;
}

.badge-domain-grant {
  border-color: rgba(79, 209, 197, 0.4);
  background: rgba(79, 209, 197, 0.1);
  color: var(--accent);
}

/* ============================================================
   Bottlenecks panel
   ============================================================ */
.bottleneck-panel {
  border: 1px solid rgba(245, 101, 101, 0.45);
  background: rgba(245, 101, 101, 0.07);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.bottleneck-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 12px;
  color: #fc8181;
}

.bottleneck-count {
  background: rgba(245, 101, 101, 0.2);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.bottleneck-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bottleneck-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.bottleneck-title {
  font-weight: 600;
  color: var(--text-main);
}

.bottleneck-meta {
  color: var(--text-muted);
}

.bottleneck-meta a {
  color: var(--accent-strong);
  text-decoration: none;
}

.bottleneck-meta a:hover { text-decoration: underline; }

.bottleneck-repos {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
}

.text-urgent {
  color: var(--danger);
  font-weight: 600;
}

/* College academic panel variant */
.bottleneck-panel-college {
  border-color: rgba(99, 179, 237, 0.45);
  background: rgba(99, 179, 237, 0.07);
}

.bottleneck-panel-college .bottleneck-header {
  color: #90cdf4;
}

.bottleneck-panel-college .bottleneck-count {
  background: rgba(99, 179, 237, 0.2);
}

.bottleneck-panel-calm {
  border-color: rgba(99, 179, 237, 0.25);
  background: rgba(99, 179, 237, 0.04);
}

/* College deliverable-type badges */
.badge-college-type {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  vertical-align: middle;
  white-space: nowrap;
}

.badge-college-exam   { border-color: rgba(245, 101, 101, 0.4); background: rgba(245, 101, 101, 0.1); color: #fc8181; }
.badge-college-essay  { border-color: rgba(154, 230, 180, 0.4); background: rgba(154, 230, 180, 0.1); color: #9ae6b4; }
.badge-college-project{ border-color: rgba(99,  179, 237,  0.4); background: rgba(99,  179, 237,  0.1); color: #90cdf4; }
.badge-college-code   { border-color: rgba(214, 188, 250, 0.4); background: rgba(214, 188, 250, 0.1); color: #d6bcfa; }
.badge-college-reading{ border-color: rgba(251, 211, 141, 0.4); background: rgba(251, 211, 141, 0.1); color: #fbd38d; }
.badge-college-presentation { border-color: rgba(79, 209, 197, 0.4); background: rgba(79, 209, 197, 0.1); color: #4fd1c5; }

/* ============================================================
   Priority table & cards
   ============================================================ */
.priority-table .score-cell { text-align: center; }

.impact-score {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.impact-max {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 1px;
}

.signal-title {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.4;
}

.signal-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.signal-meta a {
  color: var(--accent-strong);
  text-decoration: none;
}

.signal-meta a:hover { text-decoration: underline; }

.no-signal-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.override-input {
  width: 54px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 13, 32, 0.95);
  color: var(--text-main);
  font-size: 13px;
  text-align: center;
  font-family: var(--font-main);
}

.override-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 209, 197, 0.4);
  outline: none;
}

/* Hide spinner on number input for cleaner look */
.override-input::-webkit-inner-spin-button,
.override-input::-webkit-outer-spin-button { opacity: 0.4; }

.priority-table-wrap { display: block; }
.priority-cards { display: none; flex-direction: column; gap: 8px; }

.priority-form-row td { padding: 0 0.5rem 0.75rem; background: var(--surface); border: none; }

.priority-card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

@media (max-width: 640px) {
  .priority-table-wrap { display: none; }
  .priority-cards { display: flex; }
}

/* Footer */
.footer {
  max-width: 1120px;
  margin: 24px auto 16px;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

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

/* Responsive */
@media (max-width: 880px) {
  .controls-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Stacked header + focus strip is too tall to pin on small screens —
     sticky here hid the tab nav and most of the viewport (#111). */
  .topbar { position: relative; }
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .top-stats { justify-content: flex-start; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .work-form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .controls-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-form-grid { grid-template-columns: 1fr; }
  .work-card-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tab-btn { padding: 10px 12px; font-size: 13px; }
  .agent-table-wrap { display: none; }
  .agent-cards { display: flex; }

  /* Two-row tab layout on mobile */
  .tab-nav-inner { flex-wrap: wrap; padding-bottom: 0; }
  /* Turn the divider into a full-width row break */
  .tab-divider { flex-basis: 100%; width: 100%; height: 1px; margin: 0; background: var(--border-subtle); }
}

/* ============================================================
   OKR Progress tab
   ============================================================ */
.okr-progress-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.okr-progress-toolbar select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
}

.okr-category-group { margin-bottom: 28px; }
.okr-category-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.okr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.okr-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.okr-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.okr-card-title { display: flex; align-items: center; gap: 8px; }

.okr-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: monospace;
}

.okr-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.okr-task-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--card-alt);
  color: var(--text-muted);
}

.okr-task-chip-empty { opacity: 0.6; }

.okr-target-date { font-size: 12px; color: var(--text-muted); }
.okr-next-due { font-size: 12px; color: var(--accent); font-weight: 500; }

.okr-objective { font-size: 14px; font-weight: 600; color: var(--text-main); }

.okr-key-result { font-size: 13px; color: var(--text-muted); }

.okr-bar-wrap { display: flex; align-items: center; gap: 10px; }

.okr-bar-track {
  flex: 1;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
}

.okr-bar-fill {
  height: 8px;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
  min-width: 0;
}

.okr-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.okr-today-section { margin-top: 8px; }

.okr-today-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.okr-today-row {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.okr-today-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.okr-today-okr-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  font-family: monospace;
}

.okr-today-desc { font-size: 14px; color: var(--text-main); }

.okr-today-notes { font-size: 12px; color: var(--text-muted); }

.okr-task-time {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--card-alt);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* OKR card expand button */
.okr-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.okr-expand-btn:hover { color: var(--text-main); background: var(--border-subtle); }

/* OKR-level dependency badge */
.okr-dep-badge {
  font-size: 11px;
  padding: 1px 7px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-pill);
  color: #f59e0b;
  white-space: nowrap;
}

/* Expanded task list inside an OKR card */
.okr-task-list {
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.okr-task-list-empty {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0;
}

.okr-task-row {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.okr-task-row-done { opacity: 0.6; }

.okr-task-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.okr-task-desc { flex: 1; font-size: 13px; color: var(--text-main); min-width: 0; }

.okr-task-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.okr-blocked-by {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.okr-task-notes {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 640px) {
  .okr-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Repo card — task activity (from OKR tracker)
   ============================================================ */
.badge-tasks {
  background: rgba(79, 209, 197, 0.12);
  color: var(--accent);
  border: 1px solid rgba(79, 209, 197, 0.3);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  white-space: nowrap;
}

.repo-task-activity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}

.repo-task-bar-track {
  flex: 0 0 80px;
  height: 4px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: inline-block;
}

.repo-task-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
  display: block;
}

.repo-task-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   Pipeline / Kanban board
   ============================================================ */
.pipeline-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-filter-row select {
  background: var(--card-alt);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
  padding: 0 0 40px;
}

.pipeline-col {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.pipeline-col-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pipeline-col-inprogress .pipeline-col-label { color: var(--accent); }
.pipeline-col-done .pipeline-col-label        { color: var(--success); }

.pipeline-col-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--card-alt);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.pipeline-col-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.pipeline-card {
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
}

.pipeline-card:hover { border-color: rgba(79, 209, 197, 0.3); }

.pipeline-card-done {
  opacity: 0.55;
}

.pipeline-card-okr {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.pipeline-card-desc {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.45;
}

.pipeline-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pipeline-chip {
  font-size: 11px;
  background: rgba(79, 209, 197, 0.12);
  color: var(--accent);
  border: 1px solid rgba(79, 209, 197, 0.25);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  white-space: nowrap;
}

.pipeline-chip-muted {
  background: var(--card);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.pipeline-card-notes {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  border-left: 2px solid var(--border-subtle);
  padding-left: 8px;
}

.pipeline-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.pipeline-advance-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(79, 209, 197, 0.10);
  border: 1px solid rgba(79, 209, 197, 0.3);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pipeline-advance-btn:hover {
  background: rgba(79, 209, 197, 0.2);
  border-color: var(--accent);
}

.pipeline-advance-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pipeline-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
  opacity: 0.7;
}

@media (max-width: 860px) {
  .pipeline-board {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Tab nav — primary / secondary distinction
   ============================================================ */
.tab-btn.tab-primary {
  font-weight: 700;
  color: var(--text-main);
}

.tab-btn.tab-primary.active,
.tab-btn.tab-primary:hover {
  color: var(--accent);
}

.tab-divider {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 4px;
  vertical-align: middle;
  align-self: center;
}

/* ============================================================
   Today view
   ============================================================ */
.today-header {
  padding: 20px 0 8px;
}

.today-headline {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
}

.today-subline {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.today-section {
  margin: 20px 0 0;
}

.today-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.today-section-urgent .today-section-label { color: #f87171; }
.today-section-warn   .today-section-label { color: #fbbf24; }
.today-section-dim    .today-section-label { color: var(--text-muted); opacity: 0.6; }
.today-section-resource .today-section-label { color: var(--accent); }

.today-section-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.today-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}

.today-row-main {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

.today-row-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.today-row-mine { border-left: 3px solid var(--accent); }
.today-row-blocked { border-left: 3px solid #f87171; }
.today-row-deadline { border-left: 3px solid #fbbf24; }
.today-row-behind { border-left: 3px solid #f97316; }
.today-row-done { opacity: 0.55; }

.today-log-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   Capacity view
   ============================================================ */
.capacity-pace-gap {
  font-size: 12px;
  color: #f87171;
  font-weight: 600;
}

/* ============================================================
   Resource grid & cards
   ============================================================ */
.resource-manage-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

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

.resource-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.resource-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.resource-category {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.resource-notes {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.resource-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.resource-badge-abundant { color: #34d399; font-weight: 700; font-size: 12px; }
.resource-badge-underused { color: #60a5fa; font-weight: 700; font-size: 12px; }
.resource-badge-active    { color: var(--accent); font-weight: 700; font-size: 12px; }
.resource-badge-depleted  { color: #f87171; font-weight: 700; font-size: 12px; }
.resource-badge-unknown   { color: var(--text-muted); font-weight: 700; font-size: 12px; }

/* ============================================================
   Pull Requests — donut chart view
   ============================================================ */
.pr-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.pr-total-label {
  color: var(--text-muted);
}

.pr-freshness {
  color: var(--text-muted);
}

.pr-chart-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
}

.pr-donut-svg {
  flex-shrink: 0;
  width: 240px;
  height: 240px;
}

.pr-slice {
  transition: opacity 0.15s;
  cursor: default;
}

.pr-slice:hover {
  opacity: 0.8;
  filter: brightness(1.15);
}

.pr-center-count {
  font-size: 26px;
  font-weight: 700;
  fill: var(--text-main);
  font-family: var(--font-main);
}

.pr-center-label {
  font-size: 11px;
  fill: var(--text-muted);
  font-family: var(--font-main);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pr-legend {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pr-legend-header,
.pr-legend-hint-row {
  display: grid;
  grid-template-columns: 12px 1fr 36px 36px 36px 36px;
  gap: 6px;
  align-items: center;
  padding: 2px 0;
}

.pr-legend-hint-row span {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

.pr-legend-row {
  display: grid;
  grid-template-columns: 12px 1fr 36px auto;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background 0.1s;
}

.pr-legend-row:hover {
  background: var(--bg-alt);
}

.pr-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pr-legend-name {
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.pr-legend-pct {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pr-legend-counts {
  display: flex;
  gap: 4px;
}

.pr-badge {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.pr-badge-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

.pr-open   { background: rgba(79, 209, 197, 0.14); color: #4fd1c5; }
.pr-merged { background: rgba(167, 139, 250, 0.14); color: #a78bfa; }
.pr-closed { background: rgba(160, 174, 192, 0.14); color: #a0aec0; }

/* ============================================================
   PR history list
   ============================================================ */
.pr-history-section {
  margin-top: 28px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.pr-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.pr-history-filters select,
.pr-history-filters input[type="search"] {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 13, 32, 0.95);
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-main);
  outline: none;
}

.pr-history-filters select:focus,
.pr-history-filters input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 209, 197, 0.4);
}

.pr-history-filters input[type="search"] { min-width: 200px; flex: 1; }

.pr-history-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.pr-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pr-history-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(13, 16, 28, 0.7);
  transition: border-color 0.12s;
}

.pr-history-row:hover { border-color: rgba(79, 209, 197, 0.25); }

.pr-history-state {
  margin-top: 2px;
  flex-shrink: 0;
  min-width: 54px;
  text-align: center;
}

.pr-history-main { flex: 1; min-width: 0; }

.pr-history-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.pr-history-title:hover { color: var(--accent); }

.pr-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.pr-history-more {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
  margin: 0;
}

@media (max-width: 600px) {
  .pr-history-filters input[type="search"] { min-width: 100%; }
}

/* ============================================================
   Shared utility
   ============================================================ */
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.btn-link:hover { opacity: 0.75; }

.btn-danger-sm {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.btn-danger-sm:hover { border-color: #f87171; background: rgba(248,113,113,0.08); }

@media (max-width: 600px) {
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .today-row-meta {
    flex-direction: column;
    gap: 3px;
  }
}

/* ============================================================
   Task search — clickable task text + dark search modal
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.task-link {
  all: unset;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted rgba(79, 209, 197, 0.45);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.task-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.task-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.task-search-modal {
  width: min(640px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-main);
  color-scheme: dark;
}

.task-search-modal[open] { display: flex; flex-direction: column; }
.task-search-modal::backdrop { background: rgba(3, 4, 10, 0.72); backdrop-filter: blur(3px); }

.task-search-header {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.task-search-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-main);
  font: inherit;
  font-size: 14px;
}

.task-search-input:focus { outline: none; border-color: var(--accent); }

.task-search-results {
  overflow-y: auto;
  padding: 8px 16px 16px;
}

.task-search-group { margin-top: 12px; }

.task-search-group-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.task-search-result {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.task-search-result:hover,
.task-search-result:focus-visible { border-color: var(--accent); background: var(--card-alt); }

.task-search-result-title { font-size: 14px; color: var(--text-main); overflow-wrap: anywhere; }
.task-search-result-detail { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.task-search-result-meta { font-size: 11px; color: var(--text-muted); opacity: 0.8; }

.task-search-results mark {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 2px;
}
