/* ---------- Theme tokens ---------- */
:root {
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "IBM Plex Sans", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 920px;
  --page-pad: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;
  --transition: 0.25s ease;
}

:root[data-theme="light"] {
  --bg: #fbfbfa;
  --bg-soft: #f3f4f1;
  --surface: #ffffff;
  --border: #e4e4dd;
  --border-strong: #d2d3ca;
  --text: #1a1a17;
  --text-soft: #5b5d57;
  --text-faint: #8a8c84;
  --accent: #047857;
  --accent-soft: rgba(4, 120, 87, 0.08);
  --shadow: 0 1px 2px rgba(20, 22, 18, 0.04), 0 8px 28px rgba(20, 22, 18, 0.06);
  --row-hover: #f6f7f3;
}

:root[data-theme="dark"] {
  --bg: #0b0f14;
  --bg-soft: #11161d;
  --surface: #131922;
  --border: #232c38;
  --border-strong: #313c4b;
  --text: #e8edf2;
  --text-soft: #a3adba;
  --text-faint: #6f7b8a;
  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --row-hover: #18202a;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0 var(--page-pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: calc(var(--maxw) - var(--page-pad) - var(--page-pad));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 52px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  font-weight: 600;
}

.brand-logo {
  width: 22px;
  height: 22px;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.6rem, 2vw, 1.2rem);
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  font-size: 0.85rem;
  font-weight: 500;
  -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  color: var(--text-soft);
  flex: 0 0 auto;
  white-space: nowrap;
  transition: color var(--transition);
}

.nav a:hover {
  color: var(--text);
}

.nav-cta {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text) !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  transition: color var(--transition);
}

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

.nav-glyph {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* arXiv mark keeps its brand colors; size to nav text height. */
.nav-glyph--arxiv {
  width: auto;
  height: 15px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-icon {
  gap: 0.5rem;
}

.btn-glyph--arxiv {
  width: auto;
  height: 1.05em;
}

:root[data-theme="dark"] .icon-sun {
  display: none;
}

:root[data-theme="light"] .icon-moon {
  display: none;
}

/* ---------- Layout ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.hero-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 2.5vw, 1.4rem);
  flex-wrap: wrap;
}

.hero-logo {
  width: clamp(46px, 9vw, 68px);
  height: clamp(46px, 9vw, 68px);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.18));
}

.hero-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.4rem, 7.5vw, 4rem);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}

/* ---- Typewriter ---- */
.type-box {
  display: inline-flex;
  align-items: baseline;
  text-align: left;
}

.type-text {
  white-space: nowrap;
}

/* Hide the title until the typing script reveals it (prevents a flash of the
   full word). Only active when the animation will run. */
.will-type .type-text {
  visibility: hidden;
}

.type-caret {
  display: none;
}

.will-type .type-caret {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  margin-left: 0.02em;
  /* Fast blink before typing; JS slows it to 1.05s once typing starts. */
  animation: caret-blink 0.36s steps(1, end) infinite;
}

.will-type .type-caret::before {
  content: "_";
}

@keyframes caret-blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  font-weight: 400;
  color: var(--text-soft);
  margin: 1.4rem auto 0;
  max-width: 34ch;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.hero-subtitle .tua {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Authors ---------- */
.authors {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.05rem;
  max-width: 56ch;
  margin: 2rem auto 0;
  padding: 0;
  font-size: 1.02rem;
  color: var(--text);
}

.authors li {
  white-space: nowrap;
}

.authors a {
  border-radius: 0.25rem;
  padding: 0.05rem 0.18rem;
  transition: background-color var(--transition), color var(--transition);
}

.authors a:hover,
.authors a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.authors sup,
.affiliations sup,
.equal-contrib sup {
  color: var(--accent);
  font-size: 0.66em;
  padding-left: 0.05em;
}

.affiliations {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin: 1rem auto 0;
  padding: 0;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.affiliations li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.affil-logo {
  height: 16px;
  width: auto;
  display: block;
}

.equal-contrib {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), color var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

:root[data-theme="dark"] .btn-primary {
  color: #04140d;
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-top: 1px solid var(--border);
}

/* Only the table breaks out of the text column so all columns fit by default;
   it falls back to horizontal scroll once the viewport is too narrow.
   The heading and description stay at the normal text width. */
.table-wrap {
  width: min(1200px, calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
}

.section-head {
  margin-bottom: 1.8rem;
}

.section-head h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.45rem, 4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.4rem;
}

.section-sub {
  color: var(--text-soft);
  margin: 0;
  max-width: none;
}

/* ---------- Leaderboard ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.leaderboard thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 1rem 1.1rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.leaderboard tbody td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}

.leaderboard tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard tbody tr {
  transition: background var(--transition);
}

.leaderboard tbody tr:hover {
  background: var(--row-hover);
}

.lb-row[data-href] {
  cursor: pointer;
}

.row-link {
  color: inherit;
}

.row-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.col-go .row-link {
  display: inline-flex;
}

/* Chevron affordance: muted, brightens on row hover. */
.col-go {
  width: 1.6rem;
  text-align: center;
  color: var(--text-faint);
  transition: color var(--transition), transform var(--transition);
}

.lb-row:hover .col-go {
  color: var(--accent);
}

.col-go svg {
  display: inline-block;
  vertical-align: middle;
}

.col-rank {
  width: 3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.col-agent {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.model-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.model-logo {
  height: 16px;
  width: 16px;
  flex-shrink: 0;
}

/* currentColor logos (OpenAI, Z.ai) follow the text color in both themes. */
.model-logo--adaptive {
  color: var(--text);
}

.col-model code,
.col-think code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text);
  background: var(--accent-soft);
  padding: 0.1em 0.45em;
  border-radius: 5px;
  white-space: nowrap;
}

.col-think code {
  background: transparent;
  color: var(--text-soft);
  padding: 0;
}

.col-score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}

.col-score strong {
  color: var(--accent);
}

.col-score .pm {
  color: var(--text-faint);
  font-weight: 400;
}

.col-score strong .pm {
  color: var(--accent);
  opacity: 0.7;
}

.lb-loading {
  text-align: center;
  color: var(--text-faint);
  padding: 2rem 1rem;
}

.medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #3a2e00;
}

.medal.gold {
  background: linear-gradient(145deg, #ffe27a, #e0a528);
}
.medal.silver {
  background: linear-gradient(145deg, #eef1f4, #b6bcc4);
}
.medal.bronze {
  background: linear-gradient(145deg, #f0c08a, #c07d3a);
  color: #3a1f00;
}

.table-note {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- Prose ---------- */
.prose {
  max-width: none;
  color: var(--text-soft);
  font-size: 1.02rem;
}

.prose strong {
  color: var(--text);
}

/* ---------- Citation ---------- */
.citation-block {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  white-space: pre;
}

.citation-block code {
  font: inherit;
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem var(--page-pad) 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.86rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1.5rem;
}

.footer a {
  color: var(--text-soft);
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--accent);
}

/* ============ Detail page ============ */
.detail-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem var(--page-pad) 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color var(--transition);
}

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

.detail-head {
  margin: 1.5rem 0 2.5rem;
}

/* Grid: logo aligns with the title line (row 1); subtitle is a true second
   line (row 2) sitting directly under the title text (column 2). */
.detail-title {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  row-gap: 0.15rem;
  align-items: center;
  margin-bottom: 1.75rem;
}

.model-logo--lg {
  grid-column: 1;
  grid-row: 1;
  width: 40px;
  height: 40px;
  align-self: center;
}

.detail-title h1 {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

.detail-sub {
  grid-column: 2;
  grid-row: 2;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.detail-sub code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--accent-soft);
  padding: 0.1em 0.45em;
  border-radius: 5px;
  color: var(--text);
}

.metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.metric-card {
  flex: 1 1 auto;
  min-width: max-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}

.metric-value .pm {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 0.78em;
}

.metric-label {
  margin-top: 0.2rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  white-space: nowrap;
}

/* table header + legend row */
.detail-tablehead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  max-width: 980px;
  margin: 0 auto 1.2rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend .attempt {
  width: 16px;
  height: 14px;
}

/* attempt squares */
.attempts {
  display: inline-flex;
  gap: 4px;
}

.attempt {
  display: inline-block;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  background: var(--border-strong);
}

.attempt--pass {
  background: var(--accent);
}

.attempt--partial {
  background: #e0a528;
}

.attempt--fail {
  background: #d9534f;
}

.attempt--missing {
  background: transparent;
  border: 1px dashed var(--border-strong);
}

/* mean reward bar */
.meanbar {
  position: relative;
  height: 18px;
  width: 160px;
  max-width: 100%;
  background: var(--bg-soft);
  border-radius: 5px;
  overflow: hidden;
}

.meanbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #ffffff));
  border-radius: 5px 0 0 5px;
}

.meanbar-val {
  position: absolute;
  top: 0;
  right: 6px;
  line-height: 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* tasks table columns */
.tasks-table .col-task code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--text);
}

.tasks-table .col-cost {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  text-align: right;
  white-space: nowrap;
}

.tasks-table .col-mean {
  width: 180px;
}

/* The tasks table only has a few narrow columns, so size it to its content
   (centered) instead of inheriting the leaderboard's full-width breakout. */
.detail-tablewrap {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  transform: none;
}

.tasks-table {
  width: auto;
}

/* ============ Cost vs. Performance scatter ============ */
.chart-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.25rem clamp(0.75rem, 2vw, 1.5rem);
}

.scatter {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.scatter-plot {
  width: 100%;
  min-width: 0;
}

/* Let frontier annotations that sit above the top markers stay visible. */
.scatter-plot .main-svg {
  overflow: visible;
}

/* Legend: full width beneath the plot, one wrapping row per dimension
   (models, then agents). */
.scatter-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.legend-group {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.legend-head {
  flex: 0 0 auto;
  width: 3.4rem;
  padding-top: 0.22rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 600;
}

/* Items wrap within their own column so subsequent lines align under the
   first item, not under the Model/Agent title. */
.legend-items {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.45rem;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
}

.legend-item:hover {
  background: var(--row-hover);
  color: var(--text);
}

.legend-item.is-off {
  opacity: 0.4;
}

.legend-item.is-off .legend-swatch,
.legend-item.is-off .legend-shape {
  filter: grayscale(1);
}

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

.legend-shape {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-soft);
}

/* ============ Tasks page ============ */
.tasks-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--page-pad) 1rem;
}

.tasks-header h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}

.tasks-sub {
  color: var(--text-soft);
  max-width: none;
  margin: 0;
}

/* --- Controls (sticky under the top bar) --- */
.task-controls {
  position: sticky;
  top: 52px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.8rem 0 1rem;
  padding: 0.9rem 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
}

.task-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-faint);
  transition: border-color var(--transition);
}

.task-search:focus-within {
  border-color: var(--accent);
  color: var(--accent);
}

.task-search input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
}

.task-search input::placeholder {
  color: var(--text-faint);
}

.cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-filter {
  --cat: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.cat-filter:hover {
  border-color: var(--cat);
  color: var(--text);
}

.cat-filter .cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cat);
  flex-shrink: 0;
}

.cat-filter .cat-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.cat-filter.is-active {
  background: color-mix(in srgb, var(--cat) 16%, var(--surface));
  border-color: var(--cat);
  color: color-mix(in srgb, var(--cat) 55%, var(--text));
}

.cat-filter.is-active .cat-num {
  color: inherit;
}

.task-count {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin: 0 0 1rem;
}

/* --- Task list (accordion) --- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 2rem;
}

.task-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.task-card:hover {
  border-color: var(--border-strong);
}

.task-card.is-open {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.task-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: background var(--transition);
}

.task-head:hover {
  background: var(--row-hover);
}

.task-id {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: normal;
}

.task-sub {
  flex: 1;
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.task-chevron {
  color: var(--text-faint);
  flex-shrink: 0;
  margin-top: 0.1rem;
  transition: transform var(--transition), color var(--transition);
}

.task-card.is-open .task-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.task-body {
  border-top: 1px solid var(--border);
  padding: 1rem 1.1rem 1.2rem;
  background: var(--bg-soft);
}

.task-instructions {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* --- Capsule category tag --- */
.tag {
  --cat: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.22em 0.7em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--cat) 15%, var(--surface));
  color: color-mix(in srgb, var(--cat) 58%, var(--text));
  border: 1px solid color-mix(in srgb, var(--cat) 32%, transparent);
}

.tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cat);
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .nav {
    justify-content: flex-start;
  }

  .task-sub {
    display: none;
  }
  .task-id {
    flex: 1;
  }
}
