/* StatsCentral Apps Next — organisms. */

/* ── Header ── Navy bar, cardinal rule. Owns no heading: the page's <h1> lives in the page header. */
.sc-header {
  background: rgb(var(--color-header));
  color: rgb(var(--color-text-inverse));
  border-bottom: var(--border-width-rule) solid rgb(var(--color-accent));
  font-size: var(--text-body-s);
}

.sc-header__container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
  min-height: 64px;
  padding-block: var(--space-2);
}

.sc-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: rgb(var(--color-text-inverse));
  text-decoration: none;
}

.sc-header__logo {
  display: block;
  width: 120px;
  height: auto;
}

.sc-header__service {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: var(--space-4);
  border-left: var(--border-width) solid rgb(var(--color-header-divider));
  color: rgb(var(--color-text-inverse));
  font-size: var(--text-s);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  line-height: 1.2;
}
.sc-header__service:hover { text-decoration: underline; text-underline-offset: .15em; }

.sc-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.sc-header__menu { position: relative; }

.sc-header__action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: var(--control-height);
  min-height: var(--control-height);
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: none;
  color: rgb(var(--color-text-inverse));
  font-size: var(--text-body-s);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
}
.sc-header__action:visited { color: rgb(var(--color-text-inverse)); }
.sc-header__action:hover { text-decoration: underline; text-underline-offset: .15em; }
.sc-header__action[aria-expanded="true"] { background: rgb(var(--color-text-inverse) / .12); }

.sc-header__action .sc-count {
  margin-left: -10px;
  margin-top: -14px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 12px;
}

.sc-header__account-role {
  color: rgb(var(--color-text-inverse-secondary));
  font-weight: var(--weight-regular);
}

.sc-header__chevron {
  width: 8px;
  height: 8px;
  margin: -4px 2px 0 2px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.sc-header__action[aria-expanded="true"] .sc-header__chevron { margin-top: 4px; transform: rotate(-135deg); }

.sc-header__brand:focus-visible,
.sc-header__service:focus-visible,
.sc-header__action:focus-visible {
  outline: var(--focus-width) solid transparent;
  background: rgb(var(--color-focus));
  color: rgb(var(--color-focus-text));
  box-shadow: 0 var(--focus-bar) rgb(var(--color-focus-text));
  text-decoration: none;
}
.sc-header__brand:focus-visible .sc-header__logo { filter: invert(1); }
.sc-header__action:focus-visible .sc-header__account-role { color: rgb(var(--color-focus-text)); }

@media (max-width: 640px) {
  .sc-header__logo { width: 96px; }
  .sc-header__service { font-size: var(--text-body); padding-left: var(--space-3); }
  .sc-header__brand { gap: var(--space-3); }
  .sc-header__account-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ── App switcher ── Grid of apps inside a menu panel. */
.sc-app-switcher { width: min(360px, calc(100vw - var(--gutter) * 2)); padding: var(--space-3); }
.sc-app-switcher__title { margin: 0 0 var(--space-2); padding-inline: var(--space-1); font-size: var(--text-body-s); font-weight: var(--weight-bold); }
.sc-app-switcher__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sc-app-switcher__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: var(--space-2);
  color: rgb(var(--color-link));
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: .15em;
}
.sc-app-switcher__link:visited { color: rgb(var(--color-link)); }
.sc-app-switcher__link:hover { background: rgb(var(--color-surface)); color: rgb(var(--color-link-hover)); }
.sc-app-switcher__link[aria-current="true"] { color: rgb(var(--color-text)); text-decoration: none; background: rgb(var(--color-surface)); }
.sc-app-switcher__link:focus-visible {
  outline: var(--focus-width) solid transparent;
  color: rgb(var(--color-focus-text));
  background: rgb(var(--color-focus));
  box-shadow: inset 0 calc(var(--focus-bar) * -1) rgb(var(--color-focus-text));
  text-decoration: none;
}
.sc-app-switcher__footer { margin: var(--space-2) 0 0; padding: var(--space-3) var(--space-2) 0; border-top: var(--border-width) solid rgb(var(--color-border)); }

/* ── App frame ── The side navigation beside the header, page and footer. Below 769px it stacks on top. */
.sc-app-frame {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  flex: 1 0 auto;
}

.sc-app-frame__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sc-app-frame__main > .sc-width-container { flex: 1 0 auto; }

/* ── Side navigation ── The app's sections, grouped by the record they belong to. Navy, with the cardinal rule on its edge. */
.sc-side-navigation {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  /* Generous bottom room, so the last item scrolls clear of the edge even while a banner above pushes the sidebar down. */
  padding: var(--space-6) var(--space-5) calc(var(--space-10) + var(--space-8));
  background: rgb(var(--color-header));
  border-right: var(--border-width-rule) solid rgb(var(--color-accent));
  color: rgb(var(--color-text-inverse));
  font-size: var(--text-body-s);
}

.sc-side-navigation__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.sc-side-navigation__brand { display: inline-block; }
.sc-side-navigation__logo { display: block; width: 120px; height: auto; }

.sc-side-navigation__service {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: rgb(var(--color-text-inverse));
  font-size: var(--text-s);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
}
.sc-side-navigation__service:visited { color: rgb(var(--color-text-inverse)); }
.sc-side-navigation__service:hover { text-decoration: underline; text-underline-offset: .15em; }

.sc-side-navigation__toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: none;
  color: rgb(var(--color-text-inverse));
  font-size: var(--text-body-s);
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.sc-side-navigation__toggle[aria-expanded="true"] { background: rgb(var(--color-text-inverse) / .12); }
.sc-side-navigation__toggle .sc-header__chevron { border-width: 0 2px 2px 0; }
.sc-side-navigation__toggle[aria-expanded="true"] .sc-header__chevron { margin-top: 4px; transform: rotate(-135deg); }

.sc-side-navigation__group { margin-top: var(--space-6); }

.sc-side-navigation__title {
  margin: 0 0 var(--space-2);
  color: rgb(var(--color-text-inverse-secondary));
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.sc-side-navigation__subtitle {
  margin: calc(var(--space-1) * -1) 0 var(--space-2);
  color: rgb(var(--color-text-inverse-secondary));
  font-size: var(--text-xs);
}

.sc-side-navigation__list { margin: 0; padding: 0; list-style: none; }

/* The bar marking the current page sits on the sidebar's edge, so link text lines up with the group titles. */
.sc-side-navigation__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  margin-left: calc(var(--space-5) * -1);
  padding: var(--space-1) 0 var(--space-1) calc(var(--space-5) - var(--border-width-rule));
  border-left: var(--border-width-rule) solid transparent;
  color: rgb(var(--color-text-inverse));
  text-decoration: none;
  text-underline-offset: .15em;
}
.sc-side-navigation__link:visited { color: rgb(var(--color-text-inverse)); }
.sc-side-navigation__icon { flex: none; width: 20px; height: 20px; opacity: .8; }
.sc-side-navigation__link[aria-current="page"] .sc-side-navigation__icon { opacity: 1; }
.sc-side-navigation__link:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.sc-side-navigation__link[aria-current="page"] {
  border-left-color: rgb(var(--color-text-inverse));
  background: rgb(var(--color-text-inverse) / .08);
  font-weight: var(--weight-bold);
  text-decoration: none;
}

.sc-side-navigation__brand:focus-visible,
.sc-side-navigation__service:focus-visible,
.sc-side-navigation__toggle:focus-visible,
.sc-side-navigation__link:focus-visible {
  outline: var(--focus-width) solid transparent;
  background: rgb(var(--color-focus));
  color: rgb(var(--color-focus-text));
  box-shadow: 0 var(--focus-bar) rgb(var(--color-focus-text));
  text-decoration: none;
}
.sc-side-navigation__link:focus-visible { border-left-color: rgb(var(--color-focus-text)); box-shadow: none; }
.sc-side-navigation__brand:focus-visible .sc-side-navigation__logo { filter: invert(1); }

/* Inside the app frame the brand lives in the side navigation, so the header is a plain bar of actions. */
.sc-header--bar {
  background: rgb(var(--color-bg));
  color: rgb(var(--color-text));
  border-bottom: var(--border-width) solid rgb(var(--color-border));
}
.sc-header--bar .sc-header__action:not(:focus-visible),
.sc-header--bar .sc-header__action:visited:not(:focus-visible) { color: rgb(var(--color-text)); }
.sc-header--bar .sc-header__action[aria-expanded="true"]:not(:focus-visible) { background: rgb(var(--color-surface)); }
.sc-header--bar .sc-header__action:not(:focus-visible) .sc-header__account-role { color: rgb(var(--color-text-secondary)); }

.sc-side-navigation__logo--icon { display: none; width: 28px; }

.sc-side-navigation__collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  border: 0;
  background: transparent;
  color: rgb(var(--color-text-inverse));
  cursor: pointer;
}
.sc-side-navigation__collapse:hover { background: rgb(var(--color-text-inverse) / .12); }
.sc-side-navigation__collapse:focus-visible {
  outline: var(--focus-width) solid transparent;
  background: rgb(var(--color-focus));
  color: rgb(var(--color-focus-text));
  box-shadow: 0 var(--focus-bar) rgb(var(--color-focus-text));
}
.sc-side-navigation__collapse-icon { width: 20px; height: 20px; }

/* Collapsed, the navigation keeps only its icons; each link keeps its label for screen readers and as a tooltip. */
@media (min-width: 769px) {
  .sc-app-frame--collapsed { grid-template-columns: 72px minmax(0, 1fr); }
  .sc-app-frame--collapsed .sc-side-navigation { padding-inline: var(--space-3); }
  .sc-app-frame--collapsed .sc-side-navigation__top { flex-direction: column; gap: var(--space-4); }
  .sc-app-frame--collapsed .sc-side-navigation__logo--full { display: none; }
  .sc-app-frame--collapsed .sc-side-navigation__logo--icon { display: block; }
  .sc-app-frame--collapsed .sc-side-navigation__collapse-icon { transform: rotate(180deg); }
  .sc-app-frame--collapsed .sc-side-navigation__service { display: flex; justify-content: center; margin-top: var(--space-4); }
  .sc-app-frame--collapsed .sc-side-navigation__service:not(:has(.sc-app-mark)) { display: none; }
  .sc-app-frame--collapsed :is(.sc-side-navigation__service-name, .sc-side-navigation__label) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .sc-app-frame--collapsed :is(.sc-side-navigation__title, .sc-side-navigation__subtitle) { display: none; }
  .sc-app-frame--collapsed .sc-side-navigation__group { margin-top: var(--space-4); }
  .sc-app-frame--collapsed .sc-side-navigation__group + .sc-side-navigation__group {
    padding-top: var(--space-4);
    border-top: var(--border-width) solid rgb(var(--color-text-inverse) / .2);
  }
  .sc-app-frame--collapsed .sc-side-navigation__link {
    position: relative;
    justify-content: center;
    min-height: 40px;
    margin-inline: calc(var(--space-3) * -1);
    padding-inline: 0;
  }
  .sc-app-frame--collapsed .sc-side-navigation__icon { width: 22px; height: 22px; }
  .sc-app-frame--collapsed .sc-side-navigation__link .sc-count {
    position: absolute;
    top: 0;
    right: var(--space-2);
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .sc-app-frame { grid-template-columns: minmax(0, 1fr); }
  .sc-side-navigation__collapse { display: none; }

  .sc-side-navigation {
    position: static;
    height: auto;
    overflow: visible;
    padding: var(--space-3) var(--gutter) var(--space-4);
    border-right: 0;
    border-bottom: var(--border-width-rule) solid rgb(var(--color-accent));
  }
  .sc-side-navigation__logo { width: 96px; }
  .sc-side-navigation__toggle { display: inline-flex; }
  .sc-side-navigation[data-sc-init]:has(.sc-side-navigation__toggle[aria-expanded="false"]) .sc-side-navigation__sections { display: none; }
  .sc-side-navigation__group { margin-top: var(--space-4); }
  .sc-side-navigation__link {
    margin-left: calc(var(--gutter) * -1);
    padding-left: calc(var(--gutter) - var(--border-width-rule));
  }
}

/* ── Context bar ── The record the whole app is scoped to (League OS's season and sport), under the header. */
.sc-context-bar {
  padding-block: var(--space-2);
  border-bottom: var(--border-width) solid rgb(var(--color-border));
  background: rgb(var(--color-surface));
  font-size: var(--text-body-s);
}
.sc-context-bar__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}

/* ── Phase banner ── Shown while the new design is behind its flag. */
.sc-phase-banner {
  padding-block: var(--space-2);
  border-bottom: var(--border-width) solid rgb(var(--color-border));
  font-size: var(--text-body-s);
}
.sc-phase-banner__content {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin-block: 0;
}
.sc-phase-banner__content .sc-tag { flex: none; }

/* ── Impersonation banner ── */
.sc-impersonation-banner {
  padding-block: var(--space-2);
  background: rgb(var(--tag-yellow-bg));
  color: rgb(var(--tag-yellow-text));
  border-bottom: var(--border-width) solid rgb(var(--tag-yellow-text) / .35);
  font-size: var(--text-body-s);
}
.sc-impersonation-banner__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}
.sc-impersonation-banner strong { font-weight: var(--weight-bold); }
.sc-impersonation-banner .sc-button-link { color: rgb(var(--tag-yellow-text)); font-weight: var(--weight-bold); }

/* ── Footer ── */
.sc-footer {
  margin-top: auto;
  padding-block: var(--space-7);
  border-top: var(--border-width) solid rgb(var(--color-border));
  background: rgb(var(--color-surface));
  font-size: var(--text-small);
}
.sc-footer__container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
}
.sc-footer__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sc-footer__link,
.sc-footer__link:visited { color: rgb(var(--color-text)); }
.sc-footer__meta {
  margin: 0 0 0 auto;
  color: rgb(var(--color-text-secondary));
}

/* ── Page header ── Caption, the page's only <h1>, optional lead, actions. */
.sc-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-7);
  margin-bottom: var(--space-7);
}
.sc-page-header__main { min-width: 0; flex: 1 1 420px; }
.sc-page-header__identity { display: flex; align-items: center; gap: var(--space-5); }
.sc-page-header__title {
  margin: 0;
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  overflow-wrap: break-word;
}
.sc-page-header__title-meta { color: rgb(var(--color-text-secondary)); font-weight: var(--weight-regular); }
.sc-page-header__lead {
  margin: var(--space-3) 0 0;
  max-width: var(--readable-width);
  color: rgb(var(--color-text-secondary));
  font-size: var(--text-s);
}
.sc-page-header .sc-tag-group { margin-top: var(--space-2); }
.sc-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.sc-page-header--hero {
  display: block;
  margin: 0;
  padding-block: var(--space-9) var(--space-8);
  border-bottom: var(--border-width) solid rgb(var(--color-border));
  background: rgb(var(--color-surface));
}

/* ── Filter bar ── */
.sc-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}
.sc-filter-bar__field { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; }
.sc-filter-bar__field--grow { flex: 1 1 300px; max-width: 420px; }
.sc-filter-bar__field .sc-label { margin: 0; }
.sc-filter-bar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); min-height: var(--control-height); }
.sc-filter-bar__summary { margin: 0 0 var(--space-3); color: rgb(var(--color-text-secondary)); font-size: var(--text-body-s); }

/* ── Table ── Bordered, scrolls inside its wrapper; .sc-table--responsive becomes cards below 641px using each cell's data-label. */
.sc-table-wrapper {
  /* Without a containing block, visually hidden labels in a scrolled table escape the overflow and widen the page. */
  position: relative;
  margin-bottom: var(--space-8);
  overflow-x: auto;
  border: var(--border-width) solid rgb(var(--color-border));
}
.sc-table-wrapper:focus-visible { outline: var(--focus-width) solid rgb(var(--color-focus)); }

.sc-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: var(--text-body-s);
  font-variant-numeric: tabular-nums;
}

.sc-table__caption {
  padding: var(--space-4);
  border-bottom: var(--border-width) solid rgb(var(--color-border));
  font-size: var(--text-s);
  font-weight: var(--weight-bold);
  text-align: left;
}

.sc-table__head { background: rgb(var(--color-surface)); }

.sc-table__header {
  padding: var(--space-3) var(--space-4);
  color: rgb(var(--color-text-secondary));
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
}

.sc-table__cell {
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-width) solid rgb(var(--color-border));
  text-align: left;
  vertical-align: top;
}

.sc-table__cell--primary { font-weight: var(--weight-semibold); }
.sc-table__header--numeric,
.sc-table__cell--numeric { text-align: right; }
.sc-table__header--shrink,
.sc-table__cell--shrink { width: 1%; white-space: nowrap; }

/* A table's links all look like links, whatever classes a view gave them, and
   stay blue once visited: a list you work through every day shouldn't turn
   purple row by row. Buttons, and links dressed as buttons, keep their own look. */
.sc-table a:not([class*="button"]) {
  color: rgb(var(--color-link));
  text-decoration: underline;
  text-decoration-thickness: max(1px, .0625rem);
  text-underline-offset: .15em;
}
.sc-table a:not([class*="button"]):hover {
  color: rgb(var(--color-link-hover));
  text-decoration-thickness: max(3px, .1875rem);
}
.sc-table a:not([class*="button"]):focus-visible {
  outline: var(--focus-width) solid transparent;
  color: rgb(var(--color-focus-text));
  background-color: rgb(var(--color-focus));
  box-shadow: 0 -2px rgb(var(--color-focus)), 0 var(--focus-bar) rgb(var(--color-focus-text));
  text-decoration: none;
}

.sc-table__actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.sc-table__actions-list {
  display: inline-flex;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sc-table__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: none;
  color: rgb(var(--color-link));
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .15em;
  cursor: pointer;
}
.sc-table__sort::after {
  content: "";
  width: 0;
  height: 0;
  border: 4px solid transparent;
  opacity: .5;
}
[aria-sort="ascending"] .sc-table__sort::after { border-bottom: 6px solid currentColor; border-top: 0; opacity: 1; }
[aria-sort="descending"] .sc-table__sort::after { border-top: 6px solid currentColor; border-bottom: 0; opacity: 1; }
[aria-sort="ascending"] .sc-table__sort,
[aria-sort="descending"] .sc-table__sort { color: rgb(var(--color-text)); }
.sc-table__sort:focus-visible {
  outline: var(--focus-width) solid transparent;
  color: rgb(var(--color-focus-text));
  background: rgb(var(--color-focus));
  box-shadow: 0 var(--focus-bar) rgb(var(--color-focus-text));
  text-decoration: none;
}

.sc-table__empty {
  padding: var(--space-6) var(--space-4);
  border-top: var(--border-width) solid rgb(var(--color-border));
  color: rgb(var(--color-text-secondary));
}

@media (max-width: 640px) {
  .sc-table-wrapper:has(.sc-table--responsive) { border: 0; overflow: visible; }
  .sc-table--responsive .sc-table__caption { padding-inline: 0; border: 0; }
  /* Hidden cell by cell: a clipped <thead> alone still lends its full-width cells to the page's scroll width. */
  .sc-table--responsive .sc-table__head,
  .sc-table--responsive .sc-table__head * {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .sc-table--responsive,
  .sc-table--responsive tbody,
  .sc-table--responsive .sc-table__row { display: block; }
  .sc-table--responsive .sc-table__row {
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border: var(--border-width) solid rgb(var(--color-border));
  }
  .sc-table--responsive .sc-table__cell {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-top: var(--border-width) solid rgb(var(--color-border-subtle));
    text-align: left;
    width: auto;
    white-space: normal;
  }
  .sc-table--responsive .sc-table__cell:first-child { border-top: 0; }
  .sc-table--responsive .sc-table__cell > * { justify-self: start; }
  .sc-table--responsive .sc-table__cell::before {
    content: attr(data-label);
    color: rgb(var(--color-text-secondary));
    font-weight: var(--weight-semibold);
  }
  .sc-table--responsive .sc-table__cell--primary {
    display: block;
    font-size: var(--text-body);
  }
  .sc-table--responsive .sc-table__cell--primary::before { content: none; }
  .sc-table--responsive .sc-table__actions { width: auto; }
  .sc-table--responsive .sc-table__actions::before { content: none; }
  .sc-table--responsive .sc-table__actions-list { display: flex; flex-wrap: wrap; }
}

/* ── Summary card ── A titled, bordered block. Also the default container for a page section. */
.sc-summary-card {
  margin-bottom: var(--space-7);
  border: var(--border-width) solid rgb(var(--color-border));
  background: rgb(var(--color-bg));
}

.sc-summary-card__title-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-width) solid rgb(var(--color-border));
}

.sc-summary-card__title {
  margin: 0;
  font-size: var(--text-s);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
}

.sc-summary-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-body-s);
}

.sc-summary-card__content { padding: var(--space-2) var(--space-5) var(--space-5); }
.sc-summary-card__content--spacious { padding-top: var(--space-5); }
.sc-summary-card__content--flush { padding: 0; }
.sc-summary-card__content > :last-child { margin-bottom: 0; }
.sc-summary-card__content > .sc-summary-list { margin-bottom: 0; }
/* A list's row padding spaces its rows; at the card's edges the card's own padding is enough. */
.sc-summary-card__content > .sc-summary-list > .sc-summary-list__row:last-child,
.sc-summary-card__content > .sc-step-progress__list > .sc-step-progress__item:last-child { padding-bottom: 0; }
.sc-summary-card__content--spacious > .sc-summary-list:first-child > .sc-summary-list__row:first-child,
.sc-summary-card__content--spacious > .sc-step-progress__list:first-child > .sc-step-progress__item:first-child { padding-top: 0; }
.sc-summary-card__content--flush .sc-table-wrapper { margin: 0; border: 0; }
.sc-summary-card__content--flush .sc-table__head .sc-table__header { border-top: 0; }
.sc-summary-card__content--flush .sc-tabs { margin: var(--space-4) var(--space-5) 0; }
.sc-summary-card__content--flush .sc-empty-state { margin: var(--space-5); }
.sc-summary-card__content--flush .sc-filter-bar { margin: var(--space-4) var(--space-5); }
.sc-summary-card__content--flush .sc-filter-bar__summary { margin-inline: var(--space-5); }
.sc-summary-card__content--flush .sc-pagination { margin: var(--space-4) var(--space-5); }

.sc-summary-card__footer {
  padding: var(--space-3) var(--space-5);
  border-top: var(--border-width) solid rgb(var(--color-border));
  font-size: var(--text-body-s);
}

.sc-summary-card--danger { border-color: rgb(var(--color-error)); }
.sc-summary-card--danger .sc-summary-card__title-wrapper { border-bottom-color: rgb(var(--color-error)); }

@media (max-width: 640px) {
  .sc-summary-card__title-wrapper,
  .sc-summary-card__content,
  .sc-summary-card__footer { padding-inline: var(--space-4); }
}

/* ── Task list ── Each row is a task with a status; the whole row is the link when the task can be started. */
.sc-task-list {
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  border-top: var(--border-width) solid rgb(var(--color-border-subtle));
}

.sc-task-list__item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-4);
  border-bottom: var(--border-width) solid rgb(var(--color-border-subtle));
}
.sc-summary-card__content > .sc-task-list:first-child { border-top: 0; }
.sc-task-list__item--with-link:hover { background: rgb(var(--color-surface)); }

.sc-task-list__name-and-hint { flex: 1 1 280px; min-width: 0; }
.sc-task-list__name { font-weight: var(--weight-semibold); }
.sc-task-list__name--disabled { color: rgb(var(--color-text-secondary)); }

.sc-task-list__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.sc-task-list__hint {
  display: block;
  margin-top: 2px;
  color: rgb(var(--color-text-secondary));
  font-size: var(--text-small);
}

.sc-task-list__status {
  flex: none;
  color: rgb(var(--color-text));
  font-size: var(--text-body-s);
}
.sc-task-list__status--cannot-start-yet { color: rgb(var(--color-text-secondary)); }

.sc-task-list-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}
.sc-task-list-summary__status { color: rgb(var(--color-text-secondary)); font-size: var(--text-body-s); }
.sc-task-list-summary + .sc-progress { margin-bottom: var(--space-2); }

/* ── Step progress ── The "where am I" aside on multi-step flows. */
.sc-step-progress {
  padding: var(--space-5) var(--space-5);
  background: rgb(var(--color-surface));
}
.sc-step-progress__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-s);
  font-weight: var(--weight-bold);
}
.sc-step-progress__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sc-step-progress__item {
  display: flex;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: var(--border-width) solid rgb(var(--color-border));
}
.sc-step-progress__item:last-child { border-bottom: 0; }
.sc-step-progress__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  background: rgb(var(--color-surface-strong));
  color: rgb(var(--grey-700));
  font-size: var(--text-small);
  font-weight: var(--weight-bold);
}
.sc-step-progress__item--current .sc-step-progress__number { background: rgb(var(--color-accent)); color: rgb(var(--color-accent-text)); }
.sc-step-progress__item--complete .sc-step-progress__number { background: rgb(var(--color-success)); color: rgb(var(--color-text-inverse)); }
.sc-step-progress__name { display: block; font-weight: var(--weight-semibold); }
.sc-step-progress__item .sc-tag { margin-top: var(--space-1); }
.sc-step-progress__footer { margin: var(--space-2) 0 0; color: rgb(var(--color-text-secondary)); font-size: var(--text-small); }

/* Horizontal: the strip above an onboarding wizard's form. Wraps on phones. */
.sc-step-progress--horizontal {
  margin-bottom: var(--space-7);
  padding: 0;
  background: none;
}
.sc-step-progress--horizontal .sc-step-progress__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
}
.sc-step-progress--horizontal .sc-step-progress__item {
  align-items: center;
  padding: 0;
  border: 0;
}
.sc-step-progress--horizontal .sc-step-progress__item:not(.sc-step-progress__item--current, .sc-step-progress__item--complete) .sc-step-progress__name {
  color: rgb(var(--color-text-secondary));
  font-weight: var(--weight-regular);
}
.sc-step-progress--horizontal .sc-step-progress__item--current .sc-step-progress__name { font-weight: var(--weight-bold); }

/* ── Panel ── The confirmation page's headline. */
.sc-panel {
  margin-bottom: var(--space-7);
  padding: var(--space-8) var(--space-6);
  background: rgb(var(--color-success));
  color: rgb(var(--color-text-inverse));
  text-align: center;
}
.sc-panel__title {
  margin: 0 0 var(--space-4);
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}
.sc-panel__body {
  margin: 0;
  font-size: var(--text-l);
}
.sc-panel__body strong { display: block; font-variant-numeric: tabular-nums; }

/* ── Accordion ── */
.sc-accordion { margin-bottom: var(--space-7); }

.sc-accordion__controls { margin-bottom: var(--space-2); }

.sc-accordion__section { border-top: var(--border-width) solid rgb(var(--color-border)); }
.sc-accordion__section:last-child { border-bottom: var(--border-width) solid rgb(var(--color-border)); }

.sc-accordion__heading { margin: 0; font-size: var(--text-s); font-weight: var(--weight-bold); }

.sc-accordion__button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 56px;
  padding: var(--space-3) 0;
  border: 0;
  background: none;
  color: rgb(var(--color-text));
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sc-accordion__button:hover .sc-accordion__label { text-decoration: underline; text-underline-offset: .15em; }

.sc-accordion__icon {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.sc-accordion__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -6px 0 0 -4px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
[aria-expanded="true"] > .sc-accordion__icon::after { margin-top: -2px; transform: rotate(-135deg); }

.sc-accordion__summary {
  display: block;
  color: rgb(var(--color-text-secondary));
  font-size: var(--text-body-s);
  font-weight: var(--weight-regular);
}

.sc-accordion__button:focus-visible {
  outline: var(--focus-width) solid transparent;
  background: rgb(var(--color-focus));
  color: rgb(var(--color-focus-text));
  box-shadow: 0 var(--focus-bar) rgb(var(--color-focus-text));
}
.sc-accordion__button:focus-visible .sc-accordion__summary { color: rgb(var(--color-focus-text)); }

.sc-accordion__content { padding: 0 0 var(--space-6) 36px; }
.sc-accordion__content > :last-child { margin-bottom: 0; }

/* ── Dialog ── Native <dialog>, opened with showModal(): inert background and Escape for free; sc.js returns focus to the trigger. */
.sc-dialog {
  width: min(var(--dialog-width), calc(100vw - var(--space-7)));
  max-height: calc(100vh - var(--space-7));
  padding: 0;
  border: var(--border-width-rule) solid rgb(var(--color-text));
  background: rgb(var(--color-bg));
  color: rgb(var(--color-text));
}
.sc-dialog::backdrop { background: rgb(var(--color-text) / .6); }

.sc-dialog__body { padding: var(--space-6); }
.sc-dialog__title { margin: 0 0 var(--space-3); font-size: var(--text-m); font-weight: var(--weight-bold); line-height: var(--leading-heading); }
.sc-dialog__message { margin: 0 0 var(--space-6); }
.sc-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
}

/* ── Drawer ── Also a native <dialog>, pinned to the right edge. */
.sc-drawer {
  width: min(var(--drawer-width), 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: var(--border-width-rule) solid rgb(var(--color-text));
  background: rgb(var(--color-bg));
  color: rgb(var(--color-text));
}
.sc-drawer::backdrop { background: rgb(var(--color-text) / .4); }
.sc-drawer[open] { display: flex; flex-direction: column; animation: sc-slide-in var(--duration-base) ease-out; }

.sc-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-width) solid rgb(var(--color-border));
}
.sc-drawer__title { margin: 0; font-size: var(--text-s); font-weight: var(--weight-bold); }
.sc-drawer__body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-2) var(--space-5) var(--space-5); }
.sc-drawer__footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); padding: var(--space-3) var(--space-5); border-top: var(--border-width) solid rgb(var(--color-border)); font-size: var(--text-body-s); }

.sc-close-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--control-height);
  padding: 0 var(--space-2);
  border: 0;
  background: none;
  color: rgb(var(--color-link));
  font-size: var(--text-body-s);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: .15em;
  cursor: pointer;
}
.sc-close-button:focus-visible {
  outline: var(--focus-width) solid transparent;
  background: rgb(var(--color-focus));
  color: rgb(var(--color-focus-text));
  box-shadow: 0 var(--focus-bar) rgb(var(--color-focus-text));
  text-decoration: none;
}

/* ── Notification list ── Inside the drawer. Unread is said in words, the dot only repeats it. */
.sc-notification-list { margin: 0; padding: 0; list-style: none; }
.sc-notification-list__item {
  position: relative;
  padding: var(--space-3) 0 var(--space-3) var(--space-5);
  border-bottom: var(--border-width) solid rgb(var(--color-border-subtle));
  font-size: var(--text-body-s);
}
.sc-notification-list__item--unread::before {
  content: "";
  position: absolute;
  top: calc(var(--space-3) + 7px);
  left: 0;
  width: 10px;
  height: 10px;
  background: rgb(var(--color-accent));
}
.sc-notification-list__title { margin: 0; font-weight: var(--weight-semibold); }
.sc-notification-list__meta { margin: 2px 0 0; color: rgb(var(--color-text-secondary)); font-size: var(--text-small); }

/* ── App launcher ── The /apps home grid. */
.sc-app-launcher {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-7);
  padding: 0;
  list-style: none;
}
.sc-app-launcher__link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-4);
  border: var(--border-width) solid rgb(var(--color-border));
  color: rgb(var(--color-text));
  text-decoration: none;
}
.sc-app-launcher__link:hover { border-color: rgb(var(--color-border-strong)); }
.sc-app-launcher__link .sc-app-mark { margin-top: 7px; }
.sc-app-launcher__name {
  display: block;
  color: rgb(var(--color-link));
  font-weight: var(--weight-bold);
  text-decoration: underline;
  text-decoration-thickness: max(1px, .0625rem);
  text-underline-offset: .15em;
}
.sc-app-launcher__link:hover .sc-app-launcher__name { color: rgb(var(--color-link-hover)); text-decoration-thickness: max(3px, .1875rem); }
.sc-app-launcher__blurb { display: block; color: rgb(var(--color-text-secondary)); font-size: var(--text-small); }
.sc-app-launcher__link:focus-visible {
  outline: var(--focus-width) solid transparent;
  background: rgb(var(--color-focus));
  border-color: rgb(var(--color-focus-text));
  box-shadow: inset 0 calc(var(--focus-bar) * -1) rgb(var(--color-focus-text));
}
.sc-app-launcher__link:focus-visible .sc-app-launcher__name,
.sc-app-launcher__link:focus-visible .sc-app-launcher__blurb { color: rgb(var(--color-focus-text)); text-decoration: none; }
