/* --------------------------------------------------------------------------
   tally — a commit matrix with a red signal.
   The dark palette is the primary one. Light mode is a deliberate second
   theme, not an automatic inversion.
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --surface-1: #fbf8f6;
  --surface-2: #f4eeeb;
  --page: #efe7e3;
  --ink: #160d0f;
  --ink-2: #5b4a4b;
  --muted: #8a7677;
  --grid: #e2d6d3;
  --axis: #c9b8b6;
  --border: rgba(22, 13, 15, 0.12);
  --border-strong: rgba(200, 16, 46, 0.35);
  --accent: #c8102e;
  --accent-soft: #8f0f22;
  --accent-dim: #f0c9cd;
  --track: #f0dcdc;
  --matrix-0: #ebe3e0;
  --matrix-1: #d98f97;
  --matrix-2: #c95a68;
  --matrix-3: #b83245;
  --matrix-4: #9e1f31;
  --matrix-5: #700a1a;
  --series-red: #c8102e;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --shadow: 0 18px 50px rgba(22, 13, 15, 0.10);
  --glow: 0 0 18px rgba(200, 16, 46, 0.18);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #100b0c;
    --surface-2: #160f11;
    --page: #070506;
    --ink: #f4e9e7;
    --ink-2: #c3adae;
    --muted: #8a7375;
    --grid: #241417;
    --axis: #3a2427;
    --border: rgba(255, 43, 61, 0.14);
    --border-strong: rgba(255, 43, 61, 0.45);
    --accent: #ff2b3d;
    --accent-soft: #ff6b78;
    --accent-dim: #2a1114;
    --track: #2a1114;
    --matrix-0: #1a1113;
    --matrix-1: #8a1622;
    --matrix-2: #b01a2a;
    --matrix-3: #d92a3c;
    --matrix-4: #ff4d5e;
    --matrix-5: #ff9aa3;
    --series-red: #ff2b3d;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    --glow: 0 0 24px rgba(255, 43, 61, 0.18);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #100b0c;
  --surface-2: #160f11;
  --page: #070506;
  --ink: #f4e9e7;
  --ink-2: #c3adae;
  --muted: #8a7375;
  --grid: #241417;
  --axis: #3a2427;
  --border: rgba(255, 43, 61, 0.14);
  --border-strong: rgba(255, 43, 61, 0.45);
  --accent: #ff2b3d;
  --accent-soft: #ff6b78;
  --accent-dim: #2a1114;
  --track: #2a1114;
  --matrix-0: #1a1113;
  --matrix-1: #8a1622;
  --matrix-2: #b01a2a;
  --matrix-3: #d92a3c;
  --matrix-4: #ff4d5e;
  --matrix-5: #ff9aa3;
  --series-red: #ff2b3d;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --glow: 0 0 24px rgba(255, 43, 61, 0.18);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 43, 61, 0.10), transparent 55%),
    var(--page);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(200, 16, 46, 0.07), transparent 55%),
    var(--page);
}

a {
  color: inherit;
  text-decoration-color: var(--axis);
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow.accent { color: var(--accent); }

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

:root[data-theme="dark"] h1,
:root:where(:not([data-theme="light"])) h1 {
  text-shadow: 0 0 28px rgba(255, 43, 61, 0.22);
}

h2 {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h2::before {
  content: "// ";
  color: var(--accent);
}

.asof, .sub {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.label {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */

.card, .hero-figure, .share-card, .kpi {
  position: relative;
  background:
    linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card {
  padding: 18px 20px;
  margin-bottom: 16px;
}

.matrix-card {
  overflow: hidden;
  border-top: 2px solid var(--accent);
  box-shadow: var(--glow), var(--shadow);
}

.matrix-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(680px 240px at 16% 0%, rgba(255, 43, 61, 0.10), transparent 70%);
}

.matrix-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.018) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.55;
}

.matrix-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

.matrix-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.matrix-side {
  min-width: 0;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.matrix-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.matrix-head h2 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
}

.matrix-head .sub { max-width: 48ch; }

.matrix-total { text-align: right; flex: none; }

.matrix-total-value {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-shadow: 0 0 20px rgba(255, 43, 61, 0.28);
}

.matrix-scroll {
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: var(--accent-dim) var(--surface-1);
}

#matrix {
  display: block;
  width: 100%;
  height: auto;
  min-width: 760px;
  overflow: visible;
}

.matrix-cell {
  stroke: none;
  transition: opacity 120ms ease;
}

.matrix-cell:hover,
.matrix-cell:focus-visible {
  stroke: var(--ink);
  stroke-width: 1.5;
  outline: none;
}

.matrix-cell[data-level="5"] {
  filter: drop-shadow(0 0 3px rgba(255, 43, 61, 0.45));
}

.matrix-month,
.matrix-weekday {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.matrix-month { text-transform: uppercase; }

.matrix-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.matrix-stat .k {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-stat .v {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.matrix-stat .m {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.matrix-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.matrix-legend {
  margin: 0;
  gap: 5px;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex: none;
}

.matrix-tooltip { position: absolute; top: 10px; left: 10px; }

/* --------------------------------------------------------------------------
   Project ranking
   -------------------------------------------------------------------------- */

.side-head h2 { color: var(--ink); }

.project-ranking {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.project-row {
  display: grid;
  grid-template-columns: 18px 26px minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
}

.project-rank {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.project-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  overflow: hidden;
  border-radius: 6px;
}

.project-icon.fallback {
  border: 1px solid var(--border-strong);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 10px rgba(255, 43, 61, 0.12);
}

.project-favicon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.repo-name .project-icon {
  width: 20px;
  height: 20px;
}

.repo-name .project-favicon {
  width: 16px;
  height: 16px;
}

.project-body { min-width: 0; }

.project-name {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.project-label {
  overflow-wrap: anywhere;
  white-space: normal;
}

.project-meta {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-count {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.project-bar-track {
  grid-column: 2 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--track);
}

.project-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(255, 43, 61, 0.45);
}

.side-note { margin-top: 14px; font-size: 11px; }

.side-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.side-link:hover { color: var(--accent-soft); }

/* --------------------------------------------------------------------------
   Hero figures and KPIs
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hero-figure, .share-card { padding: 20px 22px; }

.hero-figure .value {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 54px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-periods {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page);
}

.share-periods button {
  padding: 3px 7px;
  font-size: 9px;
}

.share-value {
  margin: 6px 0 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-shadow: 0 0 18px rgba(255, 43, 61, 0.22);
}

.share-prior { margin-top: 7px; font-size: 11px; }

.meter {
  position: relative;
  height: 9px;
  margin: 13px 0 8px;
}

.meter-track, .meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 5px;
}

.meter-track { width: 100%; background: var(--track); }

.meter-fill {
  width: 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 12px rgba(255, 43, 61, 0.35);
  transition: width 300ms ease;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi { padding: 13px 15px; }

.kpi .label { font-size: 9px; }

.kpi .value {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.kpi .sub { margin-top: 2px; font-size: 11px; }

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--page);
}

button {
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover { color: var(--ink); background: var(--accent-dim); }

button.active,
button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--surface-1);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.ghost {
  border: 1px solid var(--border);
  background: var(--surface-1);
}

.ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--accent);
  font-size: 15px;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Legends and charts
   -------------------------------------------------------------------------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 14px 0 4px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 2px;
  background: var(--swatch, var(--series-1));
}

.chart-wrap {
  position: relative;
  width: 100%;
  margin-top: 6px;
}

#chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
  overflow: visible;
}

.chart-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart-tick { fill: var(--muted); font-family: var(--mono); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-hit:focus-visible { outline: none; stroke: var(--accent); stroke-width: 1.5; }

.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 168px;
  max-width: 260px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--ink);
  box-shadow: var(--shadow), 0 0 20px rgba(255, 43, 61, 0.10);
  font-size: 12px;
  pointer-events: none;
}

.tooltip .tip-date {
  margin-bottom: 6px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tooltip .tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tooltip .tip-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.tooltip .tip-value {
  color: var(--ink);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tooltip .tip-key {
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-view {
  max-height: 340px;
  margin-top: 14px;
  overflow: auto;
  scrollbar-color: var(--accent-dim) var(--surface-1);
}

table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11px; }

th, td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--grid);
  text-align: right;
  white-space: nowrap;
}

th:first-child, td:first-child { text-align: left; }

th {
  position: sticky;
  top: 0;
  background: var(--surface-1);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
td:first-child { color: var(--ink); }
.table-scroll-note { margin-top: 6px; color: var(--muted); font-size: 10px; }

/* --------------------------------------------------------------------------
   Two-column panels
   -------------------------------------------------------------------------- */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  gap: 8px 14px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--grid);
}

.identity-row:last-child { border-bottom: 0; }

.identity-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.identity-name .identity-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-stat {
  color: var(--ink-2);
  font-family: var(--mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.identity-stat .n { color: var(--ink); font-weight: 600; }
.identity-stat .k { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }

.identity-head {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--grid);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.bots { margin-top: 14px; }
.bots summary { cursor: pointer; color: var(--accent); font-family: var(--mono); font-size: 11px; }
.bots .identity-row { padding: 7px 0; }

.repo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--grid);
}

.repo-row:last-child { border-bottom: 0; }

.repo-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 550;
}

.repo-name .repo-label {
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.25;
}

.repo-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.repo-count {
  color: var(--ink);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.repo-bar-track {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--track);
}

.repo-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 6px rgba(255, 43, 61, 0.30);
}

/* --------------------------------------------------------------------------
   Recent and status
   -------------------------------------------------------------------------- */

.recent { margin: 6px 0 0; padding: 0; list-style: none; }

.recent li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--grid);
}

.recent li:last-child { border-bottom: 0; }

.recent .dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 8px var(--swatch);
}

.recent .msg { margin: 0; color: var(--ink); }
.recent .meta { margin: 2px 0 0; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.recent .when { color: var(--muted); font-family: var(--mono); font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recent .sha { color: var(--muted); font-family: var(--mono); font-size: 10px; }

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

.status-grid .kpi { padding: 10px 12px; }
.status-grid .kpi .value { font-size: 18px; }

.notice {
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-1);
}

.method { margin-top: 10px; color: var(--ink-2); font-size: 12px; }
.method summary { cursor: pointer; color: var(--accent); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.method p { max-width: 78ch; }

.errors {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 11px;
}

.errors li { margin: 2px 0; overflow-wrap: anywhere; }

.loading { opacity: 0.55; transition: opacity 150ms ease; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .matrix-layout { grid-template-columns: 1fr; }
  .matrix-side {
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .project-ranking {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 20px;
  }
}

@media (max-width: 860px) {
  .hero, .two-col { grid-template-columns: 1fr; }
  .kpis, .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-figure .value { font-size: 44px; }
}

@media (max-width: 620px) {
  .page { padding: 20px 14px 48px; }
  .kpis, .status-grid { grid-template-columns: 1fr; }
  .card-head { flex-direction: column; }
  .matrix-head { flex-direction: column; }
  .matrix-total { text-align: left; }
  .matrix-foot { flex-direction: column; align-items: flex-start; }
  .project-ranking { grid-template-columns: 1fr; }
  .identity-row { grid-template-columns: minmax(0, 1fr) auto; }
  .share-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media print {
  :root { --page: #ffffff; --surface-1: #ffffff; --surface-2: #ffffff; }
  .controls, .icon-button, .side-link { display: none; }
  .card, .hero-figure, .share-card { break-inside: avoid; box-shadow: none; }
}
