/* GitHub dark (Primer) tokens */
:root {
  --bg: #0d1117;
  --bg-inset: #010409;
  --bg-subtle: #151b23;
  --bg-muted: #212830;
  --border: #3d444d;
  --border-muted: #262c36;
  --fg: #f0f6fc;
  --fg-default: #e6edf3;
  --fg-muted: #9198a1;
  --accent: #4493f8;
  --open: #3fb950;
  --merged: #ab7df8;
  --closed: #f85149;
  --draft: #9198a1;
  --attention-bg: rgba(187, 128, 9, 0.15);
  --attention-border: rgba(187, 128, 9, 0.4);
  --danger-bg: rgba(248, 81, 73, 0.1);
  --danger-border: rgba(248, 81, 73, 0.4);
  --control-bg: #212830;
  --control-hover: #2a313c;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --radius-lg: 12px;
  --page: 1200px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-default);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2 { margin: 0; font-weight: 600; }
.muted { color: var(--fg-muted); }
button, select, input { font: inherit; color: var(--fg-default); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }

/* State colour: icons and numbers share one token per state */
[data-state="all"], [data-tone="all"] { --tone: var(--accent); }
[data-state="active"], [data-tone="active"], .state-active { --tone: var(--open); }
[data-state="draft"], [data-tone="draft"], .state-draft { --tone: var(--draft); }
[data-state="merged"], [data-tone="merged"], .state-merged { --tone: var(--merged); }
[data-state="closed"], [data-tone="closed"], .state-closed { --tone: var(--closed); }

.icon { display: inline-flex; flex: none; color: var(--tone, currentColor); }
.icon svg { width: 16px; height: 16px; fill: currentColor; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(1, 4, 9, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-muted);
}
.header-inner,
.container { max-width: var(--page); margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand:hover { color: inherit; }
.brand-logo { display: block; height: 22px; width: auto; }
.brand-divider { width: 1px; height: 20px; background: var(--border); }
.brand-title { color: var(--fg-muted); font-size: 14px; font-weight: 500; letter-spacing: 0.01em; }
.header-status { display: flex; align-items: center; gap: 16px; font-size: 12px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-muted); font-weight: 500; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-muted); }
.live[data-state="live"] { color: var(--fg-default); }
.live[data-state="live"] .live-dot { background: var(--open); animation: pulse 2.4s ease-out infinite; }
.live[data-state="reconnecting"] .live-dot { background: #d29922; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55); }
  70%, 100% { box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
}

.container { padding-top: 28px; padding-bottom: 56px; }

/* Banner */
.banner {
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid var(--attention-border);
  border-radius: var(--radius);
  background: var(--attention-bg);
  font-size: 13px;
}
.banner[data-kind="error"] { border-color: var(--danger-border); background: var(--danger-bg); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label { color: var(--fg-muted); font-size: 12px; font-weight: 500; }
.hint { margin: 10px 0 24px; font-size: 12px; min-height: 18px; }

.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--control-bg);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
}
.segmented button {
  padding: 3px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.segmented button:hover { color: var(--fg-default); }
.segmented button[aria-pressed="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 0 0 1px var(--border); }

.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 3px 11px;
  border: 1px solid var(--border-muted);
  border-radius: 2em;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.chip:hover { color: var(--fg-default); border-color: var(--border); }
.chip[aria-pressed="true"] { background: rgba(68, 147, 248, 0.12); border-color: rgba(68, 147, 248, 0.5); color: var(--accent); }

.select, input[type="date"] {
  padding: 4px 8px;
  background: var(--control-bg);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  font-size: 12px;
  color-scheme: dark;
}
.select:hover, input[type="date"]:hover { border-color: var(--border); }
.custom-range { display: inline-flex; align-items: center; gap: 6px; }
.btn {
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { background: var(--control-bg); }

/* Stats strip: one panel, five cells */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 24px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
}
.stat { padding: 20px 24px 22px; }
.stat + .stat { border-left: 1px solid var(--border-muted); }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 13px; font-weight: 500; }
.stat-value {
  margin-top: 10px;
  color: var(--tone);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.3s;
}
.stale .stat-value, .stale .repo-table td.num { opacity: 0.55; }

/* Boxes */
.box {
  background: var(--bg);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}
.box-header { padding: 14px 20px; border-bottom: 1px solid var(--border-muted); }
.box-header h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); }
.section-icon { color: var(--tone, var(--fg-muted)); }
.counter {
  min-width: 20px;
  padding: 0 7px;
  border-radius: 2em;
  background: var(--bg-muted);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
}
.counter:empty { display: none; }

.columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
.columns .box { margin-bottom: 0; }

/* Repo table */
.table-wrap { overflow-x: auto; }
.repo-table { width: 100%; border-collapse: collapse; }
.repo-table th, .repo-table td { padding: 12px 20px; text-align: left; white-space: nowrap; }
.repo-table th {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-muted);
}
.repo-table th .icon { vertical-align: -3px; margin-right: 6px; }
.repo-table td { border-bottom: 1px solid var(--border-muted); }
.repo-table tbody tr:last-child td { border-bottom: 0; }
.repo-table tbody tr { transition: background 0.15s; }
.repo-table tbody tr:hover { background: var(--bg-subtle); }
.repo-table .num { text-align: right; width: 14%; }
.repo-table td.num { color: var(--tone); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.repo-name { display: inline-flex; align-items: baseline; gap: 10px; }
.repo-label { color: var(--fg); font-weight: 600; }
.repo-slug { color: var(--fg-muted); font-size: 12px; }
.repo-name:hover .repo-label { color: var(--accent); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow-y: auto; }
.list li { display: flex; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border-muted); }
.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--bg-subtle); }
.list .empty { justify-content: center; padding: 36px 20px; color: var(--fg-muted); }
.list .icon { padding-top: 2px; }
.item-body { min-width: 0; flex: 1; }
.item-title { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.item-title a:hover { color: var(--accent); }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; color: var(--fg-muted); font-size: 12px; }
.avatar { width: 16px; height: 16px; border-radius: 50%; background: var(--bg-muted); }
.person { display: inline-flex; align-items: center; gap: 5px; }
.person b { color: var(--fg-default); font-weight: 500; }
.branch {
  padding: 1px 6px;
  border-radius: var(--radius);
  background: rgba(68, 147, 248, 0.1);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.label {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 2em;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}
.repo-tag { color: var(--fg-muted); font-weight: 500; }
.feed .item-title { font-weight: 400; }
.feed .verb { color: var(--fg-muted); }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat[data-state="all"] { grid-column: 1 / -1; }
  .stat + .stat { border-left: 0; }
  .stat { border-top: 1px solid var(--border-muted); }
  .stat[data-state="all"] { border-top: 0; }
  .stat:nth-child(odd):not([data-state="all"]) { border-left: 1px solid var(--border-muted); }
  .columns { grid-template-columns: 1fr; }
  .header-inner, .container { padding-left: 16px; padding-right: 16px; }
  #updated { display: none; }
  .repo-slug { display: none; }
  .repo-table th, .repo-table td { padding-left: 14px; padding-right: 14px; }
}

/* Loading states ------------------------------------------------------------ */

/* Thin indeterminate bar under the header: any load, foreground or background. */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; opacity: 0; transition: opacity 0.2s; }
[data-busy] .progress { opacity: 1; }
.progress::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: indeterminate 1.1s ease-in-out infinite;
}
@keyframes indeterminate { from { left: -30%; } to { left: 100%; } }

/* Filters are locked while a filter change loads. */
.filters[aria-busy="true"] { cursor: progress; }
.filters button:disabled, .filters select:disabled, .filters input:disabled { cursor: progress; }
.filters[aria-busy="true"] .segmented button:not([aria-pressed="true"]),
.filters[aria-busy="true"] .chip,
.filters[aria-busy="true"] .select,
.filters[aria-busy="true"] input { opacity: 0.55; }

/* Skeletons */
.sk, [data-loading] .stat-value, [data-loading] .repo-table td.num::after {
  background: linear-gradient(90deg, var(--bg-muted) 25%, #2d3540 37%, var(--bg-muted) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
}
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

[data-loading] .stat-value { color: transparent; width: 88px; max-width: 70%; }

.repo-table td.num { position: relative; }
[data-loading] .repo-table td.num { color: transparent; }
[data-loading] .repo-table td.num::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 28px;
  height: 12px;
  margin-top: -6px;
}

[data-loading] #open-list, [data-loading] #feed { opacity: 0.4; pointer-events: none; transition: opacity 0.2s; }

.skeleton-row { align-items: flex-start; }
.skeleton-row:hover { background: transparent !important; }
.sk { display: block; }
.sk-icon { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.sk-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.sk-line { height: 10px; width: 70%; }
.sk-line.short { width: 40%; }

.spinner {
  display: none;
  width: 12px;
  height: 12px;
  margin-left: 2px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
[data-loading] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .progress::before, .sk, [data-loading] .stat-value, [data-loading] .repo-table td.num::after, .spinner { animation-duration: 3s; }
}

/* Leaderboards ------------------------------------------------------------- */
:root {
  --gold: #d29922;
  --silver: #b1bac4;
  --bronze: #c9814c;
  --diff-add: #3fb950;
  --diff-del: #f85149;
}

.box-header-split { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.box-note { color: var(--fg-muted); font-size: 12px; }
.section-icon.trophy { color: var(--gold); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td { padding: 10px 20px; text-align: left; white-space: nowrap; }
.lb-table th { color: var(--fg-muted); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--border-muted); }
.lb-table td { border-bottom: 1px solid var(--border-muted); font-variant-numeric: tabular-nums; }
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table tbody tr { transition: background 0.15s; }
.lb-table tbody tr:hover { background: var(--bg-subtle); }
.lb-table .num { text-align: right; }
.lb-table td.num { color: var(--fg-default); }
.lb-table td.zero { color: var(--border); }
.lb-total-col { width: 120px; }
.lb-table td.lb-total { color: var(--fg); font-size: 15px; font-weight: 600; }
.lb-table td.loc-add { color: var(--diff-add); font-weight: 500; }
.lb-table td.loc-del { color: var(--diff-del); font-weight: 500; }

/* Podium: a thin medal-coloured edge and a faint wash on the top three rows */
.lb-table tr.podium td:first-child { box-shadow: inset 2px 0 0 var(--medal); }
.lb-table tr.podium { background: linear-gradient(90deg, color-mix(in srgb, var(--medal) 7%, transparent), transparent 45%); }
.lb-table tr.gold { --medal: var(--gold); }
.lb-table tr.silver { --medal: var(--silver); }
.lb-table tr.bronze { --medal: var(--bronze); }

.lb-rank-col, .lb-rank { width: 96px; }
.lb-pos { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-pos.gold { --medal-fg: var(--gold); }
.lb-pos.silver { --medal-fg: var(--silver); }
.lb-pos.bronze { --medal-fg: var(--bronze); }
.lb-pos.gold, .lb-pos.silver, .lb-pos.bronze { color: var(--medal-fg); }
.pos-trophy svg { width: 16px; height: 16px; }
.pos-label { min-width: 22px; }
.pos-change { font-size: 11px; font-weight: 600; }
.pos-change.up { color: var(--open); }
.pos-change.down { color: var(--closed); }

/* Timing-tower gap to the leader */
.lb-gap-col { width: 110px; }
.lb-table td.lb-gap { color: var(--fg-muted); font-size: 13px; }
.lb-table td.lb-gap.leader { color: var(--gold); font-weight: 600; }

/* Group rows: "Podium" / "Rest of the grid" */
.lb-table tr.lb-group:hover { background: transparent; }
.lb-table tr.lb-group td {
  padding-top: 6px;
  padding-bottom: 6px;
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lb-table tr.lb-group td.podium-label { color: var(--gold); }

.lb-person { display: inline-flex; align-items: center; gap: 12px; }
.lb-person:hover .lb-name { color: var(--accent); }
.lb-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-muted); box-shadow: 0 0 0 1px var(--border-muted); flex: none; }
.podium .lb-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--medal); }
.lb-names { display: flex; flex-direction: column; line-height: 1.3; }
.lb-name { color: var(--fg); font-weight: 600; }
.lb-login { color: var(--fg-muted); font-size: 12px; }

.lb-diffstat-col, .lb-diffstat { width: 72px; }
.diffstat { display: inline-flex; gap: 2px; vertical-align: middle; }
.ds { width: 8px; height: 8px; border-radius: 2px; }
.ds.add { background: var(--diff-add); }
.ds.del { background: var(--diff-del); }
.ds.neutral { background: var(--bg-muted); }

/* Loading: skeleton rows until the first full build lands */
.lb-skeleton td { padding-top: 14px; padding-bottom: 14px; }
.lb-skeleton:hover { background: transparent !important; }
.sk-rank { width: 26px; height: 26px; border-radius: 50%; }
.sk-avatar { width: 28px; height: 28px; border-radius: 50%; }
.sk-num { width: 36px; height: 12px; margin-left: auto; }
/* Filters never affect the boards, so only their own build shows this spinner. */
.spinner.lb-spinner { display: none; }
[data-boards-loading] .spinner.lb-spinner { display: inline-block; }

@media (max-width: 960px) {
  .lb-table th, .lb-table td { padding-left: 12px; padding-right: 12px; }
  .lb-login, .lb-diffstat-col, .lb-diffstat { display: none; }
}

/* Core repos ----------------------------------------------------------------- */
.core-badge { color: var(--accent); cursor: help; }
.core-badge svg { width: 14px; height: 14px; }
.chip .core-badge { margin-right: 4px; vertical-align: -2px; }
.repo-cell { display: inline-flex; align-items: center; gap: 8px; }
.th-repo { display: inline-flex; align-items: center; gap: 4px; }
.lb-repo-col { min-width: 72px; }

.tooltip {
  position: fixed;
  z-index: 100;
  padding: 4px 8px;
  border-radius: var(--radius);
  background: #3d444d;
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(1, 4, 9, 0.6);
}

/* Lines of code fill in after the PR board (file lists take longer). */
.spinner.loc-spinner { display: none; }
[data-loc-loading] .spinner.loc-spinner { display: inline-block; }

/* Gap / Interval switch */
.lb-table td.lb-gap, .lb-table th.lb-gap-col { transition: opacity 0.15s ease; }
[data-gap-fading] .lb-table td.lb-gap, [data-gap-fading] .lb-table th.lb-gap-col { opacity: 0; }


/* Leaderboard headers: one line each, all on one baseline above the numbers. */
.lb-table thead th { vertical-align: bottom; white-space: nowrap; }
.lb-table th.lb-repo-col { cursor: help; min-width: 0; }
/* Plain inline text so every header shares the same text baseline. */
.th-repo { display: inline; }
.th-repo .core-badge { display: inline-block; margin-right: 4px; vertical-align: -2px; }
.th-repo .core-badge svg { width: 13px; height: 13px; display: block; }

/* Linear: tones -------------------------------------------------------------------- */
[data-state="done"], [data-tone="done"] { --tone: var(--merged); }
.lin-body { padding: 16px 20px; }
.lin-body > * + * { margin-top: 16px; }

.mini-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mini-tile { padding: 12px 14px; background: var(--bg-subtle); border: 1px solid var(--border-muted); border-radius: var(--radius); }
.mini-label { color: var(--fg-muted); font-size: 12px; font-weight: 500; }
.mini-value { margin-top: 4px; color: var(--tone, var(--fg)); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.mini-sub { margin-top: 2px; color: var(--fg-muted); font-size: 11px; }
[data-loading] .mini-value { color: transparent; background: var(--bg-muted); border-radius: 4px; width: 60%; }

.chart { position: relative; height: 220px; }
.chart.tall { height: 280px; }

.headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.headline-value { color: var(--fg); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.headline-label, .headline-sub { color: var(--fg-muted); font-size: 13px; }
.trend { font-size: 13px; font-weight: 600; }
.trend.up { color: var(--open); }
.trend.down { color: var(--closed); }

/* Pipeline / bar rows ------------------------------------------------------------------ */
.pipeline { padding: 12px 20px 16px; }
.pipe-row, .bucket { display: grid; grid-template-columns: 200px 1fr 56px; align-items: center; gap: 12px; padding: 4px 0; }
.pipe-name, .bucket-label { color: var(--fg-default); font-size: 13px; }
.pipe-track { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--bg-muted); overflow: hidden; }
.pipe-bar { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transition: width 0.4s ease; }
.pipe-count { text-align: right; color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.tone-gray { background: #6e7681; }
.tone-blue { background: var(--accent); }
.tone-green { background: var(--open); }
.tone-purple { background: var(--merged); }
.buckets { margin-top: 8px; }

/* Dropdown checklists (projects, labels) --------------------------------------------- */
.multi { position: relative; }
.multi summary { list-style: none; cursor: pointer; min-width: 140px; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: "▾"; margin-left: 8px; color: var(--fg-muted); }
.multi[aria-disabled] summary, .lin-filters[aria-busy="true"] .multi summary { pointer-events: none; opacity: 0.55; }
.multi-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(1, 4, 9, 0.6);
}
.multi-heading { padding: 6px 8px 2px; color: var(--fg-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.multi-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.multi-item:hover { background: var(--bg-muted); }
.multi-item input { accent-color: var(--accent); }
.multi-clear { width: 100%; margin-top: 4px; }

/* Tables and lists ----------------------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 6px 8px; color: var(--fg-muted); font-size: 12px; font-weight: 500; text-align: left; border-bottom: 1px solid var(--border-muted); white-space: nowrap; }
.data-table td { padding: 8px; border-bottom: 1px solid var(--border-muted); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.zero { color: var(--border); }
.data-table .strong { color: var(--fg); font-weight: 600; }
.progress-cell { min-width: 160px; }
.progress-cell .pipe-track { margin-bottom: 4px; }
.progress-cell .muted { font-size: 12px; }
.load-bars { min-width: 120px; }
.load-bars .pipe-track + .pipe-track { margin-top: 3px; }
.danger-text { color: var(--closed); font-weight: 600; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.sub-heading { margin: 0 0 8px; color: var(--fg-muted); font-size: 12px; font-weight: 600; }
.list.compact { max-height: 420px; border: 1px solid var(--border-muted); border-radius: var(--radius); }
.list.compact li { padding: 8px 12px; }
.empty-note { margin: 0; color: var(--fg-muted); font-size: 13px; }
.legend-note { margin: 8px 0 0; color: var(--fg-muted); font-size: 12px; }
.swatch { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 8px; border-radius: 2px; vertical-align: -1px; }
.swatch:first-child { margin-left: 0; }
.item-title.normal { font-weight: 400; }

.label.urgent, .label.flag.danger { border-color: rgba(248, 81, 73, 0.5); color: var(--closed); }
.label.flag { margin-left: 8px; }
.label.flag.warn { border-color: rgba(210, 153, 34, 0.5); color: #d29922; }
.label.tone-completed { border-color: rgba(171, 125, 248, 0.5); color: var(--merged); }
.label.tone-started { border-color: rgba(63, 185, 80, 0.5); color: var(--open); }
.label.tone-canceled { border-color: rgba(248, 81, 73, 0.4); color: var(--closed); }
.age { color: var(--fg-muted); }
.age.stuck { color: var(--closed); font-weight: 600; }

@media (max-width: 960px) {
  .pipe-row, .bucket { grid-template-columns: 130px 1fr 44px; }
}
@media (max-width: 600px) {
  .brand-divider, .brand-title { display: none; }
}

/* Sub-navigation (GitHub repo-nav style) ----------------------------------------- */
.subnav { background: var(--bg); border-bottom: 1px solid var(--border-muted); }
.subnav-inner { display: flex; gap: 8px; max-width: var(--page); margin: 0 auto; padding: 0 32px; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--fg-default);
  font-size: 14px;
  line-height: 20px;
}
.tab:hover { color: var(--fg); background: var(--bg-muted); text-decoration: none; }
.tab .icon { color: var(--fg-muted); }
.tab[aria-selected="true"] { font-weight: 600; color: var(--fg); }
.tab[aria-selected="true"] .icon { color: var(--fg); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 2px;
  border-radius: 6px;
  background: #f78166;
}
.tab-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 2em;
  background: var(--bg-muted);
  color: var(--fg-default);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}
.tab-count:empty { display: none; }

/* Explanations and group labels ---------------------------------------------------- */
.card-sub { margin: 0; padding: 12px 20px 0; color: var(--fg-muted); font-size: 12px; line-height: 1.5; }
.group-label { margin: 8px 0 12px; color: var(--fg-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* Column layouts: stacked below 1680px, side by side on wide screens -------------------- */
.grid-2, .boards-3 { display: flex; flex-direction: column; }
@media (min-width: 1680px) {
  :root { --page: 2400px; }
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; margin-bottom: 24px; }
  .boards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; margin-bottom: 24px; }
  .grid-2 > .box, .boards-3 > .box { margin-bottom: 0; }
  .area-work .list, #gh-feed .list { max-height: 640px; }
}

/* Activity grid (GitHub contribution-graph style) ----------------------------------------- */
.contrib { padding: 16px 20px 18px; overflow-x: auto; }
.contrib-summary { margin: 0 0 10px; color: var(--fg-default); font-size: 13px; }
.contrib-summary .muted { margin-left: 6px; font-size: 12px; }
.contrib-grid { display: grid; gap: var(--gap); min-width: 640px; }
.contrib-month { color: var(--fg-muted); font-size: 11px; white-space: nowrap; line-height: 16px; }
.contrib-day { align-self: center; color: var(--fg-muted); font-size: 10px; }
.contrib { --gap: 3px; }
@media (min-width: 1680px) { .contrib { --gap: 4px; } }
.cell { width: 100%; aspect-ratio: 1; border-radius: 2px; background: #151b23; outline: 1px solid rgba(240, 246, 252, 0.04); outline-offset: -1px; }
.cell.future { visibility: hidden; }
.cell[data-l="1"] { background: #033a16; }
.cell[data-l="2"] { background: #196c2e; }
.cell[data-l="3"] { background: #2ea043; }
.cell[data-l="4"] { background: #56d364; }
.contrib-purple .cell[data-l="1"] { background: #2e1e57; }
.contrib-purple .cell[data-l="2"] { background: #553a9c; }
.contrib-purple .cell[data-l="3"] { background: #8957e5; }
.contrib-purple .cell[data-l="4"] { background: #c4a6ff; }
.contrib-legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--fg-muted); font-size: 12px; }
.contrib-scale { display: inline-flex; align-items: center; gap: 4px; }
.contrib-scale .cell { width: 11px; height: 11px; aspect-ratio: auto; }

/* Ticket Score / Ticketed PRs values (text tokens tinted only slightly) --------------- */
.lb-table td.score.good, .lb-table td.ticketed.good { color: var(--open); }
.lb-table td.score.ok, .lb-table td.ticketed.ok { color: #d29922; }
.lb-table td.score.low, .lb-table td.ticketed.low { color: var(--closed); }
.lb-table tr.unranked td { color: var(--fg-muted); }
.lb-table td.pad { padding: 20px; }
.boards-3 .lb-table th, .boards-3 .lb-table td { padding-left: 12px; padding-right: 12px; }

/* Linear tab: cards side by side share a row height ----------------------------------- */
@media (min-width: 1680px) {
  #view-linear .grid-2 { align-items: stretch; }
  #view-linear .grid-2 > .box { display: flex; flex-direction: column; }
  #view-linear .grid-2 > .box > .lin-body { flex: 1; display: flex; flex-direction: column; }
  #view-linear .grid-2 > .box > .lin-body > .chart:last-child { flex: 1; min-height: 220px; }
}

/* Letter avatars (no profile picture) ------------------------------------------------- */
.letter-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  user-select: none;
}
.avatar.letter-avatar { width: 16px; height: 16px; font-size: 7px; }
.lb-avatar.letter-avatar { width: 28px; height: 28px; font-size: 11px; }
