/* ============================================================================================
   dashboard-kit -- shared visual language for this portfolio's AI-agent dashboards
   (ci-triage-dashboard today; loadtest-dashboard is the next to adopt it).

   What's SHARED (copy this file as-is into a new dashboard): the token *names*, the header/footer
   layout (gradient hairline, brand block, repo-switch dropdown, theme toggle), every component
   below "COMPONENTS". What's PER-APP (edit these before shipping a new dashboard): the --accent
   value and the header's brand mark/icon/wordmark -- each dashboard keeps its own identity color
   while using an identical structural system, and the shared hairline treatment is what makes two
   different-colored dashboards still read as the same family on sight. ci-triage-dashboard's
   accent is a violet distinct from any categorical slot, on purpose -- see FailureCategories.java's
   javadoc: category color is identity, and an accent color that doubled as a category would blur
   that (buttons/active-states/the hairline would start meaning "assertion failure" by association).

   Categorical/status palette below is unchanged from the dataviz-skill-validated reference order
   already used across both dashboards -- this file only elevates chrome, layout, and typography
   around it, never the data-color system itself. */

:root {
  color-scheme: light;

  /* -- App accent (PER-APP: change this block for a new dashboard) -- */
  --accent: #6552d0;
  --accent-wash: rgba(101, 82, 208, 0.10);
  --accent-strong: #4f3fb0;

  /* -- Surfaces -- */
  --page-plane: #f7f6f4;
  --surface-1: #ffffff;
  --surface-2: #f1efec;

  /* -- Mesh wash: two stops of --accent only, never a category color (see this file's header
     comment on why --accent stays out of the categorical slots) -- fixed behind the whole page,
     not just the hero, so the product reads as "one designed surface" from the first scroll
     instead of a flat gray plane with one decorated card at the top. SHARED as token names; the
     values just track --accent/--accent-strong so a new dashboard inherits this for free. -- */
  --mesh-1: rgba(101, 82, 208, 0.08);
  --mesh-2: rgba(79, 63, 176, 0.05);

  /* -- Ink -- */
  --text-primary: #17161c;
  --text-secondary: #55535f;
  --text-muted: #8b8993;

  /* -- Structure -- */
  --gridline: #e7e5e1;
  --baseline: #cfcdc7;
  --border: rgba(23, 22, 28, 0.09);
  --border-strong: rgba(23, 22, 28, 0.14);

  /* -- Elevation -- */
  --shadow-sm: 0 1px 2px rgba(23, 22, 28, 0.05);
  --shadow-md: 0 1px 2px rgba(23, 22, 28, 0.04), 0 12px 28px -12px rgba(23, 22, 28, 0.16);
  --shadow-lg: 0 4px 10px -2px rgba(23, 22, 28, 0.10), 0 24px 48px -16px rgba(23, 22, 28, 0.22);

  /* -- Categorical (dataviz-skill reference order, slots 1-7 in use) -- */
  --cat-1: #2a78d6;
  --cat-2: #eb6834;
  --cat-3: #1baf7a;
  --cat-4: #eda100;
  --cat-5: #e87ba4;
  --cat-6: #008300;
  --cat-7: #4a3aa7;

  /* -- Status (fixed, never themed) -- */
  --status-good: #0ca30c;
  --status-good-wash: rgba(12, 163, 12, 0.12);
  --status-warning: #b8790a;
  --status-warning-wash: rgba(250, 178, 25, 0.18);
  --status-critical: #d03b3b;
  --status-critical-wash: rgba(208, 59, 59, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #8b7ef0;
    --accent-wash: rgba(139, 126, 240, 0.16);
    --accent-strong: #a79cf5;

    --page-plane: #0b0b0d;
    --surface-1: #17161b;
    --surface-2: #1e1d23;
    --mesh-1: rgba(139, 126, 240, 0.10);
    --mesh-2: rgba(167, 156, 245, 0.05);

    --text-primary: #f5f4f7;
    --text-secondary: #c2bfc9;
    --text-muted: #8b8993;

    --gridline: #2b2a30;
    --baseline: #3a3940;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -12px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 4px 10px -2px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.6);

    --cat-1: #3987e5;
    --cat-2: #d95926;
    --cat-3: #199e70;
    --cat-4: #c98500;
    --cat-5: #d55181;
    --cat-6: #1a9c1a;
    --cat-7: #9085e9;

    --status-good: #0ca30c;
    --status-good-wash: rgba(12, 163, 12, 0.18);
    --status-warning: #fab219;
    --status-warning-wash: rgba(250, 178, 25, 0.22);
    --status-critical: #e66767;
    --status-critical-wash: rgba(230, 103, 103, 0.18);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #8b7ef0;
  --accent-wash: rgba(139, 126, 240, 0.16);
  --accent-strong: #a79cf5;
  --page-plane: #0b0b0d;
  --surface-1: #17161b;
  --surface-2: #1e1d23;
  --mesh-1: rgba(139, 126, 240, 0.10);
  --mesh-2: rgba(167, 156, 245, 0.05);
  --text-primary: #f5f4f7;
  --text-secondary: #c2bfc9;
  --text-muted: #8b8993;
  --gridline: #2b2a30;
  --baseline: #3a3940;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 4px 10px -2px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.6);
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
  --cat-5: #d55181; --cat-6: #1a9c1a; --cat-7: #9085e9;
  --status-good: #0ca30c; --status-good-wash: rgba(12, 163, 12, 0.18);
  --status-warning: #fab219; --status-warning-wash: rgba(250, 178, 25, 0.22);
  --status-critical: #e66767; --status-critical-wash: rgba(230, 103, 103, 0.18);
}

/* ============================================================================================
   BASE
   ============================================================================================ */

* { box-sizing: border-box; }

html { color-scheme: light; }

/* Two soft accent-only radial washes, fixed to the viewport so they don't scroll away or repeat
   per-page-length -- the "one designed surface" texture behind every card, not a flat plane with
   one decorated hero at the top. Sits behind body's own background-color via z-index, so text and
   cards (both painted on opaque --surface-1) are unaffected -- this is chrome, not a readability
   risk. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px circle at 12% -8%, var(--mesh-1), transparent 55%),
    radial-gradient(700px circle at 100% 18%, var(--mesh-2), transparent 50%);
}

body {
  margin: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font: 15px/1.6 "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

svg { display: block; }

/* ============================================================================================
   SITE HEADER / FOOTER -- a top bar, not a permanent sidebar. A repo-switching sidebar was tried
   and reverted: with only a handful of repos, a permanent ~250px column cost more space than it
   earned, and returning to the index to pick a different repo is the intended flow anyway (see
   DashboardController's javadoc) -- the header's dropdown covers the "I don't want to scroll back
   up" case without reserving space for it on every page. The gradient hairline is this project's
   half of a shared brand signature with loadtest-dashboard's header (same treatment, each app's
   own --accent) -- see this file's header comment for what's meant to port between the two.
   ============================================================================================ */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}
.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
}
.site-header-inner {
  max-width: 1120px; margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.brand-block { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18.5px; letter-spacing: -0.015em; color: var(--text-primary);
}
.brand:hover { text-decoration: none; }
.brand svg.brand-mark { flex: none; filter: drop-shadow(0 2px 5px var(--accent-wash)); }
.brand .brand-suffix { color: var(--text-muted); font-weight: 500; }
.tagline { font-size: 13px; color: var(--text-muted); padding-left: 12px; border-left: 1px solid var(--border); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.repo-switch {
  font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary);
  max-width: 220px;
}
.repo-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-secondary); font: inherit; font-size: 12.5px; cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text-primary); }
.theme-toggle svg { flex: none; }

.site-footer { border-top: 1px solid var(--border); margin-top: 48px; }
.site-footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 20px 32px 32px;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-muted);
}
.site-footer-inner a { color: var(--text-secondary); font-weight: 500; }
.site-footer-inner a:hover { color: var(--accent); }

.container { max-width: 1120px; margin: 0 auto; padding: 40px 32px 56px; }

/* ============================================================================================
   TYPOGRAPHY HELPERS
   ============================================================================================ */

.eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-strong); }
.page-title { margin: 4px 0 0; font-size: 34px; font-weight: 800; letter-spacing: -0.025em; color: var(--text-primary); }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-secondary); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); }

/* ============================================================================================
   MOTION -- entrance rise for the page's top-level blocks, disabled under reduced-motion.
   ============================================================================================ */

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero, .overview-strip, .card { animation: rise-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .hero, .overview-strip, .card { animation: none !important; }
}

/* ============================================================================================
   HERO -- the page's opening block (repo/detail headers). A soft radial accent wash instead of
   a flat card, so the top of every page has one confident visual moment instead of reading as
   another gray box in a stack of gray boxes.
   ============================================================================================ */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 34px 36px;
  margin-bottom: 22px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px circle at 88% -16%, var(--accent-wash), transparent 60%),
    radial-gradient(360px circle at -6% 118%, var(--accent-wash), transparent 55%);
  pointer-events: none;
}
/* Faint dot grid, accent-tinted, fading out toward the card's own corners -- a texture cue
   ("this is a designed surface") rather than a decoration that competes with the content sitting
   on top of it. Sized in a CSS var so it can be nudged per-app without hunting the gradient math. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 30%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(480px circle at 88% -16%, black, transparent 70%);
  mask-image: radial-gradient(480px circle at 88% -16%, black, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.hero > * { position: relative; }

/* ============================================================================================
   COMPONENTS
   ============================================================================================ */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
  margin-bottom: 20px;
}

.card h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
/* Small colored tick ahead of every section heading -- one recurring, low-cost accent touch that
   ties every card back to the product's own color rather than leaving every heading flat gray. */
.card h2::before {
  content: "";
  width: 3px; height: 12px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

/* Two panels that each summarize a small amount of data (a donut + legend, a short list) --
   neither earns a full 1120px row on its own. auto-fit collapses the unused track when only one
   of the two th:unless blocks renders, so a lone panel still stretches to fill the row instead of
   leaving dead space beside it. */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; margin-bottom: 20px; }
.panel-grid > .card { margin-bottom: 0; }

.overview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.overview-strip .stat-tile { background: var(--surface-1); padding: 22px 24px; margin: 0; }
.stat-tile-top { display: flex; align-items: center; justify-content: space-between; }
.stat-tile .icon-badge {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-wash); color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.stat-tile .icon-badge svg { width: 15px; height: 15px; }
.stat-tile.stat-tile-critical .icon-badge { background: var(--status-critical-wash); color: var(--status-critical); }
.stat-tile.stat-tile-warning .icon-badge { background: var(--status-warning-wash); color: var(--status-warning); }
.stat-tile .label { color: var(--text-muted); font-size: 12px; }
.stat-tile .value { font-size: 34px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* -- Stat-tile trend: 14-day sparkline + delta chip, see DashboardQueryService#runTrend for how
   the polyline points and delta% are computed server-side. Only the "Triage runs" tile carries
   one today -- the other two KPIs don't have their own time series yet. -- */
.stat-tile-trend { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.sparkline { width: 100%; max-width: 96px; height: 30px; flex: 1; overflow: visible; }
.sparkline polyline { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trend-chip {
  flex: none; display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.trend-chip.up { color: var(--status-good); background: var(--status-good-wash); }
.trend-chip.down { color: var(--status-critical); background: var(--status-critical-wash); }
.trend-chip.flat { color: var(--text-muted); background: var(--surface-2); }

/* -- Filters -- */

.filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filters .field { display: flex; align-items: center; gap: 8px; }
.filters label { color: var(--text-muted); font-size: 13px; }
.filters select {
  font: inherit;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
}
.filters select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* -- Table -- */

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--gridline); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr.run-row:hover td { background: var(--surface-2); }
tr.run-row td:first-child { font-weight: 600; }

.run-time { white-space: nowrap; }
.run-time .relative { color: var(--text-primary); }
.run-time .absolute { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 1px; }

.summary-preview {
  color: var(--text-secondary);
  max-width: 360px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -- Badges & chips -- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.good { color: var(--status-good); background: var(--status-good-wash); }
.badge.critical { color: var(--status-critical); background: var(--status-critical-wash); }

.category-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-secondary); white-space: nowrap;
}
.category-badge .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.badge-group { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-more { font-size: 12px; color: var(--text-muted); align-self: center; }

.cat-1 { background: var(--cat-1); } .cat-2 { background: var(--cat-2); }
.cat-3 { background: var(--cat-3); } .cat-4 { background: var(--cat-4); }
.cat-5 { background: var(--cat-5); } .cat-6 { background: var(--cat-6); }
.cat-7 { background: var(--cat-7); }

/* A second, non-color channel for category identity: the icon's own color (set inline per-row,
   see repo.html/detail.html/index.html) so shape distinguishes categories even in grayscale. */
.cat-icon { width: 14px; height: 14px; flex: none; }
.category-badge .cat-icon { width: 13px; height: 13px; }

.icon-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.icon-chip svg { flex: none; }
.icon-chip.recurring { color: var(--status-warning); background: var(--status-warning-wash); }
.icon-chip.first-seen { color: var(--text-muted); background: var(--surface-2); }

/* -- Category donut -- the repo dashboard's centerpiece: a conic-gradient ring (the exact
   percentage boundaries are computed server-side, see DashboardQueryService#donutGradient, since
   Thymeleaf can't accumulate a running total across a th:each) with a legend beside it. Same
   category colors as the bar chart elsewhere -- this is a second view of the same data, not a
   second data-color system. ------------------------------------------------------------------- */

.donut-wrap { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.donut {
  position: relative; width: 184px; height: 184px; border-radius: 50%; flex: none;
  filter: drop-shadow(0 8px 20px var(--accent-wash));
  animation: pop-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 0.1s;
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .donut { animation: none; } }
.donut-hole {
  position: absolute; inset: 26px; border-radius: 50%; background: var(--surface-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow-sm);
}
.donut-hole .num { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.donut-hole .label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.donut-legend { display: flex; flex-direction: column; gap: 11px; flex: 1; min-width: 220px; }
.donut-legend-row { display: flex; align-items: center; gap: 10px; }
.donut-legend-row .name { flex: 1; font-size: 13.5px; color: var(--text-secondary); }
.donut-legend-row .count { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.donut-legend-row .pct { color: var(--text-muted); font-size: 12px; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* -- Recurring-failures list -- */

.recurring-list { display: flex; flex-direction: column; }
.recurring-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--gridline); }
.recurring-item:last-child { border-bottom: none; }
.recurring-item .title { font-weight: 600; font-size: 13.5px; }
.recurring-item .meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.recurring-count {
  flex: none; font-weight: 700; font-size: 13px; color: var(--status-warning);
  background: var(--status-warning-wash); border-radius: 999px; padding: 4px 12px;
}

/* -- Repo index (landing page) -- a card grid, not a plain list row: this is the first thing
   anyone sees, so it's the one place worth spending extra visual weight per item rather than
   optimizing for density. Falls back to one column below ~520px in a card's own width. -- */

.repo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.repo-item {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 22px; color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface-1);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.repo-item:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.repo-item-name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.005em; }
.repo-item-meta { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
.repo-item-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(155deg, var(--accent), var(--accent-strong)); color: #fff;
  box-shadow: 0 4px 10px -3px var(--accent-wash);
  display: flex; align-items: center; justify-content: center;
}
.repo-item-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.repo-item-body { min-width: 0; flex: 1; }
.repo-item .category-badge { align-self: flex-start; }

/* -- Detail page -- */

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.detail-header .meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.detail-header .meta code { font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.detail-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-secondary);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--surface-2); color: var(--text-primary); text-decoration: none; }
.btn.btn-accent {
  background: linear-gradient(155deg, var(--accent), var(--accent-strong));
  border-color: var(--accent-strong); color: #fff;
  box-shadow: 0 4px 12px -4px var(--accent-wash), var(--shadow-sm);
}
.btn.btn-accent:hover { filter: brightness(1.08); }

.narrative-card { border-left: 3px solid var(--accent); padding-left: 22px; }
.narrative-card .kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; margin-bottom: 10px; }
.narrative-card .body { font-size: 15.5px; line-height: 1.75; color: var(--text-primary); white-space: pre-wrap; }

.fix-card { background: var(--surface-2); border-radius: 12px; padding: 17px 19px; margin-top: 18px; }
.fix-card .kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; margin-bottom: 7px; }
.fix-card .body { font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; }

.category-mix { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--gridline); }
.category-mix .label { font-size: 12.5px; color: var(--text-muted); margin-right: 4px; }

.signal-card { border: 1px solid var(--border); border-radius: 12px; padding: 17px 19px; margin-bottom: 12px; transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease; }
.signal-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.signal-card:last-child { margin-bottom: 0; }
.signal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.signal-title { font-weight: 600; font-size: 14.5px; }
.signal-location { color: var(--text-muted); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.signal-badges { display: flex; align-items: center; gap: 8px; flex: none; }
.signal-message { margin-top: 11px; font-size: 13.5px; color: var(--text-secondary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.6; }

.signal-card details { margin-top: 11px; }
.signal-card summary { cursor: pointer; font-size: 12.5px; color: var(--text-muted); user-select: none; }
.signal-card summary:hover { color: var(--accent); }
.signal-card pre {
  margin: 10px 0 0; padding: 13px 15px; background: var(--surface-2); border-radius: 10px;
  font-size: 12.5px; line-height: 1.55; overflow-x: auto; color: var(--text-secondary);
  max-height: 360px; overflow-y: auto;
}

/* -- Misc -- */

.pagination { display: flex; gap: 12px; margin-top: 18px; font-size: 13px; color: var(--text-muted); align-items: center; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); padding: 56px 20px; text-align: center; }
.empty-state svg { color: var(--text-muted); opacity: 0.6; }
.empty-state code { background: var(--surface-2); padding: 2px 7px; border-radius: 5px; font-size: 12.5px; }

/* ============================================================================================
   RESPONSIVE
   ============================================================================================ */

@media (max-width: 760px) {
  .site-header-inner { padding: 14px 18px; }
  .tagline { display: none; }
  .repo-switch { max-width: 150px; }
  .container { padding: 24px 18px 48px; }
  .site-footer-inner { padding: 18px 18px 28px; }
}
