:root {
  --ink: #14110f;
  --paper: #f4efe5;
  --paper-2: #e7ddca;
  --line: #2f2a24;
  --green: #116149;
  --red: #b7322c;
  --gold: #c58a1d;
  --blue: #254e7b;
  --muted: #6b6258;
  --shadow: 0 18px 60px rgba(35, 28, 20, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(20, 17, 15, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(20, 17, 15, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

button,
table {
  font: inherit;
}

.app-shell {
  width: min(1680px, calc(100% - 22px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 12px;
  margin: 0 auto;
  padding: 8px 0 32px;
}

.schedule-rail,
.panel,
.masthead,
.tabs {
  border: 2px solid var(--line);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.schedule-rail {
  position: sticky;
  top: 8px;
  height: calc(100vh - 16px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.rail-head,
.panel-head {
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
}

.download-btn {
  white-space: nowrap;
  letter-spacing: 0.06em;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.download-btn svg {
  width: 18px;
  height: 18px;
}

.download-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.download-btn:disabled {
  cursor: progress;
  opacity: 0.6;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--red);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 860px;
  font-size: clamp(40px, 5.2vw, 74px);
  line-height: 0.88;
}

h2 {
  font-size: 24px;
  line-height: 1;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.social-link {
  display: inline-grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 2px solid var(--line);
  background: rgba(255, 250, 240, 0.78);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.social-link:hover {
  background: var(--gold);
}

.social-link img {
  width: 18px;
  height: 18px;
}

.schedule-list {
  overflow-y: auto;
  padding: 6px;
}

.schedule-item {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  gap: 5px 8px;
  min-height: 48px;
  margin: 0 0 5px;
  padding: 7px;
  border: 1px solid rgba(47, 42, 36, 0.35);
  background: rgba(244, 239, 229, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.schedule-item:not(:disabled):hover,
.schedule-item.active {
  border-color: var(--line);
  background: var(--ink);
  color: var(--paper);
}

.schedule-item:disabled {
  border-color: rgba(47, 42, 36, 0.16);
  background: rgba(231, 221, 202, 0.46);
  color: rgba(20, 17, 15, 0.42);
  cursor: not-allowed;
}

.schedule-num {
  grid-row: span 2;
  color: var(--gold);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
}

.schedule-teams {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}

.schedule-teams b {
  color: var(--red);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
}

.schedule-meta {
  min-width: 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-status {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  width: 14px;
  height: 14px;
}

.schedule-item.predicted .schedule-status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2f80ed;
  box-shadow: 0 0 0 0 rgba(47, 128, 237, 0.54);
  animation: prediction-pulse 1.25s ease-in-out infinite;
}

.schedule-item.done .schedule-status {
  position: relative;
  border-radius: 999px;
  background: var(--green);
}

.schedule-item.done .schedule-status::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 4px;
  height: 7px;
  border: solid rgba(244, 239, 229, 0.88);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.schedule-item.upcoming .schedule-status {
  border: 1px solid rgba(47, 42, 36, 0.22);
  border-radius: 999px;
}

.schedule-item:disabled .schedule-num,
.schedule-item:disabled .schedule-meta,
.schedule-item:disabled .schedule-teams b {
  color: rgba(20, 17, 15, 0.34);
}

.schedule-item:not(:disabled):hover .schedule-meta,
.schedule-item.active .schedule-meta {
  color: var(--paper-2);
}

@keyframes prediction-pulse {
  0%,
  100% {
    opacity: 0.42;
    box-shadow: 0 0 0 0 rgba(47, 128, 237, 0.42);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(47, 128, 237, 0);
  }
}

.benchmark-view {
  min-width: 0;
}

.masthead {
  min-height: 168px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: 18px;
  padding: 20px 24px;
  background:
    radial-gradient(circle at 80% 20%, rgba(197, 138, 29, 0.2), transparent 36%),
    linear-gradient(135deg, #fffaf0, #eadfc9);
}

.match-card {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  padding: 14px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}

.match-card span {
  color: var(--paper-2);
  font-size: 13px;
  line-height: 1.3;
}

.match-card strong {
  font-size: 24px;
  line-height: 1;
}

.tabs {
  display: flex;
  gap: 0;
  margin: 10px 0;
  box-shadow: none;
}

.tab {
  min-height: 38px;
  border: 0;
  border-right: 2px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  padding: 0 18px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.tab.active {
  background: var(--gold);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 10px;
  border: 2px solid var(--line);
  background: var(--paper-2);
}

.metric-strip div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 2px solid var(--line);
}

.metric-strip div:last-child {
  border-right: 0;
}

.metric-strip span,
dt {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-strip strong,
dd {
  margin: 4px 0 0;
  display: block;
  font-size: 22px;
  line-height: 1;
}

.tug-of-war {
  padding: 14px;
}

.tug-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.tug-head strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.tug-final {
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.tug-stage {
  display: grid;
  grid-template-columns: minmax(120px, 0.23fr) minmax(220px, 1fr) minmax(120px, 0.23fr);
  align-items: center;
  gap: 12px;
}

.tug-team {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 4px;
  min-height: 54px;
  padding: 9px 10px;
  border: 2px solid var(--line);
}

.tug-team span {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tug-team strong {
  font-size: 25px;
  line-height: 0.9;
}

.tug-team-one {
  background: var(--team1-bg);
  color: var(--team1-fg);
}

.tug-team-two {
  background: var(--team2-bg);
  color: var(--team2-fg);
  text-align: right;
}

.tug-rope {
  position: relative;
  height: 54px;
  border: 2px solid var(--line);
  background:
    linear-gradient(
      90deg,
      var(--team1-bg) 0 var(--team1-pull),
      var(--team2-bg) var(--team1-pull) 100%
    );
  overflow: hidden;
}

.tug-rope::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 250, 240, 0.18) 0 8px,
    rgba(20, 17, 15, 0.16) 8px 10px
  );
  mix-blend-mode: soft-light;
}

.tug-left,
.tug-right {
  position: absolute;
  top: 50%;
  width: calc(50% - 14px);
  height: 8px;
  border-top: 2px solid rgba(20, 17, 15, 0.56);
  border-bottom: 2px solid rgba(20, 17, 15, 0.56);
  transform: translateY(-50%);
}

.tug-left {
  left: 0;
}

.tug-right {
  right: 0;
}

.tug-knot {
  position: absolute;
  left: var(--team1-pull);
  top: 50%;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  background: var(--paper);
  transform: translate(-50%, -50%) rotate(45deg);
}

.panel {
  margin-bottom: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(47, 42, 36, 0.28);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
}

.pick {
  display: inline-block;
  min-width: 76px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: var(--pick-bg, #d8ead5);
  color: var(--pick-fg, var(--green));
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.28);
}

.draw-pick {
  border-color: rgba(47, 42, 36, 0.52);
  box-shadow: none;
}

.model-label {
  display: inline-grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.model-label strong {
  display: block;
  font-size: 13px;
}

.model-label small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.provider-icon,
.provider-fallback {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(47, 42, 36, 0.35);
  background: rgba(255, 250, 240, 0.7);
}

.provider-icon {
  padding: 5px;
  object-fit: contain;
}

.provider-fallback {
  display: inline-grid;
  place-items: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 900;
}

.prediction-row {
  cursor: pointer;
}

.leaderboard-row {
  cursor: pointer;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.sort-button:hover,
.sort-button.active {
  color: var(--red);
}

.sort-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.sort-button b {
  width: 1em;
  color: var(--red);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.prediction-row:hover,
.prediction-row.selected,
.leaderboard-row:hover,
.leaderboard-row.selected {
  background: rgba(197, 138, 29, 0.16);
}

.prediction-row:focus,
.leaderboard-row:focus {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.prediction-detail-row td {
  padding: 0;
  border-bottom: 2px solid var(--line);
  background: rgba(20, 17, 15, 0.04);
}

.inline-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  border-left: 6px solid var(--gold);
}

.reasoning-column,
.score-column {
  min-width: 0;
  padding: 20px 24px;
}

.score-column {
  border-left: 2px solid var(--line);
  background: rgba(231, 221, 202, 0.42);
}

.detail-label {
  display: block;
  margin-bottom: 10px;
  color: var(--red);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.reasoning-column > p {
  max-width: 760px;
  margin: 0 0 20px;
  line-height: 1.55;
}

.reasoning-column dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.reasoning-column dd {
  font-size: 14px;
  line-height: 1.35;
}

.total-score {
  color: var(--green);
  font-size: 15px;
  white-space: nowrap;
}

.total-score.pending {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.score-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}

.score-heading > strong {
  color: var(--green);
  font-size: 36px;
  line-height: 0.85;
}

.score-heading small,
.score-categories small {
  color: var(--muted);
  font-size: 11px;
}

.score-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid rgba(47, 42, 36, 0.28);
}

.score-categories > div {
  padding: 12px 10px 12px 0;
}

.score-categories span {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-categories strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.score-categories strong + small {
  display: block;
  margin-top: 3px;
  line-height: 1.25;
}

.goal-scorer-score-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.goal-scorer-score-list li {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(47, 42, 36, 0.18);
}

.goal-scorer-score-list li:last-child {
  border-bottom: 0;
}

.goal-scorer-score-list strong,
.goal-scorer-score-list small {
  display: block;
}

.goal-scorer-score-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.goal-scorer-score-list b {
  min-width: 26px;
  color: var(--green);
  font-size: 18px;
  text-align: right;
}

.score-pending {
  padding: 22px 0;
}

.score-pending strong {
  font-size: 22px;
}

.score-pending p {
  max-width: 420px;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.leaderboard-detail-row td {
  padding: 0;
  border-bottom: 2px solid var(--line);
  background: rgba(20, 17, 15, 0.04);
}

.leaderboard-carousel {
  display: grid;
  grid-auto-columns: minmax(280px, 340px);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 14px;
  scroll-snap-type: inline proximity;
}

.leaderboard-match-card {
  min-height: 230px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.92);
  scroll-snap-align: start;
}

.leaderboard-match-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-match-card header strong {
  color: var(--green);
  font-size: 18px;
}

.leaderboard-match-card h3 {
  min-height: 42px;
  margin: 12px 0 5px;
  font-size: 18px;
  line-height: 1.15;
}

.card-result {
  min-height: 34px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.leaderboard-match-card dl {
  margin: 0;
}

.leaderboard-match-card dd {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.card-score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
  border-top: 1px solid rgba(47, 42, 36, 0.28);
}

.card-score-grid div {
  min-width: 0;
  padding: 10px 4px 0 0;
}

.card-score-grid span {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.card-score-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.card-score-grid small {
  color: var(--muted);
  font-size: 8px;
}

.card-scorer-hits {
  margin: 10px 0 0;
  color: var(--green);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.35;
}

.empty-state {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  padding: 22px;
}

.unavailable-view,
.tba-view {
  min-height: 360px;
  display: grid;
  place-content: center;
  text-align: center;
}

.unavailable-view h2,
.tba-view h2 {
  font-size: clamp(36px, 6vw, 82px);
  max-width: 800px;
}

.tba-note {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.rule-list article {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(47, 42, 36, 0.28);
}

.rule-list article > strong {
  color: var(--gold);
  font-size: 48px;
  line-height: 0.9;
}

.rule-list h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.rule-list p,
.rules-note {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.rules-note {
  padding: 18px 24px;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .schedule-rail {
    position: static;
    height: 240px;
  }

  .masthead {
    grid-template-columns: 1fr;
  }

  .inline-detail {
    grid-template-columns: 1fr;
  }

  .score-column {
    border-top: 2px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 16px, 1680px);
    padding-top: 8px;
  }

  .masthead {
    padding: 16px;
  }

  h1 {
    font-size: 38px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .tug-head,
  .tug-stage {
    grid-template-columns: 1fr;
  }

  .tug-head {
    display: grid;
  }

  .tug-final {
    width: fit-content;
    white-space: normal;
  }

  .tug-team-two {
    text-align: left;
  }

  .tug-rope {
    min-height: 48px;
  }

  .metric-strip div {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .metric-strip div:last-child {
    border-bottom: 0;
  }

}

/* ============================================================
   ANALYSIS TAB
   ============================================================ */
.analysis-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analysis-intro {
  padding: 16px 18px;
}
.analysis-intro h2 {
  margin: 0 0 6px;
  font-size: 26px;
}
.analysis-intro p {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
}

.analysis-tiles {
  flex-wrap: wrap;
}
.analysis-tiles strong em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
}

.chart-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.chart-head h2 {
  margin: 0;
  font-size: 21px;
}
.chart-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 42ch;
}

.chart-body {
  padding: 14px 16px 6px;
  overflow-x: auto;
}
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.grid-line { stroke: rgba(20, 17, 15, 0.12); stroke-width: 1; }
.axis-label { fill: var(--muted); font-size: 11px; }
.axis-title { fill: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }

.race-line { transition: opacity 0.18s ease, stroke-width 0.18s ease; }
.race-line.dimmed { opacity: 0.12; }
.race-focus { stroke: #fff; stroke-width: 2; pointer-events: none; }

.scatter-node { cursor: pointer; }
.scatter-node circle { transition: fill-opacity 0.15s ease; }
.scatter-node:hover circle { fill-opacity: 0.95; }
.scatter-label { fill: var(--ink); font-size: 11px; font-weight: 700; }

.anatomy-seg, .scorer-bar { cursor: pointer; transition: opacity 0.15s ease; }
.anatomy-seg:hover, .scorer-bar:hover { opacity: 0.82; }
.bar-name { fill: var(--ink); font-size: 12px; font-weight: 600; }
.bar-total { fill: var(--muted); font-size: 11px; font-weight: 700; }

.calib-ideal { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 5 5; }

/* legends */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 4px 16px 16px;
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1.5px solid var(--line);
  background: rgba(255, 250, 240, 0.7);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.legend-chip:hover { transform: translateY(-1px); }
.legend-chip.legend-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(20, 17, 15, 0.35);
  flex: none;
}

.chart-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-control label {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.chart-control select {
  border: 2px solid var(--line);
  background: rgba(255, 250, 240, 0.9);
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* style DNA table */
.style-table-wrap { padding: 12px 16px 16px; overflow-x: auto; }
.style-table { width: 100%; border-collapse: collapse; }
.style-table th { text-align: left; border-bottom: 2px solid var(--line); padding: 0 0 6px; }
.style-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid rgba(20, 17, 15, 0.08); position: relative; min-width: 96px; }
.style-table td:first-child, .style-table th:first-child { padding-left: 4px; min-width: 150px; }
.style-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.cell-bar {
  position: absolute;
  left: 0; bottom: 3px;
  height: 5px;
  width: var(--w);
  background: var(--c);
  opacity: 0.55;
  border-radius: 2px;
}
.cell-val { position: relative; font-variant-numeric: tabular-nums; }

/* shared tooltip */
.chart-tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 8px 11px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  max-width: 260px;
  box-shadow: 0 10px 30px rgba(20, 17, 15, 0.32);
}
.chart-tooltip b { color: var(--gold); }
.chart-tooltip small { color: rgba(244, 239, 229, 0.7); }

/* margin / bump / head-to-head */
.zero-line { stroke: var(--ink); stroke-width: 1.6; }
.end-label { font-size: 11px; font-weight: 700; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.h2h-cell { cursor: pointer; transition: stroke 0.1s ease; stroke: transparent; stroke-width: 2; }
.h2h-cell:hover { stroke: var(--ink); }
.h2h-val { font-size: 11px; font-weight: 700; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; pointer-events: none; }
.h2h-coltext { font-size: 11px; }

/* keep the square head-to-head matrix compact so it fits on screen */
.h2h-svg { max-width: 560px; margin: 0 auto; }
.h2h-val { font-size: 10px; }
.h2h-coltext { font-size: 10px; }
