:root {
  --bg-0: #05090d;
  --bg-1: #09131c;
  --bg-2: #102231;
  --bg-3: #081019;
  --card: rgba(14, 28, 39, 0.64);
  --card-strong: rgba(15, 31, 43, 0.84);
  --line: rgba(140, 210, 228, 0.18);
  --line-strong: rgba(120, 228, 255, 0.28);
  --text: #eef8ff;
  --muted: #afc5d4;
  --accent: #67e6ff;
  --accent-2: #2dc9d3;
  --accent-red: #ff4d5f;
  --accent-red-2: #ff6d7e;
  --danger: #ff596d;
  --shadow: 0 18px 48px rgba(2, 10, 16, 0.44);
  --shadow-strong: 0 22px 62px rgba(1, 7, 12, 0.52);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --text-title: clamp(1rem, 0.94rem + 0.22vw, 1.2rem);
  --text-subtitle: clamp(0.78rem, 0.74rem + 0.14vw, 0.9rem);
  --text-label: clamp(0.7rem, 0.68rem + 0.08vw, 0.78rem);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 5% 18%, rgba(198, 15, 36, 0.62) 0%, rgba(128, 9, 24, 0.38) 18%, rgba(45, 8, 14, 0.18) 34%, transparent 54%),
    radial-gradient(circle at 20% 34%, rgba(147, 8, 26, 0.24) 0%, transparent 26%),
    radial-gradient(circle at 92% 58%, rgba(255, 255, 255, 0.16) 0%, rgba(161, 170, 181, 0.08) 16%, transparent 34%),
    radial-gradient(circle at 78% 20%, rgba(45, 201, 211, 0.08) 0%, transparent 18%),
    linear-gradient(110deg, #2d050c 0%, #13070b 12%, #090c12 28%, #070b11 56%, #090d14 78%, #05080d 100%);
  position: relative;
  overflow-x: hidden;
  letter-spacing: 0.005em;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3,
.eyebrow {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.01em;
}

h3 {
  font-size: var(--text-title);
  line-height: 1.2;
}

.eyebrow {
  font-size: 0.77rem;
  text-transform: uppercase;
  color: rgba(145, 191, 211, 0.84);
  margin-bottom: 0.35rem;
  letter-spacing: 0.18em;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(74px);
  pointer-events: none;
  opacity: 0.42;
}

.orb-a {
  width: 380px;
  height: 380px;
  background: rgba(196, 17, 44, 0.92);
  top: -40px;
  left: -120px;
  animation: drift-a 14s ease-in-out infinite;
}

.orb-b {
  width: 320px;
  height: 320px;
  background: rgba(202, 210, 220, 0.32);
  top: 56%;
  right: -120px;
  animation: drift-b 17s ease-in-out infinite;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 0.4px, transparent 0.4px);
  background-size: 2px 2px;
  opacity: 0.22;
}

.glass {
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  background:
    linear-gradient(145deg, rgba(18, 34, 47, 0.7), rgba(10, 18, 27, 0.78)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.05), rgba(103, 230, 255, 0.04));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.topbar {
  margin: 1rem auto;
  width: min(1320px, calc(100% - 1.4rem));
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

#appHeader {
  position: sticky;
  top: 0.65rem;
  z-index: 80;
}

.topbar::before,
.panel::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 77, 95, 0.05), transparent 28%, rgba(103, 230, 255, 0.05));
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-lockup-splash {
  justify-content: center;
  text-align: left;
}

.brand-logo {
  display: block;
  height: auto;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(198, 15, 36, 0.35)) drop-shadow(0 2px 8px rgba(0,0,0,0.45));
  border-radius: 14px;
}

.brand-logo-header {
  width: 52px;
  max-width: 52px;
}

.brand-logo-splash {
  width: 108px;
  max-width: 108px;
}

.auth-box {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.layout {
  margin: 0 auto 2rem;
  width: min(1320px, calc(100% - 1.4rem));
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-bottom: 2rem;
}

.panel {
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
  overflow: hidden;
  animation: fade-in-up 0.55s ease both;
}

#builderPanel {
  grid-column: 1 / -1;
}

#builderPanel .panel-head {
  display: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel h2,
.modal-card h3,
.account-section h4 {
  letter-spacing: 0.01em;
}

.panel h2 {
  font-size: 1.18rem;
}

.grid-form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-bottom: 1rem;
}

.grid-form label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.82rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border-radius: 10px;
  border: 1px solid rgba(126, 183, 204, 0.22);
  background: linear-gradient(180deg, rgba(9, 17, 26, 0.92), rgba(8, 15, 22, 0.72));
  color: var(--text);
  padding: 0.62rem 0.7rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus,
select:focus {
  outline: 2px solid rgba(103, 230, 255, 0.24);
  outline-offset: 1px;
  border-color: rgba(103, 230, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(103, 230, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.selector-chip:focus-visible,
.model-card:focus-visible,
.model-filter-pill:focus-visible,
.account-tab:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(103, 230, 255, 0.55);
  outline-offset: 2px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  align-self: end;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: 40px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(90deg, #ff0f4b 0%, #e95f83 56%, #ead7de 100%);
  border-color: rgba(255, 160, 184, 0.42);
  color: #141318;
  box-shadow: 0 8px 18px rgba(180, 46, 87, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #ff2a60 0%, #ef6d92 55%, #f0e1e7 100%);
  box-shadow: 0 10px 22px rgba(188, 50, 94, 0.34);
}

.btn-ghost {
  border-color: rgba(139, 201, 220, 0.3);
  color: #d6ecf7;
  background: linear-gradient(180deg, rgba(17, 30, 42, 0.82), rgba(10, 18, 26, 0.62));
}

.btn-ghost:hover {
  border-color: rgba(141, 215, 238, 0.52);
  box-shadow: 0 8px 18px rgba(8, 26, 38, 0.3);
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 201, 220, 0.18);
  background: linear-gradient(180deg, rgba(8, 15, 22, 0.38), rgba(8, 15, 22, 0.15));
  scrollbar-width: none;
}

.table-wrap::-webkit-scrollbar,
.account-table-wrap::-webkit-scrollbar {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid rgba(129, 186, 204, 0.1);
  padding: 0.55rem 0.5rem;
  text-align: left;
  font-size: 0.84rem;
}

th {
  color: #e7f7ff;
  background: linear-gradient(180deg, rgba(11, 22, 33, 0.94), rgba(8, 17, 25, 0.88));
  position: sticky;
  top: 0;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

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

th.is-sortable::after {
  content: "↕";
  display: inline-block;
  margin-left: 0.35rem;
  color: rgba(171, 205, 220, 0.55);
  font-size: 0.72rem;
}

th.is-sorted {
  color: #ffffff;
}

th.is-sorted[data-sort-direction="asc"]::after {
  content: "↑";
  color: #67e6ff;
}

th.is-sorted[data-sort-direction="desc"]::after {
  content: "↓";
  color: #67e6ff;
}

tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.015);
}

tr:hover td {
  background: linear-gradient(90deg, rgba(255, 77, 95, 0.08), rgba(67, 145, 173, 0.12));
}

.table-tone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.1rem;
  padding: 0.24rem 0.54rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 201, 220, 0.24);
  background: rgba(9, 17, 26, 0.5);
  font-weight: 700;
  line-height: 1.2;
}

.table-tone--velocity {
  min-width: 4.2rem;
  padding: 0.2rem 0.44rem;
  white-space: nowrap;
  font-size: 0.77rem;
}

.table-tone--low {
  border-color: rgba(120, 223, 176, 0.5);
  color: #b6f2d4;
  background: rgba(120, 223, 176, 0.08);
}

.table-tone--mid {
  border-color: rgba(103, 230, 255, 0.45);
  color: #9eeeff;
  background: rgba(103, 230, 255, 0.08);
}

.table-tone--high {
  border-color: rgba(255, 196, 122, 0.55);
  color: #ffd9a2;
  background: rgba(255, 196, 122, 0.08);
}

.table-tone--max {
  border-color: rgba(255, 118, 146, 0.58);
  color: #ffc1d0;
  background: rgba(255, 118, 146, 0.08);
}

.builder-summary-pill,
.group-intensity-tag,
.table-tone,
.model-filter-pill,
.selector-metric-pill {
  border-radius: 999px;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.chip {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 999px;
  padding: 0.4rem 0.72rem;
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.75), rgba(10, 18, 26, 0.54));
  font-size: 0.8rem;
  cursor: pointer;
  color: #cfeeff;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chip:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 230, 255, 0.42);
  box-shadow: 0 8px 20px rgba(4, 18, 28, 0.34);
}

.chip.active {
  border-color: rgba(255, 77, 95, 0.7);
  color: #fff7f9;
  background: linear-gradient(120deg, rgba(96, 19, 33, 0.72), rgba(17, 59, 73, 0.72));
  box-shadow: 0 10px 24px rgba(255, 77, 95, 0.16);
}

.kpi-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.kpi-row .kpi {
  min-width: 0;
  padding: 0.56rem 0.62rem;
  min-height: 76px;
}

.kpi-row .kpi strong {
  font-size: clamp(0.96rem, 1.1vw, 1.14rem);
}

.kpi-row .kpi small,
.kpi-row .kpi .kpi-subvalue {
  font-size: 0.7rem;
}

.session-summary {
  border: 1px solid rgba(139, 201, 220, 0.18);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.92rem;
  margin: -0.2rem 0 0.95rem;
  background:
    linear-gradient(180deg, rgba(12, 23, 34, 0.76), rgba(9, 16, 24, 0.58)),
    linear-gradient(110deg, rgba(255, 77, 95, 0.05), rgba(103, 230, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 20px rgba(4, 18, 28, 0.2);
}

.session-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.session-summary-head h3 {
  margin: 0;
  font-size: 0.94rem;
}

.session-summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 230, 255, 0.34);
  background: rgba(103, 230, 255, 0.1);
  color: #8ff1ff;
  font-size: var(--text-label);
  font-weight: 700;
}

.session-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.45rem;
}

.session-summary-item {
  border: 1px solid rgba(139, 201, 220, 0.14);
  border-radius: 10px;
  background: rgba(9, 17, 26, 0.36);
  padding: 0.45rem 0.54rem;
}

.session-summary-item small {
  display: block;
  margin-bottom: 0.18rem;
  color: #bfd3df;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.session-summary-item strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  color: #f1fbff;
}

.kpi {
  border: 1px solid rgba(139, 201, 220, 0.18);
  background:
    linear-gradient(180deg, rgba(12, 23, 34, 0.74), rgba(10, 18, 26, 0.54)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.04), rgba(103, 230, 255, 0.04));
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 24px rgba(4, 18, 28, 0.18);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: kpiFadeSlide 280ms ease;
}

.kpi:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 230, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 28px rgba(4, 18, 28, 0.24);
}

.kpi small {
  color: var(--muted);
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kpi strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.28rem;
  line-height: 1.1;
  color: #f4fbff;
}

.kpi-subvalue {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 500;
}

.kpi--feature {
  border-color: rgba(103, 230, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(14, 28, 40, 0.88), rgba(10, 18, 26, 0.62)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.05), rgba(103, 230, 255, 0.08));
}

.kpi--feature strong {
  color: #67e6ff;
}

.kpi--metric {
  text-align: center;
  align-items: center;
  justify-content: center;
}

.kpi--metric small,
.kpi--metric .kpi-subvalue {
  text-align: center;
}

@keyframes kpiFadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.group-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  color: #03121b;
  font-weight: 700;
}

.group-1 {
  background: #ff6f6f;
}

.group-2 {
  background: #ffb25b;
}

.group-3 {
  background: #d7d64f;
}

.group-4 {
  background: #57cf96;
}

.group-5,
.group-6,
.group-7,
.group-8 {
  background: #6db7ff;
}

.delete-btn {
  border: 1px solid rgba(255, 89, 109, 0.42);
  color: #ffe2e7;
  background: linear-gradient(180deg, rgba(81, 16, 29, 0.74), rgba(50, 11, 19, 0.58));
  border-radius: 8px;
  padding: 0.24rem 0.5rem;
  cursor: pointer;
  animation: pulse-danger 2.6s ease-in-out infinite;
}

.delete-btn:hover,
.btn-danger:hover {
  box-shadow: 0 10px 22px rgba(255, 77, 95, 0.16);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(8, 15, 22, 0.55);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 77, 95, 0.7), rgba(103, 230, 255, 0.55));
  border-radius: 999px;
  border: 2px solid rgba(8, 15, 22, 0.35);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pulse-danger {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 77, 95, 0.08);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 77, 95, 0.02);
  }
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(70px, 35px, 0) scale(1.1);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-80px, 35px, 0) scale(1.08);
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .grid-form {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .kpi-row {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }

  .selector-chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-form {
    grid-template-columns: 1fr 1fr;
  }

  .grid-form button {
    grid-column: 1 / -1;
  }

  .kpi-row {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }

  .context-summary-bar {
    top: calc(0.55rem + 118px);
    padding: 0.54rem 0.62rem;
  }

  .context-summary-main {
    gap: 0.36rem;
  }

  .athlete-filter-row {
    grid-template-columns: 1fr;
  }

  .athlete-rule-actions {
    justify-content: flex-start;
  }

  .account-bulk-edit {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .selector-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-models-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .compare-models-list {
    grid-template-columns: 1fr;
  }

  .compare-metrics-grid {
    grid-template-columns: 1fr;
  }

  .compare-models-modal-card {
    width: calc(100vw - 0.5rem);
    max-height: calc(100vh - 0.5rem);
    padding: 0.7rem;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .compare-matrix-wrap {
    padding: 0.46rem;
  }
}

/* ═══════════════════════════════════════════════
   UTILITY
════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════
   SPLASH / LOGIN
════════════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.splash-card {
  border-radius: 26px;
  padding: 2.8rem 2.4rem 2.2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-strong);
  animation: fade-in-up 0.6s ease both;
}

.splash-card h1 {
  font-size: 2.4rem;
  background: linear-gradient(110deg, var(--accent-red) 0%, #ffd2d8 24%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 28px rgba(255, 77, 95, 0.14);
}

.splash-card .eyebrow {
  margin-bottom: 0.18rem;
}

.splash-sub {
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.6;
  margin: 0;
}

.btn-lg {
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  gap: 0.6rem;
  display: inline-flex;
  align-items: center;
}

.splash-card .btn {
  align-self: center;
}

.splash-auth-switch {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.splash-auth-tab {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(139, 201, 220, 0.26);
  background: linear-gradient(180deg, rgba(14, 26, 37, 0.78), rgba(8, 15, 22, 0.56));
  color: var(--muted);
  font-weight: 700;
}

.splash-auth-tab.active {
  color: #fff8fa;
  border-color: rgba(255, 77, 95, 0.48);
  background: linear-gradient(120deg, rgba(94, 17, 31, 0.8), rgba(13, 54, 66, 0.72));
}

.splash-auth-form {
  width: 100%;
  display: grid;
  gap: 0.72rem;
}

.splash-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  text-align: left;
  color: var(--muted);
  font-size: 0.82rem;
}

.splash-auth-field input {
  width: 100%;
  margin: 0;
}

.splash-auth-submit {
  width: 100%;
  justify-content: center;
  min-height: 42px;
  padding: 0.72rem 1rem;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  background: linear-gradient(135deg, rgba(255, 77, 95, 0.76), rgba(255, 118, 105, 0.7));
}

.splash-forgot-btn {
  width: 100%;
  justify-content: center;
}

.splash-auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  color: rgba(175, 197, 212, 0.84);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.splash-auth-divider::before,
.splash-auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 201, 220, 0.24), transparent);
}

#splashLoginBtn {
  width: 100%;
  align-self: center !important;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
  min-height: 42px;
  padding: 0.72rem 1rem;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(245, 249, 252, 0.94);
  border: 1px solid rgba(139, 201, 220, 0.18);
  background: linear-gradient(180deg, rgba(18, 31, 43, 0.82), rgba(10, 18, 26, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.16);
}

#splashLoginBtn svg {
  width: 18px;
  height: 18px;
}

#splashLoginBtn:hover,
#splashLoginBtn:focus-visible,
.splash-auth-submit:hover,
.splash-auth-submit:focus-visible {
  transform: translateY(-1px);
}

#splashLoginBtn:hover,
#splashLoginBtn:focus-visible {
  border-color: rgba(139, 201, 220, 0.28);
  background: linear-gradient(180deg, rgba(24, 39, 53, 0.86), rgba(11, 20, 29, 0.78));
}

.splash-footer {
  display: none !important;
  font-size: 0.78rem;
  color: rgba(159, 192, 206, 0.7);
  margin: 0;
}

/* ═══════════════════════════════════════════════
   TOPBAR upgrades
════════════════════════════════════════════════ */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.topbar-brand { flex: 0 0 auto; }

.topbar-brand h1 {
  font-size: clamp(1.45rem, 1.1rem + 1vw, 2rem);
}

.topbar-brand .eyebrow {
  margin-bottom: 0.12rem;
}

.topbar-team {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.team-select {
  flex: 1 1 180px;
  max-width: 300px;
  border-radius: 10px;
  border: 1px solid rgba(139, 201, 220, 0.26);
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.86), rgba(9, 17, 26, 0.7));
  color: var(--text);
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

.btn-danger {
  border-color: rgba(244, 122, 122, 0.42);
  color: #ffe7e7;
  background: linear-gradient(180deg, rgba(145, 52, 52, 0.78), rgba(108, 34, 34, 0.7));
}

.btn-danger:hover {
  background: linear-gradient(180deg, rgba(165, 62, 62, 0.84), rgba(124, 40, 40, 0.75));
  box-shadow: 0 8px 18px rgba(97, 23, 23, 0.32);
}
.btn-danger:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.auth-box {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(103, 230, 255, 0.46);
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(103, 230, 255, 0.04);
}

.user-name {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   FLOATING STATUS
════════════════════════════════════════════════ */
.status-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 520;
  min-width: 220px;
  max-width: min(420px, calc(100% - 1rem));
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(139, 201, 220, 0.16);
  background:
    linear-gradient(90deg, rgba(255, 77, 95, 0.08), rgba(103, 230, 255, 0.08)),
    linear-gradient(180deg, rgba(12, 23, 34, 0.92), rgba(8, 15, 22, 0.86));
  box-shadow: var(--shadow-strong);
  cursor: pointer;
}

.status-toast--info {
  border-color: rgba(139, 201, 220, 0.16);
}

.status-toast--success {
  border-color: rgba(120, 223, 176, 0.45);
  background:
    linear-gradient(90deg, rgba(120, 223, 176, 0.12), rgba(103, 230, 255, 0.08)),
    linear-gradient(180deg, rgba(12, 23, 34, 0.94), rgba(8, 15, 22, 0.88));
}

.status-toast--error {
  border-color: rgba(255, 118, 146, 0.45);
  background:
    linear-gradient(90deg, rgba(255, 118, 146, 0.12), rgba(255, 77, 95, 0.08)),
    linear-gradient(180deg, rgba(12, 23, 34, 0.94), rgba(8, 15, 22, 0.88));
}

.status-toast p {
  margin: 0;
  font-size: 0.86rem;
  color: #e4f5ff;
  white-space: pre-line;
}

/* ═══════════════════════════════════════════════
   TEAM BADGE + COUNT
════════════════════════════════════════════════ */
.team-badge {
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0.15rem 0 0;
  font-weight: 600;
}

.athlete-count {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.empty-cell {
  color: #c8dbe7;
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  padding: 1.2rem !important;
  background:
    linear-gradient(180deg, rgba(12, 23, 34, 0.45), rgba(10, 18, 26, 0.24)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.03), rgba(103, 230, 255, 0.03));
  border: 1px dashed rgba(139, 201, 220, 0.16);
  border-radius: 12px;
}

/* ═══════════════════════════════════════════════
   CHIP with delete button
════════════════════════════════════════════════ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

.chip-del {
  border: none;
  background: transparent;
  color: rgba(159, 192, 206, 0.6);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  margin-left: 0.1rem;
}

.chip-del:hover { color: var(--danger); }

/* ═══════════════════════════════════════════════
   BUILDER ACTIONS
════════════════════════════════════════════════ */
.builder-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
}

.builder-form {
  margin-bottom: 1rem;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(139, 201, 220, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(11, 19, 28, 0.92), rgba(9, 16, 24, 0.82)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.04), rgba(103, 230, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.builder-form-intro {
  grid-column: 1 / -1;
}

.builder-form-intro strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

.builder-form-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.builder-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #dbeef8;
  font-size: 0.84rem;
  line-height: 1.3;
}

.builder-field-label {
  display: flex;
  align-items: flex-end;
  min-height: 2.8rem;
}

.builder-field input,
.builder-field select {
  min-height: 56px;
}

.builder-submit-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.25rem;
}

.builder-form-note {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

#generatePrescriptionBtn {
  min-width: 220px;
  max-width: 240px;
  min-height: 56px;
  font-size: 1rem;
  font-weight: 800;
}

#generatePrescriptionBtn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.builder-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.builder-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(139, 201, 220, 0.24);
  background: rgba(10, 18, 26, 0.58);
}

.builder-collapse-btn .builder-collapse-label {
  display: none;
}

.builder-collapse-btn:hover {
  border-color: rgba(139, 201, 220, 0.42);
  background: rgba(11, 22, 32, 0.78);
}

.builder-collapse-icon {
  display: inline-block;
  font-size: 0.74rem;
  line-height: 1;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.builder-collapse-btn[aria-expanded="false"] .builder-collapse-icon {
  transform: rotate(-90deg);
}

.builder-selection-body {
  display: grid;
  gap: 0.62rem;
  max-height: 2400px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.16s ease;
}

.builder-selection-block.is-collapsed .builder-selection-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.builder-selection-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.builder-selection-actions .btn.active {
  border-color: rgba(103, 230, 255, 0.46);
  color: #a6f5ff;
  background: linear-gradient(180deg, rgba(18, 35, 47, 0.9), rgba(11, 22, 32, 0.76));
  box-shadow: 0 10px 22px rgba(4, 18, 28, 0.3);
}

.context-summary-bar {
  position: sticky;
  top: calc(0.65rem + 86px);
  z-index: 70;
  padding: 0.62rem 0.8rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 201, 220, 0.22);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.context-summary-main {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: #d9eef9;
  font-size: 0.78rem;
}

.context-summary-main span {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  background: rgba(10, 18, 26, 0.48);
}

.context-summary-undo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #ffe7ed;
}

.athlete-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 0.52rem;
  align-items: end;
}

.athlete-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.athlete-rule-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.coach-brief {
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.72rem;
  margin-bottom: 0.55rem;
  background: linear-gradient(180deg, rgba(11, 20, 30, 0.76), rgba(9, 16, 24, 0.58));
}

.coach-brief-block {
  display: grid;
  gap: 0.32rem;
}

.coach-brief-line {
  border-radius: 10px;
  border: 1px solid rgba(139, 201, 220, 0.16);
  padding: 0.36rem 0.52rem;
  font-size: 0.82rem;
  color: #d8ebf6;
  background: rgba(8, 15, 22, 0.42);
}

.coach-brief-line strong {
  color: #9fefff;
}

.coach-brief-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.builder-summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.28rem 0.64rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 201, 220, 0.2);
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.7), rgba(10, 18, 26, 0.52));
  color: #dbeef8;
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.prescription-view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(139, 201, 220, 0.15);
  padding-bottom: 0.8rem;
}

.prescription-view-toggle .btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.prescription-view-toggle .btn.active {
  background: rgba(103, 230, 255, 0.12);
  border-color: rgba(103, 230, 255, 0.3);
  color: #67e6ff;
}

.comparison-toolbar {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.comparison-panel {
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.68rem;
  margin-bottom: 0.82rem;
  background: linear-gradient(180deg, rgba(11, 20, 30, 0.72), rgba(9, 16, 24, 0.56));
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.56rem;
  margin-bottom: 0.62rem;
}

.comparison-card {
  border: 1px solid rgba(139, 201, 220, 0.16);
  border-radius: 12px;
  padding: 0.54rem 0.62rem;
  background: rgba(9, 17, 26, 0.42);
}

.comparison-card--accent {
  border-color: rgba(103, 230, 255, 0.32);
  background: linear-gradient(145deg, rgba(14, 31, 43, 0.82), rgba(9, 18, 27, 0.72));
}

.comparison-card h4 {
  margin: 0 0 0.42rem;
  font-size: 0.86rem;
  color: #d9f1fb;
}

.comparison-card p {
  margin: 0.2rem 0;
  font-size: 0.8rem;
  color: #c8dfec;
}

.comparison-table-wrap {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 340px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid rgba(139, 201, 220, 0.14);
  padding: 0.42rem 0.48rem;
  font-size: 0.78rem;
}

.compare-models-modal-card {
  width: min(1600px, calc(100vw - 0.8rem));
  max-height: calc(100vh - 0.8rem);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.72rem;
  border-radius: 22px;
  padding: 1rem;
  border: 1px solid rgba(139, 201, 220, 0.22);
  background:
    linear-gradient(180deg, rgba(6, 10, 15, 0.96), rgba(7, 12, 18, 0.92)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.08), rgba(103, 230, 255, 0.04));
}

#compareModelsModal.modal-overlay {
  padding: 0.4rem;
}

.compare-models-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 0;
}

.compare-models-head h3 {
  margin: 0;
}

.compare-models-head p {
  margin: 0.22rem 0 0;
  color: #c2d8e5;
  font-size: 0.84rem;
}

.compare-models-shell {
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: 14px;
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(7, 12, 18, 0.78), rgba(9, 14, 22, 0.62));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.compare-models-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.compare-models-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55rem;
  max-height: min(44vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  padding-right: 0.12rem;
}

.compare-model-chip {
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.75), rgba(10, 18, 26, 0.58));
  color: #d9eef9;
  text-align: left;
  padding: 0.56rem 0.62rem;
  display: grid;
  gap: 0.26rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.compare-model-chip:hover {
  border-color: rgba(103, 230, 255, 0.36);
  transform: translateY(-1px);
}

.compare-model-chip.is-selected {
  border-color: rgba(255, 77, 95, 0.58);
  background: linear-gradient(120deg, rgba(95, 18, 32, 0.86), rgba(16, 57, 70, 0.78));
  box-shadow: 0 0 0 2px rgba(255, 77, 95, 0.2), 0 10px 24px rgba(255, 77, 95, 0.14);
}

.compare-model-chip-name {
  font-weight: 700;
  font-size: 0.84rem;
}

.compare-model-chip-meta {
  color: #bdd3e0;
  font-size: 0.75rem;
}

.compare-model-chip-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.compare-model-chip-badge {
  border: 1px solid rgba(139, 201, 220, 0.24);
  border-radius: 999px;
  padding: 0.14rem 0.46rem;
  font-size: 0.68rem;
  color: #cde8f4;
  background: rgba(9, 17, 26, 0.45);
}

.compare-model-chip.is-selected .compare-model-chip-badge {
  border-color: rgba(255, 182, 196, 0.4);
  color: #ffe7ed;
  background: rgba(87, 19, 33, 0.45);
}

.compare-models-actions {
  margin-top: 0.62rem;
}

.compare-models-actions .btn {
  min-width: 104px;
  min-height: 34px;
  padding: 0.44rem 0.72rem;
  font-size: 0.78rem;
  border-radius: 9px;
}

.compare-models-results {
  margin-top: 0;
  display: grid;
  gap: 0.82rem;
  scroll-margin-top: 0.65rem;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
  -webkit-overflow-scrolling: touch;
}

.compare-results-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.compare-semaphore-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.compare-sema-chip {
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  font-size: 0.66rem;
  border: 1px solid rgba(139, 201, 220, 0.24);
  color: #d7edf8;
}

.compare-inline-row-wrap {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 12px;
  padding: 0.62rem;
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.5), rgba(8, 14, 21, 0.38));
}

.compare-inline-row-wrap h4 {
  margin: 0 0 0.48rem;
  font-size: 0.84rem;
}

.compare-inline-row {
  display: grid;
  grid-template-columns: repeat(var(--compare-cols, 1), minmax(180px, 1fr));
  gap: 0.55rem;
  overflow-x: auto;
  align-items: stretch;
}

.compare-model-inline-card {
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: 10px;
  padding: 0.46rem 0.54rem;
  background: rgba(9, 17, 26, 0.42);
}

.compare-model-inline-card h5 {
  margin: 0;
  font-size: 0.82rem;
  color: #eaf8ff;
  line-height: 1.25;
}

.compare-model-inline-card p {
  margin: 0.2rem 0 0;
  color: #bfd3df;
  font-size: 0.72rem;
}

.compare-vertical-stack {
  display: grid;
  gap: 0.56rem;
}

.compare-vertical-card {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 12px;
  padding: 0.5rem;
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.5), rgba(8, 14, 21, 0.38));
}

.compare-vertical-head h5 {
  margin: 0;
  font-size: 0.88rem;
  color: #edf8ff;
}

.compare-vertical-head-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.compare-vertical-head p {
  margin: 0.14rem 0 0;
  color: #bfd3df;
  font-size: 0.7rem;
}

.compare-profile-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.compare-profile-chip--neuro {
  color: #ffe5d5;
  border-color: rgba(255, 154, 112, 0.42);
  background: rgba(255, 122, 69, 0.16);
}

.compare-profile-chip--mixed {
  color: #f4f1db;
  border-color: rgba(225, 193, 94, 0.34);
  background: rgba(201, 165, 59, 0.14);
}

.compare-profile-chip--cardio {
  color: #daf7ef;
  border-color: rgba(73, 198, 149, 0.38);
  background: rgba(32, 161, 110, 0.16);
}

.compare-profile-bar {
  display: grid;
  gap: 0.22rem;
  margin-top: 0.34rem;
}

.compare-profile-bar-track {
  position: relative;
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 122, 69, 0.16), rgba(201, 165, 59, 0.16) 45%, rgba(32, 161, 110, 0.18));
  border: 1px solid rgba(139, 201, 220, 0.14);
}

.compare-profile-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.compare-profile-bar-fill.compare-profile-chip--neuro {
  background: linear-gradient(90deg, rgba(255, 122, 69, 0.92), rgba(255, 154, 112, 0.92));
}

.compare-profile-bar-fill.compare-profile-chip--mixed {
  background: linear-gradient(90deg, rgba(201, 165, 59, 0.92), rgba(235, 206, 112, 0.92));
}

.compare-profile-bar-fill.compare-profile-chip--cardio {
  background: linear-gradient(90deg, rgba(32, 161, 110, 0.92), rgba(73, 198, 149, 0.92));
}

.compare-profile-bar small {
  color: #bfd3df;
  font-size: 0.64rem;
}

.compare-profile-driver-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.26rem;
  margin-top: 0.34rem;
}

.compare-profile-driver {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.14rem 0.4rem;
  font-size: 0.64rem;
  color: #d8edf7;
  border: 1px solid rgba(139, 201, 220, 0.18);
  background: rgba(9, 17, 26, 0.45);
}

.compare-vertical-section {
  margin-top: 0.42rem;
  border: 1px solid rgba(139, 201, 220, 0.16);
  border-radius: 10px;
  padding: 0.4rem;
  background: rgba(8, 15, 22, 0.42);
}

.compare-vertical-section h6 {
  margin: 0 0 0.28rem;
  font-size: 0.72rem;
  color: #d5ebf7;
}

.compare-vertical-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.26rem 0.38rem;
}

.compare-vertical-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.68rem;
  padding: 0.04rem 0;
}

.compare-vertical-metric-label {
  color: #c2d8e5;
  font-size: 0.67rem;
  line-height: 1.2;
  min-width: 0;
}

.compare-vertical-metric-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  padding: 0.1rem 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 201, 220, 0.22);
  font-size: 0.63rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.compare-compact-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
  margin-top: 0.32rem;
}

@media (max-width: 720px) {
  .compare-vertical-head-main {
    align-items: flex-start;
    flex-direction: column;
  }
}

.compare-vertical-groups-grid {
  display: grid;
  gap: 0.4rem;
}

.compare-vertical-group-card {
  border: 1px solid rgba(139, 201, 220, 0.14);
  border-radius: 10px;
  padding: 0.42rem;
  background: rgba(9, 17, 26, 0.4);
}

.compare-vertical-group-card h6 {
  margin: 0 0 0.32rem;
  font-size: 0.72rem;
  color: #d6ecf7;
}

.compare-vertical-group-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.compare-vertical-group-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.12rem 0.38rem;
  border: 1px solid rgba(139, 201, 220, 0.2);
  font-size: 0.64rem;
}

@media (max-width: 920px) {
  .compare-vertical-metrics-grid {
    grid-template-columns: 1fr;
  }

  .compare-vertical-metric-value {
    width: 84px;
  }
}

.compare-matrix-wrap {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 12px;
  padding: 0.62rem;
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.5), rgba(8, 14, 21, 0.38));
}

.compare-matrix-wrap h4 {
  margin: 0 0 0.48rem;
  font-size: 0.84rem;
}

.compare-matrix-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.compare-matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.compare-matrix-table th,
.compare-matrix-table td {
  border-bottom: 1px solid rgba(139, 201, 220, 0.14);
  padding: 0.42rem 0.46rem;
  font-size: 0.76rem;
  text-align: center;
  white-space: nowrap;
}

.compare-matrix-table th.compare-matrix-label {
  text-align: left;
  min-width: 170px;
  max-width: 240px;
  white-space: normal;
}

.compare-matrix-model {
  min-width: 170px;
}

.compare-matrix-model div {
  font-size: 0.74rem;
  font-weight: 700;
  color: #eaf8ff;
  line-height: 1.2;
}

.compare-matrix-model small {
  color: #b9cedb;
  font-size: 0.64rem;
}

.compare-matrix-value {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: #ebf8ff;
  border-radius: 8px;
  font-size: 0.74rem;
  min-width: 148px;
}

.compare-sema-high {
  background: rgba(84, 201, 126, 0.16);
  border-color: rgba(84, 201, 126, 0.4) !important;
  color: #bff4cf;
}

.compare-sema-mid {
  background: rgba(252, 207, 76, 0.14);
  border-color: rgba(252, 207, 76, 0.4) !important;
  color: #ffe8a3;
}

.compare-sema-low {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.42) !important;
  color: #ffd1d1;
}

.compare-sema-neutral {
  background: rgba(139, 201, 220, 0.08);
  border-color: rgba(139, 201, 220, 0.22) !important;
  color: #d7edf8;
}

.compare-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.72rem;
}

.compare-result-card {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 14px;
  padding: 0.72rem;
  background:
    linear-gradient(180deg, rgba(11, 20, 30, 0.78), rgba(9, 16, 24, 0.62)),
    linear-gradient(110deg, rgba(255, 77, 95, 0.05), rgba(103, 230, 255, 0.08));
}

.compare-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.compare-result-title {
  margin: 0;
  font-size: 0.94rem;
}

.compare-result-subtitle {
  margin: 0.2rem 0 0;
  color: #bfd3df;
  font-size: 0.74rem;
}

.compare-result-pill {
  border: 1px solid rgba(103, 230, 255, 0.34);
  border-radius: 999px;
  padding: 0.18rem 0.56rem;
  font-size: 0.7rem;
  color: #8ff1ff;
  background: rgba(103, 230, 255, 0.1);
  white-space: nowrap;
}

.compare-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 0.44rem;
}

.compare-metric-item {
  border: 1px solid rgba(139, 201, 220, 0.16);
  border-radius: 10px;
  padding: 0.4rem 0.46rem;
  background: rgba(9, 17, 26, 0.38);
}

.compare-metric-item small {
  display: block;
  color: #bdd0dc;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.12rem;
}

.compare-metric-item strong {
  font-family: "Space Grotesk", sans-serif;
  color: #f1fbff;
  font-size: 0.98rem;
}

.compare-group-summary {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 12px;
  padding: 0.65rem;
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.5), rgba(8, 14, 21, 0.38));
}

.compare-group-summary h4 {
  margin: 0 0 0.46rem;
  font-size: 0.84rem;
}

.compare-group-list {
  display: grid;
  gap: 0.36rem;
}

.compare-group-item {
  border: 1px solid rgba(139, 201, 220, 0.16);
  border-radius: 10px;
  padding: 0.36rem 0.44rem;
  background: rgba(8, 15, 22, 0.44);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.34rem 0.56rem;
  align-items: center;
}

.compare-group-tag {
  border-radius: 999px;
  border: 1px solid rgba(139, 201, 220, 0.24);
  padding: 0.14rem 0.44rem;
  font-size: 0.67rem;
  color: #d9eef9;
  background: rgba(9, 17, 26, 0.52);
}

.compare-group-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  color: #c5dceb;
  font-size: 0.72rem;
}

.compare-group-values strong {
  color: #eef9ff;
  font-weight: 700;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 0.9rem;
  margin-top: 0.7rem;
}

.groups-grid.coach-mode .group-card {
  padding: 0.72rem;
  gap: 0.56rem;
}

.groups-grid.coach-mode .group-card-header {
  padding-bottom: 0.52rem;
  gap: 0.45rem;
}

.groups-grid.coach-mode .group-card-subtitle {
  display: none;
}

.groups-grid.coach-mode .group-card-prescription {
  padding: 0.48rem 0.62rem;
}

.groups-grid.coach-mode .group-card-prescription strong {
  font-size: 1.06rem;
}

.groups-grid.coach-mode .group-card-stats {
  gap: 0.32rem;
}

.groups-grid.coach-mode .group-stat {
  padding: 0.4rem 0.5rem;
}

.groups-grid.coach-mode .group-stat-value {
  font-size: 0.82rem;
}

.groups-grid.coach-mode .group-card-athletes {
  min-height: 8.85rem;
  max-height: 8.85rem;
  gap: 0.32rem;
}

.groups-grid.coach-mode .group-athlete-item {
  min-height: 2.66rem;
  padding: 0.42rem 0.54rem;
}

.groups-grid.coach-mode .group-athlete-name {
  font-size: 0.8rem;
}

.groups-grid.coach-mode .group-athlete-metric {
  min-height: 20px;
  font-size: 0.62rem;
  padding: 0.1rem 0.34rem;
}

.groups-grid.coach-mode .group-card-footer {
  padding-top: 0.5rem;
}

.group-card {
  border: 1px solid rgba(139, 201, 220, 0.2);
  background: linear-gradient(180deg, rgba(12, 23, 34, 0.7), rgba(10, 18, 26, 0.5));
  border-radius: var(--radius-md);
  padding: 0.95rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  display: grid;
  gap: 0.75rem;
}

.group-card--low {
  border-color: rgba(120, 223, 176, 0.32);
  background:
    linear-gradient(180deg, rgba(12, 23, 34, 0.74), rgba(10, 18, 26, 0.56)),
    linear-gradient(110deg, rgba(120, 223, 176, 0.08), rgba(120, 223, 176, 0.02));
}

.group-card--mid {
  border-color: rgba(139, 201, 220, 0.24);
  background:
    linear-gradient(180deg, rgba(12, 23, 34, 0.74), rgba(10, 18, 26, 0.56)),
    linear-gradient(110deg, rgba(103, 230, 255, 0.08), rgba(103, 230, 255, 0.02));
}

.group-card--high {
  border-color: rgba(255, 196, 122, 0.34);
  background:
    linear-gradient(180deg, rgba(12, 23, 34, 0.76), rgba(10, 18, 26, 0.58)),
    linear-gradient(110deg, rgba(255, 196, 122, 0.1), rgba(255, 196, 122, 0.03));
}

.group-card--max {
  border-color: rgba(255, 118, 146, 0.35);
  background:
    linear-gradient(180deg, rgba(12, 23, 34, 0.76), rgba(10, 18, 26, 0.58)),
    linear-gradient(110deg, rgba(255, 118, 146, 0.1), rgba(255, 118, 146, 0.03));
}

.group-card-header {
  border-bottom: 1px solid rgba(139, 201, 220, 0.15);
  padding-bottom: 0.72rem;
  display: grid;
  gap: 0.65rem;
}

.group-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.group-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #67e6ff;
  margin: 0;
}

.group-card-subtitle {
  margin: 0.22rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(171, 205, 220, 0.76);
}

.group-card-prescription {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(139, 201, 220, 0.16);
  background: linear-gradient(180deg, rgba(9, 17, 26, 0.7), rgba(11, 20, 29, 0.48));
}

.group-card-prescription strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.38rem;
  line-height: 1;
  color: #f4fbff;
}

.group-card-prescription span {
  color: var(--muted);
  font-size: 0.74rem;
}

.group-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.group-stat {
  display: grid;
  gap: 0.14rem;
  padding: 0.55rem 0.68rem;
  border-radius: 10px;
  background: rgba(139, 201, 220, 0.05);
  border: 1px solid rgba(139, 201, 220, 0.1);
}

.group-stat-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(171, 205, 220, 0.76);
}

.group-stat-value {
  font-size: 0.9rem;
  color: #edf8ff;
}

.group-card-distance {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.group-intensity-tag {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #dbf5ff;
  border: 1px solid rgba(139, 201, 220, 0.24);
  background: rgba(9, 17, 26, 0.38);
}

.group-card--low .group-intensity-tag {
  border-color: rgba(120, 223, 176, 0.5);
  color: #b6f2d4;
}

.group-card--mid .group-intensity-tag {
  border-color: rgba(103, 230, 255, 0.45);
  color: #9eeeff;
}

.group-card--high .group-intensity-tag {
  border-color: rgba(255, 196, 122, 0.55);
  color: #ffd9a2;
}

.group-card--max .group-intensity-tag {
  border-color: rgba(255, 118, 146, 0.58);
  color: #ffc1d0;
}

.group-card-athletes {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 11rem;
  max-height: 11rem;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(103, 230, 255, 0.28) transparent;
}

.group-card-athletes::-webkit-scrollbar {
  width: 6px;
}

.group-card-athletes::-webkit-scrollbar-track {
  background: transparent;
}

.group-card-athletes::-webkit-scrollbar-thumb {
  background: rgba(103, 230, 255, 0.22);
  border-radius: 999px;
}

.group-athlete-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.7rem;
  align-items: center;
  padding: 0.58rem 0.68rem;
  min-height: 3.35rem;
  background: linear-gradient(180deg, rgba(139, 201, 220, 0.06), rgba(139, 201, 220, 0.03));
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 201, 220, 0.08);
  font-size: 0.84rem;
  color: #e8f5fb;
}

.group-athlete-main {
  display: grid;
  gap: 0.18rem;
}

.group-athlete-name {
  font-weight: 700;
  line-height: 1.2;
  font-size: 0.86rem;
}

.group-athlete-value {
  color: rgba(214, 236, 247, 0.72);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.group-athlete-metrics {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.group-athlete-metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 230, 255, 0.18);
  background: rgba(103, 230, 255, 0.06);
  color: #7feeff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
}

.group-card-footer {
  margin-top: 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(139, 201, 220, 0.1);
  font-size: 0.76rem;
  color: var(--muted);
}

#toggleCoachModeBtn[aria-pressed="true"] {
  border-color: rgba(103, 230, 255, 0.52);
  color: #e8fbff;
  background: linear-gradient(120deg, rgba(13, 54, 66, 0.78), rgba(10, 18, 26, 0.62));
  box-shadow: 0 8px 18px rgba(103, 230, 255, 0.14);
}

.builder-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.3rem 0 0.55rem;
  flex-wrap: wrap;
}

.builder-results-head h3 {
  margin: 0;
  font-size: var(--text-title);
}

.builder-results-head p {
  margin: 0;
  color: #bdd0dc;
  font-size: var(--text-subtitle);
}

.builder-results-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.builder-context {
  margin-bottom: 1rem;
}

.glass-subpanel {
  border: 1px solid rgba(139, 201, 220, 0.12);
  background: linear-gradient(180deg, rgba(12, 23, 34, 0.58), rgba(10, 18, 26, 0.38));
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.builder-context-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.builder-team-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 250px;
}

.builder-team-picker-copy {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.builder-team-picker-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.builder-team-select {
  min-width: 210px;
  max-width: 320px;
  border-radius: 10px;
  font-size: 0.84rem;
  padding: 0.45rem 0.62rem;
}

.active-team-image {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(139, 201, 220, 0.32);
  box-shadow: 0 8px 20px rgba(4, 18, 28, 0.24);
}

.builder-context-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.builder-selection-block {
  margin-bottom: 1rem;
  padding: 0.88rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(139, 201, 220, 0.1);
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.5), rgba(8, 14, 21, 0.38));
  transition: border-color 0.16s ease, background 0.16s ease;
}

.builder-selection-block:hover {
  border-color: rgba(139, 201, 220, 0.2);
}

.builder-selection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.builder-selection-head h3 {
  margin: 0;
  font-size: var(--text-title);
}

.builder-selection-head p {
  margin: 0;
  color: #bdd0dc;
  font-size: var(--text-subtitle);
}

.selector-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  align-content: start;
  max-height: 346px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.12rem;
}

.selector-chip {
  border: 1px solid rgba(139, 201, 220, 0.18);
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.78), rgba(10, 18, 26, 0.58));
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 168px;
  position: relative;
}

.selector-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 230, 255, 0.3);
  box-shadow: 0 10px 24px rgba(4, 18, 28, 0.28);
}

.selector-chip.active {
  border-color: rgba(255, 77, 95, 0.58);
  background: linear-gradient(120deg, rgba(95, 18, 32, 0.86), rgba(16, 57, 70, 0.78));
  box-shadow: 0 0 0 2px rgba(255, 77, 95, 0.2), 0 12px 26px rgba(255, 77, 95, 0.16);
}

.selector-chip.active::before {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9baa;
  box-shadow: 0 0 0 4px rgba(255, 155, 170, 0.16);
}

.selector-chip-title {
  font-weight: 700;
  width: 100%;
  min-height: 2.2rem;
  display: flex;
  align-items: flex-start;
}

.selector-chip-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.selector-athlete-thumb,
.selector-athlete-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 40px;
}

.selector-athlete-thumb {
  object-fit: cover;
  border: 1px solid rgba(139, 201, 220, 0.36);
}

.selector-athlete-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  color: #d6ecf7;
  border: 1px solid rgba(139, 201, 220, 0.32);
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.85), rgba(10, 18, 26, 0.7));
}

.selector-chip-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.selector-chip-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.34rem;
  margin-top: auto;
  width: 100%;
  align-self: stretch;
}

.selector-metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.7rem;
  color: #d6ecf7;
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.85), rgba(10, 18, 26, 0.65));
  width: 100%;
  min-height: 26px;
}

.selector-metric-pill strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  margin-left: auto;
  text-align: right;
}

.selector-metric-icon {
  font-size: 0.64rem;
  line-height: 1;
}

.selector-metric-label {
  opacity: 0.9;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 2.9rem;
}

.selector-metric-pill--top {
  border-color: rgba(120, 223, 176, 0.42);
  color: #c9f8df;
  background:
    linear-gradient(180deg, rgba(15, 44, 34, 0.88), rgba(10, 28, 24, 0.72)),
    linear-gradient(90deg, rgba(120, 223, 176, 0.1), transparent);
}

.selector-metric-pill--mid {
  border-color: rgba(103, 230, 255, 0.35);
  color: #c8f5ff;
  background:
    linear-gradient(180deg, rgba(12, 31, 44, 0.86), rgba(10, 21, 30, 0.7)),
    linear-gradient(90deg, rgba(103, 230, 255, 0.1), transparent);
}

.selector-metric-pill--low {
  border-color: rgba(255, 118, 146, 0.42);
  color: #ffd7e1;
  background:
    linear-gradient(180deg, rgba(46, 20, 31, 0.88), rgba(26, 12, 19, 0.72)),
    linear-gradient(90deg, rgba(255, 118, 146, 0.1), transparent);
}

.selector-metric-pill--na {
  border-color: rgba(139, 201, 220, 0.2);
  color: var(--muted);
}

.empty-chip-state {
  grid-column: 1 / -1;
  border: 1px dashed rgba(139, 201, 220, 0.18);
  border-radius: 14px;
  padding: 0.95rem;
  color: #c6d9e6;
  font-size: 0.84rem;
  line-height: 1.45;
  display: grid;
  gap: 0.22rem;
  background:
    linear-gradient(180deg, rgba(10, 18, 26, 0.44), rgba(8, 15, 22, 0.3)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.03), rgba(103, 230, 255, 0.03));
}

.empty-chip-state strong {
  color: #e5f4fd;
  font-size: 0.86rem;
}

.empty-chip-state span {
  color: #bdd0dc;
}

/* ═══════════════════════════════════════════════
   MODEL SELECTOR — filter pills + cards
════════════════════════════════════════════════ */
.model-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.model-filter-pill {
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.7), rgba(10, 18, 26, 0.5));
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.15s ease;
  min-height: 36px;
}

.model-filter-pill:hover {
  border-color: rgba(103, 230, 255, 0.38);
  color: var(--accent);
  transform: translateY(-1px);
}

.model-filter-pill.active {
  border-color: rgba(103, 230, 255, 0.55);
  color: #fff;
  background: linear-gradient(120deg, rgba(16, 57, 70, 0.82), rgba(12, 23, 34, 0.68));
  box-shadow: 0 4px 16px rgba(103, 230, 255, 0.1);
}

.model-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.55rem;
}

.model-card {
  border: 1px solid rgba(139, 201, 220, 0.16);
  background: linear-gradient(180deg, rgba(13, 24, 35, 0.75), rgba(10, 18, 26, 0.54));
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 96px;
}

.model-card:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 230, 255, 0.28);
  box-shadow: 0 8px 20px rgba(4, 18, 28, 0.3);
}

.model-card.active {
  border-color: rgba(255, 77, 95, 0.6);
  background: linear-gradient(120deg, rgba(95, 18, 32, 0.78), rgba(16, 57, 70, 0.72));
  box-shadow: 0 10px 26px rgba(255, 77, 95, 0.14);
}

.model-card-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.model-card-dur {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.1rem;
}

.model-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.mc-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.14rem 0.44rem;
  border-radius: 5px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.mc-chip--vam {
  background: rgba(255, 160, 50, 0.14);
  color: #ffc97a;
  border: 1px solid rgba(255, 160, 50, 0.22);
}

.mc-chip--mss {
  background: rgba(180, 100, 255, 0.13);
  color: #d4a8ff;
  border: 1px solid rgba(180, 100, 255, 0.22);
}

.mc-chip--asr {
  background: rgba(67, 200, 140, 0.12);
  color: #7aecb8;
  border: 1px solid rgba(67, 200, 140, 0.22);
}

.mc-chip--tlim {
  background: rgba(80, 220, 100, 0.1);
  color: #90f0a8;
  border: 1px solid rgba(80, 220, 100, 0.2);
}

.mc-chip--rest {
  background: rgba(103, 230, 255, 0.08);
  color: #86dff5;
  border: 1px solid rgba(103, 230, 255, 0.16);
}

.tlim-cell {
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
}


.modal-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 77, 95, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(103, 230, 255, 0.08), transparent 24%),
    rgba(2, 8, 14, 0.76);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

#accountModal {
  z-index: 220;
}

#teamModal {
  z-index: 320;
}

#athleteEditModal {
  z-index: 360;
}

#teamEditModal {
  z-index: 350;
}

.modal-card {
  border-radius: 20px;
  padding: 2rem;
  width: min(400px, 100%);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  animation: fade-in-up 0.45s ease both;
}

.modal-card h3 {
  margin: 0 0 1.2rem;
  font-family: "Space Grotesk", sans-serif;
}

.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-card input {
  width: 100%;
  margin-bottom: 1.2rem;
}

.form-modal-card {
  width: min(560px, calc(100% - 1rem));
  border-radius: 22px;
  padding: 1.35rem;
  border: 1px solid rgba(139, 201, 220, 0.22);
  background:
    linear-gradient(180deg, rgba(6, 10, 15, 0.96), rgba(7, 12, 18, 0.92)),
    linear-gradient(90deg, rgba(255, 77, 95, 0.08), rgba(103, 230, 255, 0.04));
}

.form-shell {
  border: 1px solid rgba(139, 201, 220, 0.2);
  border-radius: 16px;
  padding: 0.95rem;
  background: linear-gradient(180deg, rgba(7, 12, 18, 0.78), rgba(9, 14, 22, 0.62));
}

.form-shell-team {
  padding: 1rem;
}

.athlete-edit-modal-card {
  width: min(760px, calc(100% - 1rem));
}

.athlete-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 0.75rem;
}

.athlete-edit-form .form-inline-hint {
  margin: 0;
}

.athlete-edit-form .upload-preview {
  margin: 0.2rem 0 0.4rem;
}

.athlete-edit-form .modal-actions {
  grid-column: 1 / -1;
}

.team-edit-modal-card {
  width: min(560px, calc(100% - 1rem));
}

.team-edit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.team-edit-form .upload-preview {
  margin: 0.2rem 0 0.4rem;
}

.team-edit-form .modal-actions {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #e8f5fb;
  margin-bottom: 0.78rem;
}

.form-field input,
.form-field select {
  margin-bottom: 0;
}

.form-field input::placeholder {
  color: rgba(201, 220, 230, 0.52);
}

.form-advanced {
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 12px;
  padding: 0.58rem 0.64rem;
  margin-bottom: 0.7rem;
  background: rgba(11, 18, 27, 0.45);
}

.form-advanced summary {
  cursor: pointer;
  color: #d7ecf6;
  font-size: 0.84rem;
  font-weight: 600;
}

.form-inline-hint {
  grid-column: 1 / -1;
  margin: -0.2rem 0 0.2rem;
  font-size: 0.76rem;
  color: rgba(171, 205, 220, 0.86);
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-actions .btn {
  min-width: 130px;
}

/* ═══════════════════════════════════════════════
   ACCOUNT CENTER MODAL
════════════════════════════════════════════════ */
.account-modal-card {
  width: min(1200px, calc(100vw - 1rem));
  max-height: calc(100dvh - 1rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.25rem;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.account-head h3 {
  margin: 0;
}

.account-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.account-head-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.account-logout-mobile {
  display: none;
}

.account-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.account-tab {
  border: 1px solid rgba(139, 201, 220, 0.22);
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.72), rgba(10, 18, 26, 0.46));
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 0.82rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.account-tab:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.account-tab.active {
  color: #fff7f9;
  border-color: rgba(255, 77, 95, 0.58);
  background: linear-gradient(120deg, rgba(94, 17, 31, 0.78), rgba(13, 54, 66, 0.72));
  box-shadow: 0 10px 24px rgba(255, 77, 95, 0.12);
}

.account-section {
  margin-top: 1rem;
}

.account-section h4 {
  margin: 0 0 0.3rem;
  font-family: "Space Grotesk", sans-serif;
}

.account-create-form {
  margin-bottom: 0.85rem;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.first-login-alerts-card {
  margin: 0 0 0.9rem;
  border: 1px solid rgba(139, 201, 220, 0.24);
  border-radius: 14px;
  padding: 0.72rem 0.78rem;
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.78), rgba(8, 14, 22, 0.58));
}

.first-login-alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.first-login-alerts-head h5 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
}

.first-login-alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.38rem;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.first-login-alert-item,
.first-login-alert-empty {
  border: 1px solid rgba(139, 201, 220, 0.18);
  border-radius: 10px;
  padding: 0.46rem 0.56rem;
  background: rgba(10, 17, 26, 0.56);
}

.first-login-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.first-login-alert-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.first-login-alert-main strong {
  font-size: 0.84rem;
  color: #eef8ff;
  line-height: 1.18;
  word-break: break-word;
}

.first-login-alert-main span {
  font-size: 0.74rem;
  color: rgba(175, 197, 212, 0.95);
  line-height: 1.18;
}

.first-login-alert-item time {
  white-space: nowrap;
  font-size: 0.74rem;
  color: rgba(175, 197, 212, 0.95);
}

.first-login-alert-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.first-login-delete-btn {
  min-height: 30px;
  padding: 0.35rem 0.56rem;
  font-size: 0.72rem;
}

.first-login-alert-empty {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(175, 197, 212, 0.9);
}

.athlete-create-form {
  margin-bottom: 1.1rem;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  border: 1px solid rgba(139, 201, 220, 0.22);
  border-radius: 16px;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(7, 12, 18, 0.75), rgba(9, 15, 23, 0.64));
}

.athlete-create-form > button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: flex-end;
  min-width: 190px;
}

.account-hint {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-bulk-edit {
  margin: 0 0 0.75rem;
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 201, 220, 0.18);
  background: linear-gradient(180deg, rgba(11, 20, 30, 0.66), rgba(8, 16, 24, 0.52));
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 0.45rem;
  align-items: end;
}

.account-bulk-edit h5 {
  margin: 0;
  font-size: 0.8rem;
  color: #dcedf8;
  letter-spacing: 0.02em;
}

.account-bulk-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
}

.account-bulk-edit label {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.account-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.6rem;
}

.account-table-wrap {
  border-radius: 12px;
  overflow: auto;
  border: 1px solid rgba(139, 201, 220, 0.16);
  background: rgba(8, 15, 22, 0.26);
  scrollbar-width: none;
}

.account-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.account-table th,
.account-table td {
  font-size: 0.78rem;
  padding: 0.45rem;
  border-bottom: 1px solid rgba(162, 221, 238, 0.14);
  text-align: left;
}

.account-table th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(11, 22, 33, 0.96), rgba(8, 17, 25, 0.9));
}

.account-table input {
  margin: 0;
  width: 100%;
  min-width: 80px;
  padding: 0.42rem 0.5rem;
  font-size: 0.8rem;
}

.account-table input:disabled {
  opacity: 0.55;
}

.team-thumb {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.35rem;
  border: 1px solid rgba(139, 201, 220, 0.2);
}

.athlete-thumb {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  margin-top: 0.35rem;
  border: 1px solid rgba(139, 201, 220, 0.24);
}

.upload-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(139, 201, 220, 0.24);
  margin-top: 0.35rem;
}

.upload-preview-lg {
  width: 104px;
  height: 104px;
}

.upload-preview.image-frame-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.upload-preview.image-frame-draggable.is-dragging {
  cursor: grabbing;
}

input[type="file"] {
  border: 1px dashed rgba(139, 201, 220, 0.28);
  background: linear-gradient(180deg, rgba(9, 17, 26, 0.94), rgba(8, 15, 22, 0.72));
  padding: 0.45rem;
  border-radius: 12px;
}

input[type="file"]::file-selector-button {
  border: 1px solid rgba(255, 160, 184, 0.46);
  background: linear-gradient(90deg, #ff1e58 0%, #ee6d91 60%, #ead8de 100%);
  color: #17151a;
  border-radius: 999px;
  padding: 0.36rem 0.72rem;
  font-weight: 700;
  margin-right: 0.65rem;
  cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
  border: 1px solid rgba(255, 160, 184, 0.46);
  background: linear-gradient(90deg, #ff1e58 0%, #ee6d91 60%, #ead8de 100%);
  color: #17151a;
  border-radius: 999px;
  padding: 0.36rem 0.72rem;
  font-weight: 700;
  margin-right: 0.65rem;
  cursor: pointer;
}

.selector-athlete-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(139, 201, 220, 0.34);
  margin-bottom: 0.12rem;
}

.account-actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.account-tag {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid rgba(139, 201, 220, 0.18);
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  background: rgba(9, 17, 26, 0.42);
}

@media (min-width: 641px) {
  .account-panel[data-account-panel="models"] .account-table {
    min-width: 880px;
  }

  .account-panel[data-account-panel="models"] .account-table th,
  .account-panel[data-account-panel="models"] .account-table td {
    font-size: 0.72rem;
    padding: 0.3rem 0.34rem;
    line-height: 1.12;
  }

  .account-panel[data-account-panel="models"] .account-table input,
  .account-panel[data-account-panel="models"] .account-table select {
    min-height: 34px;
    padding: 0.3rem 0.36rem;
    font-size: 0.72rem;
  }

  .account-panel[data-account-panel="models"] .account-actions-cell {
    white-space: nowrap;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.24rem;
  }

  .account-panel[data-account-panel="models"] .account-actions-cell .btn,
  .account-panel[data-account-panel="models"] .account-actions-cell .account-tag {
    flex: 0 0 auto;
  }

  .account-panel[data-account-panel="models"] .account-actions-cell .btn {
    min-height: 30px;
    padding: 0.2rem 0.38rem;
    font-size: 0.66rem;
  }

  .account-panel[data-account-panel="models"] .account-table th:nth-child(8),
  .account-panel[data-account-panel="models"] .account-table td:nth-child(8) {
    min-width: 260px;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE UPDATES
════════════════════════════════════════════════ */
@media (min-width: 861px) and (max-width: 1180px) {
  #resultsTable {
    min-width: 980px;
  }

  #resultsTable th,
  #resultsTable td {
    font-size: 0.78rem;
    padding: 0.46rem 0.44rem;
  }

  #resultsTable th {
    font-size: 0.66rem;
    letter-spacing: 0.045em;
  }

  .table-tone {
    min-width: 4.7rem;
    padding: 0.18rem 0.45rem;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem;
  }

  #appHeader {
    top: 0.45rem;
  }

  .layout {
    width: min(1320px, calc(100% - 1rem));
    gap: 0.8rem;
    padding-bottom: 0;
  }

  .panel {
    padding: 0.85rem;
    border-radius: 16px;
  }

  .grid-form {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .account-create-form {
    grid-template-columns: 1fr;
  }

  .account-bulk-grid {
    grid-template-columns: 1fr;
  }

  .athlete-create-form {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }

  .builder-form {
    grid-template-columns: 1fr 1fr;
  }

  .groups-grid {
    grid-template-columns: 1fr;
  }

  .prescription-view-toggle {
    flex-wrap: wrap;
  }

  .prescription-view-toggle .btn {
    flex: 1 1 180px;
  }

  .builder-field-label {
    min-height: 2.5rem;
  }

  .athlete-edit-form {
    grid-template-columns: 1fr;
  }

  .builder-submit-row {
    flex-direction: column;
    align-items: stretch;
  }

  #generatePrescriptionBtn {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .athlete-create-form > button[type="submit"] {
    width: 100%;
    justify-self: stretch;
  }

  .grid-form label,
  .grid-form input,
  .grid-form select,
  .grid-form button,
  .team-select {
    width: 100%;
    max-width: 100%;
  }

  .topbar-team,
  .auth-box {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-team { width: 100%; }
  .team-select { max-width: 100%; }

  .table-wrap,
  .account-table-wrap {
    border-radius: 10px;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .builder-selection-actions .btn {
    flex: 1 1 140px;
  }

  .builder-selection-toolbar {
    width: 100%;
  }

  .builder-selection-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .builder-selection-actions .btn,
  .builder-collapse-btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  .builder-selection-actions .builder-collapse-btn {
    grid-column: 1 / -1;
  }

  .athlete-filter-row {
    grid-template-columns: 1fr;
    gap: 0.44rem;
  }

  .athlete-filter-field {
    font-size: 0.78rem;
  }

  .athlete-filter-field select {
    min-height: 42px;
    padding: 0.62rem 0.74rem;
  }

  .selector-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.56rem;
    max-height: 420px;
  }

  .selector-chip {
    min-height: 158px;
    padding: 0.7rem 0.72rem;
  }
}

@media (max-width: 640px) {
  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .modal-overlay {
    padding: 0.55rem;
    align-items: flex-end;
  }

  #accountModal.modal-overlay {
    align-items: center;
    padding: 0.3rem;
  }

  .modal-card,
  .form-modal-card,
  .athlete-edit-modal-card,
  .team-edit-modal-card,
  .account-modal-card {
    width: 100%;
    max-height: calc(100dvh - 0.7rem);
    border-radius: 16px;
  }

  .modal-card {
    padding: 1rem;
    overflow: auto;
  }

  .modal-actions .btn {
    width: 100%;
    min-width: 0;
  }

  #compareModelsModal .compare-models-actions .btn {
    width: auto;
    min-width: 104px;
  }

  .brand-logo-header {
    width: 44px;
    max-width: 44px;
  }

  .brand-logo-splash {
    width: 88px;
    max-width: 88px;
  }

  .brand-lockup {
    gap: 0.7rem;
  }

  .topbar-brand h1 {
    font-size: 1.35rem;
  }

  #logoutBtn {
    display: none;
  }

  .account-logout-mobile {
    display: inline-flex;
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 0.5rem;
  }

  .kpi-row .kpi {
    min-height: 68px;
    padding: 0.5rem 0.54rem;
  }

  .kpi-row .kpi small,
  .kpi-row .kpi .kpi-subvalue {
    font-size: 0.64rem;
  }

  .kpi-row .kpi strong {
    font-size: 0.94rem;
  }

  .builder-form {
    grid-template-columns: 1fr;
    padding: 0.8rem;
  }

  .builder-field-label {
    min-height: auto;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .builder-context-copy,
  .builder-selection-head,
  .builder-selection-toolbar,
  .builder-results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .builder-team-picker {
    width: 100%;
  }

  .builder-team-picker-copy {
    width: 100%;
  }

  .builder-team-select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .builder-selection-actions {
    width: 100%;
  }

  .builder-selection-actions .btn {
    flex: 1 1 100%;
    min-height: 44px;
    padding: 0.62rem 0.72rem;
    font-size: 0.88rem;
  }

  .builder-collapse-btn {
    margin-left: 0;
  }

  .builder-selection-actions {
    grid-template-columns: 1fr;
  }

  .builder-selection-head {
    gap: 0.52rem;
  }

  #builderAthletesSection .builder-selection-head {
    position: relative;
    padding-right: 2.4rem;
  }

  #builderAthletesSection #builderSelectionSummary {
    display: none;
  }

  #builderAthletesSection .builder-selection-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #builderAthletesSection .builder-selection-actions .builder-collapse-btn {
    position: absolute;
    top: 0;
    right: 0;
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0;
    grid-column: auto;
    z-index: 1;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #builderAthletesSection .builder-selection-actions .btn:not(.builder-collapse-btn) {
    min-height: 42px;
    white-space: nowrap;
    line-height: 1;
    padding-inline: 0.5rem;
    font-size: 0.82rem;
  }

  #builderAthletesSection #selectAllAthletesBtn,
  #builderAthletesSection #clearAthletesBtn {
    white-space: nowrap;
  }

  #builderModelsSection .builder-selection-head {
    position: relative;
    padding-right: 2.4rem;
  }

  #builderModelsSection #builderModelSummary {
    display: none;
  }

  #builderModelsSection #toggleModelsSelectorBtn {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0;
    z-index: 1;
  }

  #builderTaskSection .builder-selection-head {
    position: relative;
    padding-right: 2.4rem;
  }

  #builderTaskSection #toggleTaskConfigBtn {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0;
    border-radius: 999px;
    z-index: 1;
  }

  #builderTaskSection .builder-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.62rem;
    gap: 0.52rem;
    border-radius: 14px;
  }

  #builderTaskSection .builder-field {
    gap: 0.3rem;
    font-size: 0.78rem;
  }

  #builderTaskSection .builder-field-label {
    min-height: auto;
    font-size: 0.74rem;
    line-height: 1.2;
  }

  #builderTaskSection .builder-field input,
  #builderTaskSection .builder-field select {
    min-height: 42px;
    padding: 0.48rem 0.62rem;
    font-size: 0.88rem;
  }

  #builderTaskSection .builder-form-note {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  #builderTaskSection #generatePrescriptionBtn {
    min-height: 46px;
    font-size: 0.9rem;
  }

  .builder-summary-pill {
    min-height: 34px;
    font-size: 0.82rem;
  }

  .athlete-filter-field {
    font-size: 0.8rem;
  }

  #builderAthletesSection .athlete-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.44rem;
  }

  .selector-chip-grid {
    grid-template-columns: 1fr;
    max-height: 52vh;
  }

  .selector-chip {
    min-height: 144px;
  }

  .selector-chip-title {
    min-height: 1.8rem;
    font-size: 0.92rem;
  }

  .selector-chip-meta {
    font-size: 0.8rem;
  }

  .selector-metric-pill {
    min-height: 24px;
    font-size: 0.66rem;
    padding: 0.1rem 0.38rem;
    gap: 0.2rem;
  }

  .selector-metric-pill strong {
    font-size: 0.66rem;
  }

  .selector-metric-label {
    min-width: 2.4rem;
    font-size: 0.63rem;
  }

  .selector-metric-icon {
    font-size: 0.56rem;
  }

  .model-card-grid {
    grid-template-columns: 1fr;
    max-height: 540px;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    padding-right: 0.12rem;
    -webkit-overflow-scrolling: touch;
  }

  .model-card {
    min-height: 98px;
  }

  .model-card-chips {
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.18rem;
    align-items: center;
  }

  .mc-chip {
    width: 100%;
    min-width: 0;
    padding: 0.12rem 0.18rem;
    font-size: 0.56rem;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .model-filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.34rem;
    margin-bottom: 0.62rem;
    padding-bottom: 0.08rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .model-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .model-filter-pill {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 30px;
    padding: 0.18rem 0.5rem;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
  }

  .builder-summary-pill {
    width: 100%;
    justify-content: center;
  }

  .prescription-view-toggle {
    display: grid;
    grid-template-columns: 1fr;
  }

  .prescription-view-toggle .btn {
    width: 100%;
  }

  .groups-grid {
    gap: 0.75rem;
  }

  .group-card {
    padding: 0.9rem;
  }

  .group-card-athletes-details {
    margin-top: 0.1rem;
    border-top: 1px dashed rgba(139, 201, 220, 0.18);
    padding-top: 0.36rem;
  }

  .group-card-athletes-details summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #c6e8f7;
    font-size: 0.74rem;
    font-weight: 700;
  }

  .group-card-athletes-details summary::-webkit-details-marker {
    display: none;
  }

  .group-card-athletes-details summary::before {
    content: "▸";
    font-size: 0.66rem;
    transition: transform 0.18s ease;
  }

  .group-card-athletes-details[open] summary::before {
    transform: rotate(90deg);
  }

  .group-card-athletes-details .group-card-athletes {
    margin-top: 0.34rem;
    min-height: 0;
    max-height: 13.5rem;
  }

  .athlete-count {
    font-size: 0.75rem;
  }

  .account-modal-card {
    width: calc(100vw - 0.5rem);
    max-height: calc(100dvh - 0.5rem);
    padding: 0.9rem;
    border-radius: 18px;
  }

  .account-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(180deg, rgba(10, 18, 26, 0.92), rgba(10, 18, 26, 0.72));
    padding-bottom: 0.3rem;
  }

  .account-panel[data-account-panel="models"] .model-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.46rem;
    margin-bottom: 0.62rem;
  }

  .account-panel[data-account-panel="models"] .model-form label {
    gap: 0.2rem;
    font-size: 0.72rem;
  }

  .account-panel[data-account-panel="models"] .model-form input,
  .account-panel[data-account-panel="models"] .model-form select {
    min-height: 38px;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
  }

  .account-panel[data-account-panel="models"] .model-form > button[type="submit"] {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
    margin-top: 0.1rem;
    font-size: 0.84rem;
  }

  .account-panel[data-account-panel="athletes"] .athlete-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.46rem;
    padding: 0.62rem;
    margin-bottom: 0.7rem;
  }

  .account-panel[data-account-panel="athletes"] .athlete-create-form .form-field {
    gap: 0.2rem;
    margin-bottom: 0.38rem;
    font-size: 0.72rem;
  }

  .account-panel[data-account-panel="athletes"] .athlete-create-form input,
  .account-panel[data-account-panel="athletes"] .athlete-create-form select {
    min-height: 38px;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
  }

  .account-panel[data-account-panel="athletes"] .athlete-create-form .form-inline-hint,
  .account-panel[data-account-panel="athletes"] .athlete-create-form .upload-preview,
  .account-panel[data-account-panel="athletes"] .athlete-create-form > button[type="submit"] {
    grid-column: 1 / -1;
  }

  .account-panel[data-account-panel="athletes"] .athlete-create-form > button[type="submit"] {
    width: 100%;
    min-height: 40px;
    margin-top: 0.1rem;
    font-size: 0.84rem;
  }

  .account-panel[data-account-panel="teams"] .account-inline-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .account-panel[data-account-panel="athletes"] .account-table-wrap,
  .account-panel[data-account-panel="models"] .account-table-wrap {
    max-height: 36vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .account-panel[data-account-panel="athletes"] .account-table,
  .account-panel[data-account-panel="models"] .account-table {
    min-width: 720px;
  }

  .account-panel[data-account-panel="athletes"] .account-table th,
  .account-panel[data-account-panel="athletes"] .account-table td,
  .account-panel[data-account-panel="models"] .account-table th,
  .account-panel[data-account-panel="models"] .account-table td {
    font-size: 0.68rem;
    padding: 0.28rem 0.3rem;
    line-height: 1.15;
  }

  .account-panel[data-account-panel="athletes"] .account-table th,
  .account-panel[data-account-panel="models"] .account-table th {
    letter-spacing: 0.03em;
  }

  .account-panel[data-account-panel="athletes"] .athlete-thumb {
    width: 26px;
    height: 26px;
    margin-top: 0;
  }

  .account-panel[data-account-panel="athletes"] .account-actions-cell,
  .account-panel[data-account-panel="models"] .account-actions-cell {
    gap: 0.2rem;
  }

  .account-panel[data-account-panel="athletes"] .account-actions-cell .btn,
  .account-panel[data-account-panel="models"] .account-actions-cell .btn {
    min-height: 28px;
    min-width: 52px;
    padding: 0.16rem 0.3rem;
    font-size: 0.64rem;
    line-height: 1.05;
  }

  .account-panel[data-account-panel="models"] .account-tag {
    font-size: 0.62rem;
    padding: 0.08rem 0.28rem;
  }

  .account-panel[data-account-panel="models"] .account-actions-cell {
    white-space: nowrap;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.18rem;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .account-panel[data-account-panel="models"] .account-actions-cell .btn,
  .account-panel[data-account-panel="models"] .account-actions-cell .account-tag {
    flex: 0 0 auto;
  }

  .account-panel[data-account-panel="models"] .account-table input,
  .account-panel[data-account-panel="models"] .account-table select {
    min-height: 32px;
    padding: 0.28rem 0.34rem;
    font-size: 0.7rem;
  }

  .account-panel[data-account-panel="teams"] .account-table-wrap {
    overflow-x: hidden;
  }

  .account-panel[data-account-panel="teams"] .account-table {
    min-width: 0;
    table-layout: fixed;
  }

  .account-panel[data-account-panel="teams"] .account-table th,
  .account-panel[data-account-panel="teams"] .account-table td {
    font-size: 0.74rem;
    padding: 0.36rem;
    white-space: normal;
    word-break: break-word;
  }

  .account-panel[data-account-panel="teams"] .account-actions-cell {
    white-space: normal;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.24rem;
    align-items: center;
    justify-content: flex-start;
  }

  .account-panel[data-account-panel="teams"] .account-actions-cell .btn {
    width: auto;
    min-width: 58px;
    min-height: 32px;
    padding: 0.24rem 0.34rem;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .account-panel[data-account-panel="teams"] .team-thumb {
    margin-top: 0;
    margin-inline: auto;
  }

  .status-toast {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    max-width: none;
  }

  .athlete-edit-form {
    grid-template-columns: 1fr;
  }

  .team-edit-form {
    grid-template-columns: 1fr;
  }

  #resultsTable {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  #resultsTable thead {
    display: none;
  }

  #resultsTable tbody,
  #resultsTable tr,
  #resultsTable td {
    display: block;
    width: 100%;
  }

  #resultsTable tbody tr {
    margin: 0 0 0.72rem;
    border: 1px solid rgba(139, 201, 220, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(12, 23, 34, 0.74), rgba(10, 18, 26, 0.54));
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(5, 16, 24, 0.22);
  }

  #resultsTable tbody tr:last-child {
    margin-bottom: 0;
  }

  #resultsTable td {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.44rem;
    padding: 0.42rem 0.64rem;
    border-bottom: 1px solid rgba(129, 186, 204, 0.1);
    font-size: 0.8rem;
    min-height: 0;
  }

  #resultsTable td:last-child {
    border-bottom: none;
  }

  #resultsTable td::before {
    content: attr(data-label);
    position: static;
    transform: none;
    width: auto;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.61rem;
    font-weight: 700;
    line-height: 1.2;
  }

  #resultsTable .mobile-prescription-row {
    margin: 0 0 0.72rem;
    border: none;
    background: none;
    box-shadow: none;
    overflow: visible;
  }

  #resultsTable .mobile-prescription-row > td {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    min-height: 0;
  }

  #resultsTable .mobile-prescription-row > td::before {
    content: none;
  }

  .mobile-prescription-card {
    border: 1px solid rgba(139, 201, 220, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(12, 23, 34, 0.78), rgba(10, 18, 26, 0.58));
    box-shadow: 0 8px 18px rgba(5, 16, 24, 0.22);
    padding: 0.46rem;
    display: grid;
    gap: 0.36rem;
  }

  .mobile-prescription-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
  }

  .mobile-prescription-name {
    font-size: 0.84rem;
    line-height: 1.2;
    color: #edf8ff;
  }

  .mobile-prescription-key-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.28rem;
  }

  .mobile-prescription-key-item {
    border: 1px solid rgba(139, 201, 220, 0.14);
    border-radius: 10px;
    padding: 0.3rem 0.34rem;
    background: rgba(9, 17, 26, 0.34);
    display: grid;
    gap: 0.1rem;
  }

  .mobile-prescription-key-item small {
    color: #bcd1de;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .mobile-prescription-key-item strong {
    color: #f1fbff;
    font-size: 0.76rem;
    line-height: 1.2;
  }

  .mobile-prescription-details {
    border-top: 1px dashed rgba(139, 201, 220, 0.2);
    padding-top: 0.24rem;
  }

  .mobile-prescription-details summary {
    cursor: pointer;
    color: #c8f0ff;
    font-size: 0.72rem;
    font-weight: 700;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
  }

  .mobile-prescription-details summary::-webkit-details-marker {
    display: none;
  }

  .mobile-prescription-details summary::before {
    content: "▸";
    font-size: 0.66rem;
    transition: transform 0.18s ease;
  }

  .mobile-prescription-details[open] summary::before {
    transform: rotate(90deg);
  }

  .mobile-prescription-detail-grid {
    margin-top: 0.28rem;
    display: grid;
    gap: 0.2rem;
  }

  .mobile-prescription-detail-item {
    display: grid;
    grid-template-columns: 5.2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.3rem;
    padding: 0.16rem 0;
    border-bottom: 1px solid rgba(129, 186, 204, 0.08);
  }

  .mobile-prescription-detail-item:last-child {
    border-bottom: none;
  }

  .mobile-prescription-detail-item span {
    color: #b5cbd9;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .mobile-prescription-detail-item strong {
    color: #e9f7ff;
    font-size: 0.72rem;
    line-height: 1.2;
    min-width: 0;
  }

  .mobile-prescription-detail-item .table-tone {
    min-width: 0;
    width: fit-content;
    padding: 0.1rem 0.3rem;
    font-size: 0.62rem;
  }

  #resultsTable .table-tone {
    min-width: 0;
    padding: 0.12rem 0.34rem;
    font-size: 0.66rem;
  }

  #resultsTable .table-tone--velocity {
    padding: 0.1rem 0.3rem;
    font-size: 0.64rem;
  }

  #resultsTable td[data-label="Atleta"] strong {
    font-size: 0.88rem;
  }
}

@media (min-width: 390px) and (max-width: 430px) {
  .selector-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 56vh;
    gap: 0.48rem;
  }
}

@media (max-width: 420px) {
  .topbar,
  .layout {
    width: calc(100% - 0.6rem);
  }

  .panel {
    padding: 0.72rem;
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.44rem;
  }

  .kpi {
    min-height: 64px;
  }

  .builder-selection-actions .btn {
    flex: 1 1 100%;
  }

  #builderAthletesSection .builder-selection-actions .btn:not(.builder-collapse-btn) {
    font-size: 0.76rem;
    padding-inline: 0.42rem;
    white-space: nowrap;
  }

  #resultsTable td {
    grid-template-columns: 5.6rem minmax(0, 1fr);
    gap: 0.38rem;
    padding: 0.38rem 0.56rem;
  }

  #resultsTable td::before {
    font-size: 0.58rem;
  }

  .mobile-prescription-card {
    padding: 0.44rem;
  }

  .mobile-prescription-detail-item {
    grid-template-columns: 4.8rem minmax(0, 1fr);
    gap: 0.3rem;
  }

  .mobile-prescription-key-grid {
    gap: 0.24rem;
  }

  .mobile-prescription-key-item {
    padding: 0.26rem 0.28rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

