/* Orbit design system: content and navigation components for lobby lists, rosters, messages, campaign
   reference and settings. docs/design-system/surfaces.md explains every rule and lists the ad hoc
   styles each component replaces. Load after design-tokens.css, design-system.css and style.css. It reads
   only --ds-* tokens. The density and avatar tokens it declares below belong in design/tokens.json once
   that file can express per-subtree modes; until then they live here. */

:root,
[data-density="comfortable"] {
  /* Density hooks. Components size themselves from these, never from a raw value, so a subtree switches
     with data-density="compact" or back with data-density="comfortable". */
  --ds-density-row: var(--ds-target);
  --ds-density-pad-block: var(--ds-space-2);
  --ds-density-pad-inline: var(--ds-space-3);
  --ds-density-gap: var(--ds-space-3);
  --ds-density-inset: var(--ds-space-4);
  --ds-density-text: var(--ds-text-lg);
  --ds-density-subtext: var(--ds-text-sm);
}

:root {
  /* Avatar scale. md matches the roster rows; xl matches the prejoin preview at phone width. */
  --ds-avatar-xs: 20px;
  --ds-avatar-sm: 28px;
  --ds-avatar-md: 36px;
  --ds-avatar-lg: 48px;
  --ds-avatar-xl: 72px;
}

/* Compact rows stay at 32px, above WCAG 2.2's 24px minimum target. */
[data-density="compact"] {
  --ds-density-row: calc(var(--ds-target-compact) + var(--ds-space-1));
  --ds-density-pad-block: var(--ds-space-1);
  --ds-density-pad-inline: var(--ds-space-2);
  --ds-density-gap: var(--ds-space-2);
  --ds-density-inset: var(--ds-space-3);
  --ds-density-text: var(--ds-text-md);
  --ds-density-subtext: var(--ds-text-xs);
}

/* A finger needs the comfortable target even where a mouse is happy with compact text. */
@media (pointer: coarse) {
  [data-density="compact"] { --ds-density-row: var(--ds-target); }
}

/* Tabs: the ARIA tablist pattern. Put role="tablist" and an accessible name on .ds-tabs, role="tab",
   aria-selected and aria-controls on each button, and role="tabpanel" on .ds-tabpanel. Only the selected
   tab is in the tab order; arrow keys, Home and End move between tabs (surfaces.md has the script). */

.ds-tabs {
  display: flex;
  gap: var(--ds-space-1);
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  border-block-end: 1px solid var(--ds-hairline);
}

.ds-tab {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  /* A long translation wraps inside 20 characters instead of pushing its neighbours out of view. */
  max-inline-size: min(100%, 20ch);
  min-block-size: var(--ds-density-row);
  margin: 0 0 -1px;
  padding: 0 var(--ds-density-pad-inline);
  border: 0;
  border-block-end: 2px solid transparent;
  color: var(--ds-ink-muted);
  background: transparent;
  font: 600 var(--ds-density-text)/1.2 var(--ds-font-sans);
  text-align: center;
  text-wrap: balance;
  overflow-wrap: break-word;
  cursor: pointer;
  transition: color var(--ds-duration-fast) var(--ds-ease-standard), border-color var(--ds-duration-fast) var(--ds-ease-standard),
    background-color var(--ds-duration-fast) var(--ds-ease-standard);
}
.ds-tab:hover:enabled { color: var(--ds-ink); }
.ds-tab[aria-selected="true"] { color: var(--ds-ink); border-block-end-color: var(--ds-accent); }
.ds-tab:disabled { color: var(--ds-ink-disabled); opacity: .6; cursor: not-allowed; }
/* The tablist scrolls, which clips an outside ring, so the ring sits inside the tab. */
.ds-tabs > .ds-tab:focus-visible { outline: var(--ds-focus-width) solid var(--ds-focus-color); outline-offset: calc(var(--ds-focus-width) * -1); }

/* Segmented pill: the same tablist drawn like .ds-segmented. Use it for two to four short views. */
/* Long labels wrap the pill onto a second row rather than scroll or break words. */
.ds-tabs--pill {
  flex-wrap: wrap;
  overflow-x: visible;
  gap: var(--ds-space-0);
  padding: var(--ds-space-0);
  border: 0;
  border-radius: var(--ds-radius-md);
  background: var(--ds-fill-sunken);
  box-shadow: inset 0 0 0 1px var(--ds-hairline);
}
.ds-tabs--pill > .ds-tab {
  flex: 1 1 auto;
  min-block-size: calc(var(--ds-density-row) - var(--ds-space-0) * 2);
  margin: 0;
  border: 0;
  max-inline-size: 100%;
  border-radius: calc(var(--ds-radius-md) - var(--ds-space-0));
}
.ds-tabs--pill > .ds-tab:focus-visible { outline-offset: var(--ds-focus-offset); }
.ds-tabs--pill > .ds-tab[aria-selected="true"] { background: var(--ds-fill-raised); box-shadow: var(--ds-shadow-raise); }

.ds-tabpanel { min-width: 0; padding-block-start: var(--ds-density-gap); }

/* List: rows in a <ul>/<ol>, optionally grouped under a heading. A row is either one link or button
   (.ds-row on the <a>/<button>), or a <li class="ds-row"> whose .ds-row-primary link stretches over the
   row while trailing actions stay separately clickable. Never nest a button inside a button. */

.ds-list { display: grid; gap: var(--ds-space-0); margin: 0; padding: 0; list-style: none; min-width: 0; }
.ds-list--divided { gap: 0; }
.ds-list--divided > * + * { border-block-start: 1px solid var(--ds-hairline); }
.ds-list--inset { padding: var(--ds-space-1); border-radius: var(--ds-radius-lg); background: var(--ds-surface); box-shadow: inset 0 0 0 1px var(--ds-hairline); }
.ds-list--inset .ds-row { border-radius: calc(var(--ds-radius-lg) - var(--ds-space-1)); }

.ds-list-group { display: grid; gap: var(--ds-space-1); min-width: 0; }
.ds-list-group + .ds-list-group { margin-block-start: var(--ds-density-gap); }
.ds-list-group-header {
  margin: 0;
  padding-inline: var(--ds-density-pad-inline);
  color: var(--ds-ink-muted);
  font: 600 var(--ds-text-sm)/1.3 var(--ds-font-sans);
  overflow-wrap: anywhere;
}

.ds-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-1) var(--ds-density-gap);
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: var(--ds-density-row);
  margin: 0;
  padding: var(--ds-density-pad-block) var(--ds-density-pad-inline);
  border: 0;
  border-radius: var(--ds-radius-md);
  color: var(--ds-ink);
  background: transparent;
  font: 400 var(--ds-density-text)/1.3 var(--ds-font-sans);
  text-align: start;
  text-decoration: none;
  transition: background-color var(--ds-duration-fast) var(--ds-ease-standard);
}
.ds-row-leading { display: inline-grid; flex: none; place-items: center; min-inline-size: 20px; color: var(--ds-ink-muted); }
/* The body keeps at least 12 characters; past that, trailing actions wrap under it instead of crushing it. */
.ds-row-body { display: grid; flex: 1 1 12ch; gap: var(--ds-space-0); min-width: 0; }
.ds-row-title { color: var(--ds-ink); font-weight: 500; overflow-wrap: anywhere; }
.ds-row-subtitle { color: var(--ds-ink-muted); font-size: var(--ds-density-subtext); line-height: 1.35; overflow-wrap: anywhere; }
.ds-row-trailing { position: relative; z-index: 1; display: flex; flex: none; align-items: center; gap: var(--ds-space-1); margin-inline-start: auto; color: var(--ds-ink-muted); font-size: var(--ds-density-subtext); font-variant-numeric: tabular-nums; }
/* Opt in where a roster must stay one line per person; the full name still belongs in the accessible name. */
.ds-row--truncate :is(.ds-row-title, .ds-row-subtitle) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ds-row-primary { color: inherit; text-decoration: none; }
.ds-row-primary::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }

:is(a[href], button, label).ds-row,
.ds-row:has(.ds-row-primary) { cursor: pointer; }
:is(a[href], button:enabled, label).ds-row:hover,
.ds-row:has(.ds-row-primary:hover) { background: var(--ds-hairline); }
:is(a[href], button:enabled).ds-row:active,
.ds-row:has(.ds-row-primary:active) { background: var(--ds-fill-pressed); }

/* Rows usually sit in scrolling panels, so their ring is inset. */
.ds-row:is(a, button, [tabindex]):focus-visible,
.ds-row:has(.ds-row-primary:focus-visible) { outline: var(--ds-focus-width) solid var(--ds-focus-color); outline-offset: calc(var(--ds-focus-width) * -1); }
.ds-row .ds-row-primary:focus-visible { outline: none; }

/* Selected is shown by a fill and a leading bar, so it does not depend on hue alone. */
.ds-row:is([aria-selected="true"], [aria-current]:not([aria-current="false"])),
.ds-row:has(.ds-row-primary[aria-current]:not([aria-current="false"])) { background: var(--ds-accent-wash); }
.ds-row:is([aria-selected="true"], [aria-current]:not([aria-current="false"]))::before,
.ds-row:has(.ds-row-primary[aria-current]:not([aria-current="false"]))::before {
  content: '';
  position: absolute;
  inset-block: var(--ds-space-2);
  inset-inline-start: 0;
  inline-size: 3px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-accent);
}
.ds-row:is(:disabled, [aria-disabled="true"]) { color: var(--ds-ink-disabled); opacity: .6; cursor: not-allowed; }
.ds-row:is(:disabled, [aria-disabled="true"]) .ds-row-title { color: inherit; }

/* Avatar: a photo over initials over a color. The initials stay in the DOM so a failed photo falls
   back to them; whoever loads the image sets [hidden] on it when it errors. */

.ds-avatar {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: var(--ds-avatar-size, var(--ds-avatar-md));
  block-size: var(--ds-avatar-size, var(--ds-avatar-md));
  border-radius: 50%;
  color: var(--ds-avatar-ink, var(--ds-ink));
  background: var(--ds-avatar-color, var(--ds-fill-raised));
  font: 700 calc(var(--ds-avatar-size, var(--ds-avatar-md)) * .4)/1 var(--ds-font-sans);
  user-select: none;
}
.ds-avatar > img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border-radius: inherit; object-fit: cover; }
.ds-avatar > img[hidden] { display: none; }
.ds-avatar-initials { max-inline-size: 90%; overflow: hidden; white-space: nowrap; unicode-bidi: isolate; }
.ds-avatar:has(> img:not([hidden])) > .ds-avatar-initials { visibility: hidden; }
.ds-avatar--square { border-radius: 30%; }

.ds-avatar--xs, .ds-avatar-stack--xs { --ds-avatar-size: var(--ds-avatar-xs); }
.ds-avatar--sm, .ds-avatar-stack--sm { --ds-avatar-size: var(--ds-avatar-sm); }
.ds-avatar--md, .ds-avatar-stack--md { --ds-avatar-size: var(--ds-avatar-md); }
.ds-avatar--lg, .ds-avatar-stack--lg { --ds-avatar-size: var(--ds-avatar-lg); }
.ds-avatar--xl, .ds-avatar-stack--xl { --ds-avatar-size: var(--ds-avatar-xl); }

/* Presence: each state has its own shape (solid, crescent, bar, ring), and the dot is aria-hidden, so
   pair it with visible or .ds-visually-hidden text. --ds-avatar-ring matches the surface behind it. */
.ds-avatar-presence {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  box-sizing: border-box;
  inline-size: max(8px, calc(var(--ds-avatar-size, var(--ds-avatar-md)) * .28));
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ds-ink-disabled);
  box-shadow: 0 0 0 2px var(--ds-avatar-ring, var(--ds-surface));
}
.ds-avatar-presence[data-presence="online"] { background: var(--ds-success); }
.ds-avatar-presence[data-presence="away"] {
  background: radial-gradient(circle at 30% 30%, var(--ds-avatar-ring, var(--ds-surface)) 38%, var(--ds-warning) 40%);
}
.ds-avatar-presence[data-presence="busy"] { background: var(--ds-danger-ink); }
.ds-avatar-presence[data-presence="busy"]::after {
  content: '';
  position: absolute;
  inset: calc(50% - 1px) 22%;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-avatar-ring, var(--ds-surface));
}
.ds-avatar-presence[data-presence="offline"] { border: 2px solid var(--ds-ink-disabled); background: var(--ds-avatar-ring, var(--ds-surface)); }

.ds-avatar-stack { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.ds-avatar-stack > * + * { margin-inline-start: calc(var(--ds-avatar-size, var(--ds-avatar-md)) * -.25); }
.ds-avatar-stack .ds-avatar { box-shadow: 0 0 0 2px var(--ds-avatar-ring, var(--ds-surface)); }
.ds-avatar-stack-more {
  color: var(--ds-ink-muted);
  background: var(--ds-fill);
  font-size: calc(var(--ds-avatar-size, var(--ds-avatar-md)) * .34);
  font-variant-numeric: tabular-nums;
}

/* Badge: a count or a one-word state. Longer text belongs in .ds-chip. */

.ds-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-inline-size: 18px;
  min-block-size: 18px;
  padding: 0 calc(var(--ds-space-1) + var(--ds-space-0) / 2);
  border-radius: var(--ds-radius-pill);
  color: var(--ds-ink);
  background: var(--ds-fill-raised);
  font: 700 var(--ds-text-xs)/1 var(--ds-font-sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: middle;
}
.ds-badge--accent { color: var(--ds-accent-ink); background: var(--ds-accent); }
.ds-badge--success { color: var(--ds-canvas); background: var(--ds-success); }
.ds-badge--warning { color: var(--ds-canvas); background: var(--ds-warning); }
.ds-badge--danger { color: var(--ds-danger-ink); background: var(--ds-danger); box-shadow: inset 0 0 0 1px var(--ds-danger-edge); }
/* A dot carries no text, so its meaning must be in the owner's accessible name. */
.ds-badge--dot { min-inline-size: 8px; min-block-size: 8px; inline-size: 8px; block-size: 8px; padding: 0; }
/* Pinned to the top end corner of a position:relative owner, such as an icon button. */
.ds-badge--attached {
  position: absolute;
  inset-block-start: calc(var(--ds-space-1) * -1);
  inset-inline-end: calc(var(--ds-space-1) * -1);
  box-shadow: 0 0 0 2px var(--ds-badge-ring, var(--ds-surface));
  pointer-events: none;
}

/* Progress: a native <progress>. Without a value it is indeterminate: a sweeping band, or static
   stripes when the person asks for reduced motion. Name it with a <label> or aria-labelledby. */

.ds-progress {
  display: block;
  box-sizing: border-box;
  inline-size: 100%;
  block-size: var(--ds-progress-height, 6px);
  border: 0;
  border-radius: var(--ds-radius-pill);
  overflow: hidden;
  color: var(--ds-accent);
  background: var(--ds-fill-sunken);
  box-shadow: inset 0 0 0 1px var(--ds-hairline);
  appearance: none;
}
.ds-progress::-webkit-progress-bar { background: transparent; }
.ds-progress::-webkit-progress-value { border-radius: inherit; background: var(--ds-accent); transition: inline-size var(--ds-duration-base) var(--ds-ease-out); }
.ds-progress::-moz-progress-bar { border-radius: inherit; background: var(--ds-accent); }
.ds-progress:indeterminate::-moz-progress-bar { background: transparent; }
.ds-progress:indeterminate {
  background: repeating-linear-gradient(-45deg, var(--ds-accent-wash) 0 6px, var(--ds-fill-sunken) 6px 12px);
}
@media (prefers-reduced-motion: no-preference) {
  .ds-progress:indeterminate {
    background: linear-gradient(90deg, transparent, var(--ds-accent), transparent) no-repeat -150% 0 / 40% 100%, var(--ds-fill-sunken);
    animation: ds-progress-sweep 1.4s var(--ds-ease-standard) infinite;
  }
  .ds-progress:indeterminate:dir(rtl) { animation-direction: reverse; }
}
@keyframes ds-progress-sweep { to { background-position: 250% 0, 0 0; } }

.ds-progress-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--ds-space-1) var(--ds-space-3);
  margin-block-end: var(--ds-space-1);
  color: var(--ds-ink-muted);
  font: 600 var(--ds-text-sm)/1.3 var(--ds-font-sans);
  overflow-wrap: anywhere;
}
.ds-progress-label > :last-child { font-variant-numeric: tabular-nums; }

/* Spinner: decorative (aria-hidden). Announce the wait in text, e.g. a role="status" line beside it.
   Reduced motion swaps the spin for a slow fade. */

.ds-spinner {
  --ds-spinner-size: 20px;
  display: inline-block;
  flex: none;
  box-sizing: border-box;
  inline-size: var(--ds-spinner-size);
  block-size: var(--ds-spinner-size);
  border: max(2px, calc(var(--ds-spinner-size) / 9)) solid var(--ds-fill-raised);
  border-top-color: var(--ds-accent);
  border-radius: 50%;
  vertical-align: middle;
  animation: ds-pulse 1.6s var(--ds-ease-standard) infinite alternate;
}
.ds-spinner--sm { --ds-spinner-size: 16px; }
.ds-spinner--lg { --ds-spinner-size: 32px; }
@media (prefers-reduced-motion: no-preference) {
  .ds-spinner { animation: ds-spin .8s linear infinite; }
}
@keyframes ds-spin { to { rotate: 1turn; } }
@keyframes ds-pulse { from { opacity: .45; } }

/* Skeleton: placeholder shapes for content that is on its way. Mark them aria-hidden and set
   aria-busy="true" on the region. They appear only after 300ms, so fast loads never flash. */

.ds-skeleton {
  display: block;
  block-size: 1em;
  border-radius: var(--ds-radius-xs);
  background: var(--ds-fill);
  animation: ds-appear 1ms 300ms both;
}
.ds-skeleton--text { block-size: .75em; margin-block: .4em; inline-size: var(--ds-skeleton-width, 100%); }
.ds-skeleton--text:last-child:not(:only-child) { inline-size: var(--ds-skeleton-width, 62%); }
.ds-skeleton--circle { inline-size: var(--ds-avatar-size, var(--ds-avatar-md)); block-size: auto; aspect-ratio: 1; border-radius: 50%; }
.ds-skeleton--block { block-size: var(--ds-skeleton-height, 96px); border-radius: var(--ds-radius-md); }
@media (prefers-reduced-motion: no-preference) {
  .ds-skeleton {
    background: linear-gradient(90deg, transparent 30%, var(--ds-hairline) 50%, transparent 70%) 100% 0 / 300% 100%, var(--ds-fill);
    animation: ds-appear var(--ds-duration-base) 300ms both, ds-shimmer 1.6s linear 300ms infinite;
  }
  .ds-skeleton:dir(rtl) { animation-direction: normal, reverse; }
}
@keyframes ds-appear { from { opacity: 0; } }
@keyframes ds-shimmer { to { background-position: 0 0, 0 0; } }

/* Empty state: says what will appear here and offers the next step. The art is decorative. */

.ds-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--ds-space-2);
  min-block-size: var(--ds-empty-min-height, auto);
  padding: var(--ds-space-6) var(--ds-space-4);
  color: var(--ds-ink-muted);
  text-align: center;
}
.ds-empty-art { display: grid; place-items: center; margin-block-end: var(--ds-space-1); color: var(--ds-accent); font-size: 32px; line-height: 1; }
.ds-empty-art > :is(svg, img) { inline-size: 48px; block-size: 48px; }
.ds-empty-title { margin: 0; max-inline-size: 32ch; color: var(--ds-ink); font: 600 var(--ds-text-lg)/1.3 var(--ds-font-sans); text-wrap: balance; overflow-wrap: anywhere; }
.ds-empty-body { margin: 0; max-inline-size: 42ch; font: var(--ds-text-md)/1.45 var(--ds-font-sans); text-wrap: pretty; overflow-wrap: anywhere; }
.ds-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-space-2); margin-block-start: var(--ds-space-2); }
@media (prefers-reduced-motion: no-preference) {
  .ds-empty-art { animation: ds-drift 4s var(--ds-ease-standard) infinite alternate; }
}
@keyframes ds-drift { to { translate: 0 -3px; rotate: -3deg; } }

/* Card: a grouped container. A card becomes one target with a .ds-card-link that stretches over it;
   buttons elsewhere in the card stay separately clickable. */

.ds-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--ds-density-gap);
  min-width: 0;
  padding: var(--ds-density-inset);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  color: var(--ds-ink);
  background: var(--ds-surface);
  box-shadow: var(--ds-lip);
  overflow-wrap: anywhere;
  transition: border-color var(--ds-duration-fast) var(--ds-ease-standard), background-color var(--ds-duration-fast) var(--ds-ease-standard);
}
.ds-card--raised { background: var(--ds-surface-overlay); box-shadow: var(--ds-shadow-raise); }
.ds-card--sunken { background: var(--ds-fill-sunken); box-shadow: none; }
.ds-card-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--ds-space-2); min-width: 0; }
.ds-card-title { margin: 0; font: 600 var(--ds-text-lg)/1.3 var(--ds-font-sans); text-wrap: balance; }
.ds-card-subtitle { margin: 0; color: var(--ds-ink-muted); font-size: var(--ds-text-sm); line-height: 1.4; }
.ds-card-media {
  margin-block-start: calc(var(--ds-density-inset) * -1);
  margin-inline: calc(var(--ds-density-inset) * -1);
  overflow: hidden;
  border-start-start-radius: calc(var(--ds-radius-lg) - 1px);
  border-start-end-radius: calc(var(--ds-radius-lg) - 1px);
}
.ds-card-media > :is(img, video, canvas, svg) { display: block; inline-size: 100%; block-size: auto; }
.ds-card-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-space-2); }
/* Only actions rise above the stretched link; lifting the title would trap the link inside it. */
.ds-card-footer > *, .ds-card :is(button, .ds-card-action) { position: relative; z-index: 1; }

.ds-card-link { color: inherit; text-decoration: none; }
.ds-card-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.ds-card:has(.ds-card-link) { cursor: pointer; }
.ds-card:has(.ds-card-link:hover) { border-color: var(--ds-accent-edge); background: var(--ds-fill); }
.ds-card:has(.ds-card-link:focus-visible) { outline: var(--ds-focus-width) solid var(--ds-focus-color); outline-offset: var(--ds-focus-offset); }
.ds-card .ds-card-link:focus-visible { outline: none; }
.ds-card:has(.ds-card-link[aria-current]:not([aria-current="false"])),
.ds-card[aria-current]:not([aria-current="false"]) { border-color: var(--ds-accent); box-shadow: inset 0 0 0 1px var(--ds-accent); }

/* Divider: <hr class="ds-divider"> between blocks; the vertical form between inline items. A labelled
   divider is a plain element with text, not a separator, so its words stay readable. */

.ds-divider { block-size: 0; margin: var(--ds-density-gap) 0; border: 0; border-block-start: 1px solid var(--ds-hairline); }
.ds-divider--strong { border-color: var(--ds-border); }
.ds-divider--vertical { align-self: stretch; block-size: auto; inline-size: 0; margin: 0 var(--ds-space-1); border-block-start: 0; border-inline-start: 1px solid var(--ds-hairline); }
.ds-divider-label {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  margin-block: var(--ds-density-gap);
  color: var(--ds-ink-muted);
  font: 600 var(--ds-text-xs)/1.3 var(--ds-font-sans);
  text-align: center;
  overflow-wrap: anywhere;
}
.ds-divider-label::before, .ds-divider-label::after { content: ''; flex: 1 1 var(--ds-space-4); border-block-start: 1px solid var(--ds-hairline); }

/* Kbd: one key, or a combination as an outer <kbd> holding one inner <kbd> per key. */

.ds-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-inline-size: 20px;
  min-block-size: 20px;
  padding: 0 var(--ds-space-1);
  border: 1px solid var(--ds-border-strong);
  border-block-end-width: 2px;
  border-radius: var(--ds-radius-xs);
  color: var(--ds-ink);
  background: var(--ds-fill);
  font: 600 var(--ds-text-xs)/1 var(--ds-font-sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  unicode-bidi: isolate;
  vertical-align: middle;
}
kbd.ds-kbd:has(> kbd) { gap: var(--ds-space-0); min-inline-size: 0; padding: 0; border: 0; background: transparent; }

/* Windows high contrast and other forced palettes. Hue-only signals get a system color and keep their
   shape; edges that were shadows become borders. */

@media (forced-colors: active) {
  .ds-tab { border-block-end-color: Canvas; }
  .ds-tab[aria-selected="true"] { border-block-end-color: Highlight; }
  .ds-tabs--pill > .ds-tab[aria-selected="true"]:not(:focus-visible) { outline: 2px solid Highlight; outline-offset: -2px; }
  .ds-tabs--pill > .ds-tab[aria-selected="true"]:focus-visible { text-decoration: underline; }
  .ds-tabs--pill, .ds-list--inset, .ds-card, .ds-badge, .ds-progress { border: 1px solid CanvasText; }
  .ds-row:is([aria-selected="true"], [aria-current]:not([aria-current="false"]))::before,
  .ds-row:has(.ds-row-primary[aria-current]:not([aria-current="false"]))::before,
  .ds-avatar-presence[data-presence],
  .ds-badge--dot { forced-color-adjust: none; background: Highlight; }
  .ds-avatar-presence[data-presence] { box-shadow: 0 0 0 2px Canvas; }
  .ds-avatar-presence[data-presence="away"] { background: radial-gradient(circle at 30% 30%, Canvas 38%, Highlight 40%); }
  .ds-avatar-presence[data-presence="busy"]::after { background: Canvas; }
  .ds-avatar-presence[data-presence="offline"] { background: Canvas; border-color: GrayText; }
  .ds-avatar { border: 1px solid CanvasText; }
  .ds-progress::-webkit-progress-value { background: Highlight; }
  .ds-progress::-moz-progress-bar { background: Highlight; }
  .ds-spinner { border-color: GrayText; border-top-color: Highlight; }
  .ds-skeleton { forced-color-adjust: none; background: GrayText; }
  .ds-kbd { border-color: CanvasText; }
  .ds-card:has(.ds-card-link[aria-current]:not([aria-current="false"])),
  .ds-card[aria-current]:not([aria-current="false"]) { border-color: Highlight; }
  .ds-card:is([aria-current]:not([aria-current="false"]), :has(.ds-card-link[aria-current]:not([aria-current="false"])))
    :is(.ds-card-title, .ds-card-link) { text-decoration: underline; }
}
