/* Design tokens and components follow the PinTool MM site (pintoolx/market-making frontend). */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("assets/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --ink: #0e0f28;
  --accent: #2050f2;
  --pink: #f22085;
  --bg: #e4eaf2;
  --panel: #edf1f7;
  --line: #abb8ce;
  --muted: #4c5870;
  --field-border: #8997ad;
  --good: #1f7a4d;
  --bad: #d0263a;
  --font: "Space Grotesk", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgb(32 80 242 / 0.2); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { position: relative; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate; }

/* Brand contour lines, strongest at the edges and fading out behind the content. */
.page::before {
  content: "";
  position: fixed;
  inset: -3%;
  z-index: -1;
  pointer-events: none;
  background: url("assets/hero.svg") center / cover no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 48%, rgb(0 0 0 / 0.35) 30%, #000 100%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 48%, rgb(0 0 0 / 0.35) 30%, #000 100%);
  animation: contourDrift 14s ease-in-out infinite alternate;
}
@keyframes contourDrift {
  from { transform: translate3d(-1.1%, -0.7%, 0) scale(1.01); }
  to { transform: translate3d(1.1%, 0.7%, 0) scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
  .page::before { animation: none; }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 24px max(48px, calc((100% - 1184px) / 2));
}
.logo { display: inline-flex; }
.logo img { display: block; max-width: 100%; height: auto; }
.updated { font-size: 13px; font-weight: 600; color: var(--muted); }

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(1184px + 96px);
  margin: 0 auto;
  padding: 8px 48px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.muted { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

.page-head { display: flex; flex-direction: column; gap: 12px; }
.page-head > .eyebrow { color: var(--accent); }
.page-head h1 { margin: 0; font-size: clamp(32px, 4vw, 44px); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; }
.page-head h1 span { display: block; color: var(--accent); }
.page-head p { margin: 4px 0 0; max-width: 62ch; color: var(--muted); }

.panel {
  min-width: 0;
  padding: 24px;
  border-radius: 16px;
  background: var(--panel);
  outline: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.panel h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.panel .muted { min-height: 1.6em; margin-bottom: 8px; }

.picker { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.field.grow { flex: 3 1 320px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.4 var(--font);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel);
  outline: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  min-width: 0;
}
.stat .value { font-size: 20px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.accent { background: var(--accent); color: #eef3fb; }
.stat.accent .eyebrow { color: #cbd8ff; }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #65738a;
  border-radius: 999px;
  background: #d9e2ee;
  font-size: 12px;
  font-weight: 600;
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.wide { grid-column: 1 / -1; }
/* Until a backtest adds its value chart, the range chart has the row to itself. */
#bt-charts:has(#bt-value-wrap[hidden]) > div { grid-column: 1 / -1; }
#bt-drag { margin: 8px 0 0; min-height: 1.5em; }
.chart { position: relative; height: 260px; }
.chart.tall { height: 380px; }

.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.ok { color: var(--good); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }

/* Same footer as the PinTool MM site: the divider spans only the content column. */
.footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 20px max(48px, calc((100% - 1184px) / 2));
  font: 500 13px/1.4 var(--font);
  color: var(--ink);
}
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: max(48px, calc((100% - 1184px) / 2));
  right: max(48px, calc((100% - 1184px) / 2));
  border-top: 1px solid var(--line);
}
.copyright { margin: 0; }
.links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.links a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.links a:hover { color: var(--accent); }
.social { display: inline-flex; }
.social svg { width: 16px; height: 16px; fill: currentColor; }

@media (max-width: 900px) {
  .header, .footer { padding-inline: 16px; }
  .footer::before { left: 16px; right: 16px; }
  main { padding-inline: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .header { padding-block: 16px; }
  .logo img { width: 135px; }
  .panel { padding: 16px; }
  .panel h2 { font-size: 18px; }
  .chart.tall { height: 440px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat .value { font-size: 16px; }
}

.backtest-form { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 16px; }
.backtest-form fieldset { display: flex; flex-wrap: wrap; gap: 16px; flex: 1 1 100%; min-width: 0; margin: 0; padding: 12px 0 0; border: 0; border-top: 2px solid var(--line); }
.backtest-form legend { padding: 0 12px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.secondary { display: inline-flex; align-items: center; padding: 8px 18px; border: 0; border-radius: 8px; outline: 2px solid var(--ink); background: var(--panel); color: var(--ink); font: 600 16px/1.2 var(--font); cursor: pointer; }
.secondary:hover { background: #fff; }
.apply { min-height: 32px; padding: 4px 0; border: 0; background: none; color: var(--accent); font: 600 14px/1.2 var(--font); text-decoration: underline; cursor: pointer; }
#bt-scan h3 { margin: 24px 0 4px; }
#bt-scan .notice { margin: 8px 0 12px; }
.backtest-form .field { flex: 0 1 240px; }
.backtest-form .field.wide { flex-basis: 340px; }
#backtest-result { margin-bottom: 16px; }
.stat.positive .value { color: var(--good); }
.stat.negative .value { color: var(--bad); }
.bad-text { color: var(--bad); }

.view { display: flex; flex-direction: column; gap: 24px; }

/* Segmented control, as the role tabs in the PinTool MM header. */
.segmented { display: inline-flex; align-self: flex-start; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 0 var(--ink); }
.segmented a, .segmented button { padding: 6px 14px; border: 0; background: var(--bg); color: var(--ink); font: 600 14px/1.2 var(--font); white-space: nowrap; text-decoration: none; cursor: pointer; }
.segmented > * + * { border-left: 2px solid var(--ink); }
.segmented a:not([aria-current="page"]):hover, .segmented button:not([aria-pressed="true"]):hover { background: #edf1f7; }
.segmented [aria-current="page"], .segmented [aria-pressed="true"] { background: var(--accent); color: #eef3fb; }
.segmented.range a, .segmented.range button { padding: 3px 10px; font-size: 13px; }
/* View switch in the header, as the role tabs in the PinTool MM header. */
.header .tabs { align-self: center; }
@media (max-width: 560px) {
  .header { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .header .tabs { width: 100%; gap: 8px; overflow: visible; border: 0; border-radius: 0; box-shadow: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header .tabs a { flex: 1; min-height: 44px; display: grid; place-items: center; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 2px 0 var(--ink); text-align: center; }
  .header .tabs > * + * { border-left: 2px solid var(--ink); }
}

.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }

/* Primary button, as in the PinTool MM site. */
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 18px; border: 0; border-radius: 8px; outline: 2px solid var(--ink);
  background: var(--accent); color: #fff; font: 600 16px/1.2 var(--font); cursor: pointer;
  filter: drop-shadow(0 2px 0 var(--ink)); transition: transform 80ms ease-out, filter 80ms ease-out;
}
.primary:hover { transform: translateY(-2px); filter: drop-shadow(0 4px 0 var(--ink)); }
.primary:active { transition-duration: 0ms; transform: translateY(1px); filter: drop-shadow(0 1px 0 var(--ink)); }

.backtest-cta { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.backtest-cta > div { display: flex; flex-direction: column; gap: 6px; flex: 1 1 320px; }
.backtest-cta .muted { min-height: 0; margin: 0; }

.steps { margin: 8px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 15px; }
.steps strong { color: var(--ink); }

[hidden] { display: none !important; }

.status-link { color: var(--muted); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); border: 1px solid var(--ink); }
.status-link.bad .dot { background: var(--bad); }
#now-table td { white-space: normal; vertical-align: top; }
#now-table td:nth-child(2) { min-width: 160px; }
#now-table a, .pool-card a, #fee-traps a, #better-venues a { color: var(--accent); text-underline-offset: 3px; }
.net-score { font-weight: 700; }
.risk-badge { position: relative; display: inline-block; padding: 2px 7px; margin-block: 2px; border: 1px solid #65738a; border-radius: 8px; background: #d9e2ee; font-size: 12px; cursor: help; }
.risk-badge [role="tooltip"] { display: none; position: absolute; z-index: 3; width: 200px; right: 0; bottom: 100%; padding: 10px; border: 1px solid var(--ink); border-radius: 8px; background: var(--panel); color: var(--ink); white-space: normal; }
.risk-badge:hover [role="tooltip"], .risk-badge:focus [role="tooltip"] { display: block; }
.now-cards { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.pool-card { padding-block: 18px; border-bottom: 1px solid var(--line); }
.pool-card:last-child { border-bottom: 0; }
.pool-card h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.pool-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0 0 12px; }
.pool-card dt { color: var(--muted); font-size: 12px; }
.pool-card dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
#fee-traps p, #better-venues p { overflow-wrap: anywhere; }
/* Tooltips stay inside the viewport and outside the table's scroll clipping. */
.risk-badge [role="tooltip"] { position: fixed; left: 50%; right: auto; bottom: 24px; transform: translateX(-50%); width: min(360px, calc(100vw - 48px)); font-size: 14px; }
@media (max-width: 750px) {
  #view-now .table-wrap { display: none; }
  .now-cards { display: block; }
  .ranking-filters { margin-bottom: 4px; }
  .ranking-filters .field { flex: 1 1 130px; }
  .ranking-filters .field:last-child { flex-basis: 100%; }
  .backtest-form .field { flex: 1 1 200px; }
}
@media (max-width: 560px) {
  .header { grid-template-columns: minmax(0, 1fr) auto; }
  .header .tabs { grid-column: 1 / -1; grid-row: 2; }
  .header .status-link { grid-column: 2; grid-row: 1; }
  #presets { display: flex; width: 100%; }
  #presets button { flex: 1; min-height: 44px; }
  #backtest-result .stat:last-child { grid-column: 1 / -1; }
}

@media (pointer: coarse) {
  .segmented.range button { min-height: 44px; }
}
#new-radar { margin-top: 16px; }
#new-radar summary { cursor: pointer; font-weight: 600; }

.ranking-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ranking-filters .field { min-width: 0; }
.ranking-filters input, .ranking-filters select { min-height: 44px; }
.secondary {
  align-self: flex-start; padding: 8px 16px; min-height: 44px;
  border: 0; border-radius: 8px; outline: 2px solid var(--ink);
  background: var(--bg); color: var(--ink); font: 700 15px/1.4 var(--font);
  cursor: pointer; filter: drop-shadow(0 2px 0 var(--ink));
  transition: transform 80ms ease-out, filter 80ms ease-out;
}
.secondary:hover { transform: translateY(-2px); filter: drop-shadow(0 4px 0 var(--ink)); }
.secondary:active { transform: none; background: var(--accent); color: #fff; }
@media (max-width: 900px) {
  .ranking-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #presets { flex-wrap: wrap; }
  #presets button { flex: 1 1 45%; }
  #presets button:nth-child(3) { border-left: 0; }
  #presets button:nth-child(n+3) { border-top: 2px solid var(--ink); }
  .ranking-filters { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* LP Atlas additions, built from the same tokens. */
a { color: var(--accent); text-underline-offset: 3px; }
.rows tbody tr { cursor: pointer; }
.rows tbody tr:hover { background: #e1e8f3; }
.rows td.num, .rows th.num { text-align: right; }
.rows td:first-child { white-space: normal; min-width: 200px; }
.chip.flag { border-color: var(--bad); color: var(--bad); background: #f6e4e6; cursor: help; }
.chip.accent { border-color: var(--accent); color: var(--accent); background: #e1e8fd; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 8px 0; align-items: end; }
.filters .check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; }
.filters .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pool-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pool-title h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.03em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.notice { padding: 12px 16px; border: 2px solid var(--bad); border-radius: 12px; background: #f6e4e6; font-size: 14px; }
.notice.info { border-color: var(--ink); background: var(--panel); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; margin: 4px 0 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.assume { margin: 8px 0 0; padding-left: 20px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.bar { display: flex; height: 14px; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--bg); }
.bar > span { display: block; height: 100%; background: var(--accent); }
.bar > span + span { background: var(--pink); }
.stat .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat.accent .sub { color: #cbd8ff; }
.asset-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.asset-head h2 span { color: var(--muted); font-weight: 500; font-size: 15px; }
.asset-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: var(--muted); }
.asset-facts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; font-weight: 600; }
@media (max-width: 560px) { .rows td:first-child { min-width: 150px; } }
summary.asset-head { list-style: none; }
summary.asset-head::-webkit-details-marker { display: none; }
summary.asset-head h2::before { content: "+"; display: inline-block; width: 1em; color: var(--accent); }
details[open] > summary.asset-head h2::before { content: "\2212"; }
details[open] > summary.asset-head { margin-bottom: 12px; }

/* Overview page */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.board h2 { font-size: 16px; }
.board ol { list-style: none; margin: 8px 0; padding: 0; }
.board li a { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.board li a:hover strong { text-decoration: underline; }
.board .rank { width: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.board .who { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 14px; }
.board .who .muted { font-size: 12px; }
.board .figure { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board .figure .ok { color: var(--good); }
.board .figure .bad { color: var(--bad); }
.board > .muted { font-size: 12px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chips button { min-height: 32px; padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink); font: 600 13px/1.2 var(--font); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ink); color: #eef3fb; }
.panel > .check { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; font-weight: 600; }
#home-table td:first-child { min-width: 0; white-space: nowrap; }
#home-table td:nth-child(2) { white-space: normal; min-width: 200px; }
.panel > .check input { width: 18px; height: 18px; accent-color: var(--accent); }
th button { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
th button:hover { color: var(--ink); text-decoration: underline; }
th[aria-sort] button { color: var(--ink); }
th[aria-sort="descending"] button::after { content: " \25BE"; }
th[aria-sort="ascending"] button::after { content: " \25B4"; }
.watch { min-height: 28px; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 6px; background: var(--panel); color: var(--ink); font: 600 12px/1.2 var(--font); cursor: pointer; }
.watch[aria-pressed="true"] { background: var(--ink); color: #eef3fb; }
@media (max-width: 560px) {
  .chips button, .watch { min-height: 40px; }
  /* The rankings become a row to swipe through, so the table is not four screens down. */
  .boards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 8px; }
  .board { scroll-snap-align: start; }
  #home-table td:nth-child(2) { min-width: 150px; }
}

/* Analyst page */
.backtest-form .field.note { flex: 1 1 100%; }
.trace { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trace li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.trace li.pending { color: var(--muted); border-style: dashed; }
.trace li.failed { border-color: var(--bad); }
.trace li.note { border: 0; padding: 2px 12px; color: var(--muted); font-style: italic; }
.trace .what { flex: 1 1 260px; min-width: 0; font-weight: 600; }
.trace .found { display: block; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.trace li.failed .found { color: var(--bad); }
.pick > p { margin: 12px 0 0; max-width: 78ch; }
.evidence-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 16px; }
.evidence { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.evidence h3 { margin: 0 0 8px; font-size: 14px; line-height: 1.35; }
/* Labels here run long, so each figure sits under its label instead of beside it. */
.evidence .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
.evidence .kv dd { margin-bottom: 8px; text-align: left; }
#an-brief { display: contents; }
.evidence a { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; }

/* Rating: a letter per question, on a fixed scale */
.grade { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 2px solid var(--ink); border-radius: 6px; font-weight: 700; font-size: 14px; line-height: 1; cursor: default; }
.grade.g-S { background: var(--accent); color: #fff; }
.grade.g-A { background: #d6efe0; color: var(--good); }
.grade.g-B { background: #e1e8fd; color: var(--accent); }
.grade.g-C { background: #fdf0cf; color: #6b4a00; }
.grade.g-D { background: #fbdfcf; color: #8a3500; }
.grade.g-F { background: #f6e4e6; color: var(--bad); }
.grade.none { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.rate-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 8px; }
.rate-head .grade { min-width: 52px; height: 52px; font-size: 28px; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.rate-head p { flex: 1 1 280px; margin: 0; }
.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; margin-top: 20px; }
.rate { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); min-width: 0; }
.rate h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.rate > .muted { margin: 6px 0 0; }
.rate-value { margin: 12px 0 0; font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rate-value span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.scale { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin: 12px 0; padding: 0; font-size: 10.5px; letter-spacing: -0.02em; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale li { padding: 4px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); white-space: nowrap; overflow: hidden; }
.scale b { display: block; font-size: 13px; color: var(--ink); }
.scale li.on { border: 2px solid var(--ink); color: var(--ink); font-weight: 700; }
.rate .kv { grid-template-columns: minmax(0, 1fr); gap: 0; font-size: 13px; }
.rate .kv dd { margin-bottom: 8px; text-align: left; }
.scale-note { margin: -6px 0 12px; font-size: 11px; color: var(--muted); }
.rate-sub { margin: 24px 0 8px; font-size: 14px; }
.checks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks .chip { flex: 0 0 auto; min-width: 62px; text-align: center; }
#home-table .grade { cursor: help; }

/* Protocols page */
#pr-table .expand { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; vertical-align: middle; }
#pr-table button.expand { border: 2px solid var(--ink); border-radius: 6px; background: var(--bg); color: var(--ink); font: 700 15px/1 var(--font); cursor: pointer; }
#pr-table tr.child td { background: var(--bg); font-size: 14px; }
#pr-table tr.child td:first-child { padding-left: 28px; }
#pr-table .grades { white-space: nowrap; }
#pr-table .grades .grade { min-width: 22px; height: 22px; font-size: 12px; }
#pr-table .grades .count { margin: 0 8px 0 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
table.rules td, table.rules th { vertical-align: top; min-width: 150px; font-size: 14px; line-height: 1.45; }
table.rules td:first-child { min-width: 130px; }
h3.pair { margin: 24px 0 0; font-size: 16px; }
#pr-pairs .table-wrap + h3.pair { margin-top: 28px; }
