/* CL221 — shared layout tokens; palette lives on html[data-theme] */
html[data-theme="dark"],
html[data-theme="light"] {
  --brand-accent: #25ab48;
  --brand-accent-secondary: #4cc76a;
  --brand-loss: #b92928;
  --accent: var(--brand-accent);
  --accent-secondary: var(--brand-accent-secondary);
  --accent-on-filled: #052e1f;
  --accent-on-loss: #450a0a;
  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --radius-pill: 999px;
  --tab-bar-inner: 3.25rem;
  --tab-bar-height: calc(1rem + var(--tab-bar-inner) + var(--safe-area-bottom));
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-chrome: var(--tab-bar-height);
  --warning: #f5d565;
  --warning-bright: #fbbf24;
  --info-muted: #94a3b8;
}

html[data-theme="dark"] {
  --bg: #0c0f0e;
  --surface: #171a19;
  --surface-raised: #1f2423;
  --elevated-bg: #1a1d1c;
  --text: #fafaf9;
  --text-secondary: #a8a29e;
  --text-muted: #78716c;
  --brand-accent-soft: rgba(37, 171, 72, 0.14);
  --brand-accent-shadow: rgba(37, 171, 72, 0.25);
  --brand-loss-soft: rgba(185, 41, 40, 0.16);
  --accent-soft: var(--brand-accent-soft);
  --accent-shadow: var(--brand-accent-shadow);
  --border: rgba(250, 250, 249, 0.1);
  --border-subtle: rgba(250, 250, 249, 0.08);
  --border-strong: rgba(250, 250, 249, 0.14);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 24px 48px rgba(0, 0, 0, 0.45);
  --overlay-32: rgba(0, 0, 0, 0.32);
  --overlay-42: rgba(0, 0, 0, 0.42);
  --surface-tint-02: rgba(250, 250, 249, 0.02);
  --surface-tint-03: rgba(250, 250, 249, 0.03);
  --surface-tint-04: rgba(250, 250, 249, 0.04);
  --surface-tint-06: rgba(250, 250, 249, 0.06);
  --surface-tint-12: rgba(250, 250, 249, 0.12);
  --text-soft-82: rgba(250, 250, 249, 0.82);
  --text-soft-86: rgba(250, 250, 249, 0.86);
  --text-soft-90: rgba(250, 250, 249, 0.9);
  --chart-track: rgba(250, 250, 249, 0.1);
  --chart-track-subtle: rgba(250, 250, 249, 0.08);
  --panel-gradient: linear-gradient(165deg, #0a0d0b 0%, #050605 55%, #080a09 100%);
  --panel-inset-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45) inset;
  --tile-bg: rgba(0, 0, 0, 0.42);
  --tile-accent-gradient: linear-gradient(160deg, rgba(37, 171, 72, 0.1) 0%, rgba(0, 0, 0, 0.38) 100%);
  --card-gradient: linear-gradient(165deg, rgba(250, 250, 249, 0.06) 0%, rgba(0, 0, 0, 0.28) 100%);
  --accent-panel-gradient: linear-gradient(155deg, rgba(37, 171, 72, 0.14) 0%, rgba(0, 0, 0, 0.2) 68%);
  --accent-fade-end: rgba(0, 0, 0, 0.24);
  --accent-fade-deep: rgba(0, 0, 0, 0.32);
  --tab-bar-bg: rgba(12, 15, 14, 0.94);
  --install-banner-bg: rgba(23, 26, 25, 0.98);
  --floating-chip-bg: rgba(12, 15, 14, 0.78);
  --modal-backdrop: rgba(12, 15, 14, 0.72);
  --qr-fg: #0c0f0e;
  --qr-bg: #ffffff;
  --danger-text: #fecaca;
  --danger-text-alt: #fca5a5;
  --warning-text: #fde68a;
  --danger-border: #fca5a5;
  --accent-secondary-soft: rgba(250, 250, 249, 0.12);
  --perf-win: var(--brand-accent);
  --perf-win-soft: rgba(37, 171, 72, 0.18);
  --perf-loss: var(--brand-loss);
  --perf-loss-soft: var(--brand-loss-soft);
  --perf-draw: #a8a29e;
  --perf-draw-soft: rgba(168, 162, 158, 0.16);
  --perf-draw-badge: rgba(168, 162, 158, 0.35);
  --discipline-tile-fallback-bg: #292524;
  --perf-excluded: #57534e;
  --perf-excluded-soft: rgba(87, 83, 78, 0.22);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-raised: #eef1f0;
  --elevated-bg: #ffffff;
  --text: #1c1917;
  --text-secondary: #44403c;
  --text-muted: #78716c;
  --brand-accent-soft: rgba(37, 171, 72, 0.12);
  --brand-accent-shadow: rgba(37, 171, 72, 0.2);
  --brand-loss-soft: rgba(185, 41, 40, 0.1);
  --accent-soft: var(--brand-accent-soft);
  --accent-shadow: var(--brand-accent-shadow);
  --border: rgba(28, 25, 23, 0.12);
  --border-subtle: rgba(28, 25, 23, 0.08);
  --border-strong: rgba(28, 25, 23, 0.16);
  --shadow: 0 12px 32px rgba(28, 25, 23, 0.1);
  --shadow-lg: 0 12px 28px rgba(28, 25, 23, 0.12);
  --shadow-modal: 0 24px 48px rgba(28, 25, 23, 0.16);
  --overlay-32: rgba(28, 25, 23, 0.28);
  --overlay-42: rgba(28, 25, 23, 0.38);
  --surface-tint-02: rgba(28, 25, 23, 0.02);
  --surface-tint-03: rgba(28, 25, 23, 0.03);
  --surface-tint-04: rgba(28, 25, 23, 0.04);
  --surface-tint-06: rgba(28, 25, 23, 0.06);
  --surface-tint-12: rgba(28, 25, 23, 0.1);
  --text-soft-82: rgba(28, 25, 23, 0.82);
  --text-soft-86: rgba(28, 25, 23, 0.86);
  --text-soft-90: rgba(28, 25, 23, 0.9);
  --chart-track: rgba(28, 25, 23, 0.12);
  --chart-track-subtle: rgba(28, 25, 23, 0.08);
  --panel-gradient: linear-gradient(165deg, #ffffff 0%, #eef1f0 55%, #e6ebe8 100%);
  --panel-inset-shadow: 0 0 0 1px rgba(28, 25, 23, 0.06) inset;
  --tile-bg: rgba(37, 171, 72, 0.06);
  --tile-accent-gradient: linear-gradient(160deg, rgba(37, 171, 72, 0.12) 0%, rgba(37, 171, 72, 0.04) 100%);
  --card-gradient: linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 241, 240, 0.92) 100%);
  --accent-panel-gradient: linear-gradient(155deg, rgba(37, 171, 72, 0.1) 0%, rgba(238, 241, 240, 0.95) 68%);
  --accent-fade-end: rgba(238, 241, 240, 0.85);
  --accent-fade-deep: rgba(228, 232, 230, 0.92);
  --tab-bar-bg: rgba(244, 246, 245, 0.94);
  --install-banner-bg: rgba(255, 255, 255, 0.98);
  --floating-chip-bg: rgba(255, 255, 255, 0.92);
  --modal-backdrop: rgba(28, 25, 23, 0.38);
  --qr-fg: #1c1917;
  --qr-bg: #ffffff;
  --danger-text: #991b1b;
  --danger-text-alt: #b91c1c;
  --warning-text: #92400e;
  --danger-border: #f87171;
  --accent-secondary-soft: rgba(28, 25, 23, 0.08);
  --perf-win: var(--brand-accent);
  --perf-win-soft: rgba(37, 171, 72, 0.14);
  --perf-loss: var(--brand-loss);
  --perf-loss-soft: rgba(185, 41, 40, 0.12);
  --perf-draw: #78716c;
  --perf-draw-soft: rgba(120, 113, 108, 0.12);
  --perf-draw-badge: rgba(120, 113, 108, 0.32);
  --discipline-tile-fallback-bg: #e7e5e4;
  --perf-excluded: #a8a29e;
  --perf-excluded-soft: rgba(168, 162, 158, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.shell {
  grid-row: 1;
  max-width: 28rem;
  width: 100%;
  min-height: 0;
  max-height: 100dvh;
  margin: 0 auto;
  padding: calc(1.5rem + var(--safe-area-top)) 1.25rem var(--bottom-chrome);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* CL210 — banner lives inside shell flex column; safe-area on banner, not double-padded shell */
.shell:has(.cl208-install-banner:not(.hidden)),
.shell.cl210-install-banner-visible {
  padding-top: 0;
}

.shell-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-player-header {
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scroll-region {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}

.view:has(> .scroll-region) {
  overflow: hidden;
}

/* CL213 — dashboard must not gain document-level horizontal scroll */
.dashboard-body.scroll-region {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.dashboard-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-header__leading {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.dashboard-header__back {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-tint-04);
  color: var(--text);
  cursor: pointer;
}

.dashboard-header__back:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-header__back-icon {
  display: block;
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-0.05rem);
}

.dashboard-header__title {
  margin: 0;
  min-width: 0;
  flex: 1;
  font-size: clamp(1.375rem, 5.5vw, 1.625rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-header__trailing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.dashboard-header__inbox-btn,
.dashboard-header__menu-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-tint-04);
  color: var(--text);
  cursor: pointer;
  position: relative;
}

.dashboard-header__inbox-icon {
  display: block;
  width: 1.125rem;
  height: 0.8125rem;
  border: 2px solid currentColor;
  border-top: none;
  border-radius: 0 0 3px 3px;
  position: relative;
}

.dashboard-header__inbox-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.55rem;
  width: 1.125rem;
  height: 0.55rem;
  transform: translateX(-50%);
  border: 2px solid currentColor;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  box-sizing: border-box;
}

.dashboard-header__inbox-badge {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #ef4444;
  border: 1px solid var(--cl221-bg, #0c0f0e);
}

.dashboard-header__inbox-btn:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-header__menu-btn:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-header__menu-icon {
  display: block;
  width: 1.125rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.dashboard-header-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: var(--overlay-32);
}

.dashboard-header-menu {
  position: fixed;
  top: calc(1.5rem + var(--safe-area-top) + 2.75rem);
  right: max(1.25rem, calc(50% - 14rem + 1.25rem));
  z-index: 26;
  min-width: 10rem;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dashboard-header-menu__item {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: calc(var(--radius-md) - 0.125rem);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  min-height: 2.75rem;
}

.dashboard-header-menu__item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* CL222 — appearance choices in dashboard top menu */
.dashboard-header-menu__section {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-header-menu__section-label {
  margin: 0;
  padding: 0.35rem 0.9rem 0.15rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-header-menu__theme-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 0;
  border-radius: calc(var(--radius-md) - 0.125rem);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  min-height: 2.75rem;
}

.dashboard-header-menu__theme-item::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}

.dashboard-header-menu__theme-item[aria-checked="true"] {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.dashboard-header-menu__theme-item[aria-checked="true"]::after {
  border-color: var(--brand-accent);
  background: var(--brand-accent);
}

.dashboard-header-menu__theme-item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-header-menu__item--profile {
  margin-top: 0.1rem;
}

.dashboard-match-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: var(--overlay-42);
}

.dashboard-match-menu {
  padding: 0.45rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dashboard-match-menu--anchored {
  position: fixed;
  right: max(1rem, calc(50% - 14rem + 1rem));
  bottom: calc(var(--bottom-chrome) + 0.55rem);
  z-index: 32;
  min-width: min(calc(100vw - 2rem), 14rem);
}

.dashboard-match-menu__item {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  min-height: 3rem;
}

.dashboard-match-menu__item + .dashboard-match-menu__item {
  margin-top: 0.25rem;
}

.dashboard-match-menu__item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-match-menu__item--new {
  background: rgba(37, 171, 72, 0.12);
  border: 1px solid rgba(37, 171, 72, 0.28);
}

.dashboard-match-menu__item--join {
  background: var(--surface-tint-04);
  border: 1px solid var(--border);
}

.dashboard-match-menu__item:active {
  transform: translateY(1px);
}

.dashboard-match-menu__label {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-match-menu__hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.dashboard-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  margin-top: 1.25rem;
}

.dashboard-performance {
  padding-bottom: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.dashboard-performance__body {
  min-width: 0;
  max-width: 100%;
}

.dashboard-performance__title {
  margin: 0 0 0.85rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.dashboard-performance__status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.perf-overall-hero {
  margin-bottom: 1rem;
  padding: 1.1rem 1rem 0.85rem;
  border-radius: var(--radius-lg);
  background: var(--accent-panel-gradient);
  border: 1px solid rgba(37, 171, 72, 0.28);
}

.perf-overall-hero--unrated {
  background: var(--surface-tint-03);
  border-color: var(--border);
}

.perf-overall-hero__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.perf-overall-hero__copy {
  flex: 1;
  min-width: 0;
}

.perf-overall-hero__eyebrow {
  margin: 0 0 0.4rem;
  color: var(--brand-accent-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.perf-overall-hero--unrated .perf-overall-hero__eyebrow {
  color: var(--text-muted);
}

.perf-overall-hero__meta {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.perf-overall-hero--unrated .perf-overall-hero__meta {
  color: var(--text-secondary);
}

.perf-overall-hero__ring-wrap {
  position: relative;
  flex: 0 0 auto;
  width: clamp(5.5rem, 22vw, 6.75rem);
  height: clamp(5.5rem, 22vw, 6.75rem);
}

.perf-overall-hero__ring {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.perf-ring__track {
  fill: none;
  stroke: var(--chart-track);
  stroke-width: 6;
}

.perf-ring__accent {
  fill: none;
  stroke: var(--brand-accent);
  stroke-width: 6;
  stroke-linecap: round;
}

.perf-overall-hero--unrated .perf-ring__accent {
  stroke: var(--text-muted);
  opacity: 0.45;
}

.perf-overall-hero__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(1.5rem, 6vw, 1.875rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--brand-accent);
}

.perf-overall-hero--unrated .perf-overall-hero__value {
  color: var(--text-secondary);
}

.perf-overall-hero__details {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.perf-overall-hero__summary {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.perf-overall-hero__summary::-webkit-details-marker {
  display: none;
}

.perf-overall-hero__detail {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.perf-ratings {
  margin-bottom: 1rem;
}

.perf-ratings__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.perf-ratings__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.perf-ratings__note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.3;
  text-align: right;
}

.perf-ratings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr));
  gap: 0.65rem;
}

.perf-rating-tile {
  position: relative;
  padding: 0.85rem 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  background: linear-gradient(
    160deg,
    var(--card-accent-soft, var(--brand-accent-soft)) 0%,
    var(--accent-fade-end) 100%
  );
  border: 1px solid var(--card-accent-soft, var(--brand-accent-soft));
  text-align: center;
}

.perf-rating-tile--unrated {
  background: var(--surface-tint-04);
  border-color: var(--border);
}

.perf-rating-tile__badge {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.85;
}

.perf-rating-tile__value {
  display: block;
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--card-accent, var(--brand-accent));
}

.perf-rating-tile--unrated .perf-rating-tile__value {
  color: var(--text-secondary);
}

.perf-rating-tile__discipline {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.perf-rating-tile__meta {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  line-height: 1.3;
}

.perf-panel {
  padding: 1.1rem 1rem 1.15rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--surface-raised) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: perf-fade-in 0.4s ease-out both;
}

.perf-panel--cl187 {
  display: grid;
  gap: 0.15rem;
}

/* CL199 — Melissa intersection dashboard experiment */
.perf-panel--cl199 {
  display: grid;
  gap: 0.85rem;
  padding: 1.15rem 1rem 1.2rem;
  background: var(--panel-gradient);
  border: 1px solid rgba(37, 171, 72, 0.32);
  box-shadow:
    var(--panel-inset-shadow),
    var(--shadow-lg);
}

.perf-callout--cl199 {
  background: rgba(37, 171, 72, 0.08);
  border-color: rgba(37, 171, 72, 0.2);
}

.cl199-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.cl199-tile {
  display: grid;
  gap: 0.2rem;
  padding: 0.95rem 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--tile-bg);
  border: 1px solid rgba(37, 171, 72, 0.24);
  text-align: center;
}

.cl199-tile--wide {
  grid-column: 1 / -1;
}

.cl199-tile--accent {
  border-color: rgba(37, 171, 72, 0.42);
  background: var(--tile-accent-gradient);
}

.cl199-tile__icon {
  display: block;
  margin-bottom: 0.15rem;
  color: rgba(37, 171, 72, 0.55);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
}

.cl199-tile__value {
  display: block;
  font-size: clamp(1.5rem, 6.5vw, 2.125rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.cl199-tile--accent .cl199-tile__value {
  color: var(--brand-accent);
}

.cl199-tile__label {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.25;
}

.cl199-winrate-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.cl199-winrate-note__detail {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.cl199-section {
  padding-top: 0.15rem;
  border-top: 1px solid rgba(37, 171, 72, 0.14);
}

.cl199-section__title {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.cl199-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.1rem;
}

.cl199-form-pill {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  border: 1px solid transparent;
}

.cl199-form-pill--win {
  color: var(--accent-on-filled);
  background: var(--perf-win);
  border-color: rgba(37, 171, 72, 0.45);
}

.cl199-form-pill--loss {
  color: var(--accent-on-loss);
  background: var(--perf-loss);
  border-color: rgba(248, 113, 113, 0.4);
}

.cl199-form-pill--draw {
  color: var(--text);
  background: var(--perf-draw-soft);
  border-color: var(--perf-draw);
}

.cl199-form-pill--unsupported,
.cl199-form-pill--unknown {
  color: var(--text-muted);
  background: var(--perf-excluded-soft);
  border-color: var(--perf-excluded);
}

/* CL201/CL203 — dashboard aliases to global Melissa brand tokens */
#dashboard-performance {
  --cl201-green: var(--brand-accent);
  --cl201-green-soft: var(--brand-accent-soft);
  --cl201-green-border: rgba(37, 171, 72, 0.28);
  --cl228-record-donut-track: rgba(168, 162, 158, 0.16);
  --cl201-red: var(--brand-loss);
}

/* CL200 — Melissa reference visual fidelity (independent cards, no enclosing panel) */
.cl200-dashboard {
  display: grid;
  gap: 1.35rem;
  padding: 0.15rem 0 0.5rem;
  min-width: 0;
  max-width: 100%;
}

.cl212b-dashboard {
  min-width: 0;
  max-width: 100%;
}

.cl212b-dashboard .cl200-section,
.cl212b-dashboard .cl204-section {
  min-width: 0;
  max-width: 100%;
}

.cl200-callout {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-tint-04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.cl200-callout--muted {
  color: var(--text-muted);
}

.cl200-section {
  display: grid;
  gap: 0.75rem;
}

.cl200-section + .cl200-section {
  padding-top: 0.25rem;
}

.cl200-section__title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cl201-green);
}

.cl200-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

/* CL206 — four-across summary + composite rating ring */
.cl206-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

/* CL207 — equal-height cards with value baseline alignment */
.cl207-summary-grid {
  align-items: stretch;
}

.cl207-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  gap: 0;
}

.cl207-summary-card .cl200-summary-card__icon {
  flex: 0 0 auto;
  margin-bottom: 0.35rem;
}

.cl207-summary-card .cl200-summary-card__label {
  flex: 0 0 auto;
  min-height: 2.5em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  padding: 0 0.1rem;
}

.cl207-summary-card .cl200-summary-card__value,
.cl207-summary-card .cl206-streak-value {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0.35rem;
  width: 100%;
}

.cl207-rating-block {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.cl207-rating-caption {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.25;
}

.cl206-rating-ring {
  position: relative;
  width: clamp(5.25rem, 28vw, 6.5rem);
  height: clamp(5.25rem, 28vw, 6.5rem);
  margin: 0 auto;
}

.cl206-rating-ring__svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.cl206-rating-ring__track {
  fill: none;
  stroke: var(--chart-track);
  stroke-width: 4;
}

.cl206-rating-ring__accent {
  fill: none;
  stroke: var(--cl201-green);
  stroke-width: 4;
  stroke-linecap: round;
}

.cl206-rating-ring__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--cl201-green);
  font-variant-numeric: tabular-nums;
}

.cl206-rating-ring__value--unrated {
  color: var(--text-secondary);
}

.cl206-streak-value--active {
  color: var(--cl201-green);
}

/* CL212b — horizontal rating scope filter carousel */
/* CL213 — overflow contained to inner track only (no page-level horizontal expansion) */
.cl212b-rating-scope-carousel-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 0.65rem;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.cl212b-rating-scope-carousel {
  display: flex;
  gap: 0.55rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.15rem 0 0.35rem;
  box-sizing: border-box;
}

.cl212b-rating-scope-carousel::-webkit-scrollbar {
  display: none;
}

.cl212b-rating-scope-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  min-width: 6.75rem;
  max-width: 8.5rem;
  padding: 0.65rem 0.55rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card-gradient);
  color: inherit;
  text-align: center;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.cl212b-rating-scope-card:focus-visible {
  outline: 2px solid var(--cl201-green);
  outline-offset: 2px;
}

.cl212b-rating-scope-card--active {
  border-color: rgba(37, 171, 72, 0.55);
  background: linear-gradient(
    165deg,
    rgba(37, 171, 72, 0.18) 0%,
    var(--accent-fade-deep) 100%
  );
  box-shadow: 0 0 0 1px rgba(37, 171, 72, 0.22) inset;
}

/* CL214 — compact rating ring inside each scope card */
.cl214-rating-scope-card__ring {
  display: grid;
  place-items: center;
  width: 100%;
}

.cl214-rating-scope-card__ring-graphic.cl206-rating-ring {
  width: clamp(3.65rem, 19vw, 4.65rem);
  height: clamp(3.65rem, 19vw, 4.65rem);
  margin: 0.05rem auto 0;
}

.cl214-rating-scope-card__ring-graphic .cl206-rating-ring__value {
  font-size: clamp(0.9rem, 3.8vw, 1.1rem);
}

.cl212b-rating-scope-card--unrated .cl206-rating-ring__value {
  color: var(--text-secondary);
}

.cl212b-rating-scope-card__title {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.cl212b-rating-scope-card__subtitle {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

.cl212b-rating-scope-card__meta {
  font-size: 0.625rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.cl200-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.95rem 0.45rem 0.85rem;
  border-radius: 0.875rem;
  background: var(--elevated-bg);
  border: 1px solid var(--border-subtle);
  text-align: center;
  min-width: 0;
}

.cl200-summary-card__icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-bottom: 0.1rem;
}

.cl200-summary-card__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cl202-winrate-pie {
  overflow: visible;
}

.cl228-record-donut {
  overflow: visible;
}

.cl200-summary-card__label {
  color: var(--text-muted);
  font-size: clamp(0.5625rem, 2.6vw, 0.6875rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.cl200-summary-card__value {
  font-size: clamp(1.25rem, 5.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.cl200-winrate-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.4;
}

.cl200-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cl200-form-badge {
  display: inline-grid;
  place-items: center;
  min-width: 2.125rem;
  height: 2.125rem;
  padding: 0 0.35rem;
  border-radius: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}

.cl200-form-badge--win {
  color: #fff;
  background: var(--cl201-green);
}

.cl200-form-badge--loss {
  color: #fff;
  background: var(--cl201-red);
}

.cl200-form-badge--draw {
  color: var(--text);
  background: rgba(168, 162, 158, 0.35);
}

.cl200-form-badge--unsupported,
.cl200-form-badge--unknown {
  color: var(--text-muted);
  background: rgba(87, 83, 78, 0.45);
}

/* CL204/CL205 — Melissa YOUR MATCHES list */
.cl204-section {
  display: grid;
  gap: 0.65rem;
}

.cl204-section__title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cl201-green);
}

.cl205-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.cl205-section-header__order {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.cl204-matches-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.cl204-matches-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border-subtle);
}

/* CL205 — charcoal card rows with vertical gaps */
.cl205-matches-list {
  gap: 0.55rem;
  border-top: none;
}

.cl204-match-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.cl205-match-row {
  padding: 0.75rem 0.85rem;
  border-radius: 0.875rem;
  background: var(--elevated-bg);
  border: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.cl204-match-row:focus-visible,
.cl205-match-row:focus-visible {
  outline: 2px solid var(--brand-accent-secondary);
  outline-offset: 2px;
  border-radius: 0.875rem;
}

.cl204-match-row__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(168, 162, 158, 0.22);
  flex-shrink: 0;
}

.cl205-match-row__avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

.cl205-match-row__avatar-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cl204-match-row__body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.cl204-match-row__opponent {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cl204-match-row__date {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* CL211 — date · discipline secondary metadata on one muted line */
.cl211-match-row__date {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.cl204-match-row__score {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cl204-match-row__score--muted {
  color: var(--text-muted);
  font-weight: 600;
}

.cl204-match-row__badge {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}

.cl204-match-row__badge--win {
  color: #fff;
  background: var(--cl201-green);
}

.cl204-match-row__badge--loss {
  color: #fff;
  background: var(--cl201-red);
}

.cl204-match-row__badge--draw {
  color: var(--text);
  background: var(--perf-draw-badge);
}

.cl204-match-row__badge--unsupported,
.cl204-match-row__badge--unknown {
  color: var(--text-muted);
  background: rgba(87, 83, 78, 0.45);
}

@media (max-width: 360px) {
  .cl200-summary-grid {
    gap: 0.45rem;
  }

  .cl206-summary-grid {
    gap: 0.3rem;
  }

  .cl200-summary-card {
    padding: 0.85rem 0.35rem 0.75rem;
  }

  .cl206-summary-grid .cl200-summary-card {
    padding: 0.7rem 0.2rem 0.6rem;
    gap: 0.25rem;
  }

  .cl206-summary-grid .cl200-summary-card__icon {
    width: 1.85rem;
    height: 1.85rem;
  }

  .cl206-summary-grid .cl200-summary-card__label {
    font-size: clamp(0.5rem, 2.1vw, 0.5625rem);
  }

  .cl206-summary-grid .cl200-summary-card__value {
    font-size: clamp(0.875rem, 3.8vw, 1.125rem);
  }

  .cl204-match-row {
    gap: 0.5rem;
  }

  .cl205-match-row {
    padding: 0.7rem 0.75rem;
  }

  .cl204-match-row__avatar,
  .cl205-match-row__avatar {
    width: 2rem;
    height: 2rem;
  }
}

.perf-callout {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--brand-accent-soft);
  border: 1px solid rgba(37, 171, 72, 0.22);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.perf-callout--muted {
  background: var(--surface-tint-04);
  border-color: var(--border);
}

.perf-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.perf-grid__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.perf-grid__charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.perf-stat {
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  background: var(--surface-tint-03);
  border: 1px solid var(--border);
  text-align: center;
}

.perf-stat__value {
  display: block;
  font-size: clamp(1.125rem, 4.5vw, 1.375rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.perf-stat__label {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.perf-stat--accent .perf-stat__value {
  color: var(--brand-accent);
}

.perf-chart-card {
  padding: 0.85rem 0.75rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-tint-03);
  border: 1px solid var(--border);
}

.perf-chart-card__title {
  margin: 0 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.perf-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.perf-donut {
  --donut-size: 5.5rem;
  width: var(--donut-size);
  height: var(--donut-size);
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.perf-donut::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.perf-donut__center {
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.perf-donut__center small {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.perf-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  width: 100%;
}

.perf-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  line-height: 1.2;
}

.perf-legend__swatch {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.perf-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.perf-gauge__svg {
  width: 100%;
  max-width: 7.5rem;
  height: auto;
  display: block;
}

.perf-gauge__track {
  fill: none;
  stroke: var(--chart-track-subtle);
  stroke-width: 8;
  stroke-linecap: round;
}

.perf-gauge__fill {
  fill: none;
  stroke: var(--brand-accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease-out;
}

.perf-gauge__value {
  margin-top: -0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.perf-gauge__caption {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.35;
  text-align: center;
}

.perf-gauge--limited .perf-gauge__fill {
  stroke: var(--text-muted);
  opacity: 0.45;
}

.perf-gauge--limited .perf-gauge__value {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.perf-winrate-caption {
  margin: 0 0 0.85rem;
  padding-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.perf-winrate-caption__detail {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.perf-section {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.perf-section__title {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.perf-discipline {
  display: grid;
  gap: 0.75rem;
}

.perf-discipline__row {
  display: grid;
  gap: 0.4rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-tint-02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--item-accent, var(--brand-accent));
}

.perf-discipline__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.perf-discipline__name {
  font-weight: 700;
  color: var(--item-accent-secondary, var(--text));
}

.perf-discipline__meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
}

.perf-discipline__bar {
  display: flex;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface-tint-06);
}

.perf-discipline__segment {
  min-width: 0;
  transition: flex-grow 0.5s ease-out;
}

.perf-discipline__segment--win {
  background: var(--perf-win);
}

.perf-discipline__segment--loss {
  background: var(--perf-loss);
}

.perf-discipline__segment--draw {
  background: var(--perf-draw);
}

.perf-discipline__segment--excluded {
  background: var(--perf-excluded);
}

.perf-form-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.35rem 0 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.perf-form-timeline::-webkit-scrollbar {
  display: none;
}

.perf-form-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 2.75rem;
  position: relative;
}

.perf-form-node__dot {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  border: 2px solid transparent;
  background: var(--surface);
}

.perf-form-node__dot--win {
  color: var(--accent-on-filled);
  background: var(--perf-win);
  border-color: var(--item-accent, rgba(37, 171, 72, 0.5));
}

.perf-form-node__dot--loss {
  color: var(--accent-on-loss);
  background: var(--perf-loss);
  border-color: var(--item-accent, rgba(248, 113, 113, 0.45));
}

.perf-form-node__dot--draw {
  color: var(--text);
  background: var(--perf-draw-soft);
  border-color: var(--item-accent, var(--perf-draw));
}

.perf-form-node__dot--unsupported,
.perf-form-node__dot--unknown {
  color: var(--text-muted);
  background: var(--perf-excluded-soft);
  border-color: var(--perf-excluded);
}

.perf-form-node__label {
  margin-top: 0.35rem;
  max-width: 3.25rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-form-node__connector {
  flex: 0 0 0.75rem;
  height: 2px;
  margin-bottom: 1.35rem;
  background: linear-gradient(90deg, var(--border), var(--surface-tint-04));
}

.perf-empty {
  padding: 1.35rem 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(37, 171, 72, 0.08) 0%, var(--surface) 55%);
  border: 1px dashed rgba(37, 171, 72, 0.28);
  text-align: center;
}

#dashboard-performance .perf-empty {
  background: linear-gradient(160deg, rgba(37, 171, 72, 0.08) 0%, var(--surface) 55%);
  border-color: var(--cl201-green-border);
}

.perf-empty__icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-accent);
  background: var(--brand-accent-soft);
  border: 1px solid rgba(37, 171, 72, 0.25);
}

#dashboard-performance .perf-empty__icon {
  color: var(--cl201-green);
  background: var(--cl201-green-soft);
  border-color: var(--cl201-green-border);
}

.perf-empty__message {
  margin: 0 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.perf-empty__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.perf-loading {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.perf-loading__bar {
  display: block;
  height: 0.65rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    var(--surface-tint-06) 0%,
    var(--surface-tint-12) 50%,
    var(--surface-tint-06) 100%
  );
  background-size: 200% 100%;
  animation: perf-shimmer 1.2s ease-in-out infinite;
}

.perf-loading__bar--short {
  width: 55%;
}

.perf-loading__bar--medium {
  width: 78%;
}

@keyframes perf-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes perf-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 360px) {
  .perf-grid__charts {
    grid-template-columns: 1fr;
  }

  .perf-grid__stats {
    gap: 0.45rem;
  }

  .perf-stat {
    padding: 0.7rem 0.35rem;
  }

  .perf-overall-hero__body {
    flex-direction: column-reverse;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .perf-panel,
  .perf-loading__bar,
  .perf-discipline__segment,
  .perf-gauge__fill,
  .perf-ring__accent,
  .tab-bar__action,
  .tab-bar__action-icon,
  .dashboard-header__menu-btn {
    animation: none !important;
    transition: none !important;
  }
}

.new-match-picker-scroll {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  flex: 1;
  padding-top: 0.15rem;
}

.cl234-picker-section {
  display: grid;
  gap: 0.65rem;
}

.cl234-picker-section--join {
  padding-bottom: 0.15rem;
}

.cl240-picker-section--join {
  justify-items: stretch;
}

.cl234-picker-section__title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cl201-green, var(--brand-accent));
}

.cl240-picker-join-card {
  width: 100%;
  grid-template-columns: auto 1fr;
  text-align: left;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--discipline-tile-fallback-bg, var(--surface));
}

.cl240-picker-join-card:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.discipline-card__badge--qr {
  color: var(--brand-accent);
  background: var(--brand-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.cl240-picker-join-card__qr {
  display: block;
}

.cl234-picker-section--new .discipline-grid {
  margin-top: 0;
}

.new-match-picker__empty {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

.view--scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.view > .view-nav,
.view > header,
.view > .dashboard-body,
.view > .new-match-picker-scroll,
.view > .context-actions,
.view > .field--search,
.view > .match-form,
.view > .home-history {
  flex-shrink: 0;
}

.view.hidden {
  display: none;
}

.eyebrow {
  margin: 0 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

#view-select .eyebrow {
  color: var(--brand-accent);
}

#view-add-discipline[data-phase-cl-find-sport-compact-catalog="true"] {
  gap: 0.75rem;
}

#view-add-discipline[data-phase-cl-find-sport-compact-catalog="true"] .field--search {
  margin-top: 0;
}

.new-match-hub-catalog {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.new-match-hub-catalog.hidden {
  display: none !important;
}

.new-match-hub-catalog .field--search {
  margin-top: 0;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 22rem;
}

.hidden {
  display: none !important;
}

/* CL208 — slim top install banner (informational, not primary CTA) */
/* CL210 — flex child inside .shell; pinned above header; non-blocking scroll in shell-content */
.cl208-install-banner {
  flex-shrink: 0;
  align-self: stretch;
  z-index: 30;
  width: calc(100% + 2.5rem);
  max-height: max-content;
  min-height: 0;
  margin: 0 -1.25rem 0.5rem;
  padding: calc(0.5rem + var(--safe-area-top)) 1.25rem 0.55rem;
  background: var(--install-banner-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 3px 0 var(--brand-accent);
  overflow: visible;
  box-sizing: border-box;
}

.cl208-install-banner__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.cl208-install-banner__copy {
  flex: 1;
  min-width: 0;
}

.cl208-install-banner__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.cl208-install-banner__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.cl208-install-banner__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
}

.cl208-install-banner__install,
.cl208-install-banner__dismiss {
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.cl208-install-banner__install {
  border: 1px solid rgba(37, 171, 72, 0.45);
  background: rgba(37, 171, 72, 0.12);
  color: var(--brand-accent-secondary);
}

.cl208-install-banner__install:disabled,
.cl208-install-banner__install[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.cl208-install-banner__install:not(:disabled):active {
  transform: translateY(1px);
}

.cl208-install-banner__dismiss {
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.cl208-install-banner__dismiss:active {
  color: var(--text-secondary);
}

.cl208-install-banner__fallback {
  margin: 0.55rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.cl208-install-guide {
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

@media (max-width: 360px) {
  .cl208-install-banner__row {
    flex-direction: column;
    align-items: stretch;
  }

  .cl208-install-banner__actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cl208-install-banner__install:active,
  .cl208-install-banner__dismiss:active {
    transform: none;
  }
}

/* CL208 rollback reference — legacy bottom install section */
.install-section {
  margin-top: 1.25rem;
}

.install-button {
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.95rem 1.25rem;
  background: var(--accent);
  color: var(--accent-on-filled);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--accent-shadow);
}

.install-fallback,
.install-guide {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.install-guide-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.625rem;
}

.install-steps li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.view-nav {
  margin-bottom: 1rem;
}

.view-nav--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.view-nav__spacer {
  flex: 1;
}

.view-nav__profile-link {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.inbox-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.inbox-message-row {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-tint-04);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.inbox-message-row--unread {
  border-color: rgba(37, 171, 72, 0.35);
}

.inbox-message-row__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.inbox-message-row__meta {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inbox-detail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inbox-detail__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
}

.inbox-detail__body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text-secondary, var(--text-muted));
}

.inbox-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inbox-ios-guide__close {
  margin-top: 0.75rem;
}

.inbox-empty {
  margin: 0;
  color: var(--text-muted);
}

.profile-name-form {
  display: grid;
  gap: 1rem;
  max-width: 28rem;
}

.profile-name-form__hint {
  margin: 0;
  color: var(--muted, #a8a29e);
  font-size: 0.9375rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.home-history {
  margin: 1.25rem 0 0;
  text-align: center;
}

.history-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.history-link--inline {
  display: inline-block;
  margin-top: 0.75rem;
}

.history-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
  align-content: start;
}

.cl247-match-history-list {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0.35rem;
}

.history-list__status {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.history-item {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}

.history-item:active {
  transform: translateY(1px);
}

.history-item__status {
  display: inline-block;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-item__status--active {
  background: var(--item-accent-soft, var(--brand-accent-soft));
  color: var(--item-accent, var(--brand-accent));
}

.history-item__status--waiting {
  background: rgba(148, 163, 184, 0.12);
  color: var(--info-muted);
}

.history-item__status--completed {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning-bright);
}

.history-item__status--submitted {
  background: rgba(148, 163, 184, 0.14);
  color: var(--info-muted);
}

.history-item__discipline {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--item-accent, var(--brand-accent));
}

.history-item__matchup {
  font-size: 1.0625rem;
  font-weight: 700;
}

.history-item__result {
  color: var(--text);
  font-weight: 600;
}

.history-item__when {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.discipline-grid {
  display: grid;
  gap: 0.875rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.discipline-card__main {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.discipline-card--new-match.discipline-card--hero > .discipline-card__badge,
.discipline-card--new-match.discipline-card--hero > .discipline-card__main,
.discipline-card--new-match.discipline-card--hero > .discipline-card__unpin {
  position: relative;
  z-index: 1;
}

.discipline-card__unpin {
  font: inherit;
  cursor: pointer;
}

.discipline-card__unpin--icon {
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--floating-chip-bg);
  color: var(--text-soft-90);
  backdrop-filter: blur(8px);
}

.discipline-card__unpin-icon {
  display: block;
}

.discipline-card__unpin:active {
  transform: translateY(1px);
}

.discipline-card__unpin:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.discipline-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.875rem;
  min-height: 4.75rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.discipline-card[data-cl248-discipline-tile="true"],
.discipline-card--new-match[data-cl248-discipline-tile="true"] {
  background: var(--surface);
  border-color: var(--border);
}

.discipline-card--hero {
  position: relative;
  overflow: hidden;
  border-color: var(--border-strong);
  background-color: var(--discipline-tile-fallback-bg);
}

.discipline-card--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--hero-image, var(--hero-image-dark, var(--hero-image-light)));
  background-size: cover;
  background-position: center;
}

html[data-theme="light"] .discipline-card--hero::before {
  opacity: 0.72;
}

html[data-theme="dark"] .discipline-card--hero::before {
  opacity: 1;
}

.discipline-card--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    90deg,
    rgba(231, 229, 228, 0.88) 0%,
    rgba(231, 229, 228, 0.62) 48%,
    rgba(231, 229, 228, 0.2) 100%
  );
}

html[data-theme="dark"] .discipline-card--hero::after {
  background: linear-gradient(
    90deg,
    rgba(12, 15, 14, 0.94) 0%,
    rgba(12, 15, 14, 0.78) 52%,
    rgba(12, 15, 14, 0.42) 100%
  );
}

.discipline-card--hero > * {
  position: relative;
  z-index: 1;
}

.discipline-card:active {
  transform: translateY(1px);
}

.discipline-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--card-accent-soft, var(--brand-accent-soft));
  color: var(--card-accent, var(--brand-accent));
  box-shadow: inset 0 0 0 1px var(--card-accent-secondary-soft, transparent);
}

.discipline-card__badge--icon {
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  color: inherit;
  font-weight: inherit;
  box-shadow: inset 0 0 0 1px var(--border);
}

.discipline-card__icon {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  border-radius: inherit;
}

.discipline-card__icon--failed {
  display: none;
}

.discipline-card__badge-fallback--hidden {
  display: none;
}

[data-cl-svg-discipline-icon-fallback="true"].discipline-card__badge:not(.discipline-card__badge--add) {
  background: var(--card-accent-soft, var(--brand-accent-soft));
  color: var(--card-accent, var(--brand-accent));
  box-shadow: inset 0 0 0 1px var(--card-accent-secondary-soft, transparent);
}

.perf-rating-tile__badge--icon {
  display: inline-flex;
  align-items: stretch;
  justify-content: stretch;
  width: 2rem;
  height: 2rem;
  padding: 0;
  overflow: hidden;
  margin: 0 auto 0.35rem;
  border-radius: 0.5rem;
  box-shadow: inset 0 0 0 1px var(--border);
}

.perf-rating-tile__badge--icon .discipline-card__icon {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: inherit;
}

.discipline-card--add .discipline-card__badge {
  background: rgba(148, 163, 184, 0.12);
  color: var(--brand-accent);
  box-shadow: none;
}

.discipline-card__badge--add {
  font-size: 1.375rem;
  line-height: 1;
}

.discipline-card--add {
  grid-template-columns: auto 1fr;
  border-style: dashed;
}

.discipline-card--pick {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.discipline-card--pick-no-action {
  grid-template-columns: auto 1fr;
}

#view-engagement[data-phase-cl251-remove-invite-hero="true"] .engagement-card {
  margin-top: 0.35rem;
}

.discipline-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.discipline-card__label {
  font-size: 1.125rem;
  font-weight: 700;
}

.discipline-card__hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.discipline-card--hero .discipline-card__hint {
  color: var(--text-soft-82);
}

.discipline-card__action {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--card-accent, var(--brand-accent));
  white-space: nowrap;
}


.discipline-context--hero > header {
  position: relative;
  overflow: hidden;
  margin: 0 0 0.25rem;
  padding: 1.25rem 1rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background-color: var(--discipline-tile-fallback-bg);
}

.discipline-context--hero > header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--hero-image, var(--hero-image-dark, var(--hero-image-light)));
  background-size: cover;
  background-position: center;
}

html[data-theme="light"] .discipline-context--hero > header::before {
  opacity: 0.72;
}

html[data-theme="dark"] .discipline-context--hero > header::before {
  opacity: 1;
}

.discipline-context--hero > header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(231, 229, 228, 0.32) 0%,
    rgba(231, 229, 228, 0.76) 100%
  );
}

html[data-theme="dark"] .discipline-context--hero > header::after {
  background: linear-gradient(
    180deg,
    rgba(12, 15, 14, 0.45) 0%,
    rgba(12, 15, 14, 0.9) 100%
  );
}

.discipline-context--hero > header > * {
  position: relative;
  z-index: 1;
}

.discipline-context--hero > header .lede {
  color: var(--text-soft-86);
}

.context-actions {
  margin-top: 1.25rem;
  padding-top: 0;
}

.context-actions--dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.context-actions--dual .context-actions__host,
.context-actions--dual .context-actions__join {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  margin-top: 0;
  padding: 0.95rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.context-actions--dual .context-actions__host {
  border: 0;
  background: var(--accent);
  color: var(--accent-on-filled);
  box-shadow: 0 10px 24px var(--accent-shadow);
}

.context-actions--dual .context-actions__join {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: none;
}

.context-actions--dual .context-actions__host:active,
.context-actions--dual .context-actions__join:active {
  transform: translateY(1px);
}

.discipline-join {
  margin-top: 1.25rem;
}

.join-inline-scanner {
  margin-bottom: 1rem;
}

.join-inline-scanner__viewport {
  position: relative;
  min-height: 12rem;
  max-height: min(42vh, 16rem);
  overflow: hidden;
  border-radius: 1rem;
  background: #000;
}

.join-inline-scanner__video {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 12rem;
  object-fit: cover;
}

.join-inline-scanner--scanning .join-inline-scanner__video {
  display: block;
}

.join-inline-scanner__frame {
  display: none;
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(37, 171, 72, 0.85);
  border-radius: 0.75rem;
  box-shadow: 0 0 0 9999px rgba(12, 15, 14, 0.35);
  pointer-events: none;
}

.join-inline-scanner--scanning .join-inline-scanner__frame {
  display: block;
}

.join-inline-scanner__enable {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  min-height: 3rem;
}

.join-inline-scanner--scanning .join-inline-scanner__enable {
  display: none;
}

.join-inline-scanner__enable.hidden {
  display: none;
}

.join-inline-scanner__resume {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--floating-chip-bg);
  color: var(--brand-accent);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.join-inline-scanner__resume.hidden {
  display: none;
}

.join-inline-scanner--scanning .join-inline-scanner__resume {
  display: none;
}

.join-inline-scanner__resume-icon {
  display: block;
}

.join-inline-scanner__status {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

.join-inline-scanner__error {
  margin-top: 0.5rem;
}

.join-inline-scanner__manual-label {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.discipline-history-list {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.95rem 1.25rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-on-filled);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--accent-shadow);
}

.primary-button:active {
  transform: translateY(1px);
}

.match-form,
.field--search {
  margin-top: 1.25rem;
}

.match-form {
  display: grid;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.match-host-shell {
  margin-top: 1.25rem;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.875rem;
}

.match-host-shell__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.match-manual-fallback {
  margin-top: 1rem;
}

.match-manual-fallback summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

.match-manual-fallback__hint {
  margin: 0 0 0.875rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compose-waiting {
  display: grid;
  gap: 0.875rem;
}

.compose-waiting__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.compose-waiting__progress {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent, var(--text));
  letter-spacing: 0.01em;
}

.compose-waiting__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.compose-waiting__slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}

.compose-waiting__slot {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--surface-elevated, var(--surface));
}

.compose-waiting__slot-main {
  display: grid;
  gap: 0.35rem;
}

.compose-waiting__slot--provisional {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent, #4cc76a) 35%, var(--border));
}

.compose-waiting__slot--ratified,
.compose-waiting__slot--committed {
  border-style: solid;
  border-color: var(--border);
}

.compose-waiting__slot--open {
  border-style: dashed;
  opacity: 0.95;
}

.compose-waiting__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.compose-waiting__badge--open {
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-secondary) 12%, transparent);
}

.compose-waiting__badge--provisional {
  color: var(--warning);
  background: color-mix(in srgb, #f5d565 18%, transparent);
}

.compose-waiting__badge--ratified,
.compose-waiting__badge--committed {
  color: var(--accent, #4cc76a);
  background: color-mix(in srgb, var(--accent, #4cc76a) 16%, transparent);
}

.compose-waiting__name {
  font-size: 1rem;
  font-weight: 500;
}

.compose-waiting__name--muted {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.9375rem;
}

.compose-waiting__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: stretch;
}

.compose-waiting__action {
  flex: 1 1 calc(50% - 0.25rem);
  min-height: 2.75rem;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
}

.compose-waiting__action--remove {
  flex-basis: 100%;
}

.compose-waiting__host-join {
  display: grid;
  gap: 0.625rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.compose-waiting__host-join-action {
  min-height: 2.75rem;
}

.compose-waiting__start {
  min-height: 2.875rem;
}

.compose-waiting__start:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.compose-waiting__start-gate {
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, #f5d565 35%, var(--border));
  background: color-mix(in srgb, #f5d565 10%, transparent);
}

.compose-waiting__start-hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.compose-waiting__start-hint--ready {
  color: var(--brand-accent, #4cc76a);
}

.compose-waiting__start-blockers {
  margin: 0.375rem 0 0;
  padding-left: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.compose-waiting__label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compose-share {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
}

.compose-share--simplified {
  gap: 0.625rem;
}

.compose-share__copy-button {
  width: 100%;
}

.compose-share__copy-feedback {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--accent);
}

.compose-share__match-code {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

.compose-share__match-code-value {
  font-size: 1.25rem;
  letter-spacing: 0.12em;
}

.compose-u2__public-meta {
  display: grid;
  gap: 0.25rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compose-u2__joiner-status {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

.compose-u2__tile--readonly {
  cursor: default;
  pointer-events: none;
}

.compose-share__advanced-entry summary,
.compose-waiting__host-join summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.compose-share__advanced-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 0.25rem;
}

.compose-share__advanced-panel {
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.compose-entity-manual-fallback {
  margin-top: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.compose-entity-manual-fallback summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.compose-entity-manual-fallback__action {
  width: 100%;
}

.compose-waiting--ux02 .compose-waiting__start {
  margin-top: 0.25rem;
}

/* Phase U2 — QR Match waiting room */
.compose-waiting--u2 {
  gap: 1rem;
}

.compose-u2__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.compose-u2__discipline {
  margin: 0;
}

.compose-u2__gear {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.compose-u2__gear[aria-expanded="true"] {
  color: var(--accent, #4cc76a);
  border-color: color-mix(in srgb, var(--accent, #4cc76a) 40%, var(--border));
}

.compose-share--u2 {
  border: none;
  padding: 0;
  background: transparent;
  gap: 0.625rem;
}

.compose-share__qr-wrap--u2 {
  width: min(200px, 72vw);
}

.compose-u2__gear-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
}

.compose-u2__tiles-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0.25rem;
}

.compose-u2__tiles {
  display: flex;
  gap: 0.75rem;
  min-width: min-content;
  justify-content: center;
}

.compose-u2__tile {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: var(--radius-md);
  border: 2px dashed color-mix(in srgb, var(--text-secondary) 35%, var(--border));
  background: var(--surface-elevated, var(--surface));
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.compose-u2__tile--ratified,
.compose-u2__tile--provisional,
.compose-u2__tile--committed {
  border-style: solid;
}

.compose-u2__tile-mark {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.compose-u2__tile--open .compose-u2__tile-mark {
  color: var(--text-secondary);
  font-weight: 500;
}

body.compose-u2-slot-modal-open {
  overflow: hidden;
}

.compose-u2-slot-modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.compose-u2-slot-modal-root.hidden {
  display: none;
}

.compose-u2-slot-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.compose-u2-slot-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.compose-u2-slot-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 24rem);
  display: grid;
  gap: 0.625rem;
  padding: 1.125rem 1rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  box-shadow: var(--shadow-modal);
  max-height: min(85vh, 28rem);
  overflow: auto;
}

.compose-u2-slot-modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.compose-u2-slot-modal__lede {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.compose-u2__slot-dialog-action,
.compose-u2__slot-dialog-cancel {
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0;
}

.compose-u2-slot-modal__panel .primary-button,
.compose-u2-slot-modal__panel .secondary-button {
  margin-top: 0;
}

.compose-u2__slot-dialog-cancel {
  margin-top: 0.125rem;
}

.compose-u2__start {
  margin-top: 0.25rem;
}

.compose-waiting--u2 .compose-waiting__start-gate,
.compose-waiting--u2 .compose-waiting__start-blockers {
  display: none;
}

.compose-share__label {
  margin: 0;
  font-weight: 600;
  font-size: 0.9375rem;
}

.compose-share__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.compose-share__qr-wrap {
  width: min(240px, 100%);
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 1;
}

.compose-share__qr {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  min-height: 8rem;
  border-radius: var(--radius-md);
  border: 4px solid var(--qr-bg);
  box-shadow: 0 0 0 1px var(--border);
  background: var(--qr-bg);
}

.compose-share__qr[data-fta2c-qr-rendered="true"] {
  min-height: 0;
}

.compose-share__qr[data-fta2c-qr-rendered="error"] {
  min-height: 4rem;
}

.compose-share .share-row {
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 100%;
  min-width: 0;
}

.compose-share .share-row__input {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .compose-share .share-row {
    grid-template-columns: 1fr;
  }

  .compose-share .share-row__button {
    width: 100%;
  }
}

.compose-share__durable-ref {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.compose-share__copy-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.compose-share__pin,
.compose-share__wrapper {
  border-top: 1px solid var(--border);
  padding-top: 0.625rem;
}

.compose-share__pin summary,
.compose-share__wrapper summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.compose-share__pin-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compose-share__pin-display {
  margin: 0;
  font-size: 0.9375rem;
}

.compose-share__pin-actions,
.compose-share__wrapper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compose-share__pin-actions .secondary-button,
.compose-share__wrapper-actions .secondary-button {
  min-height: 2.75rem;
  flex: 1 1 auto;
}

.compose-share__wrapper-status {
  margin: 0;
  font-size: 0.875rem;
}

.compose-share__wrapper-status--active {
  color: var(--accent, #4cc76a);
}

.compose-share__wrapper-status--idle {
  color: var(--text-secondary);
}

.compose-share__wrapper-status--expired {
  color: var(--warning);
}

.compose-recovery {
  display: grid;
  gap: 0.625rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text-secondary) 8%, transparent);
}

.compose-recovery__hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.compose-recovery__action {
  width: 100%;
  min-height: 2.75rem;
}

.compose-check-in__banner--recovery {
  background: color-mix(in srgb, #f5d565 14%, transparent);
  color: var(--warning);
}

.compose-check-in__banner {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: color-mix(in srgb, var(--accent, #4cc76a) 12%, transparent);
}

.compose-check-in__banner--muted {
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
  color: var(--text-secondary);
}

.compose-check-in--mobile {
  gap: 1rem;
}

.compose-check-in--reduced,
.compose-waiting--reduced {
  gap: 0.75rem;
}

.compose-waiting--reduced .compose-waiting__start-blockers {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compose-check-in__control,
.join-paste__input {
  min-height: 2.75rem;
  font-size: 1rem;
}

.compose-check-in__submit {
  min-height: 3rem;
  font-size: 1.0625rem;
}

.compose-check-in__error-panel {
  margin: 0;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, #fca5a5 45%, var(--border));
  background: color-mix(in srgb, #fca5a5 12%, var(--surface));
  color: var(--danger-text);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.compose-check-in__error-panel--blocker {
  border-color: color-mix(in srgb, #f5d565 40%, var(--border));
  background: color-mix(in srgb, #f5d565 14%, var(--surface));
  color: var(--warning-text);
}

.compose-check-in__paste-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.join-paste {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  display: grid;
  gap: 0.75rem;
}

.join-paste__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.join-paste__hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.join-game__code-input {
  font-size: 1.125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.join-paste__action {
  min-height: 2.75rem;
  margin-top: 0;
}

#view-engagement.view--scroll {
  padding-bottom: 0.75rem;
}

@media (max-width: 480px) {
  .engagement-card {
    padding: 1rem;
  }

  .compose-check-in__field select,
  .compose-check-in__field input,
  .join-paste__input {
    font-size: 16px;
  }
}

.compose-check-in {
  display: grid;
  gap: 0.75rem;
}

.compose-check-in__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.compose-check-in__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.compose-check-in__field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.compose-check-in__field select,
.compose-check-in__field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

.compose-waiting__status {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

@media (min-width: 480px) {
  .compose-waiting__slot {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .compose-waiting__actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .compose-waiting__action {
    flex: 0 1 auto;
    min-width: 6.5rem;
  }

  .compose-waiting__action--remove {
    flex-basis: auto;
  }
}

.field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.field--checkbox input {
  width: 1.125rem;
  height: 1.125rem;
}

.match-side-slot {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.match-side-slot__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-accent-secondary);
}

.match-side-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.match-side-picker__chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.375rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
}

.match-side-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.match-side-selected__name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.text-button,
.secondary-button {
  border: 0;
  background: transparent;
  color: var(--brand-accent);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.25rem 0;
}

.secondary-button {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.875rem;
}

.compose-enrich {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.compose-enrich__title {
  font-weight: 700;
  margin: 0 0 0.375rem;
}

.compose-enrich__hint {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compose-enrich__grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.compose-enrich__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.compose-enrich__skip {
  margin-left: auto;
}

.compose-enrich__error {
  margin: 0.75rem 0 0;
  color: var(--danger, #c0392b);
  font-size: 0.875rem;
}

.compose-enrich__success,
.compose-enrich__saved {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.match-side-identify summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.match-side-identify__grid {
  display: grid;
  gap: 0.5rem;
}

.field {
  display: grid;
  gap: 0.375rem;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.field__input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--text);
  caret-color: var(--text);
  font-size: 1rem;
}

.field__input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
}

.field__input:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
  border-color: var(--accent);
}

.form-error {
  margin: 0;
  color: var(--danger-text-alt);
  font-size: 0.9375rem;
}

.engagement-card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
}

.engagement-card__discipline {
  margin: 0 0 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.engagement-card__matchup {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.engagement-card__status {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.match-load-diag__line {
  margin: 0.5rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.match-load-diag__copy {
  margin-top: 0.75rem;
}

.engagement-card__hint {
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.engagement-card__action {
  margin-top: 1rem;
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  margin-top: 1rem;
  padding: 0.95rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:active {
  transform: translateY(1px);
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.scoreboard__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.scoreboard__name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}

.scoreboard__score {
  margin: 0;
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.scoreboard__score--editable {
  display: block;
  width: 100%;
  padding: 0.25rem;
  border: 2px dashed transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.scoreboard__score--editable:hover,
.scoreboard__score--editable:focus-visible {
  border-color: var(--accent-soft);
  outline: none;
}

.scoreboard__score-edit {
  display: grid;
  gap: 0.5rem;
}

.scoreboard__score-input {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.375rem 0.5rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--text);
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 800;
  text-align: center;
  touch-action: manipulation;
}

.scoreboard__score-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.score-button--compact {
  min-height: 2.75rem;
  font-size: 1rem;
}

.scoreboard__controls {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.score-button {
  flex: 1;
  min-height: 3.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.score-button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on-filled);
}

.score-button:active {
  transform: translateY(1px);
}

.result-card__headline {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.result-card__scores {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.share-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.share-section__label {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--text);
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.share-row__input {
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 1rem;
}

.share-row__button {
  margin-top: 0;
  width: auto;
  min-width: 6.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
}

.form-success {
  margin: 0.75rem 0 0;
  color: var(--accent);
  font-size: 0.9375rem;
}

.snooker-breaks {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.snooker-breaks__label {
  margin: 0 0 0.375rem;
  font-weight: 700;
  color: var(--accent);
}

.snooker-breaks__hint {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.snooker-breaks__grid {
  display: grid;
  gap: 0.75rem;
}

.break-panel {
  padding: 0.875rem;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent-secondary-soft, rgba(250, 250, 249, 0.12));
}

.break-panel__name {
  margin: 0 0 0.375rem;
  font-weight: 700;
  color: var(--accent);
}

.break-panel__stat {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.break-panel__controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.break-panel__controls .score-button {
  min-height: 2.75rem;
  font-size: 1rem;
  padding: 0.5rem;
}


.result-card__breaks {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-secondary);
}

.history-item__extra {
  font-size: 0.875rem;
  color: var(--item-accent-secondary, var(--accent-secondary));
  font-weight: 600;
}

.catalog-results {
  display: grid;
  gap: 0.875rem;
  margin-top: 1rem;
  padding-bottom: 0.5rem;
  align-content: start;
}

.catalog-results__status {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.discipline-browse__crumb {
  grid-column: 1 / -1;
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.discipline-card--taxonomy-category,
.discipline-card--taxonomy-collection {
  text-align: left;
}

.discipline-card__badge--folder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--surface-elevated, rgba(148, 163, 184, 0.16));
  color: var(--text-secondary);
}

.discipline-branch-actions {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.625rem;
}

.discipline-branch-actions__use {
  width: 100%;
}

.discipline-branch-actions__explore {
  width: 100%;
}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex !important;
  visibility: visible;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-sizing: border-box;
  min-height: var(--tab-bar-height);
  padding: 0.5rem 0.85rem calc(0.5rem + var(--safe-area-bottom));
  background: var(--tab-bar-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.tab-bar--with-action .tab-bar__item {
  flex: 1;
  max-width: none;
}

.tab-bar__item {
  flex: 1;
  max-width: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  text-align: center;
}

.tab-bar__item--selected {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.tab-bar__action {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-on-filled);
  box-shadow: 0 8px 20px var(--accent-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tab-bar__action:focus-visible {
  outline: 2px solid var(--brand-accent-secondary);
  outline-offset: 2px;
}

.tab-bar__action:active {
  transform: translateY(1px);
}

.tab-bar__action--open {
  box-shadow: 0 4px 12px var(--accent-shadow);
}

.tab-bar__action-icon {
  display: block;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.15s ease;
}

.tab-bar__action--open .tab-bar__action-icon {
  transform: rotate(45deg);
}

.update-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(var(--bottom-chrome) + 0.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-on-filled);
  box-shadow: 0 12px 30px var(--accent-shadow);
  z-index: 30;
}

.update-banner.hidden {
  display: none;
}

.update-banner button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.875rem;
  background: var(--accent-on-filled);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

/* CL221 — appearance / theme preference */
.cl221-appearance {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.cl221-appearance__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.cl221-appearance__lede {
  margin: 0 0 0.85rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.cl221-theme-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.cl221-theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.cl221-theme-option {
  display: block;
  cursor: pointer;
}

.cl221-theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cl221-theme-option__label {
  display: block;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-tint-03);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cl221-theme-option input:checked + .cl221-theme-option__label {
  border-color: rgba(37, 171, 72, 0.45);
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.cl221-theme-option input:focus-visible + .cl221-theme-option__label {
  outline: 2px solid var(--brand-accent-secondary);
  outline-offset: 2px;
}

.cl221-appearance__hint {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}
