/* Shared pieces: fields, search, heads, tables, tabs, lists, grids, states. */

.ink {
  color: var(--ink);
}

/* Search matches: ink and a heavier weight, no accent. */
mark {
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

/* ------------------------------------------------------------------ fields */

.field {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid var(--control);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color var(--ease), box-shadow var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.field::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field:hover {
  border-bottom-color: var(--muted);
}

.field:focus,
.field:focus-visible {
  outline: none;
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 var(--ink);
}

.field[aria-invalid="true"] {
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}

.field::-webkit-search-cancel-button {
  filter: grayscale(1);
}

.field--select {
  width: auto;
  padding-right: 1.25rem;
  background-image: none;
  cursor: pointer;
}

.select {
  position: relative;
}

.select::after {
  content: "";
  position: absolute;
  right: 0.15rem;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translateY(-75%) rotate(45deg);
  pointer-events: none;
}

.field--select option {
  background: var(--bg);
  color: var(--ink);
}

/* ------------------------------------------------------------------ search (header + pickers) */

.search {
  position: relative;
  width: 10.5rem;
}

.search .field {
  font-size: var(--fs-small);
}

/* In the header the field has no resting underline (it would run parallel to the header hairline);
   its placeholder names it, and hover / focus draw the line. */
.site-header .search .field {
  border-bottom-color: transparent;
}

.site-header .search .field:hover {
  border-bottom-color: var(--control);
}

.site-header .search .field:focus {
  border-bottom-color: var(--ink);
}

/* Header field: a magnifier on the left and a "/" key hint on the right (hover devices, until focused or
   filled) make it read as a field, not as a fifth nav link. */
.search__icon {
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search--header .search__input {
  padding-left: 1.4rem;
  padding-right: 1.6rem;
}

.search__key {
  position: absolute;
  right: 0;
  top: 50%;
  min-width: 1.15rem;
  padding: 0 0.3rem;
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
  text-align: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.search__input:focus ~ .search__key,
.search__input:not(:placeholder-shown) ~ .search__key {
  display: none;
}

@media (hover: none), (max-width: 960px) {
  .search__key {
    display: none;
  }

  .search--header .search__input {
    padding-right: 0;
  }
}

.search__list {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  width: 19rem;
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  border: 1px solid var(--rule);
  background: var(--bg);
}

.search__option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--body);
  font-size: 0.95rem;
  cursor: pointer;
}

.search__option:first-child {
  border-top: 0;
}

.search__option[aria-selected="true"] {
  background: var(--bg-hover);
  color: var(--ink);
}

.search__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search__online {
  color: var(--accent);
  font-size: var(--fs-xs);
}

.search__rank {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.search__status {
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  font-size: var(--fs-small);
}

/* Desktop header: the field's box spans the header's height, so the suggestions open with their top
   border lying exactly on the header's bottom hairline (no stepped double rule). */
@media (min-width: 961px) {
  .site-header .header-panel {
    align-self: stretch;
  }

  .site-header .search {
    display: flex;
    align-items: center;
    align-self: stretch;
  }

  .site-header .search__list {
    top: 100%;
  }
}

@media (max-width: 960px) {
  .search {
    width: 100%;
  }

  .search__list {
    left: 0;
    width: auto;
  }

  /* In the mobile menu the field sits in the open panel: show its underline. */
  .site-header .search .field {
    border-bottom-color: var(--control);
  }
}

/* ------------------------------------------------------------------ players in tables */

.who {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  vertical-align: middle;
}

.who__head {
  display: inline-flex;
  flex: none;
}

.who__name {
  color: var(--ink);
  font-weight: 500;
}

/* ------------------------------------------------------------------ tables */

.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table th {
  padding: 0 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 0.8rem 0.75rem 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

/* The last column ends exactly on the hairline's right edge. */
.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

.table .c-rank {
  width: 3.5rem;
}

.table td.c-rank {
  color: var(--muted);
}

.table .c-name {
  min-width: 0;
}

.table .c-score {
  width: 7.5rem;
  text-align: right;
  white-space: nowrap;
}

.table td.c-score {
  color: var(--ink);
}

.table .c-pct {
  width: 6rem;
  padding-left: 1.5rem;
  color: var(--muted);
  text-align: right;
}

.entry.is-top td.c-rank {
  color: var(--ink);
}

/* A score of zero: "—" in the rank and score columns, muted. */
.entry.is-zero td.c-rank,
.entry.is-zero td.c-score {
  color: var(--muted);
}

/* No filled surfaces: hovering a row underlines its name, an open row only loses its hairline.
   Hover only where there is a real pointer: after a tap the underline would stay stuck. */
.row.is-expandable {
  cursor: pointer;
}

@media (hover: hover) {
  .row:hover .who__name,
  .row:hover .c-name .plain {
    text-decoration-line: underline;
    text-decoration-color: var(--underline);
  }
}

/* An expandable row's name cell: content on the left, the chevron toggle at its right end (no extra
   column, so the last column still ends on the hairline's right edge). */
.cell-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.cell-split__main {
  min-width: 0;
}

.entry.is-open .row td {
  border-bottom-color: transparent;
}

.detail td {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  border-bottom: 0;
  color: var(--body);
  font-size: var(--fs-small);
}

.entry.is-open .detail:last-child td {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

/* An opened row explains the ranking: quieter than it. */
.detail .plain {
  color: var(--body);
}

.row-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.25rem -0.25rem -0.25rem 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--underline);
}

.row-toggle:hover,
.row-toggle[aria-expanded="true"] {
  color: var(--muted);
}

@media (hover: hover) {
  .row:hover .row-toggle {
    color: var(--muted);
  }
}

.chev {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: transform var(--ease), opacity var(--ease);
}

.row-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

/* Chevrons are always there, quietly (the rows open: say so), in full on the row pointed at or open. */
.row-toggle .chev {
  opacity: 0.45;
}

.row:hover .chev,
.row-toggle:focus-visible .chev,
.row-toggle[aria-expanded="true"] .chev {
  opacity: 1;
}

@media (max-width: 640px) {
  .table .c-pct {
    display: none;
  }

  .table .c-rank {
    width: 2.25rem;
  }

  .table .c-score {
    width: auto;
  }

  /* With the percentile hidden, a score that is now the last visible column ends on the edge. */
  .table .c-score:nth-last-child(2) {
    padding-right: 0;
  }
}

/* Very narrow phones (320–360px): names may break rather than push the page sideways. */
@media (max-width: 360px) {
  .row-toggle {
    width: 1.5rem;
  }

  .cell-split {
    gap: 0.4rem;
  }

  .who {
    gap: 0.4rem;
  }

  .who__name {
    overflow-wrap: anywhere;
  }
}

/* ------------------------------------------------------------------ tabs, sort links, pager, toolbar */

.tabs--bar {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.tabs__list {
  display: flex;
  gap: 1.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}

/* On phones the tab row scrolls edge to edge instead of being clipped at the gutter. */
@media (max-width: 760px) {
  .tabs--bar .tabs__list {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
}

.tabs__list::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.85rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--fs-small);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease);
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-current="page"],
.tab[aria-pressed="true"] {
  color: var(--ink);
}

/* The active underline is its own 1px bar. (An inset box-shadow bled down the sides of tabs that
   start at fractional x positions, drawing a thin box around the active tab.) */
.tab[aria-current="page"]::after,
.tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
}

.tab__count {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.toolbar > .field {
  flex: 0 1 18rem;
  width: auto;
}

.toolbar__count {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}

/* Nothing to count: no box, so it takes no gap and the field reaches the right edge. */
.toolbar__count:empty {
  display: none;
}

@media (max-width: 640px) {
  .toolbar--board {
    flex-wrap: nowrap;
    gap: 1rem;
  }

  .toolbar--board > .field {
    flex: 1 1 auto;
  }

  .toolbar--board .toolbar__count {
    white-space: nowrap;
  }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2rem;
  margin-top: 2rem;
  font-size: var(--fs-small);
}

.pager__info {
  color: var(--muted);
}

.pager__off {
  color: var(--underline);
}

.sorts {
  font-size: var(--fs-small);
}

.sort {
  color: var(--muted);
  text-decoration: none;
}

.sort.is-current {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--ink);
  text-underline-offset: 0.35em;
}

/* ------------------------------------------------------------------ list helpers */

.line__meta {
  color: var(--muted);
  font-size: var(--fs-small);
}

/* "· Diamond sword": a detail never splits from its dot (see metaBits). */
.meta-bit {
  white-space: nowrap;
}

.list-meta {
  margin: -0.75rem 0 1.25rem;
}

.more {
  margin-top: 1.25rem;
  font-size: var(--fs-small);
}

/* ------------------------------------------------------------------ states */

.state {
  max-width: var(--measure);
}

p.state__title {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
}

h2.state__title {
  font-size: 1.5rem;
}

h1.state__title {
  font-size: var(--fs-h2);
}

.state__text {
  margin-top: 0.5rem;
  color: var(--muted);
}

.page-head .state__text {
  margin-top: 1.25rem;
  font-size: var(--fs-lede);
}

.state__actions {
  margin-top: 1.5rem;
}

.ghost-rows {
  border-top: 1px solid var(--rule);
}

.ghost-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 3.5rem;
  padding: 0 0.6rem;
  border-bottom: 1px solid var(--rule);
}

/* Loading ghosts: quiet blocks in the shape of what is coming, with a slow shimmer (none with reduced
   motion, see base.css). */
.ghost-row__face,
.ghost-row__name,
.ghost-row__value,
.ghost-box,
.ghost-chip,
.ghost-line,
.histo__ghost {
  display: block;
  border-radius: 6px;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.ghost-row__face {
  flex: none;
  width: 32px;
  height: 32px;
}

.ghost-row__name {
  width: min(11rem, 40%);
  height: 0.8rem;
}

.ghost-row__value {
  width: 3.5rem;
  height: 0.8rem;
  margin-left: auto;
}

.ghost-tabs {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
  padding-bottom: 0.9rem;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.ghost-chip {
  flex: none;
  width: 4.5rem;
  height: 1.5rem;
  border-radius: 99px;
}

.ghost-chip--tab {
  width: 5.25rem;
  height: 1.1rem;
}

.ghost-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.ghost-line {
  height: 0.9rem;
}

.ghost-line--title {
  width: 10rem;
  margin-bottom: 1.6rem;
}

.ghost-dist .histo__bars {
  border-bottom-color: var(--rule);
}

.histo__ghost {
  flex: 1 1 0;
  height: var(--v);
  border-radius: 3px 3px 0 0;
}

.ghost-box--model {
  min-height: 320px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.ghost-box--rank {
  width: 15rem;
  height: 4.5rem;
  margin-top: 1.5rem;
  border-radius: var(--radius);
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.nomatch {
  padding: 1.25rem 0;
  color: var(--muted);
}

.nomatch p + p {
  margin-top: 0.5rem;
}

/* ================================================================== v2: personality layer */

/* Line icons never shrink inside a flex row (a squeezed tab would otherwise squash them to 0). */
.icon {
  flex: none;
}

.tabs__list > li {
  flex: none;
}

/* ------------------------------------------------------------------ panels & tiles */

.panel {
  position: relative;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--panel-highlight);
}

.panel--flush {
  padding: 0;
}

.panel--link {
  transition: border-color var(--ease), transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

@media (hover: hover) {
  .panel--link:hover {
    border-color: var(--rule-strong);
    box-shadow: var(--panel-highlight), var(--shadow-lift);
    transform: var(--lift);
  }
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel__title .icon {
  color: var(--hue, var(--accent));
}

.tile {
  min-width: 0;
  padding: 1.1rem 1.25rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--panel-highlight);
}

.tile__label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: var(--fs-small);
}

.tile__icon {
  color: var(--hue, var(--accent));
}

.tile__value {
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: clamp(1.45rem, 1.1rem + 1vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.tile__value small {
  margin-left: 0.3rem;
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 500;
  letter-spacing: 0;
}

.tile__sub {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  background: color-mix(in srgb, var(--hue, var(--accent)) 15%, transparent);
  color: var(--hue, var(--accent));
}

.with-icon {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ------------------------------------------------------------------ rank numerals */

.rk {
  display: inline-block;
  min-width: 1.5ch;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.rk--1,
.rk--2,
.rk--3 {
  font-size: 1.3rem;
  font-weight: 750;
}

.rk--1 {
  color: var(--gold);
}

.rk--2 {
  color: var(--silver);
}

.rk--3 {
  color: var(--bronze);
}

.rk--none {
  color: var(--faint);
  font-weight: 400;
}

/* ------------------------------------------------------------------ badges & player chips */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem 0.2rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 99px;
  background: var(--surface);
  color: var(--body);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}

.badge .icon {
  color: var(--hue, var(--accent));
}

.badge--strong {
  border-color: transparent;
  background: var(--accent-soft);
  background: color-mix(in srgb, var(--hue, var(--accent)) 15%, transparent);
  color: var(--ink);
}

.badge--link:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pchip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.pchip__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.pchip__name {
  overflow: hidden;
  color: var(--ink);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pchip__sub {
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* Online: a green dot with a slow pulse. */
.online {
  position: relative;
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  vertical-align: middle;
}

.online::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1.5px solid var(--up);
  border-radius: 50%;
  opacity: 0;
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.6);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

/* ------------------------------------------------------------------ tabs: icons, hues, ARIA tab sets */

.tab--icon {
  align-items: center;
}

.tab--icon .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
  transition: color var(--ease);
}

.tab--icon:hover .icon,
.tab--icon[aria-current="page"] .icon {
  color: var(--hue, var(--accent));
}

.tab[aria-current="page"]::after,
.tab[aria-pressed="true"]::after {
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--hue, var(--accent));
}

.tabset__bar {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.tabset__list {
  position: relative;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabset__list::-webkit-scrollbar {
  display: none;
}

@media (max-width: 760px) {
  .tabset__list {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
  }
}

.tabset__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem;
  border: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--ease), background-color var(--ease);
}

.tabset__tab:first-child {
  margin-left: -0.85rem;
}

/* Phones: the profile's four tabs fit on one line instead of scrolling. */
@media (max-width: 480px) {
  .tabset__tab {
    gap: 0.35rem;
    padding: 0.85rem 0.5rem;
    font-size: 0.9rem;
  }

  .tabset__tab:first-child {
    margin-left: -0.5rem;
  }
}

.tabset__tab:hover,
.tabset__tab[aria-selected="true"] {
  color: var(--ink);
}

.tabset__tab .icon {
  color: var(--faint);
}

.tabset__tab[aria-selected="true"] .icon {
  color: var(--accent);
}

.tabset__tab:focus-visible {
  outline-offset: -4px;
}

.tabset__ink {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--w, 0);
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  transform: translateX(var(--x, 0));
  transition: transform 320ms var(--ease-out), width 320ms var(--ease-out);
}

.tabset__panel:focus-visible {
  outline: none;
}

/* ------------------------------------------------------------------ tables: v2 columns */

.table .c-chg {
  width: 3.4rem;
  padding-right: 0.5rem;
}

.table .c-trend {
  width: 6.5rem;
}

.table .c-pct {
  width: 8.5rem;
}

@media (hover: hover) {
  .table--board .row:hover td {
    background: var(--bg-hover);
  }
}

.table--board .row td:first-child,
.table--board th:first-child,
.table--board .detail td:first-child {
  padding-left: 0.6rem;
}

.table--board .row td:last-child,
.table--board th:last-child {
  padding-right: 0.6rem;
}

.table--board .row td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.table--board .row td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.table--board td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.who {
  gap: 0.75rem;
}

.detail-chart td {
  padding: 0.75rem 0.6rem 1.25rem !important;
}

.detail-chart .lchart {
  max-width: 40rem;
  margin-top: 2.25rem;
}

@media (max-width: 760px) {
  .table .c-trend {
    display: none;
  }
}

@media (max-width: 640px) {
  .table .c-chg {
    width: 2.6rem;
    padding-right: 0.25rem;
  }

  .table--board .row td:first-child,
  .table--board th:first-child,
  .table--board .detail td:first-child {
    padding-left: 0.25rem;
  }

  .table--board .row td:last-child,
  .table--board th:last-child {
    padding-right: 0.25rem;
  }

  .rk--1,
  .rk--2,
  .rk--3 {
    font-size: 1.15rem;
  }
}

/* ------------------------------------------------------------------ motion: one orchestrated entrance */

.rise > * {
  animation: rise 520ms var(--ease-out) both;
}

.rise > :nth-child(2) { animation-delay: 60ms; }
.rise > :nth-child(3) { animation-delay: 120ms; }
.rise > :nth-child(4) { animation-delay: 180ms; }
.rise > :nth-child(5) { animation-delay: 240ms; }
.rise > :nth-child(6) { animation-delay: 300ms; }
.rise > :nth-child(7) { animation-delay: 360ms; }
.rise > :nth-child(n + 8) { animation-delay: 420ms; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ------------------------------------------------------------------ misc */

.kicker .icon {
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: -3px;
}

.empty-note {
  color: var(--muted);
  font-size: var(--fs-small);
}

.more-link {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.more-link:hover {
  color: var(--ink);
}


/* ------------------------------------------------------------------ open board rows */

/* The open row and its detail are tinted in the board's hue, with a 2 px edge on the left. */
.table--board .entry.is-open td {
  background: color-mix(in oklab, var(--hue, var(--accent)) 6%, transparent);
}

.table--board .entry.is-open .row td:first-child,
.table--board .entry.is-open .detail td:first-child {
  box-shadow: inset 2px 0 0 var(--hue, var(--accent));
}

.table--board .entry.is-open .row td:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}

.table--board .entry.is-open .row td:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}

.table--board .entry.is-open .detail td {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.detail-chart td {
  padding: 0.5rem 1rem 1.25rem 1.1rem !important;
}

.xrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 2rem;
}

.xrow--single,
.xrow--chart-only {
  grid-template-columns: minmax(0, 1fr);
}

.xrow--single .xterms {
  max-width: 34rem;
}

.xrow__title {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.xterms {
  display: grid;
  gap: 0;
}

/* One compact 28 px row per term: name, bar, its value, its points. */
.xterm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 4.5rem 4rem;
  align-items: center;
  gap: 0.75rem;
  min-height: 28px;
  color: var(--body);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}

.xterm__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  overflow: hidden;
  color: var(--body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xterm__label .icon {
  color: var(--hue);
}

.xterm__value {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.xterm__pts {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.xterm.is-neg .xterm__pts {
  color: var(--down);
}

.xrow__chart .lchart {
  margin-top: 1.5rem;
}

@media (max-width: 760px) {
  .xrow {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .xterm {
    grid-template-columns: minmax(0, 1fr) 40px auto 3.5rem;
    gap: 0.5rem;
  }

  .detail-chart td {
    padding: 0.5rem 0.4rem 1rem 0.6rem !important;
  }
}

/* ------------------------------------------------------------------ small controls */

.seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.seg__btn .icon {
  color: var(--hue, var(--accent));
}

.seg__btn:hover {
  color: var(--ink);
}

.seg--sm .seg__btn {
  padding: 0.1rem 0.6rem;
  font-size: var(--fs-xs);
}

/* the same look for links (a page's two views: cards / map) */
.seg--links .seg__btn {
  text-decoration: none;
}

.seg--links .seg__btn[aria-current="page"] {
  background: var(--surface-3);
  color: var(--ink);
}

.chip--sm {
  padding: 0.2rem 0.6rem;
  font-size: var(--fs-xs);
  text-decoration: none;
}

.range-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.3rem 0.15rem 0.7rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--hue, var(--accent)) 16%, transparent);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.range-chip[hidden] {
  display: none;
}

.range-chip__clear {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.range-chip__clear:hover {
  background: var(--surface-3);
  color: var(--ink);
}

/* Switching to an empty tab does not make the page jump. */
.tabset__panel {
  min-height: 22rem;
}

.tab-empty {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
  max-width: 36rem;
  padding: 1.5rem 0;
}

.tab-empty .icon-tile {
  margin-bottom: 0.4rem;
}

.tab-empty__title {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
}

.tab-empty__text {
  color: var(--muted);
}

.tab-empty__code code {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
