/* Tokens: load via <link href="../tokens/wmg-chords.css"> in HTML (reliable in Simple Browser). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body-md);
  line-height: 1.45;
  color: var(--text-default);
  background: var(--bg-level-01);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
}

/* Legacy .sidebar removed — design system site uses ../styles.css .sidebar-nav */

.sidebar-nav .sidebar-nav__scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sidebar-nav__components {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-top: 0;
}

.sidebar-nav__details {
  margin: 0;
}

.sidebar-nav__details--cat {
  margin-bottom: 0;
}

/* Category row — matches Figma parent nav row (icon + label + optional chevron) */
.sidebar-nav__summary {
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 2.5rem;
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  width: 2.25rem;
  max-width: 2.25rem;
  box-shadow: none;
  color: var(--text-default);
  font-size: var(--fs-body-sm);
  font-weight: 400;
  line-height: 18px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, width 0.15s ease,
    max-width 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-nav.is-expanded .sidebar-nav__summary {
  width: 14rem;
  max-width: 14rem;
  min-height: auto;
  box-shadow: var(--sidebar-nav-item-shadow);
}

.sidebar-nav__summary::-webkit-details-marker {
  display: none;
}

.sidebar-nav__summary:hover {
  background: var(--alpha-bg-default);
}

.sidebar-nav__summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sidebar-nav__summary--sub {
  /* Figma: same body text as primary rows, not uppercase */
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-default);
}

.sidebar-nav__icon--sub {
  font-size: 18px;
  opacity: 1;
  width: 1.125rem;
  height: 1.125rem;
}

.sidebar-nav__list--top {
  margin-bottom: 0;
}

.sidebar-nav__list--nested {
  box-sizing: border-box;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-sm) var(--space-lg);
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.sidebar-nav__list--nested > li {
  min-width: 0;
}

.sidebar-nav__list--nested .sidebar-nav__link {
  margin-left: 0;
}

.sidebar-nav:not(.is-expanded) .sidebar-nav__components {
  align-items: center;
  width: 100%;
}

.sidebar-nav:not(.is-expanded) .sidebar-nav__list--nested {
  display: none;
}

.main-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  flex-shrink: 0;
  padding: 0 var(--space-xl);
  border-bottom: 1px solid var(--bg-level-03);
  background: var(--bg-level-01);
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-title {
  margin: 0;
  font-size: var(--fs-display-sm);
  font-weight: var(--fw-semibold);
}

.content {
  padding: var(--space-xl);
  padding-bottom: var(--space-2xl);
  max-width: 1200px;
}

.section {
  margin-bottom: var(--space-2xl);
  scroll-margin-top: calc(var(--header-height) + var(--space-md));
}

.section-title {
  margin: 0 0 var(--space-sm);
  font-size: var(--fs-headline-md);
  font-weight: var(--fw-semibold);
}

.section-desc {
  margin: 0 0 var(--space-lg);
  color: var(--text-subtle);
  font-size: var(--fs-body-sm);
  max-width: 72ch;
}

.component-page__header {
  margin-bottom: var(--space-xl);
  max-width: 72ch;
}

.component-page__name {
  margin: 0 0 var(--space-sm);
  font-size: var(--fs-headline-md);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
  letter-spacing: -0.01em;
}

.component-page__usage {
  margin: 0;
  font-size: var(--fs-body-md);
  line-height: var(--lh-relaxed);
  color: var(--text-subtle);
}

.component-page__usage strong {
  color: var(--text-default);
  font-weight: var(--fw-semibold);
}

/* —— Documentation page shell (zeroheight-aligned tabs + hero) —— */
.ds-doc {
  max-width: 1200px;
}

.tabs--doc {
  margin: 0 0 calc(-1 * var(--space-sm));
}

.tab-panels--doc {
  padding-top: var(--space-lg);
}

.tab-panels--doc > .tab-panel {
  padding-top: 0;
}

.ds-doc-heading {
  margin: 0 0 var(--space-md);
  font-size: var(--fs-headline-md);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
  letter-spacing: -0.01em;
}

.ds-doc-lead {
  margin: 0 0 var(--space-lg);
  max-width: 72ch;
  font-size: var(--fs-body-md);
  line-height: var(--lh-relaxed);
  color: var(--text-subtle);
}

.ds-doc-prose {
  max-width: 72ch;
}

.ds-doc-prose .section-desc,
.ds-doc-prose .component-page__header {
  margin-bottom: var(--space-lg);
}

.ds-doc-prose .component-page__usage {
  margin: 0;
}

.ds-doc-placeholder {
  margin: 0;
  max-width: 72ch;
  font-size: var(--fs-body-md);
  line-height: var(--lh-relaxed);
  color: var(--text-subtle);
}

.ds-doc-placeholder code {
  font-size: 0.95em;
}

.ds-doc-code-intro {
  margin: 0 0 var(--space-xl);
  max-width: 72ch;
  font-size: var(--fs-body-md);
  line-height: var(--lh-relaxed);
  color: var(--text-subtle);
}

.ds-code-inline {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-level-03);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  color: var(--text-default);
}

.ds-code-section {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.ds-code-section:last-child {
  margin-bottom: 0;
}

.ds-code-section__title {
  margin: 0 0 var(--space-sm);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
}

.ds-code-section__hint {
  margin: 0 0 var(--space-md);
  max-width: 72ch;
  font-size: var(--fs-body-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-subtle);
}

.ds-code-block {
  margin: var(--space-md) 0;
  padding-block: 0;
  border: 1px solid var(--bg-level-03);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-level-02);
}

.ds-code-block__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--bg-level-03);
  background: var(--bg-level-01);
}

.ds-code-block__lang {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ds-code-block__copy {
  flex-shrink: 0;
}

/* Icon-only copy control (Font Awesome Free: regular; use fa-light with Pro kit if available) */
.ds-code-block__copy.btn-icon-only {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
}

.ds-code-block__pre {
  margin: 0;
  padding: var(--space-md);
  overflow: auto;
  max-height: min(480px, 55vh);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: var(--fs-caption);
  line-height: 1.55;
  color: var(--text-default);
  background: var(--bg-level-02);
  white-space: pre;
}

.ds-code-block__pre code {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.ds-doc-hero {
  margin: 0 0 var(--space-xl);
  max-width: 100%;
}

/* Matches prod doc hero banners (~860×218 in the main content column). */
.ds-doc-hero__frame {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 860 / 218;
  background: var(--base-800);
  border: 1px solid var(--bg-level-03);
}

.ds-doc-hero__img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  z-index: 1;
}

.ds-doc-hero__fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(ellipse 120% 100% at 50% 20%, rgba(91, 197, 248, 0.08), transparent 50%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.02) 18px,
      rgba(255, 255, 255, 0.02) 19px
    ),
    linear-gradient(165deg, #141820 0%, #0b0d12 100%);
}

/* Decorative pill grid (hero without uploaded image) */
.ds-doc-hero__fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: radial-gradient(ellipse 42% 55% at 50% 48%, rgba(91, 197, 248, 0.12), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 36px);
  pointer-events: none;
}

.ds-doc-hero__frame:has(.ds-doc-hero__img) .ds-doc-hero__fallback {
  opacity: 0;
  pointer-events: none;
}

.ds-doc-hero__pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-xl);
  border-radius: 999px;
  background: var(--primary-default);
  color: var(--text-on-primary);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.demo-panel {
  background: var(--bg-level-02);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--bg-level-03);
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.demo-row:last-child {
  margin-bottom: 0;
}

.demo-label {
  width: 100%;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

/* —— Foundations (zeroheight-aligned tokens in /tokens/wmg-chords.css) —— */
.foundation-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
}

.foundation-swatch {
  border-radius: var(--radius-sm);
  border: 1px solid var(--field-border-subtle);
  overflow: hidden;
  background: var(--bg-level-03);
}

.foundation-swatch__chip {
  height: 56px;
}

.foundation-swatch__meta {
  padding: var(--space-sm);
  font-size: var(--fs-caption);
  line-height: 1.35;
  color: var(--text-default);
}

.foundation-swatch__meta code {
  font-size: 11px;
  color: var(--text-subtle);
  word-break: break-all;
}

.foundation-type-sample {
  margin: 0 0 var(--space-md);
  color: var(--text-default);
}

.foundation-type-visual {
  margin: 0 0 var(--space-sm);
  color: var(--text-default);
}

.foundation-typescale-group {
  margin-top: var(--space-lg);
}

.foundation-typescale-group:first-child {
  margin-top: 0;
}

.foundation-typescale-group-title {
  margin: 0 0 var(--space-md);
  font-size: var(--fs-headline-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
  letter-spacing: 0.01em;
}

.foundation-typescale-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--space-md);
  align-items: baseline;
  margin-bottom: var(--space-sm);
}

.foundation-typescale-row:last-child {
  margin-bottom: 0;
}

.foundation-typescale-row .foundation-type-visual {
  margin-bottom: 0;
}

.foundation-typescale-row-label {
  margin: 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Typescale live mock: category | sample (at size) | specs — matches Figma typography boards */
.foundation-typescale-mock {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.foundation-typescale-mock-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  border: 1px solid var(--bg-level-04);
}

.foundation-typescale-mock-table th,
.foundation-typescale-mock-table td {
  padding: var(--space-md);
  border: 1px solid var(--bg-level-04);
  vertical-align: middle;
}

.foundation-typescale-mock-cat {
  width: 6.5rem;
  text-align: left;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  text-transform: none;
  letter-spacing: normal;
  background: var(--bg-level-03);
}

.foundation-typescale-mock-sample {
  margin: 0;
  color: var(--text-default);
  font-family: var(--font-sans);
}

.foundation-typescale-mock-spec {
  width: 6.5rem;
  text-align: right;
  font-size: var(--fs-caption);
  font-weight: 400;
  line-height: var(--lh-caption);
  color: var(--text-subtle);
  white-space: nowrap;
  background: var(--bg-level-03);
}

.foundation-typography-meta {
  margin: 0;
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  color: var(--text-subtle);
  font-family: var(--font-sans);
}

.foundation-typography-meta code {
  font-size: 11px;
}

.foundation-elev-demo {
  border-radius: var(--radius-sm);
  background: var(--bg-level-03);
  padding: var(--space-lg);
  border: 1px solid var(--field-border-subtle);
}

/* —— Buttons —— (WMG Chords Figma: Buttons, node 99:1798) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  box-sizing: border-box;
  border: none;
  border-radius: var(--radius-full);
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    text-decoration-thickness 0.15s ease,
    opacity 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
}

/* Heights: small 28, medium 32, large 40, xlarge 48 */
.btn-sm {
  min-height: 28px;
  padding: 4px var(--space-md);
  font-size: var(--fs-body-sm);
}

.btn-md {
  min-height: 32px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-body-md);
}

.btn-lg {
  min-height: 40px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-body-md);
}

.btn-xl {
  min-height: 48px;
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--fs-body-md);
}

.btn-primary {
  background: var(--primary-default);
  color: var(--text-strong);
  border: 1px solid transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--base-450);
}

.btn-primary:active:not(:disabled) {
  background: var(--primary-pressed);
  color: var(--text-strong);
}

.btn-primary:disabled {
  background: var(--primary-disabled-bg);
  color: var(--text-disabled);
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--text-strong);
  border: 1px solid var(--secondary-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--alpha-bg-strong);
  color: var(--text-strong);
  border-color: var(--base-50);
}

.btn-secondary:active:not(:disabled) {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--base-100);
}

.btn-secondary:disabled {
  background: transparent;
  color: var(--text-disabled);
  border-color: var(--text-disabled);
  opacity: 1;
}

/* Figma "Tertiary" = underlined label (not a stroked pill) */
.btn-tertiary {
  background: transparent;
  color: var(--text-strong);
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  min-height: 32px;
  padding: 10px 0;
}

.btn-tertiary.btn-sm {
  min-height: 22px;
  padding: 6px 0;
  font-size: var(--fs-body-sm);
}

.btn-tertiary:hover:not(:disabled) {
  color: var(--base-200);
  background: transparent;
  text-decoration-thickness: 2px;
}

.btn-tertiary:active:not(:disabled) {
  color: var(--base-50);
  text-decoration-thickness: 2px;
}

.btn-tertiary:disabled {
  color: var(--text-disabled);
  opacity: 1;
}

.btn-tertiary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Tertiary + icon-only: circular control (toolbar / filter trigger), not underlined text */
.btn-tertiary.btn-icon-only {
  border-radius: var(--radius-full);
  text-decoration: none;
  border: 1px solid var(--bg-level-04);
  background: transparent;
  color: var(--text-default);
}

.btn-tertiary.btn-icon-only:hover:not(:disabled) {
  background: var(--alpha-bg-default);
  color: var(--text-default);
  text-decoration: none;
  text-decoration-thickness: unset;
}

.btn-tertiary.btn-icon-only:active:not(:disabled) {
  background: var(--alpha-bg-strong);
  color: var(--text-default);
  text-decoration: none;
}

/* Ghost: low-emphasis fill on hover, no underline */
.btn-ghost {
  background: transparent;
  color: var(--text-subtle);
  border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--alpha-bg-default);
  color: var(--text-default);
}

.btn-ghost:active:not(:disabled) {
  background: var(--alpha-bg-strong);
  color: var(--text-default);
}

.btn-ghost:disabled {
  color: var(--text-disabled);
  opacity: 0.45;
}

.btn-icon-only.btn-sm {
  min-width: 28px;
  min-height: 28px;
  padding: 4px;
}

.btn-icon-only.btn-md {
  min-width: 37px;
  min-height: 37px;
  padding: 6px;
}

.btn-icon-only.btn-lg {
  min-width: 40px;
  min-height: 40px;
  padding: var(--space-sm);
}

.btn-icon-only.btn-xl {
  min-width: 48px;
  min-height: 48px;
  padding: var(--space-sm);
}

/* Accent text control (distinct from Figma tertiary underline) */
.text-link {
  background: none;
  border: none;
  color: var(--interactive-blue);
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.text-link:hover:not(:disabled) {
  color: var(--wmg-blue-200);
}

.text-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.text-link:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* —— Filters —— */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: var(--space-xs) 0;
  flex: 1;
  min-width: 200px;
  scrollbar-width: thin;
}

.filter-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--bg-level-01);
  border: 1px solid var(--bg-level-04);
  color: var(--text-default);
  font-size: var(--fs-body-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.filter-pill:hover {
  background: var(--bg-level-03);
}

.filter-pill.is-active {
  background: var(--bg-level-03);
  border-color: var(--bg-level-05);
}

.filter-pill .chevron {
  opacity: 0.7;
  font-size: 10px;
}

.filter-sort .sort-icon {
  margin-right: 2px;
}

.filter-reset {
  flex-shrink: 0;
}

.filter-applied-label {
  font-size: var(--fs-caption);
  color: var(--text-subtle);
  margin-right: var(--space-sm);
}

.filter-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px var(--space-sm) 4px var(--space-md);
  border-radius: var(--radius-full);
  background: var(--bg-level-03);
  font-size: var(--fs-caption);
  color: var(--text-default);
}

.filter-tag button {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  border-radius: var(--radius-full);
}

.filter-tag button:hover {
  color: var(--text-default);
  background: var(--alpha-bg-strong);
}

/* Filter button w/ count */
.filter-trigger {
  position: relative;
}

.filter-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--primary-default);
  color: var(--text-strong);
  font-size: 10px;
  font-weight: var(--fw-bold);
  display: grid;
  place-items: center;
}

/* Filter side panel (Figma: roster filter — WMG-Chords node 8822:4525; legacy side sheets 3220:14024) */
body.filter-panel-open {
  overflow: hidden;
}

.filter-side-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  visibility: hidden;
  pointer-events: none;
}

.filter-side-panel.is-open {
  visibility: visible;
  pointer-events: auto;
}

.filter-side-panel__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-scrim);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.filter-side-panel.is-open .filter-side-panel__backdrop {
  opacity: 1;
}

.filter-side-panel__sheet {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(400px, 100vw);
  height: 100%;
  max-height: 100dvh;
  background: var(--bg-level-02);
  color: var(--text-default);
  border-left: 1px solid var(--field-border-subtle);
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.28s ease;
}

.filter-side-panel.is-open .filter-side-panel__sheet {
  transform: translateX(0);
}

.filter-side-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-shrink: 0;
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  position: relative;
}

.filter-side-panel__title {
  margin: 0;
  font-size: var(--fs-headline-md);
  font-weight: var(--fw-bold);
  color: var(--text-default);
  line-height: 1.2;
}

.filter-side-panel__close.modal-close {
  font-size: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  color: var(--text-strong);
}

.filter-side-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.filter-accordion {
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-level-04);
  background: var(--alpha-bg-strong);
  overflow: hidden;
}

.filter-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  cursor: pointer;
  list-style: none;
}

.filter-accordion-summary::-webkit-details-marker {
  display: none;
}

.filter-accordion-chevron {
  font-size: 12px;
  color: var(--text-default);
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.filter-accordion[open] .filter-accordion-chevron {
  transform: rotate(180deg);
}

.filter-accordion-body {
  padding: 0 var(--space-lg) var(--space-md);
  border-top: 1px solid var(--bg-level-04);
}

.filter-accordion-body .choice:last-child {
  margin-bottom: 0;
}

.filter-side-panel__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
  border-top: 1px solid var(--field-border-subtle);
  background: var(--bg-level-03);
}

.filter-footer-link {
  margin: 0;
  padding: 10px 0;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--fs-body-md);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.filter-footer-link:hover {
  color: var(--base-200);
}

.filter-exposed-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 352px;
}

.filter-exposed-group__title {
  margin: 0;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
}

.filter-exposed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: flex-start;
}

.filter-exposed-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: 0;
  padding: var(--space-sm);
  border: 1px solid var(--field-border-subtle);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: var(--fs-body-sm);
  line-height: 18px;
  color: var(--text-default);
  cursor: pointer;
  transition: background 0.12s ease;
}

.filter-exposed-chip:hover {
  background: var(--alpha-bg-medium);
}

.filter-exposed-chip--all.is-active,
.filter-exposed-chip.filter-exposed-chip--all {
  background: var(--base-0);
  color: var(--base-650);
  border-color: var(--field-border-subtle);
}

.filter-exposed-chip__info {
  font-size: 14px;
  color: var(--text-strong);
}

.filter-panel-divider {
  margin: 0;
  border: none;
  border-top: 1px solid var(--field-border-subtle);
}

.filter-dropdown-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

.filter-dropdown-field__label {
  display: block;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.filter-dropdown-shell {
  border-radius: 4px;
  border: 1px solid rgba(240, 240, 240, 0.4);
  overflow: hidden;
  background: var(--bg-level-03);
}

.filter-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px var(--space-md);
  border: none;
  background: var(--alpha-bg-strong);
  font: inherit;
  font-size: var(--fs-body-sm);
  color: var(--text-strong);
  cursor: pointer;
  text-align: left;
}

.filter-dropdown-trigger__icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--text-default);
  font-size: 14px;
}

.filter-dropdown-panel {
  border-top: 1px solid var(--border-strong-emphasis);
}

.filter-dropdown-search {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 64px;
  padding: 15px var(--space-md);
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-strong-emphasis);
}

.filter-dropdown-search__icon {
  width: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-default);
  flex-shrink: 0;
}

.filter-dropdown-search__input {
  flex: 1;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0 var(--space-sm);
  border: 1px solid var(--field-border-subtle);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: var(--fs-body-sm);
  color: var(--text-default);
}

.filter-dropdown-search__input::placeholder {
  color: var(--text-subtle);
}

.filter-dropdown-search__input:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.filter-dropdown-selectall {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 32px);
  margin: var(--space-md) auto;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--base-0);
  border-radius: var(--radius-full);
  background: transparent;
  font: inherit;
  font-size: var(--fs-body-md);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  cursor: pointer;
}

.filter-dropdown-selectall:hover {
  background: rgba(255, 255, 255, 0.06);
}

.filter-dropdown-list {
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--border-strong-emphasis);
}

.filter-dropdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl) var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--border-strong-emphasis);
  background: var(--bg-level-03);
}

.filter-dropdown-row:last-child {
  border-bottom: none;
}

.filter-dropdown-row .choice {
  margin-bottom: 0;
  align-items: center;
}

.filter-dropdown-row__choice {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.filter-dropdown-row__choice span {
  font-weight: var(--fw-semibold);
}

.filter-dropdown-row__chev {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-default);
  opacity: 0.9;
}

.filter-save-default {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0 var(--space-md);
}

.filter-save-default__btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--fs-body-sm);
  line-height: 18px;
  color: var(--text-default);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.filter-save-default__btn:hover {
  color: var(--text-strong);
}

/* —— Pagination (WMG Chords prod / Figma 10058:3857; grouped bar, --radius-sm 8px outer corners) —— */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.pagination-meta {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-size: var(--fs-body-sm);
  color: var(--text-subtle);
}

.pagination-controls {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--field-border-subtle);
  background: var(--alpha-bg-default);
  overflow: hidden;
}

.pagination-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 32px;
  padding: 0 var(--space-sm);
  border: none;
  border-radius: 0;
  margin: 0;
  background: transparent;
  color: var(--text-strong);
  font-size: var(--fs-body-sm);
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pagination-seg + .pagination-seg {
  border-left: 1px solid var(--field-border-subtle);
}

.pagination-seg:hover:not(:disabled) {
  background: rgba(91, 197, 248, 0.16);
}

.pagination-seg:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--focus-ring);
  position: relative;
  z-index: 1;
}

.pagination-seg:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-seg i {
  pointer-events: none;
}

/* —— Tabs —— */
.tabs {
  border-bottom: 1px solid var(--bg-level-04);
}

.tablist {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tab {
  position: relative;
  padding: var(--space-sm) 0 var(--space-md);
  background: none;
  border: none;
  color: var(--text-subtle);
  font: inherit;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: color 0.15s ease;
}

.tab:hover {
  color: var(--text-default);
}

.tab[aria-selected="true"] {
  color: var(--text-default);
  font-weight: var(--fw-bold);
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--primary-default);
}

.tab-panels {
  padding: var(--space-lg) 0 0;
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel p {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--fs-body-sm);
}

/* —— Segmented data card (Figma 10078:2943 — spacing/type from design context) —— */
.segmented-data-cards {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: flex-start;
}

.data-card {
  --card-accent: var(--field-border-subtle);
  /* Frame: w 188px, p 16, radius 16, border strong-emphasis, elevation shadow */
  --data-card-fixed-width: 188px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 var(--data-card-fixed-width);
  width: var(--data-card-fixed-width);
  min-width: var(--data-card-fixed-width);
  max-width: var(--data-card-fixed-width);
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-level-02);
  border: 1px solid var(--border-strong-emphasis);
  box-shadow: 0 12px 11.5px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text-strong);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

/* Body: column gap 16 between TabGlow strip and content stack (Figma gap 16) */
.data-card-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

/* TabGlowLed: h 3px, full width of padded area, pill caps + blur layer */
.data-card-accent {
  display: block;
  height: 3px;
  width: 100%;
  flex-shrink: 0;
  margin: 0;
  border-radius: var(--radius-full);
  background: var(--card-accent);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* Inner stack: gap 8 between title, value block, footer (Figma gap 8) */
.data-card-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.data-card-label {
  margin: 0;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  color: var(--text-strong);
}

.data-card-value {
  margin: 0;
  font-size: 32px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

/* Footer row: gap 4px (Figma spacing/xsmall); one FA caret 14px solid */
.data-card-trend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--text-strong);
}

.data-card-trend-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.data-card-trend-icon {
  width: 14px;
  height: 14px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.data-card-trend-icon--down {
  color: var(--sys-error);
}

.data-card-trend-icon--up {
  color: var(--sys-success);
}

.data-card-trend-text {
  white-space: nowrap;
}

.data-card:hover:not(:disabled):not(.is-selected) {
  border-color: var(--border-strong-emphasis);
  background: var(--bg-level-03);
}

/* Selected — WMG yellow bar (TabGlow + LED); border translucent white */
.data-card.is-selected {
  --card-accent: var(--wmg-yellow-500);
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(255deg, rgba(255, 255, 255, 0.06) 0%, transparent 55%), var(--bg-level-02);
  box-shadow: 0 12px 11.5px rgba(0, 0, 0, 0.32);
}

.data-card.is-selected .data-card-accent {
  box-shadow: 0 0 3.45px rgba(237, 255, 67, 0.95);
}

.data-card.is-selected.data-card--accent-white {
  --card-accent: var(--base-100);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 55%), var(--bg-level-02);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 11.5px rgba(0, 0, 0, 0.32), 0 0 20px rgba(255, 255, 255, 0.1);
}

.data-card.is-selected.data-card--accent-white .data-card-accent {
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.55);
}

.data-card:disabled {
  cursor: not-allowed;
  background: var(--bg-level-03);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.data-card:disabled .data-card-accent {
  --card-accent: var(--base-600);
  opacity: 0.45;
  box-shadow: none;
}

.data-card:disabled .data-card-label,
.data-card:disabled .data-card-value,
.data-card:disabled .data-card-trend-row,
.data-card:disabled .data-card-trend-text {
  color: var(--text-disabled);
}

.data-card:disabled .data-card-trend-icon {
  color: var(--text-disabled);
}

/* —— Segmented control (WMG Chords Figma 9353:5606 — inset track + raised selected) —— */
.segmented {
  --segmented-inset: 3px;
  --segmented-inner-r: max(2px, calc(var(--radius-sm) - var(--segmented-inset)));
  display: inline-flex;
  align-items: stretch;
  padding: var(--segmented-inset);
  border-radius: var(--radius-sm);
  background: var(--bg-level-03);
  overflow: hidden;
}

.segmented.fill {
  width: 100%;
  max-width: 420px;
}

.segmented.fill button {
  flex: 1;
}

.segmented:not(.fill) button {
  flex: 0 1 auto;
}

.segmented button {
  min-width: 0;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented button:first-child {
  border-radius: var(--segmented-inner-r) 0 0 var(--segmented-inner-r);
}

.segmented button:last-child {
  border-radius: 0 var(--segmented-inner-r) var(--segmented-inner-r) 0;
}

.segmented button:only-child {
  border-radius: var(--segmented-inner-r);
}

/* Middle segments only when not selected — selected uses full radius on .is-selected */
.segmented button:not(:first-child):not(:last-child):not(.is-selected) {
  border-radius: 0;
}

.segmented button:hover:not(:disabled):not(.is-selected) {
  background: var(--alpha-bg-strong);
  color: var(--text-strong);
}

.segmented button.is-selected {
  border-radius: var(--segmented-inner-r);
  background: var(--bg-level-04);
  color: var(--wmg-yellow-500);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.45);
}

.segmented button.is-selected:hover:not(:disabled) {
  background: var(--bg-level-05);
  color: var(--wmg-yellow-500);
}

.segmented button:focus-visible {
  outline: none;
  position: relative;
  z-index: 1;
}

.segmented button:focus-visible:not(.is-selected) {
  box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.segmented button.is-selected:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px var(--focus-ring);
}

.segmented button:active:not(:disabled):not(.is-selected) {
  background: var(--bg-level-05);
  color: var(--text-strong);
}

.segmented button.is-selected:active:not(:disabled) {
  background: var(--bg-level-05);
  color: var(--wmg-yellow-500);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.segmented-hug {
  display: inline-flex;
}

/* —— Form field —— */
.form-field {
  margin-bottom: var(--space-lg);
  max-width: 420px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
  margin-bottom: var(--space-xs);
}

.field-label .req {
  color: var(--sys-error-deep);
}

.input-wrap {
  position: relative;
}

.field-input,
.field-textarea,
.field-select {
  width: 100%;
  padding: 12px var(--space-md);
  border-radius: 4px;
  border: 1px solid var(--field-border-subtle);
  background: var(--field-bg-default);
  color: var(--text-default);
  font: inherit;
  font-size: var(--fs-body-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input:hover:not(:disabled),
.field-textarea:hover:not(:disabled),
.field-select:hover:not(:disabled) {
  background: var(--field-bg-hover);
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-subtle);
}

.field-textarea {
  min-height: 100px;
  resize: vertical;
}

.field-input.is-error {
  border-color: var(--sys-error-deep);
  outline: 2px solid var(--sys-error-deep);
  outline-offset: 0;
}

.field-input.is-error:focus {
  outline-color: var(--sys-error-deep);
}

.field-input.is-success {
  border-color: var(--sys-success-deep);
  outline: 2px solid var(--sys-success-deep);
  outline-offset: 0;
}

.field-input.is-warning {
  border-color: var(--sys-warning);
  outline: 2px solid var(--sys-warning);
  outline-offset: 0;
}

.field-input:disabled,
.field-textarea:disabled,
.field-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-lg .field-input {
  padding: 14px var(--space-md);
  min-height: 48px;
}

.input-sm .field-input {
  padding: 8px var(--space-md);
  min-height: 40px;
}

/* Input with affix */
.input-group {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--bg-level-04);
  background: var(--alpha-bg-default);
  max-width: 320px;
}

.input-group:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.input-group .affix {
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  font-size: var(--fs-body-sm);
  color: var(--text-subtle);
  background: var(--bg-level-03);
  border: none;
}

.input-group .field-input {
  border-radius: 0;
  border: none;
  flex: 1;
  min-width: 0;
}

.input-group .field-input:focus {
  outline: none;
}

/* Dropdown (native + custom) */
.select-like {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23878787' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

details.dropdown {
  position: relative;
  max-width: 320px;
}

details.dropdown > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--alpha-bg-default);
  font-size: var(--fs-body-sm);
  color: var(--text-default);
  border: 1px solid transparent;
}

details.dropdown > summary::-webkit-details-marker {
  display: none;
}

details.dropdown > summary::after {
  content: "▾";
  float: right;
  opacity: 0.6;
}

details.dropdown[open] > summary {
  background: var(--alpha-bg-strong);
}

.dropdown-menu {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: var(--space-xs);
  list-style: none;
  border-radius: var(--radius-sm);
  background: var(--bg-level-02);
  border: 1px solid var(--bg-level-04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.dropdown-menu li button {
  width: 100%;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: none;
  color: var(--text-default);
  font: inherit;
  font-size: var(--fs-body-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dropdown-menu li button:hover {
  background: var(--alpha-bg-default);
}

/* Checkboxes & radios */
.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: var(--fs-body-sm);
  cursor: pointer;
}

.choice > span {
  line-height: 1.35;
  color: var(--text-default);
}

.choice:has(input:disabled) > span {
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* Radio — WMG Chords custom control (Figma 9517:777): 16px ring, 8px gap to label, 14/18 body */
.choice:has(> input[type="radio"]) {
  align-items: center;
  gap: var(--space-sm);
}

.choice:has(> input[type="radio"]) > span {
  line-height: 18px;
}

.choice input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background-color: transparent;
  background-image: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    border-width 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.choice input[type="radio"]:hover:not(:disabled):not(:checked) {
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.5);
}

.choice input[type="radio"]:checked {
  border: 1px solid rgba(255, 255, 255, 0.88);
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--primary-default) 0,
    var(--primary-default) 5px,
    transparent 5px
  );
}

.choice input[type="radio"]:checked:hover:not(:disabled) {
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.95);
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--primary-hover) 0,
    var(--primary-hover) 4px,
    transparent 4px
  );
}

.choice:not(.choice--error):has(input[type="radio"]:checked):hover:not(:has(input:disabled)) > span {
  color: var(--base-200);
}

.choice input[type="radio"]:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-level-01),
    0 0 0 4px rgba(34, 111, 245, 0.55);
}

.choice input[type="radio"]:disabled {
  cursor: not-allowed;
  border-width: 1px;
  border-color: var(--base-350);
  background-image: none;
  opacity: 1;
}

.choice input[type="radio"]:disabled:checked {
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--base-350) 0,
    var(--base-350) 5px,
    transparent 5px
  );
}

.choice.choice--error input[type="radio"]:not(:checked):not(:disabled) {
  border-color: var(--sys-error);
}

.choice.choice--error input[type="radio"]:not(:checked):not(:disabled):hover {
  border-width: 2px;
  border-color: var(--sys-error);
}

.choice.choice--error input[type="radio"]:checked:not(:disabled) {
  border-color: rgba(255, 140, 140, 0.9);
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--sys-error) 0,
    var(--sys-error) 5px,
    transparent 5px
  );
}

.choice.choice--error input[type="radio"]:checked:not(:disabled):hover {
  border-width: 2px;
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--sys-error) 0,
    var(--sys-error) 4px,
    transparent 4px
  );
}

.choice.choice--error input[type="radio"]:focus-visible:not(:disabled) {
  box-shadow:
    0 0 0 2px var(--bg-level-01),
    0 0 0 4px rgba(255, 140, 140, 0.45);
}

.choice.choice--error:has(input[type="radio"]:not(:disabled)) > span {
  color: var(--sys-error);
}

/*
 * Checkbox — WMG Chords custom control (Figma: form / selector pattern; see WMG-Chords file).
 * States: default, hover, focus-visible, pressed, checked (+ hover/pressed), indeterminate, disabled, error.
 */
.choice input[type="checkbox"]:not([role="switch"]) {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  margin-top: 2px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--field-border-subtle);
  background-color: var(--alpha-bg-default);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.choice input[type="checkbox"]:not([role="switch"]):hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.19);
  background-color: rgba(255, 255, 255, 0.09);
}

.choice input[type="checkbox"]:not([role="switch"]):focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-level-01),
    0 0 0 4px rgba(34, 111, 245, 0.55);
}

.choice input[type="checkbox"]:not([role="switch"]):not(:checked):active:not(:disabled):not(:indeterminate) {
  background-color: var(--alpha-bg-strong);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Checked — checkmark */
.choice input[type="checkbox"]:not([role="switch"]):checked {
  background-color: var(--primary-default);
  border-color: var(--primary-default);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6l2.5 2.5L9.5 3' stroke='%23fafafa' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.choice input[type="checkbox"]:not([role="switch"]):checked:hover:not(:disabled) {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.choice input[type="checkbox"]:not([role="switch"]):checked:active:not(:disabled) {
  background-color: var(--primary-pressed);
  border-color: var(--primary-pressed);
}

/* Indeterminate — dash */
.choice input[type="checkbox"]:not([role="switch"]):indeterminate {
  background-color: var(--primary-default);
  border-color: var(--primary-default);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fafafa' d='M2 5.25h8v1.5H2z'/%3E%3C/svg%3E");
}

.choice input[type="checkbox"]:not([role="switch"]):indeterminate:hover:not(:disabled) {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.choice input[type="checkbox"]:not([role="switch"]):indeterminate:active:not(:disabled) {
  background-color: var(--primary-pressed);
  border-color: var(--primary-pressed);
}

.choice input[type="checkbox"]:not([role="switch"]):disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice.choice--error input[type="checkbox"]:not([role="switch"]):not(:checked):not(:disabled) {
  border-color: var(--sys-error);
}

.choice.choice--error input[type="checkbox"]:not([role="switch"]):not(:checked):not(:disabled):hover {
  border-color: var(--sys-error);
  background-color: rgba(255, 140, 140, 0.08);
}

.choice.choice--error input[type="checkbox"]:not([role="switch"]):not(:checked):not(:disabled):focus-visible {
  box-shadow:
    0 0 0 2px var(--bg-level-01),
    0 0 0 4px rgba(255, 140, 140, 0.45);
}

.choice-state-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-lg) var(--space-xl);
  margin-top: var(--space-md);
}

.choice-state-row .choice {
  margin-bottom: 0;
}

.choice-grid {
  margin-left: var(--space-lg);
  padding-left: var(--space-md);
  border-left: 1px solid var(--bg-level-04);
}

fieldset.choice-group {
  border: none;
  margin: 0;
  padding: 0;
}

fieldset.choice-group legend {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-md);
}

/* Switch — Figma reference: 42×24 track, 4px inset, 16px thumb (e.g. Untitled file node 1:47) */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  max-width: 360px;
  padding: var(--space-sm) 0;
}

.switch-row--leading-switch {
  justify-content: flex-start;
}

.switch-label {
  font-size: var(--fs-body-sm);
  line-height: 18px;
  color: var(--text-default);
}

.switch-state-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Cover the track so layout isn’t split across lines (0×0 inline input + block slider broke stacking). */
.switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch input:focus-visible + .switch-slider {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-level-01),
    0 0 0 4px rgba(34, 111, 245, 0.55);
}

.switch-slider {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--radius-full);
  border: 1px solid var(--field-border-subtle);
  background: var(--alpha-bg-default);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.15s ease;
}

.switch:has(input:not(:disabled)):hover .switch-slider {
  background: rgba(255, 255, 255, 0.09);
}

.switch:has(input:not(:disabled):checked):hover .switch-slider {
  background: var(--primary-hover);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 4px;
  top: 50%;
  border-radius: var(--radius-full);
  background: var(--base-0);
  transform: translateY(-50%);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: var(--primary-default);
  border-color: var(--field-border-subtle);
}

.switch input:checked + .switch-slider::before {
  transform: translate(18px, -50%);
}

.switch input:disabled + .switch-slider {
  background: var(--bg-level-05);
  border: 1px solid transparent;
  cursor: not-allowed;
  box-shadow: none;
}

.switch input:disabled {
  cursor: not-allowed;
}

.switch input:disabled + .switch-slider::before {
  background: var(--base-450);
}

.switch input:disabled:checked + .switch-slider::before {
  transform: translate(18px, -50%);
}

.switch input:disabled:focus-visible + .switch-slider {
  box-shadow: none;
}

/* Date / datetime — field shell matches Figma date picker input (3888:12326); popup is native/OS */
input[type="date"].field-input,
input[type="datetime-local"].field-input {
  min-height: 48px;
  padding: 12px var(--space-md);
  color-scheme: dark;
  accent-color: var(--primary-default);
}

input[type="date"].field-input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].field-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
}

input[type="date"].field-input:hover:not(:disabled)::-webkit-calendar-picker-indicator,
input[type="datetime-local"].field-input:hover:not(:disabled)::-webkit-calendar-picker-indicator {
  opacity: 1;
}

.field-caption {
  margin: var(--space-xs) 0 0;
  font-size: var(--fs-caption);
  line-height: 16px;
  color: var(--text-default);
}

.field-caption.is-subtle {
  color: var(--text-subtle);
}

/* —— Custom date picker (popover) — WMG blue; spacing/type per Figma 3893:15662 (range) + field 3888:12326 */
.date-picker {
  position: relative;
  z-index: 1;
  max-width: 420px;
  overflow: visible; /* popover must not be clipped by panel/stacking */
}

.date-picker__shell {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  border-radius: 4px;
  border: 1px solid var(--field-border-subtle);
  background: var(--field-bg-default);
  transition: background-color 0.15s ease;
}

.date-picker__shell:hover {
  background: var(--field-bg-hover);
}

.date-picker__shell:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.date-picker__display {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px var(--space-md);
  font: inherit;
  font-size: var(--fs-body-sm);
  color: var(--text-default);
  cursor: pointer;
}

.date-picker__display::placeholder {
  color: var(--text-subtle);
}

.date-picker__display:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.date-picker__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-default);
  cursor: pointer;
  border-radius: 0 3px 3px 0;
  font-size: 16px;
}

.date-picker__trigger:hover:not(:disabled) {
  color: var(--interactive-blue);
}

.date-picker__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.date-picker--disabled .date-picker__shell {
  opacity: 0.55;
  pointer-events: none;
}

.date-picker--error .date-picker__shell {
  border-color: var(--sys-error-deep);
  outline: 2px solid var(--sys-error-deep);
  outline-offset: 0;
}

.date-picker__popover {
  position: absolute;
  z-index: 400;
  left: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  width: 296px;
  max-width: calc(100vw - 48px);
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--field-border-subtle);
  background: var(--bg-level-02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
  overflow: visible;
}

/* display:flex above wins over the native [hidden] rule — must hide when closed */
.date-picker__popover[hidden] {
  display: none !important;
  pointer-events: none;
}

/* Calendar body must size to the full grid (flex+min-height:0 was collapsing it ~1 row) */
.date-picker__body {
  flex: 0 0 auto;
  width: 100%;
  overflow: visible;
}

.date-picker__calendar-view {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
  overflow: visible;
}

.date-picker__calendar-view[hidden],
.date-picker__month-panel[hidden],
.date-picker__year-panel[hidden] {
  display: none !important;
}

.date-picker__month-panel,
.date-picker__year-panel {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 280px;
  overflow: hidden;
}

.date-picker__month-list,
.date-picker__year-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 0 0 var(--space-sm);
}

.date-picker__month-option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-xl);
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-body-md);
  line-height: 1.25;
  color: var(--text-default);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.date-picker__month-option:hover {
  background: var(--alpha-bg-default);
}

.date-picker__month-option--selected {
  background: var(--bg-level-05);
  padding-left: var(--space-md);
}

.date-picker__month-option-check {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 16px;
  font-size: 12px;
  color: var(--text-strong);
}

.date-picker__month-option:not(.date-picker__month-option--selected) .date-picker__month-option-check {
  visibility: hidden;
  width: 0;
  min-width: 0;
  overflow: hidden;
}

.date-picker__month-option-label {
  flex: 1;
  min-width: 0;
}

.date-picker__year-option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-xl);
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-body-md);
  line-height: 1.25;
  color: var(--text-default);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.date-picker__year-option:hover {
  background: var(--alpha-bg-default);
}

.date-picker__year-option--selected {
  background: var(--bg-level-05);
  padding-left: var(--space-md);
}

.date-picker__year-option-check {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 16px;
  font-size: 12px;
  color: var(--text-strong);
}

.date-picker__year-option:not(.date-picker__year-option--selected) .date-picker__year-option-check {
  visibility: hidden;
  width: 0;
  min-width: 0;
  overflow: hidden;
}

.date-picker__year-option-label {
  flex: 1;
  min-width: 0;
}

.date-picker__header--month-mode .date-picker__year-label {
  color: var(--text-disabled);
}

.date-picker__header--month-mode .date-picker__header-group:first-child > [data-nav="month-prev"],
.date-picker__header--month-mode .date-picker__header-group:first-child > [data-nav="month-next"] {
  opacity: 0;
  pointer-events: none;
}

.date-picker__header--year-mode .date-picker__month-label {
  color: var(--text-disabled);
}

.date-picker__header--year-mode .date-picker__header-group:last-child > [data-nav="year-prev"],
.date-picker__header--year-mode .date-picker__header-group:last-child > [data-nav="year-next"] {
  opacity: 0;
  pointer-events: none;
}

/* Figma 3893:15662 — month strip left, year strip right; single row (no wrap) */
.date-picker__header {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  white-space: nowrap;
}

.date-picker__header-group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 0 1 auto;
  min-width: 0;
}

.date-picker__month-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  padding: 2px var(--space-xs);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  flex-shrink: 0;
}

.date-picker__month-trigger:hover {
  background: var(--alpha-bg-default);
}

.date-picker__month-trigger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.date-picker__year-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  padding: 2px var(--space-xs);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  flex-shrink: 0;
}

.date-picker__year-trigger:hover {
  background: var(--alpha-bg-default);
}

.date-picker__year-trigger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.date-picker__month-caret-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  flex-shrink: 0;
}

.date-picker__month-trigger .date-picker__month-caret {
  font-size: 10px;
  color: var(--text-strong);
}

.date-picker__year-caret-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  flex-shrink: 0;
}

.date-picker__year-trigger .date-picker__year-caret {
  font-size: 10px;
  color: var(--text-strong);
}

.date-picker__month-label,
.date-picker__year-label {
  min-width: 2ch;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  text-align: center;
}

.date-picker__year-label {
  min-width: 2.5rem;
}

.date-picker__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--interactive-blue);
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
}

.date-picker__nav:hover:not(:disabled) {
  background: var(--alpha-bg-default);
  color: var(--wmg-blue-200);
}

.date-picker__nav:disabled {
  cursor: default;
  opacity: 0.45;
}

.date-picker__nav--dropdown {
  width: 24px;
  height: 28px;
  font-size: 10px;
  color: var(--text-strong);
}

/* Keep caret icons white; base :disabled opacity would wash them out */
.date-picker__nav--dropdown:disabled {
  opacity: 1;
  color: var(--text-strong);
}

.date-picker__nav--dropdown:hover:not(:disabled) {
  color: var(--text-strong);
}

.date-picker__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 24px);
  column-gap: var(--space-md);
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: var(--space-sm) var(--space-md) var(--space-sm);
  text-align: center;
  font-size: var(--fs-body-md);
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  color: var(--text-default);
}

.date-picker__weekdays span {
  width: 24px;
  padding: 0;
}

/* 7 × 24px + 6 × 16px + horizontal padding = 296px; 6 rows + gaps so flex never collapses to ~0 */
.date-picker__grid {
  --dp-gap-x-half: 8px; /* half of column-gap — bridge range fills via box-shadow */
  display: grid;
  grid-template-columns: repeat(7, 24px);
  grid-auto-rows: 32px;
  column-gap: var(--space-md);
  row-gap: 2px;
  justify-content: center;
  align-content: start;
  padding: var(--space-sm) var(--space-md) var(--space-md);
  flex-shrink: 0;
  min-height: calc(6 * 32px + 5 * 2px + var(--space-sm) + var(--space-md));
  width: 100%;
  box-sizing: border-box;
}

.date-picker__day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 24px;
  height: 32px;
  margin: 0;
  padding: 0;
  overflow: visible; /* allow range box-shadow to extend into grid gaps */
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-size: var(--fs-body-sm);
  line-height: 1.2;
  color: var(--text-default);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.date-picker__day--outside {
  color: var(--base-350);
  opacity: 0.85;
}

.date-picker__day:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.35);
}

.date-picker__day--today-hint {
  color: var(--interactive-blue);
  font-weight: var(--fw-semibold);
}

.date-picker__day--selected {
  background: var(--primary-default);
  color: var(--text-strong);
  border-color: transparent;
  font-weight: var(--fw-semibold);
}

.date-picker__day--selected:hover {
  background: var(--primary-hover);
  color: var(--base-450);
}

/* Range — WMG blue endpoints; in-range bridge bg-level-05 (Figma #313131) */
.date-picker__day--range-start,
.date-picker__day--range-end {
  background: var(--primary-default);
  color: var(--text-strong);
  border-color: transparent;
  font-weight: var(--fw-semibold);
  z-index: 1;
}

/*
 * Range endpoints: extend into half the column-gap with real width (not box-shadow) so
 * the label is centered in the full blue pill — shadow-only bridges looked off-center.
 */
.date-picker__day--range-start:not(.date-picker__day--range-end) {
  width: calc(24px + var(--dp-gap-x-half, 8px));
  min-width: calc(24px + var(--dp-gap-x-half, 8px));
  margin-right: calc(-1 * var(--dp-gap-x-half, 8px));
  justify-self: start;
  border-radius: 4px 0 0 4px;
}

.date-picker__day--range-end:not(.date-picker__day--range-start) {
  width: calc(24px + var(--dp-gap-x-half, 8px));
  min-width: calc(24px + var(--dp-gap-x-half, 8px));
  margin-left: calc(-1 * var(--dp-gap-x-half, 8px));
  justify-self: end;
  border-radius: 0 4px 4px 0;
}

.date-picker__day--range-start.date-picker__day--range-end {
  width: 24px;
  min-width: unset;
  margin-left: 0;
  margin-right: 0;
  justify-self: center;
  border-radius: 4px;
}

.date-picker__day--range-mid {
  background: var(--bg-level-05);
  color: var(--text-strong);
  border-color: transparent;
  border-radius: 0;
  box-shadow:
    calc(-1 * var(--dp-gap-x-half, 8px)) 0 0 0 var(--bg-level-05),
    var(--dp-gap-x-half, 8px) 0 0 0 var(--bg-level-05);
}

.date-picker__day--range-mid:hover:not(:disabled) {
  background: var(--base-450);
  box-shadow:
    calc(-1 * var(--dp-gap-x-half, 8px)) 0 0 0 var(--base-450),
    var(--dp-gap-x-half, 8px) 0 0 0 var(--base-450);
}

.date-picker__day--outside.date-picker__day--range-mid,
.date-picker__day--outside.date-picker__day--range-start,
.date-picker__day--outside.date-picker__day--range-end {
  opacity: 1;
}

.date-picker__day--range-start:hover:not(:disabled),
.date-picker__day--range-end:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--base-450);
}

.date-picker__footer {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  border-top: 1px solid var(--bg-level-04);
}

.date-picker__footer-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.date-picker__footer [data-date-cancel] {
  margin-left: -5px;
}

/* Field messages */
.field-msg {
  margin: var(--space-xs) 0 0;
  font-size: var(--fs-caption);
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
}

.field-msg.hint {
  color: var(--text-subtle);
}

.field-msg.error {
  color: var(--sys-error);
}

.field-msg.success {
  color: var(--sys-success);
}

.field-msg.warning {
  color: var(--sys-warning);
}

/* Button group */
.btn-group {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-level-04);
}

.btn-group .btn {
  position: relative;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-group .btn:first-child {
  border-top-left-radius: calc(var(--radius-sm) - 1px);
  border-bottom-left-radius: calc(var(--radius-sm) - 1px);
}

.btn-group .btn:last-child {
  border-right: 1px solid transparent;
  border-top-right-radius: calc(var(--radius-sm) - 1px);
  border-bottom-right-radius: calc(var(--radius-sm) - 1px);
}

/* Last segment: transparent right keeps layout; hover must still tint the right edge (otherwise the ring looks clipped). */
.btn-group .btn:last-child:hover:not(:disabled) {
  border-right-color: var(--base-300);
}

.btn-group .btn:focus-visible {
  z-index: 2;
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* Segmented control: filled segments (not Figma “tertiary” underline) */
.btn-group .btn-tertiary {
  background: var(--bg-level-03);
  color: var(--text-default);
  text-decoration: none;
  min-height: unset;
  padding: var(--space-sm) var(--space-md);
}

.btn-group .btn-tertiary:hover:not(:disabled) {
  background: var(--bg-level-04);
}

.btn-group .btn-tertiary:focus-visible {
  border-color: var(--base-300);
}

/* —— Alerts (full-width, top of page) —— */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  margin-bottom: var(--space-md);
}

.alert:last-child {
  margin-bottom: 0;
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  font-size: 16px;
  line-height: 1;
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-weight: var(--fw-semibold);
  margin: 0 0 var(--space-xs);
}

.alert p {
  margin: 0;
  color: inherit;
  opacity: 0.95;
}

.alert-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  padding: 2px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.alert-dismiss:hover {
  opacity: 1;
}

.alert--error {
  background: rgba(212, 43, 58, 0.18);
  border: 1px solid rgba(255, 140, 140, 0.35);
  color: var(--sys-error);
}

.alert--warning {
  background: rgba(195, 84, 19, 0.2);
  border: 1px solid rgba(255, 184, 0, 0.35);
  color: var(--sys-warning);
}

.alert--success {
  background: rgba(0, 129, 61, 0.22);
  border: 1px solid rgba(77, 232, 133, 0.35);
  color: var(--sys-success);
}

.alert--info {
  background: rgba(37, 86, 234, 0.15);
  border: 1px solid rgba(109, 142, 241, 0.4);
  color: var(--sys-info-foreground);
}

.alert a.text-link {
  color: inherit;
  text-decoration: underline;
}

/* —— Breadcrumb —— */
.breadcrumb {
  font-size: var(--fs-body-sm);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.breadcrumb a {
  color: var(--text-subtle);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--text-default);
  font-weight: var(--fw-semibold);
}

.breadcrumb-sep {
  color: var(--text-subtle);
  user-select: none;
  opacity: 0.7;
}

/* —— Filter tags (dedicated variants) —— */
.ftag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--fs-body-sm);
  border: 1px solid var(--bg-level-04);
  background: var(--bg-level-02);
  color: var(--text-default);
}

.ftag--secondary {
  background: var(--bg-level-03);
}

.ftag--static {
  cursor: default;
  padding-right: 14px;
}

.ftag--sm {
  padding: 4px 10px;
  font-size: var(--fs-caption);
}

.ftag--lg {
  padding: 10px 16px;
  font-size: var(--fs-body-md);
}

.ftag .ftag-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -2px -4px -2px 2px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.ftag .ftag-dismiss:hover {
  background: var(--alpha-bg-strong);
  color: var(--text-default);
}

/* —— Labels (UI label chip) —— */
.ds-label {
  display: inline-block;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.ds-label--on-dark {
  color: var(--text-default);
}

/* —— Loader / spinner —— */
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--bg-level-04);
  border-top-color: var(--primary-default);
  animation: spin 0.7s linear infinite;
}

.spinner--sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner--lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-subtle);
  font-size: var(--fs-body-sm);
}

/* —— Status badge —— */
.s-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
}

.s-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.s-badge--error {
  background: rgba(212, 43, 58, 0.2);
  color: var(--sys-error);
}

.s-badge--warning {
  background: var(--surface-warning-muted);
  color: var(--sys-warning);
}

.s-badge--success {
  background: var(--surface-success-muted);
  color: var(--sys-success);
}

.s-badge--info {
  background: rgba(37, 86, 234, 0.18);
  color: var(--sys-info-muted);
}

/* —— Toasts (Figma 9330:213 — 301px, blur, status tint, headline + body + close) —— */
.toast-stack {
  position: relative;
  min-height: 120px;
  border: 1px dashed var(--bg-level-04);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--bg-level-01);
}

.toast-demo-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

.toast-stack-fixed {
  position: fixed;
  top: 72px;
  right: var(--space-xl);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-end;
  pointer-events: none;
  max-width: min(301px, calc(100vw - 48px));
}

.toast-stack-fixed .toast {
  pointer-events: auto;
}

.toast {
  width: 301px;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--field-border-subtle);
  /* Figma 9330:210 — lit top edge (border-t) + faint inner highlight for depth */
  border-top: 1px solid var(--toast-border-top-highlight);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: var(--text-default);
  background-color: var(--toast-bg);
}

.toast__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  min-width: 0;
}

.toast__lead {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
  flex: 1;
}

.toast__icon {
  flex-shrink: 0;
  width: var(--fs-body-md);
  height: var(--fs-body-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-body-md);
  line-height: 1;
}

.toast--error .toast__icon {
  color: var(--sys-error);
}

.toast--success .toast__icon {
  color: var(--sys-success);
}

.toast--warning .toast__icon {
  color: var(--sys-warning);
}

.toast--info .toast__icon {
  color: var(--sys-info-foreground);
}

.toast__title {
  font-size: var(--fs-headline-sm);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--text-default);
}

.toast__body {
  margin: 0;
  font-size: var(--fs-body-sm);
  font-weight: 400;
  line-height: var(--lh-body-sm);
  color: var(--text-strong);
}

.toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: var(--space-xs);
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  transition: background 0.15s ease;
}

.toast__close:hover {
  background: var(--alpha-bg-default);
}

.toast__close:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-level-01),
    0 0 0 4px rgba(34, 111, 245, 0.55);
}

.toast__link {
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--fs-caption);
  line-height: normal;
  color: var(--text-default);
  text-decoration: underline;
  text-decoration-skip-ink: none;
  cursor: pointer;
}

.toast__link:hover {
  color: var(--text-strong);
}

.toast__link:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow:
    0 0 0 2px var(--bg-level-01),
    0 0 0 4px rgba(34, 111, 245, 0.55);
}

.toast--error {
  background-color: color-mix(in srgb, var(--sys-error-deep) 22%, transparent);
}

.toast--success {
  background-color: color-mix(in srgb, var(--sys-success-deep) 22%, transparent);
}

.toast--warning {
  background-color: color-mix(in srgb, var(--sys-warning) 22%, transparent);
}

.toast--info {
  background-color: color-mix(in srgb, var(--sys-info) 18%, transparent);
}

.toast-actions {
  margin-top: var(--space-sm);
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* —— Snackbar (bottom) —— */
.snackbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-level-03);
  border: 1px solid var(--bg-level-04);
  font-size: var(--fs-body-sm);
  max-width: 560px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.snackbar-wrap {
  position: relative;
  min-height: 56px;
}

/* —— User header —— */
.user-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-level-01);
  border: 1px solid var(--bg-level-04);
  max-width: 420px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--wmg-blue-500), var(--wmg-dark-blue-500));
  display: grid;
  place-items: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-body-sm);
  color: var(--text-strong);
  flex-shrink: 0;
}

.user-header-text {
  flex: 1;
  min-width: 0;
}

.user-header-name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body-md);
  margin: 0 0 2px;
}

.user-header-meta {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--text-subtle);
}

/* —— Cards —— */
.ds-card {
  border-radius: var(--radius-md);
  background: var(--bg-level-02);
  border: 1px solid var(--bg-level-03);
  overflow: hidden;
  max-width: 400px;
}

.ds-card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--bg-level-03);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body-md);
}

.ds-card-body {
  padding: var(--space-lg);
  font-size: var(--fs-body-sm);
  color: var(--text-subtle);
}

.ds-card-body p {
  margin: 0 0 var(--space-sm);
}

.ds-card-body p:last-child {
  margin-bottom: 0;
}

.ds-card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--bg-level-03);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.ds-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

/* —— Data table —— */
.table-scroll {
  overflow: auto;
  max-height: 320px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-level-04);
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}

.ds-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-level-03);
  color: var(--text-subtle);
  font-weight: var(--fw-semibold);
  border-bottom: 1px solid var(--bg-level-04);
  white-space: nowrap;
}

.ds-table tbody td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--bg-level-03);
  vertical-align: middle;
}

.ds-table tbody tr {
  transition: background 0.12s ease;
}

.ds-table tbody tr:hover {
  background: var(--alpha-bg-default);
}

.ds-table .cell-muted {
  color: var(--text-subtle);
}

.ds-table .cell-ellipsis {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-table-actions {
  text-align: right;
}

.cell-thumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cell-thumb-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-level-04);
  display: grid;
  place-items: center;
  font-size: var(--fs-caption);
  flex-shrink: 0;
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable:hover {
  color: var(--text-default);
}

/* —— Table views (Figma: User management overflow 10104:1635; specs 10104:1363, 10104:1376) —— */
.section-subtitle {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.tv-section-note {
  margin-top: 0;
}

.table-scroll--tv {
  max-height: min(480px, 70vh);
}

.ds-table--tv {
  table-layout: fixed;
  width: 100%;
  font-size: var(--fs-body-md);
}

.ds-table--tv thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--space-sm) var(--space-md);
  font-weight: 400;
  font-size: var(--fs-body-sm);
  color: var(--text-subtle);
  background: var(--bg-level-01);
  border-bottom: 1px solid var(--bg-level-04);
  vertical-align: middle;
}

.ds-table--tv tbody td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--bg-level-03);
  vertical-align: middle;
}

.ds-table--tv .tv-th {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  white-space: nowrap;
}

.ds-table--tv .tv-th__sort {
  font-size: 12px;
  color: var(--text-subtle);
  opacity: 0.9;
}

.tv-col--name {
  width: 16%;
}

.tv-col--email {
  width: 18%;
}

.tv-col--lg {
  width: 15%;
}

.tv-col--label {
  width: 15%;
}

.tv-col--role {
  width: 15%;
}

.tv-col--login {
  width: 12%;
}

.tv-col--actions {
  width: 9%;
}

.ds-table--zebra tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.ds-table--tv.ds-table--zebra tbody tr:hover {
  background: var(--alpha-bg-default);
}

.tv-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.tv-avatar-sm {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--bg-level-05);
  display: grid;
  place-items: center;
  font-size: var(--fs-caption);
  color: var(--text-strong);
}

.tv-truncate {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-cell-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tv-cell-cluster .tv-truncate {
  flex: 1 1 auto;
}

.tv-tag-more {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--field-border-subtle);
  background: var(--alpha-bg-strong);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  cursor: default;
}

.tv-info-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: rgba(247, 248, 255, 0.5);
  font-size: 12px;
  line-height: 1;
  cursor: help;
}

.tv-info-btn:hover,
.tv-info-btn:focus-visible {
  color: var(--text-default);
  outline: none;
}

.tv-info-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.tv-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-default);
  cursor: pointer;
}

.tv-row-action:hover {
  background: var(--alpha-bg-default);
}

.tv-row-action:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.tv-empty-dash {
  color: var(--text-default);
}

.ds-table--tv .tooltip-trigger {
  border-bottom: none;
  cursor: help;
}

.tooltip-bubble--table {
  width: 264px;
  min-width: 264px;
  max-width: 264px;
}

.tv-tooltip-more {
  max-height: 208px;
  overflow-y: auto;
  padding: var(--space-sm) var(--space-md);
  pointer-events: auto;
}

.tooltip-wrap--interactive .tooltip-bubble {
  pointer-events: auto;
}

.tv-tooltip-list {
  margin: 0;
  padding-left: 1.1rem;
}

.tv-tooltip-list li {
  margin-bottom: var(--space-xs);
}

.tv-row-empty td {
  padding: 0 !important;
  border-bottom: none;
  vertical-align: middle;
}

.tv-empty-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  color: var(--text-subtle);
}

.tv-empty-inline p {
  margin: 0;
  font-size: var(--fs-body-md);
}

.tv-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--interactive-blue);
}

/* —— Empty state —— */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  border: 1px dashed var(--bg-level-04);
  background: var(--bg-level-01);
  max-width: 480px;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-level-03);
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: var(--space-lg);
}

.empty-state h3 {
  margin: 0 0 var(--space-sm);
  font-size: var(--fs-headline-md);
  font-weight: var(--fw-semibold);
}

.empty-state p {
  margin: 0 0 var(--space-lg);
  font-size: var(--fs-body-sm);
  color: var(--text-subtle);
  max-width: 400px;
  line-height: 1.5;
}

.empty-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
  align-items: start;
}

/* —— Modal (dialog) —— */
dialog.modal {
  border: none;
  border-radius: var(--radius-md);
  padding: 0;
  background: var(--bg-level-02);
  color: var(--text-default);
  max-width: min(440px, calc(100vw - 48px));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

dialog.modal::backdrop {
  background: var(--overlay-scrim);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--bg-level-04);
}

.modal-title {
  margin: 0;
  font-size: var(--fs-headline-md);
  font-weight: var(--fw-semibold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--alpha-bg-default);
  color: var(--text-default);
}

.modal-body {
  padding: var(--space-lg);
  font-size: var(--fs-body-sm);
  color: var(--text-subtle);
}

.modal-body p {
  margin: 0 0 var(--space-md);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--bg-level-04);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Wide form modal — WMG Chords Figma (node 9724:9319) */
dialog.modal.modal--forms {
  max-width: min(680px, calc(100vw - 48px));
  border: 1px solid var(--field-border-subtle);
}

.modal-header--lead {
  align-items: flex-start;
}

.modal-header__lead {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.modal-header__icon {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 20px;
  line-height: 1;
  color: var(--text-default);
}

.modal--forms .modal-body--forms {
  padding: 0 var(--space-2xl) var(--space-lg);
  font-size: var(--fs-body-sm);
  color: var(--text-strong);
}

.modal-intro {
  line-height: 1.35;
}

.modal-body--forms > .modal-intro {
  margin: 0 0 var(--space-lg);
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-xl);
}

.modal-form-grid .form-field {
  max-width: none;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .modal-form-grid {
    grid-template-columns: 1fr;
  }
}

.modal--forms .modal-footer {
  border-top-color: var(--field-border-subtle);
  box-shadow: 0 -14px 16px -4px rgba(0, 0, 0, 0.5);
  padding: var(--space-md) var(--space-lg);
}

/* —— Tooltip —— */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}

.tooltip-trigger {
  border-bottom: 1px dotted var(--text-subtle);
  cursor: help;
  color: var(--text-default);
}

.tooltip-bubble {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  min-width: 160px;
  max-width: 280px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--bg-level-05);
  border: 1px solid var(--bg-level-04);
  font-size: var(--fs-caption);
  color: var(--text-default);
  line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus-within .tooltip-bubble {
  opacity: 1;
  visibility: visible;
}

.tooltip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--bg-level-05);
}

.tooltip-rich {
  min-width: 260px;
  max-width: 300px;
  padding: var(--space-md);
}

.tooltip-rich h4 {
  margin: 0 0 var(--space-sm);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
}

.tooltip-rich p {
  margin: 0 0 var(--space-md);
  font-size: var(--fs-caption);
  color: var(--text-subtle);
}

/* —— Zeroheight synced guidance (see scripts/sync-zeroheight.mjs) —— */
.zh-guidance {
  margin-bottom: var(--space-xl);
}

.zh-guidance__content {
  max-width: 72ch;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-level-03);
  background: var(--bg-level-02);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-loose);
  color: var(--text-default);
}

.zh-guidance__tab-title {
  margin: var(--space-lg) 0 var(--space-sm);
  font-size: var(--fs-headline-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.zh-guidance__content :first-child {
  margin-top: 0;
}

.zh-guidance__content h1,
.zh-guidance__content h2,
.zh-guidance__content h3 {
  margin: var(--space-md) 0 var(--space-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.zh-guidance__content p {
  margin: 0 0 var(--space-md);
}

.zh-guidance__content a {
  color: var(--interactive-blue);
}

.zh-guidance__content img.zeroheight-image,
.zh-guidance__content .zeroheight-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.zh-guidance__content figure.zeroheight-image-caption {
  margin: var(--space-md) 0;
}

.zh-guidance__content .zeroheight-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}

.zh-guidance__content .zeroheight-table th,
.zh-guidance__content .zeroheight-table td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--bg-level-04);
  text-align: left;
}

.zh-guidance__content .zeroheight-code-snippet pre,
.zh-guidance__content pre {
  overflow: auto;
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--bg-default);
  font-size: var(--fs-caption);
}

.zh-guidance__placeholder {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--fs-body-sm);
}

.zh-guidance__placeholder code {
  font-size: var(--fs-caption);
}

.zh-guidance__source {
  margin: var(--space-sm) 0 0;
  font-size: var(--fs-caption);
  color: var(--text-subtle);
}

/* —— Design system home (Zeroheight-style cover) —— */
.ds-home {
  max-width: 900px;
}

.ds-home__lead {
  margin: 0 0 var(--space-xl);
  max-width: 72ch;
  font-size: var(--fs-body-md);
  line-height: var(--lh-relaxed);
  color: var(--text-default);
}

.ds-home__lead em {
  font-style: italic;
  color: var(--text-subtle);
}

.ds-home__section-title {
  margin: 0 0 var(--space-md);
  font-size: var(--fs-headline-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
}

.ds-home-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-home-tile {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--bg-level-03);
  border-radius: var(--radius-md);
  background: var(--bg-level-01);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ds-home-tile:hover {
  border-color: var(--bg-level-04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ds-home-tile:focus-visible {
  outline: 2px solid var(--interactive-blue);
  outline-offset: 2px;
}

.ds-home-tile__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(
    145deg,
    var(--bg-level-02) 0%,
    var(--bg-level-03) 100%
  );
}

.ds-home-tile__visual i {
  font-size: 2.75rem;
  color: var(--text-subtle);
  opacity: 0.85;
}

.ds-home-tile:nth-child(1) .ds-home-tile__visual {
  background: linear-gradient(145deg, #2a2a33 0%, #1a1a22 100%);
}

.ds-home-tile:nth-child(1) .ds-home-tile__visual i {
  color: var(--primary-400, #6b9fff);
}

.ds-home-tile:nth-child(2) .ds-home-tile__visual {
  background: linear-gradient(145deg, #252530 0%, #16161c 100%);
}

.ds-home-tile:nth-child(2) .ds-home-tile__visual i {
  color: var(--accent-warm, #e8a87c);
}

.ds-home-tile:nth-child(3) .ds-home-tile__visual {
  background: linear-gradient(145deg, #22222c 0%, #121218 100%);
}

.ds-home-tile:nth-child(3) .ds-home-tile__visual i {
  color: #9dd49a;
}

.ds-home-tile:nth-child(4) .ds-home-tile__visual {
  background: linear-gradient(145deg, #2a2430 0%, #15151a 100%);
}

.ds-home-tile:nth-child(4) .ds-home-tile__visual i {
  color: #c4a5e8;
}

.ds-home-tile:nth-child(5) .ds-home-tile__visual {
  background: linear-gradient(145deg, #1f2528 0%, #121618 100%);
}

.ds-home-tile:nth-child(5) .ds-home-tile__visual i {
  color: #7eb8da;
}

.ds-home-tile__body {
  padding: var(--space-md) var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.ds-home-tile__title {
  margin: 0;
  font-size: var(--fs-headline-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-default);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.ds-home-tile__title .fa-arrow-up-right-from-square {
  font-size: var(--fs-caption);
  color: var(--text-subtle);
  opacity: 0.8;
}

.ds-home-tile__desc {
  margin: 0;
  font-size: var(--fs-body-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-subtle);
}

.ds-home-tiles .ds-home-tile:nth-child(5) {
  grid-column: 1;
}

@media (max-width: 700px) {
  .ds-home-tiles {
    grid-template-columns: 1fr;
  }

  .ds-home-tiles .ds-home-tile:nth-child(5) {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }

  .sidebar--ds-legacy {
    width: 100%;
    max-height: none;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--bg-level-04);
  }

  .sidebar-scroll {
    max-height: min(50vh, 420px);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    height: auto;
    min-height: var(--header-height);
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
  }
}
