﻿:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --background: #09090b;
  --page-background:
    radial-gradient(circle at 78% 12%, rgba(255, 75, 11, 0.16), transparent 27%),
    linear-gradient(135deg, #050607 0%, #0d0e10 52%, #15100f 100%);
  --foreground: #fafafa;
  --card: rgba(24, 24, 27, 0.88);
  --card-foreground: #fafafa;
  --popover: #09090b;
  --popover-foreground: #fafafa;
  --primary: #ff4b0b;
  --primary-foreground: #fffaf4;
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-300: #fdba74;
  --orange-500: #ff4b0b;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-900: #7c2d12;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted-surface: #18181b;
  --muted-foreground: #a1a1aa;
  --accent: #27272a;
  --accent-foreground: #fafafa;
  --destructive: #3f3f46;
  --destructive-foreground: #fafafa;
  --border: rgba(255, 255, 255, 0.12);
  --input: rgba(255, 255, 255, 0.14);
  --ring: #ff4b0b;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);

  --bg: var(--background);
  --panel: rgba(24, 24, 27, 0.78);
  --panel-strong: rgba(24, 24, 27, 0.95);
  --line: var(--border);
  --line-strong: rgba(255, 75, 11, 0.55);
  --text: var(--foreground);
  --heading: var(--foreground);
  --muted: var(--muted-foreground);
  --soft: #71717a;
  --tone-primary: var(--primary);
  --tone-muted: #ff9f1a;
  --tone-subtle: #f1efe9;
  --tone-strong: #fffaf4;
  --danger: #a1a1aa;
}

html[data-theme="light"] {
  color-scheme: light;
  --background: #ffffff;
  --page-background:
    radial-gradient(circle at 78% 12%, rgba(255, 75, 11, 0.1), transparent 24%),
    linear-gradient(135deg, #ffffff 0%, #fafafa 58%, #fff7f3 100%);
  --foreground: #09090b;
  --card: rgba(255, 255, 255, 0.92);
  --card-foreground: #09090b;
  --popover: #ffffff;
  --popover-foreground: #09090b;
  --primary: #ff4b0b;
  --primary-foreground: #fafafa;
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-300: #fdba74;
  --orange-500: #ff4b0b;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-900: #7c2d12;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --muted-surface: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --destructive: #e4e4e7;
  --destructive-foreground: #18181b;
  --border: rgba(9, 9, 11, 0.12);
  --input: rgba(9, 9, 11, 0.16);
  --ring: #ff4b0b;
  --shadow: 0 24px 70px rgba(24, 24, 27, 0.12);

  --bg: var(--background);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: var(--border);
  --line-strong: rgba(255, 75, 11, 0.42);
  --text: var(--foreground);
  --heading: var(--foreground);
  --muted: var(--muted-foreground);
  --soft: #71717a;
  --tone-primary: var(--primary);
  --tone-muted: #b45309;
  --tone-subtle: #3f3f46;
  --tone-strong: #18181b;
  --danger: #52525b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--page-background);
  color: var(--text);
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.58)),
    url("assets/hero-runner.png") center / cover no-repeat;
}

.login-screen[hidden],
.shell[hidden] {
  display: none;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 10, 12, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card img {
  width: 210px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 36px;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted-foreground);
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
}

.form-message.is-error {
  color: var(--muted-foreground);
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.rail-backdrop {
  display: none;
}

.menu-toggle {
  position: fixed;
  top: 14px;
  left: 194px;
  z-index: 40;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 9, 10, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.menu-toggle::before {
  content: "\2039";
  color: var(--heading);
  font-size: 30px;
  line-height: 1;
  transform: translateX(-1px);
}

.menu-toggle span {
  display: none;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--heading);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  background: rgba(4, 5, 6, 0.86);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  z-index: 5;
}

.brand {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  color: var(--soft);
  text-decoration: none;
}

.brand img {
  width: 168px;
  display: block;
}

.app-version {
  color: var(--soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 520;
  text-transform: uppercase;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

nav a:hover,
nav a.is-active {
  color: var(--heading);
  border-color: var(--line-strong);
  background: linear-gradient(90deg, rgba(250, 250, 250, 0.22), rgba(255, 255, 255, 0.04));
}

.shell.rail-collapsed {
  grid-template-columns: 86px minmax(0, 1fr);
}

.shell.rail-collapsed .menu-toggle {
  left: 22px;
  top: 104px;
}

.shell.rail-collapsed .menu-toggle::before {
  content: "\203A";
  transform: translateX(1px);
}

.shell.rail-collapsed .rail {
  padding: 28px 12px;
}

.shell.rail-collapsed .brand {
  justify-items: center;
}

.shell.rail-collapsed .brand img {
  width: 58px;
}

.shell.rail-collapsed .app-version,
.shell.rail-collapsed .nav-label,
.shell.rail-collapsed .athlete-chip {
  display: none;
}

.shell.rail-collapsed nav a {
  justify-content: center;
  padding: 10px;
  min-height: 38px;
}

.shell.rail-collapsed .nav-icon {
  width: 20px;
  height: 20px;
}

.shell.rail-collapsed .nav-icon svg {
  width: 20px;
  height: 20px;
}

.athlete-chip {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.athlete-chip span,
.kicker,
.section-title span,
.calendar-top span,
.provider-card small,
.insight-list span,
.athlete-card span {
  color: var(--tone-primary);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 500;
}

.athlete-chip strong {
  display: block;
  margin-top: 6px;
  color: var(--heading);
  font-weight: 650;
}

.athlete-select {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  padding: 0 10px;
  color: var(--heading);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.34);
}

main {
  min-width: 0;
}

.view {
  display: none;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 36px);
}

.view.is-visible {
  display: block;
}

.home-view {
  padding: 0;
}

.hero {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: end;
}

.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 44% center;
  filter: saturate(1.08) contrast(1.1);
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.22) 48%, rgba(0, 0, 0, 0.78)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.9), transparent 48%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  padding: clamp(26px, 5vw, 64px);
}

.hero-logo {
  width: min(280px, 70vw);
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: 0;
  margin-bottom: 20px;
  color: var(--heading);
  font-weight: 650;
}

.hero h1 {
  max-width: 540px;
  font-size: clamp(26px, 3.5vw, 44px);
  line-height: 1.08;
}

h2,
h3 {
  color: var(--heading);
  font-weight: 650;
}

.hero-content p:not(.kicker) {
  max-width: 620px;
  color: #d5d3ce;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
}

.hero-motivation {
  max-width: min(720px, 58vw);
  margin: clamp(20px, 3vw, 34px) 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(250, 250, 250, 0.34);
  color: rgba(241, 239, 233, 0.92);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 520;
  line-height: 1.3;
}

.home-ai-agent {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 4vw, 58px);
  bottom: clamp(24px, 6vw, 84px);
  width: min(560px, 38vw);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(250, 250, 250, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(140deg, rgba(250, 250, 250, 0.13), rgba(255, 255, 255, 0.035) 42%, rgba(0, 0, 0, 0.22)),
    rgba(13, 14, 16, 0.72);
  backdrop-filter: blur(16px);
}

.home-ai-agent .section-title {
  margin: 0;
}

.home-ai-agent .section-title h3 {
  font-size: 22px;
}

.home-ai-messages {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 250, 250, 0.56) rgba(255, 255, 255, 0.06);
}

.home-ai-message {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.home-ai-message.is-user {
  border-color: rgba(250, 250, 250, 0.42);
  background: rgba(250, 250, 250, 0.1);
}

.home-ai-message span {
  display: block;
  margin-bottom: 4px;
  color: var(--tone-primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-ai-message p {
  margin: 0;
  color: rgba(241, 239, 233, 0.9);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.home-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.home-ai-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--heading);
  background: rgba(0, 0, 0, 0.35);
}

.hero-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-action,
.secondary-action,
.icon-button,
.segmented button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--heading);
  font-weight: 700;
}

.primary-action {
  padding: 0 18px;
  background: var(--tone-primary);
  box-shadow: 0 16px 36px rgba(250, 250, 250, 0.24);
}

.primary-action:disabled,
.secondary-action:disabled,
.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.secondary-action {
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
}

.danger-action {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 61, 85, 0.48);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 61, 85, 0.1);
}

.compact {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.panel,
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.day-number,
.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-header h2 {
  margin: 4px 0 0;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 0.98;
  color: #e6e3dc;
  font-weight: 560;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.segmented button {
  min-width: 68px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 520;
  text-transform: uppercase;
}

.segmented button.is-active {
  color: #ffffff;
  background: rgba(250, 250, 250, 0.92);
}

.segmented button.is-active,
.segmented button.is-active span,
.segmented button.is-active .control-icon,
.system-control-button.is-active,
.system-control-button.is-active span,
.system-control-button.is-active .control-icon {
  color: #ffffff;
  opacity: 1;
}

.system-control-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 520;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.system-control-button .control-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}

.primary-action.system-control-button,
.secondary-action.system-control-button,
.segmented button.system-control-button {
  font-size: 13px;
  font-weight: 520;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
  font-size: 24px;
}

.period-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.training-grid,
.settings-grid,
.athlete-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.settings-grid {
  grid-template-columns: minmax(0, 1fr);
}

.admin-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.admin-create-panel,
.admin-user-form,
.team-form {
  display: grid;
  gap: 16px;
}

.admin-mode-switch {
  width: fit-content;
  max-width: 100%;
}

.admin-create-panel {
  order: 1;
}

.athlete-list-panel {
  order: 2;
}

.ai-settings-panel {
  order: 3;
}

.wide-field {
  grid-column: 1 / -1;
}

.training-grid-wide {
  grid-template-columns: minmax(0, 1fr);
}

[hidden],
.admin-only[hidden],
.admin-only-field[hidden],
.manager-only[hidden] {
  display: none !important;
}

.panel {
  padding: 18px;
}

[data-view="athlete"] .athlete-grid {
  grid-template-columns: minmax(0, 1fr);
}

.athlete-form {
  display: grid;
  gap: 18px;
}

.profile-edit-panel {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(250, 250, 250, 0.055), rgba(255, 255, 255, 0.025) 38%, rgba(0, 0, 0, 0.06)),
    rgba(255, 255, 255, 0.018);
}

.profile-edit-panel .section-title {
  margin-bottom: 2px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.profile-edit-panel .section-title h3 {
  margin-top: 5px;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 560;
}

.profile-history-panel {
  border-color: rgba(250, 250, 250, 0.2);
}

.relationship-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.test3000-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.focus-projection-panel {
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  border-color: rgba(250, 250, 250, 0.22);
  background:
    linear-gradient(120deg, rgba(250, 250, 250, 0.13), rgba(255, 255, 255, 0.035) 42%, rgba(0, 0, 0, 0.08)),
    var(--panel);
}

.panel-collapse-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-toggle-text {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.panel-toggle-text .kicker {
  pointer-events: none;
}

.performance-chart-panel.is-collapsed {
  margin-bottom: 12px;
}

.focus-projection-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.focus-projection-head h3 {
  margin: 5px 0 0;
  color: #e6e2dc;
  font-size: 20px;
  font-weight: 540;
  text-transform: uppercase;
}

.focus-projection-head > strong {
  color: var(--tone-primary);
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 520;
  line-height: 1;
}

.focus-projection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.focus-projection-grid div,
.focus-projection-empty {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.focus-projection-grid span,
.focus-projection-empty span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.focus-projection-grid strong,
.focus-projection-empty strong {
  display: block;
  margin-top: 5px;
  color: #e6e2dc;
  font-size: 15px;
  font-weight: 520;
}

.focus-projection-grid p,
.focus-projection-empty p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.focus-history {
  margin: -4px 0 16px;
  padding: 12px;
  border: 1px solid rgba(250, 250, 250, 0.18);
  border-radius: var(--radius);
  background: rgba(250, 250, 250, 0.045);
}

.focus-history span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.focus-history div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.focus-history strong {
  color: #e6e2dc;
  font-size: 14px;
  font-weight: 520;
}

.focus-history small,
.focus-history p {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.focus-roadmap-panel {
  margin-bottom: 18px;
  border-color: rgba(250, 250, 250, 0.18);
  background:
    linear-gradient(110deg, rgba(250, 250, 250, 0.075), rgba(255, 255, 255, 0.025) 40%, rgba(0, 0, 0, 0.08)),
    var(--panel);
}

.roadmap-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.roadmap-head h3 {
  margin: 5px 0 0;
  color: #dedbd4;
  font-size: 18px;
  font-weight: 500;
}

.probability-badge {
  display: grid;
  justify-items: end;
  color: var(--tone-primary);
}

.probability-badge strong {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 460;
  line-height: 1;
}

.probability-badge span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.roadmap-metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.roadmap-metric span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.roadmap-metric strong {
  display: block;
  margin-top: 5px;
  color: #e7e3dc;
  font-size: 15px;
  font-weight: 500;
}

.roadmap-metric p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.roadmap-chart {
  margin-top: 14px;
}

.roadmap-chart svg {
  width: 100%;
  height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.12);
}

.roadmap-chart line {
  stroke: rgba(255, 255, 255, 0.06);
}

.roadmap-chart .roadmap-required {
  fill: none;
  stroke: rgba(180, 180, 176, 0.42);
  stroke-width: 0.8;
  stroke-dasharray: 4 6;
}

.roadmap-chart .roadmap-current {
  fill: none;
  stroke: rgba(250, 250, 250, 0.7);
  stroke-width: 0.75;
}

.roadmap-chart text {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 430;
}

.roadmap-ai {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.roadmap-actions {
  margin-top: 12px;
}

.goals-grid {
  display: grid;
  gap: 18px;
}

.goal-form,
.goal-list-panel,
.goal-results-panel {
  display: grid;
  gap: 14px;
}

.goal-list {
  display: grid;
  gap: 12px;
}

#goalList.goal-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.goal-card {
  padding: 14px;
  border: 1px solid rgba(250, 250, 250, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(250, 250, 250, 0.09), rgba(255, 255, 255, 0.025) 42%, rgba(0, 0, 0, 0.08)),
    rgba(18, 18, 20, 0.86);
}

.goal-card-result {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.goal-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.goal-card-head span,
.goal-metrics span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.goal-card-head h4 {
  margin: 5px 0 0;
  color: #e8e4dd;
  font-size: 18px;
  font-weight: 520;
}

.goal-card-head p,
.goal-analysis,
.goal-notes {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.goal-card-head > strong {
  color: var(--tone-primary);
  font-size: 28px;
  font-weight: 460;
}

.goal-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.goal-metrics div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.goal-metrics strong {
  display: block;
  margin-top: 5px;
  color: #e7e3dc;
  font-size: 14px;
  font-weight: 500;
}

.goal-route {
  margin-top: 12px;
  padding: 9px 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.goal-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.goal-route svg {
  display: block;
  width: 100%;
  min-height: 126px;
}

.goal-route-grid {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 0.45;
}

.goal-route-axis {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 0.55;
}

.goal-route-time-tick {
  stroke: rgba(250, 250, 250, 0.38);
  stroke-width: 0.5;
}

.goal-route-target {
  stroke: rgba(241, 239, 233, 0.32);
  stroke-width: 0.55;
  stroke-dasharray: 5 7;
}

.goal-route-optimistic,
.goal-route-conservative {
  fill: none;
  stroke-width: 0.9;
  stroke-linecap: round;
}

.goal-route-optimistic {
  stroke: rgba(250, 250, 250, 0.78);
}

.goal-route-conservative {
  stroke: rgba(82, 82, 91, 0.45);
  stroke-dasharray: 3 6;
}

.goal-route-now,
.goal-route-target-dot,
.goal-route-optimistic-dot,
.goal-route-conservative-dot {
  fill: var(--tone-primary);
}

.goal-route-target-dot {
  fill: #f1efe9;
  stroke: var(--tone-primary);
  stroke-width: 0.9;
}

.goal-route-conservative-dot {
  opacity: 0.72;
}

.goal-route-y,
.goal-route-label,
.goal-route-tag {
  fill: rgba(231, 227, 220, 0.62);
  font-size: 7.5px;
  font-weight: 520;
}

.goal-route-tag {
  fill: rgba(250, 250, 250, 0.88);
  text-transform: uppercase;
}

.goal-route-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
}

.goal-route-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.goal-route-legend i {
  width: 18px;
  height: 1px;
  border-radius: 99px;
  background: rgba(250, 250, 250, 0.86);
}

.goal-route-legend .is-conservative {
  background: repeating-linear-gradient(90deg, rgba(82, 82, 91, 0.55) 0 5px, transparent 5px 8px);
}

.goal-route-legend .is-target {
  background: rgba(241, 239, 233, 0.38);
}

.goal-route-empty {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 14px;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.dashboard-hero-panel {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
}

.dashboard-panel {
  min-height: 260px;
  position: relative;
  overflow: hidden;
}

.dashboard-hero-panel::before,
.dashboard-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 20%, rgba(250, 250, 250, 0.18), transparent 24%),
    linear-gradient(105deg, rgba(250, 250, 250, 0.08), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 76px);
  opacity: 0.72;
}

.dashboard-hero-panel > *,
.dashboard-panel > * {
  position: relative;
}

.dashboard-highlights {
  display: grid;
  gap: 14px;
}

.dashboard-cockpit {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.dashboard-orbit {
  width: 196px;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(250, 250, 250, 0.22), transparent 34%),
    rgba(255, 255, 255, 0.025);
}

.dashboard-orbit span {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(250, 250, 250, 0.4);
  border-top-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: dashboardOrbit 12s linear infinite;
}

.dashboard-orbit span:nth-child(2) {
  inset: 34px;
  border-color: rgba(255, 255, 255, 0.16);
  border-left-color: rgba(250, 250, 250, 0.7);
  animation-duration: 9s;
  animation-direction: reverse;
}

.dashboard-orbit span:nth-child(3) {
  inset: 52px;
  border-style: dashed;
  opacity: 0.65;
  animation-duration: 18s;
}

.dashboard-orbit strong {
  color: var(--heading);
  font-size: 40px;
  font-weight: 520;
}

.dashboard-orbit small {
  position: absolute;
  top: 116px;
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 520;
  text-transform: uppercase;
}

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

.dashboard-trend {
  min-width: 0;
  overflow: visible;
}

.dashboard-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  align-items: center;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 520;
  text-transform: uppercase;
}

.dashboard-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.dashboard-legend i {
  display: inline-block;
  width: 28px;
  height: 1px;
}

.dashboard-trend-svg {
  width: 100%;
  height: auto;
  min-height: 0;
  display: block;
  overflow: visible;
}

.dash-grid {
  stroke: rgba(255, 255, 255, 0.055);
  stroke-width: 0.45;
}

.dash-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashboardDraw 1.8s ease both;
  filter: none;
}

.dash-line-volume {
  stroke: rgba(250, 250, 250, 0.68);
}

.dash-line-tss {
  stroke: rgba(248, 243, 232, 0.48);
  animation-delay: 0.12s;
}

.dash-node {
  fill: rgba(250, 250, 250, 0.58);
  stroke: rgba(248, 243, 232, 0.5);
  stroke-width: 0.35;
  transform-box: fill-box;
  transform-origin: center;
}

.dashboard-trend-svg text,
.test-evolution svg text {
  fill: rgba(231, 227, 220, 0.58);
  font-size: 11px;
  font-weight: 480;
}

.dashboard-trend-svg .dash-month-label {
  fill: rgba(250, 250, 250, 0.82);
  font-size: 10px;
  font-weight: 520;
  letter-spacing: 0.08em;
}

.dashboard-trend-svg .dash-day-label {
  fill: rgba(231, 227, 220, 0.38);
  font-size: 8.5px;
  font-weight: 420;
}

.dashboard-trend-svg .dash-day-label.is-strong {
  fill: rgba(231, 227, 220, 0.72);
}

@keyframes dashboardDraw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes dashboardPulse {
  50% {
    opacity: 0.58;
    transform: scale(0.9);
  }
}

.dashboard-barcode {
  height: 22px;
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 4px;
  align-items: end;
  margin-top: 4px;
  opacity: 0.82;
}

.dashboard-barcode span {
  height: var(--bar);
  border-radius: 99px 99px 0 0;
  background: linear-gradient(180deg, rgba(250, 250, 250, 0.95), rgba(250, 250, 250, 0.08));
  animation: dashboardBar 1.2s ease both;
}

@keyframes dashboardBar {
  from {
    height: 4%;
    opacity: 0.25;
  }
}

.dashboard-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-metric-card {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(250, 250, 250, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.025);
}

.dashboard-metric-card span,
.dashboard-goal-card span,
.timeline-card span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 520;
  text-transform: uppercase;
}

.dashboard-metric-card strong,
.dashboard-goal-card strong,
.timeline-card strong {
  display: block;
  margin-top: 6px;
  color: #e9e5dd;
  font-size: 17px;
  font-weight: 540;
}

.dashboard-metric-card p,
.dashboard-goal-card p,
.timeline-card p,
.timeline-card small {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.test-evolution {
  display: grid;
  gap: 12px;
}

.test-evolution svg {
  width: 100%;
  min-height: 150px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.test-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.timeline-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.test-params {
  display: grid;
  gap: 12px;
}

.test-base-card,
.test-param-card,
.test-zone-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(250, 250, 250, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.025);
}

.test-base-card {
  padding: 14px;
}

.test-base-card span,
.test-param-card span,
.test-param-title span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 560;
  text-transform: uppercase;
}

.test-base-card strong,
.test-param-card strong,
.test-param-title strong {
  display: block;
  margin-top: 6px;
  color: #e9e5dd;
  font-size: 17px;
  font-weight: 540;
}

.test-base-card p,
.test-param-card p,
.test-zone-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.test-projection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.test-param-card {
  padding: 13px;
}

.test-param-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
}

.test-zone-panel {
  padding: 14px;
}

.test-param-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
}

.test-param-title strong {
  margin-top: 0;
  font-size: 13px;
  text-align: right;
}

.test-zone-list,
.test-mix-list {
  display: grid;
  gap: 8px;
}

.test-zone-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.test-zone-list strong {
  color: #e9e5dd;
  font-size: 13px;
  font-weight: 520;
}

.test-zone-list article > span {
  color: #f1efe9;
  font-size: 13px;
  font-weight: 520;
  white-space: nowrap;
}

.test-mix-list article {
  display: grid;
  gap: 7px;
}

.test-mix-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #d6d1c8;
  font-size: 12px;
  font-weight: 520;
}

.test-mix-list strong {
  color: #f1efe9;
}

.test-mix-list i {
  display: block;
  height: 4px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, rgba(250, 250, 250, 0.9) var(--pct), rgba(255, 255, 255, 0.08) var(--pct));
}

.type-radar {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.dashboard-donut {
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--donut);
  box-shadow: 0 0 38px rgba(250, 250, 250, 0.15);
  animation: dashboardGlow 3s ease-in-out infinite;
}

.dashboard-donut::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111113;
}

.dashboard-donut span,
.dashboard-donut small {
  position: relative;
  z-index: 1;
}

.dashboard-donut span {
  color: var(--heading);
  font-size: 34px;
  font-weight: 520;
}

.dashboard-donut small {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 520;
  text-transform: uppercase;
}

@keyframes dashboardGlow {
  50% { box-shadow: 0 0 52px rgba(250, 250, 250, 0.24); }
}

.type-bars {
  display: grid;
  gap: 11px;
}

.type-bar div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.type-bar strong {
  color: var(--heading);
  font-weight: 520;
}

.type-bar i {
  display: block;
  height: 4px;
  border-radius: 99px;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.type-bar i::after {
  content: "";
  display: block;
  width: var(--pct);
  height: 100%;
  border-radius: inherit;
  background: var(--color);
  animation: dashboardWidth 1.3s ease both;
}

@keyframes dashboardWidth {
  from { width: 0; }
}

.type-insights {
  display: grid;
  gap: 14px;
}

.type-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.type-summary-strip article,
.type-insight-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(250, 250, 250, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.025);
}

.type-summary-strip article {
  padding: 13px;
}

.type-summary-strip span,
.type-insight-head span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 560;
  text-transform: uppercase;
}

.type-summary-strip strong,
.type-insight-head strong {
  display: block;
  margin-top: 6px;
  color: #e9e5dd;
  font-size: 17px;
  font-weight: 540;
}

.type-summary-strip p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.type-insight-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.type-insight-card {
  padding: 13px;
  overflow: hidden;
  position: relative;
}

.type-insight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(250, 250, 250, 0.95), rgba(82, 82, 91, 0.2));
}

.type-insight-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.type-insight-head em {
  color: #f1efe9;
  font-size: 18px;
  font-style: normal;
  font-weight: 540;
}

.type-insight-meter {
  height: 34px;
  margin: 12px 0 10px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(250, 250, 250, 0.18) var(--count), transparent var(--count)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 20%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  position: relative;
}

.type-insight-meter i {
  display: block;
  height: 100%;
  width: var(--vol);
  background: linear-gradient(90deg, rgba(250, 250, 250, 0.82), rgba(82, 82, 91, 0.2));
  animation: dashboardWidth 1.3s ease both;
}

.type-insight-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.type-insight-metrics span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.type-insight-metrics b {
  display: block;
  color: #f1efe9;
  font-size: 13px;
  font-weight: 540;
  white-space: nowrap;
}

.dashboard-goal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 18px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(250, 250, 250, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(140deg, rgba(250, 250, 250, 0.09), rgba(255, 255, 255, 0.025) 44%),
    rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.dashboard-goal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(250, 250, 250, 0.95), rgba(82, 82, 91, 0.18));
}

.goal-probability-copy {
  min-width: 0;
  position: relative;
}

.goal-probability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.goal-probability-grid small {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.goal-probability-grid b {
  display: block;
  color: #f1efe9;
  font-size: 13px;
  font-weight: 540;
  white-space: nowrap;
}

.goal-analysis-stamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  color: rgba(231, 227, 220, 0.52);
  font-size: 11px;
  line-height: 1.35;
}

.dashboard-goal-card.is-recalculating,
.dashboard-vo2-panel.is-recalculating {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(250, 250, 250, 0.08), 0 18px 50px rgba(250, 250, 250, 0.08);
}

.goal-probability-visual {
  display: grid;
  justify-items: center;
  gap: 6px;
  position: relative;
}

.goal-probability-visual span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
  text-align: center;
  text-transform: none;
}

.dashboard-goal-card svg {
  width: 92px;
}

.goal-ring-base {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 8;
}

.goal-ring-progress {
  fill: none;
  stroke: var(--tone-primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: calc(283 - (283 * var(--goal) / 100));
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  animation: dashboardDraw 1.8s ease both;
}

.dashboard-goal-card text {
  fill: #e7e3dc;
  font-size: 18px;
  font-weight: 560;
}

.goal-probability-list {
  display: grid;
  gap: 12px;
}

.dashboard-vo2-panel {
  min-height: 100%;
  padding: 16px;
  border: 1px solid rgba(250, 250, 250, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(250, 250, 250, 0.11), rgba(255, 255, 255, 0.025) 46%),
    rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.dashboard-vo2-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 68px),
    linear-gradient(180deg, transparent, rgba(250, 250, 250, 0.06));
}

.dashboard-vo2-panel > * {
  position: relative;
}

.vo2-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: start;
}

.vo2-panel-head span,
.vo2-source-grid span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 560;
  text-transform: uppercase;
}

.vo2-panel-head strong {
  display: block;
  margin-top: 6px;
  color: #f1efe9;
  font-size: 46px;
  line-height: 0.95;
  font-weight: 560;
}

.vo2-panel-head p,
.dashboard-vo2-panel > p,
.vo2-source-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.vo2-panel-head svg {
  width: 140px;
  max-width: 100%;
  margin-top: 4px;
}

.vo2-panel-head path {
  fill: none;
  stroke: rgba(250, 250, 250, 0.72);
  stroke-width: 2;
}

.vo2-panel-head circle {
  fill: #f1efe9;
  stroke: var(--tone-primary);
  stroke-width: 2;
}

.vo2-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.vo2-source-grid article {
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.vo2-source-grid strong {
  display: block;
  margin-top: 6px;
  color: #f1efe9;
  font-size: 18px;
  font-weight: 540;
}

.vo2-context-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.vo2-context-list span {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.vo2-context-list b {
  color: #f1efe9;
  font-weight: 540;
}

.vo2-ai-analysis {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vo2-ai-analysis span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 560;
  text-transform: uppercase;
}

.vo2-ai-analysis p {
  margin: 6px 0 0;
  color: rgba(231, 227, 220, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-recalc {
  align-self: start;
  white-space: nowrap;
}

.dashboard-recalc.is-loading,
.dashboard-recalc:disabled {
  opacity: 0.72;
  cursor: wait;
}

.mini-loader {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--tone-primary);
  border-radius: 50%;
  animation: spinLoader 0.75s linear infinite;
  flex: 0 0 auto;
}

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

.performance-chart-panel {
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.performance-chart-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(250, 250, 250, 0.1), transparent 36%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 72px);
  opacity: 0.7;
}

.chart-heading,
.chart-stats,
.performance-chart svg {
  position: relative;
}

.chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.chart-heading h3 {
  margin: 6px 0 0;
  color: #dedbd4;
  font-size: 20px;
  font-weight: 540;
}

.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  text-transform: uppercase;
}

.chart-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.chart-legend i {
  width: 28px;
  height: 1px;
  border-radius: 99px;
  display: inline-block;
}

.legend-volume {
  background: rgba(250, 250, 250, 0.86);
  box-shadow: 0 0 8px rgba(250, 250, 250, 0.32);
}

.legend-tss {
  background: rgba(248, 243, 232, 0.78);
  box-shadow: 0 0 8px rgba(248, 243, 232, 0.18);
}

.performance-chart {
  display: grid;
  gap: 12px;
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.chart-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.chart-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
  text-transform: uppercase;
}

.chart-stats strong {
  display: block;
  margin-top: 5px;
  color: #dedbd4;
  font-size: 16px;
  font-weight: 540;
}

.performance-chart svg {
  width: 100%;
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(0, 0, 0, 0.1));
}

.chart-grid line {
  stroke: rgba(255, 255, 255, 0.028);
  stroke-width: 1;
}

.volume-area {
  fill: url(#volumeFill);
}

.volume-line,
.tss-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.65;
  filter: none;
}

.volume-line {
  stroke: var(--tone-primary);
  stroke-opacity: 0.62;
}

.tss-line {
  stroke: #f8f3e8;
  stroke-opacity: 0.52;
}

.performance-chart text {
  fill: var(--muted);
  font-size: 8.5px;
  font-weight: 520;
}

.chart-labels text {
  fill: rgba(230, 228, 222, 0.62);
}

.tss-points circle {
  fill: rgba(250, 250, 250, 0.56);
  stroke: rgba(248, 243, 232, 0.56);
  stroke-width: 0.65;
}

.today-marker line {
  stroke: rgba(248, 243, 232, 0.42);
  stroke-width: 0.8;
  stroke-dasharray: 3 5;
}

.today-marker text {
  fill: rgba(230, 228, 222, 0.52);
  font-size: 6.5px;
  font-weight: 400;
  text-transform: uppercase;
}

.calendar-period {
  grid-template-columns: 56px repeat(var(--period-weeks, 12), minmax(180px, 1fr));
  overflow-x: auto;
  max-width: 100%;
}

.period-month {
  min-height: 240px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.period-month-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.period-month-head span {
  display: block;
  color: var(--tone-primary);
  font-size: 11px;
  font-weight: 560;
  text-transform: uppercase;
}

.period-month-head strong {
  display: block;
  margin-top: 4px;
  color: #dedbd4;
  font-size: 15px;
  font-weight: 540;
}

.period-month-stats {
  text-align: right;
}

.period-month-stats span {
  color: var(--muted);
}

.period-activities {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.period-week-list {
  display: grid;
  gap: 10px;
}

.period-month-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.period-week {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.period-week-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.period-week-head strong {
  color: #e6e2dc;
  font-size: 13px;
  font-weight: 500;
}

.period-week-head span {
  color: var(--tone-primary);
  font-size: 11px;
  font-weight: 480;
}

.period-empty {
  margin: 18px 0 0;
  color: var(--muted);
}

.chart-empty {
  position: relative;
  margin: -6px 0 0;
  color: var(--muted);
}

.calendar-top,
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.calendar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-top h3,
.section-title h3 {
  margin: 6px 0 0;
  font-size: 22px;
  color: #dedbd4;
  font-weight: 540;
}

.calendar {
  display: grid;
  gap: 8px;
}

.calendar-month {
  grid-template-columns: 56px repeat(var(--month-weeks, 5), minmax(180px, 1fr));
  overflow-x: auto;
  max-width: 100%;
}

.calendar-week {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
  grid-template-columns: minmax(0, 1fr);
}

.weekday {
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.month-grid-corner,
.month-week-header,
.month-day-label {
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 540;
  text-transform: uppercase;
}

.month-week-header {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 4px 0 7px;
}

.month-week-header strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.month-week-header strong small {
  margin-left: 6px;
  color: rgba(250, 250, 250, 0.78);
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
}

.month-week-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 520;
  text-transform: none;
}

.month-day-label {
  padding-top: 12px;
}

.day {
  min-height: 132px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.day.is-muted {
  opacity: 1;
}

.day.is-today {
  border-color: var(--line-strong);
}

.calendar-day .day {
  min-height: 560px;
}

.activity {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  display: block;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--tone-primary);
  border-radius: 6px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(250, 250, 250, 0.2), rgba(255, 255, 255, 0.05));
}

.activity.is-planned {
  border-left-color: rgba(180, 180, 180, 0.72);
  color: rgba(231, 228, 220, 0.78);
  background: linear-gradient(135deg, rgba(80, 80, 84, 0.26), rgba(255, 255, 255, 0.035));
}

.activity.is-planned span,
.activity.is-planned .activity-type {
  color: rgba(205, 205, 205, 0.74);
}

.activity strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  color: #e8e3dc;
  font-weight: 520;
  text-transform: uppercase;
}

.activity span {
  display: block;
  margin-top: 5px;
  color: var(--tone-primary);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 440;
  opacity: 0.82;
}

.activity em {
  display: block;
  margin-top: 6px;
  color: #f3efe8;
  font-size: 10px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 430;
  text-transform: uppercase;
  opacity: 0.88;
}

.activity-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #f3efe8;
  font-size: 10px;
  line-height: 1.25;
  text-transform: uppercase;
}

.activity-feedback span {
  margin: 0;
  color: #f3efe8;
  opacity: 0.9;
}

.activity-feedback .pain-low {
  color: #67d68a;
}

.activity-feedback .pain-mid {
  color: #f0c765;
}

.activity-feedback .pain-high {
  color: var(--foreground);
}

.activity-feedback-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.activity[data-source="Garmin"] {
  border-left-color: var(--tone-subtle);
}

.activity[data-source="Polar"] {
  border-left-color: var(--tone-strong);
}

.activity[data-source="Suunto"] {
  border-left-color: var(--tone-muted);
}

.activity[data-source="COROS"] {
  border-left-color: #e5e7eb;
}

.athlete-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.athlete-card img {
  width: 78px;
}

.athlete-card strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
  color: var(--heading);
  font-weight: 650;
}

.athlete-card p,
.insight-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.insight-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.insight-list article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.insight-list strong {
  display: block;
  margin: 6px 0;
  font-size: 22px;
  color: var(--heading);
  font-weight: 650;
}

.select-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-settings {
  margin-top: 18px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-header h3 {
  margin: 5px 0 0;
  color: #dedbd4;
  font-size: 24px;
  font-weight: 520;
}

.tests-field {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.tests-field legend {
  padding: 0 6px;
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.tests-grid {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr minmax(0, 1.4fr);
  gap: 10px;
}

.activity-test-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.history-field {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.history-field legend {
  padding: 0 6px;
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.history-timeline-list {
  display: grid;
  gap: 14px;
  margin-bottom: 10px;
}

.history-composer,
.history-record-card,
.history-dossier {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(250, 250, 250, 0.07), rgba(255, 255, 255, 0.02) 42%),
    rgba(255, 255, 255, 0.02);
}

.history-composer-grid,
.history-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.history-metric-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 10px;
}

.history-actions,
.history-toolbar {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.history-toolbar {
  justify-content: space-between;
}

.history-counter {
  display: grid;
  justify-items: end;
  color: var(--muted);
  font-size: 11px;
}

.history-counter strong {
  color: #f1efe9;
  font-size: 22px;
  font-weight: 560;
}

.history-output:empty {
  display: none;
}

.history-month-group {
  display: grid;
  gap: 10px;
}

.history-month-group h4 {
  margin: 8px 0 0;
  color: var(--tone-primary);
  font-size: 11px;
  font-weight: 560;
  text-transform: uppercase;
}

.history-record-card {
  margin-top: 8px;
  padding: 0;
  overflow: hidden;
}

.history-record-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  cursor: pointer;
}

.history-record-card summary::-webkit-details-marker {
  display: none;
}

.history-record-card span,
.history-dossier .section-title span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 560;
  text-transform: uppercase;
}

.history-record-card strong {
  display: block;
  margin-top: 5px;
  color: #f1efe9;
  font-size: 15px;
}

.history-record-card p {
  margin: 5px 0 0;
  color: rgba(231, 227, 220, 0.68);
  font-size: 12px;
  line-height: 1.45;
}

.history-record-meta,
.history-dossier-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 13px 13px;
}

.history-record-meta small,
.history-dossier-grid small {
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.history-record-meta b,
.history-dossier-grid b {
  display: block;
  margin-bottom: 4px;
  color: #f1efe9;
}

.history-dossier p {
  margin: 9px 0 0;
  color: rgba(231, 227, 220, 0.74);
  font-size: 12px;
  line-height: 1.5;
}

.wide-field {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 10px 12px;
  color: var(--heading);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.26);
}

.ai-settings-panel {
  margin-top: 18px;
}

.ai-settings-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.35fr) auto auto;
  gap: 12px;
  align-items: end;
}

.ai-toggle {
  min-height: 42px;
}

select {
  min-height: 42px;
  padding: 0 38px 0 12px;
  color: var(--heading);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151619;
}

.provider-list {
  display: grid;
  gap: 12px;
}

.provider-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.provider-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--tone-primary);
  font-weight: 700;
  background: rgba(250, 250, 250, 0.1);
}

.provider-card h4 {
  margin: 2px 0 6px;
  font-size: 18px;
  color: var(--heading);
  font-weight: 650;
}

.provider-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.provider-card label,
.provider-state,
.provider-athlete {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.provider-body {
  min-width: 0;
}

.provider-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 8px;
}

.provider-toggle {
  min-width: max-content;
}

.provider-state,
.provider-athlete {
  margin-top: 10px;
  font-weight: 650;
}

.provider-warning {
  margin-top: 10px !important;
  color: var(--muted-foreground) !important;
  font-weight: 650;
}

.provider-state a,
.detail-link {
  color: var(--tone-primary);
  text-decoration: none;
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dynamic-profile-fields {
  display: grid;
  gap: 14px;
  margin: 10px 0 18px;
}

.dynamic-profile-fields:empty {
  display: none;
}

.profile-dynamic-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--card) 92%, var(--accent) 8%);
  padding: 16px;
}

.profile-dynamic-block h4 {
  margin: 0 0 14px;
  color: var(--tone-primary);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.profile-dynamic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-dynamic-grid .credential-field:has(textarea),
.profile-dynamic-grid .profile-check-field {
  grid-column: span 2;
}

.profile-check-field {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--heading);
  font-size: var(--text-sm);
  font-weight: 700;
}

.profile-check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--tone-primary);
}

.credential-field {
  display: grid !important;
  gap: 5px !important;
  align-items: stretch !important;
}

.credential-field:not(:has(input)):not(:has(select)):not(:has(textarea)) {
  display: none !important;
}

.credential-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.credential-field input,
.credential-field select,
.credential-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--heading);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

select,
select option,
select optgroup {
  color-scheme: dark;
  color: var(--heading) !important;
  background: #111214 !important;
  background-color: #111214 !important;
}

select option:checked {
  color: #fffaf4 !important;
  background: var(--tone-primary) !important;
  background-color: var(--tone-primary) !important;
}

select option:hover,
select option:focus {
  color: #fffaf4 !important;
  background: #2a1a14 !important;
  background-color: #2a1a14 !important;
}

.credential-field textarea {
  min-height: 112px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
  line-height: 1.45;
}

.credential-field input:focus,
.credential-field select:focus,
.credential-field textarea:focus {
  border-color: rgba(250, 250, 250, 0.72);
  background: rgba(0, 0, 0, 0.36);
  box-shadow: 0 0 0 3px rgba(250, 250, 250, 0.11);
}

.provider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.form-actions,
.athlete-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.athlete-list {
  display: grid;
  gap: 12px;
}

.athlete-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.athlete-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.athlete-list-row.is-selected {
  border-color: var(--line-strong);
}

.athlete-row-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 0.8fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
}

.athlete-row-main strong {
  color: var(--heading);
  font-weight: 560;
}

.athlete-row-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athlete-row-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.athlete-row-details p {
  margin: 0;
}

.athlete-row-details strong {
  color: var(--heading);
  font-weight: 560;
}

.athlete-list-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.athlete-list-item.is-selected {
  border-color: var(--line-strong);
}

.athlete-item-actions {
  margin-top: 12px;
}

.athlete-list-item strong {
  display: block;
  color: var(--heading);
  font-weight: 650;
}

.athlete-list-item span,
.athlete-list-item p,
.empty-state {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--tone-primary);
}

.import-log ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.inline-import-log {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.import-log ol.is-error {
  color: var(--muted-foreground);
}

dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  color: var(--heading);
  padding: 0;
  border-color: var(--line-strong);
  overflow: hidden;
  overscroll-behavior: contain;
  background:
    linear-gradient(145deg, rgba(250, 250, 250, 0.08), rgba(255, 255, 255, 0.025) 34%, rgba(0, 0, 0, 0.08)),
    rgba(13, 14, 16, 0.96);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(12px);
}

.profile-dialog,
.workout-dialog {
  width: min(720px, calc(100vw - 28px));
}

.workout-dialog {
  width: min(1120px, calc(100vw - 32px));
}

.modal-panel {
  display: grid;
  gap: 18px;
  max-height: min(86vh, 820px);
  padding: clamp(22px, 3vw, 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 250, 250, 0.58) rgba(255, 255, 255, 0.06);
}

.modal-panel *,
.detail * {
  min-width: 0;
}

.modal-panel.is-compact {
  max-width: 560px;
}

.modal-panel .section-title {
  margin: 0;
  padding: 0 48px 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-panel .section-title h3 {
  margin-top: 5px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1;
  font-weight: 560;
}

.modal-panel .segmented {
  width: max-content;
  max-width: 100%;
  margin-top: -4px;
  overflow: hidden;
}

.workout-mode-switch {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  width: min(100%, 520px);
}

.workout-mode-switch button {
  min-width: 0;
}

.workout-mode-switch .system-control-button {
  white-space: normal;
}

.workout-mode-switch .system-control-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.workout-builder-form,
.modal-form {
  display: grid;
  gap: 16px;
}

.bulk-activity-panel {
  width: min(1500px, calc(100vw - 32px));
  height: min(86vh, 820px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

#bulkActivityDialog {
  width: min(1500px, calc(100vw - 32px));
}

.bulk-activity-panel .section-title {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(145deg, rgba(250, 250, 250, 0.08), rgba(255, 255, 255, 0.025) 34%, rgba(0, 0, 0, 0.08)),
    rgba(13, 14, 16, 0.98);
}

.bulk-activity-panel .section-title .primary-action {
  flex: 0 0 auto;
}

.bulk-editor-caption {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.bulk-activity-table-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow: auto;
  max-height: calc(min(86vh, 820px) - 190px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 250, 250, 0.58) rgba(255, 255, 255, 0.06);
}

.bulk-activity-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  border-collapse: collapse;
}

.bulk-activity-table th,
.bulk-activity-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: top;
}

.bulk-activity-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--tone-primary);
  font-size: 11px;
  text-transform: uppercase;
  background: rgba(15, 15, 17, 0.98);
}

.bulk-activity-table input,
.bulk-activity-table select {
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--heading);
  background: rgba(0, 0, 0, 0.3);
}

.bulk-activity-table input {
  text-overflow: ellipsis;
}

.bulk-activity-table td:nth-child(1) {
  color: var(--muted);
  font-weight: 800;
}

.bulk-activity-table th:nth-child(1),
.bulk-activity-table td:nth-child(1) {
  width: 44px;
}

.bulk-activity-table th:nth-child(2),
.bulk-activity-table td:nth-child(2) {
  width: 150px;
}

.bulk-activity-table th:nth-child(3),
.bulk-activity-table td:nth-child(3),
.bulk-activity-table th:nth-child(4),
.bulk-activity-table td:nth-child(4) {
  width: 106px;
}

.bulk-activity-table th:nth-child(6),
.bulk-activity-table td:nth-child(6),
.bulk-activity-table th:nth-child(7),
.bulk-activity-table td:nth-child(7),
.bulk-activity-table th:nth-child(8),
.bulk-activity-table td:nth-child(8),
.bulk-activity-table th:nth-child(9),
.bulk-activity-table td:nth-child(9) {
  width: 100px;
}

.bulk-activity-table th:nth-child(10),
.bulk-activity-table td:nth-child(10) {
  width: 150px;
}

.bulk-activity-table th:nth-child(11),
.bulk-activity-table td:nth-child(11) {
  width: 240px;
}

.workout-range,
.activity-feedback-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workout-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 138px), 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.workout-row .credential-field span,
.workout-step label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-structure,
.workout-plan-preview {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(250, 250, 250, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(250, 250, 250, 0.08), rgba(255, 255, 255, 0.035));
}

.workout-structure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workout-structure-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-field {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--heading);
  background: rgba(255, 255, 255, 0.055);
  font-size: 13px;
  font-weight: 520;
}

.workout-plan-body {
  display: grid;
  gap: 10px;
}

.workout-structure-head span {
  display: block;
  color: var(--tone-primary);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.workout-structure-head strong {
  display: block;
  margin-top: 4px;
  color: var(--heading);
  font-size: 17px;
  font-weight: 540;
}

.workout-plan-meta,
.workout-step-list {
  display: grid;
  gap: 10px;
}

.workout-plan-meta {
  grid-template-columns: 0.8fr 1.2fr;
}

.workout-step {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(10, 10, 11, 0.42);
}

.workout-step label {
  display: grid;
  gap: 5px;
}

.workout-step .danger-action {
  min-height: 42px;
  align-self: end;
}

.workout-step label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.workout-step-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.workout-step-strip article {
  min-height: 92px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.workout-step-strip span {
  color: var(--tone-primary);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.workout-step-strip strong {
  display: block;
  margin-top: 8px;
  color: var(--heading);
}

.workout-step-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .workout-step .danger-action {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .home-ai-agent {
    position: relative;
    right: auto;
    bottom: auto;
    width: calc(100% - 28px);
    margin: 0 14px 18px;
  }

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

  dialog,
  .profile-dialog,
  .workout-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .modal-panel {
    max-height: calc(100dvh - 16px);
    padding: 18px;
  }

  .workout-row,
  .workout-step,
  .workout-plan-meta,
  .workout-range,
  .activity-feedback-form {
    grid-template-columns: 1fr;
  }

  .workout-structure-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workout-structure-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.workout-day-list {
  display: grid;
  gap: 12px;
  max-height: min(42vh, 430px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.audio-workout-area {
  display: grid;
  gap: 12px;
}

.workout-builder-form > .primary-action,
.activity-feedback-form > button,
.modal-panel .provider-actions,
.detail .provider-actions {
  justify-self: start;
}

.sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(14px);
}

.sync-overlay[hidden] {
  display: none;
}

.sync-loader {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(250, 250, 250, 0.7);
  border-radius: var(--radius);
  background: rgba(12, 12, 13, 0.94);
  box-shadow: 0 28px 80px rgba(250, 250, 250, 0.18);
}

.sync-orbit {
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border: 2px solid rgba(250, 250, 250, 0.22);
  border-top-color: var(--tone-primary);
  border-right-color: var(--tone-primary);
  border-radius: 50%;
  animation: sync-spin 0.8s linear infinite;
}

.sync-loader span {
  color: var(--tone-primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sync-loader strong {
  display: block;
  margin-top: 8px;
  color: var(--heading);
  font-size: 26px;
  font-weight: 650;
}

.sync-loader p {
  margin: 10px 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.sync-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.sync-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--tone-primary), transparent);
  animation: sync-slide 1.1s ease-in-out infinite;
}

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

@keyframes sync-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

.close-button {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  font-size: 0;
  line-height: 1;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

.close-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-button:hover {
  border-color: rgba(250, 250, 250, 0.55);
  color: var(--heading);
  background: rgba(250, 250, 250, 0.13);
}

.detail {
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: clamp(22px, 3vw, 32px);
}

.detail h3 {
  margin: 8px 0 10px;
  font-size: 30px;
}

.detail p {
  color: var(--muted);
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.detail-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.detail-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--heading);
  font-weight: 650;
}

.analysis-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(250, 250, 250, 0.38);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(250, 250, 250, 0.12), rgba(255, 255, 255, 0.035));
}

.analysis-panel h4 {
  margin: 6px 0 6px;
  color: var(--heading);
  font-size: 18px;
  font-weight: 650;
}

.analysis-grid {
  margin-top: 12px;
}

.analysis-caption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .history-composer-grid,
  .history-metric-grid,
  .history-record-meta,
  .history-dossier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-grid,
  .settings-grid,
  .athlete-grid,
  .goals-grid,
  .admin-management-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .roadmap-grid,
  .goal-metrics,
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-settings-form,
  .tests-grid,
  .activity-test-picker,
  .history-entry-row,
  .athlete-filter-grid,
  .athlete-row-main,
  .athlete-row-details,
  .workout-range,
  .workout-row,
  .workout-plan-meta,
  .workout-step,
  .activity-feedback-form {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .history-composer-grid,
  .history-metric-grid,
  .history-record-meta,
  .history-dossier-grid,
  .history-record-card summary {
    grid-template-columns: 1fr;
  }

  .menu-toggle,
  .shell.rail-collapsed .menu-toggle {
    left: 14px;
    top: 14px;
  }

  .menu-toggle::before,
  .shell.rail-collapsed .menu-toggle::before {
    content: "";
  }

  .menu-toggle span {
    display: block;
  }

  .shell.menu-open .menu-toggle {
    left: calc(min(84vw, 320px) + 10px);
  }

  .shell.menu-open .menu-toggle::before {
    content: "\2039";
  }

  .shell.menu-open .menu-toggle span {
    display: none;
  }

  .shell,
  .shell.rail-collapsed {
    display: block;
  }

  .rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 320px);
    height: 100vh;
    padding: 28px 18px 18px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 35;
  }

  .shell.menu-open .rail {
    transform: translateX(0);
  }

  .rail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(6px);
  }

  .shell.menu-open .rail-backdrop {
    display: block;
  }

  .shell.rail-collapsed .brand img,
  .brand img {
    width: 156px;
  }

  .shell.rail-collapsed .brand {
    justify-items: start;
  }

  .shell.rail-collapsed .app-version,
  .shell.rail-collapsed .nav-label,
  .shell.rail-collapsed .athlete-chip {
    display: initial;
  }

  .shell.rail-collapsed .athlete-chip {
    display: block;
  }

  .shell.rail-collapsed nav a,
  nav a {
    justify-content: flex-start;
    padding: 10px 12px;
    gap: 12px;
  }

  .view {
    padding: 70px 14px 24px;
  }

  .home-view {
    padding: 0;
  }

  .hero {
    min-height: 100svh;
    align-items: end;
  }

  .hero-bg {
    object-position: 57% center;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.44) 62%, rgba(0, 0, 0, 0.78)),
      linear-gradient(0deg, rgba(0, 0, 0, 0.94), transparent 54%);
  }

  .hero-content {
    max-width: 100%;
    padding: 92px 18px 22px;
  }

  .hero-logo {
    width: min(230px, 72vw);
    margin-bottom: 18px;
  }

  .hero h1 {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1;
  }

  .hero-content p:not(.kicker) {
    max-width: 100%;
    font-size: 16px;
  }

  .hero-actions,
  .settings-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .hero-actions button,
  .page-header .secondary-action {
    width: 100%;
  }

  .page-header {
    display: block;
    padding-top: 8px;
  }

  .page-header h2 {
    font-size: clamp(36px, 11vw, 52px);
    line-height: 1;
  }

  .view[data-view="training"] > .page-header .toolbar {
    display: none;
  }

  .toolbar {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .toolbar .calendar-view-switch,
  .calendar-tools .calendar-view-switch {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    padding: 2px;
  }

  .toolbar .calendar-view-switch button,
  .calendar-tools .calendar-view-switch button {
    min-width: 0;
    height: 30px;
    padding: 0 2px;
    font-size: 9px;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .toolbar .period-nav,
  .calendar-tools .period-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .toolbar .period-nav .icon-button,
  .calendar-tools .period-nav .icon-button {
    width: 100%;
    min-width: 0;
    height: 36px;
    font-size: 18px;
  }

  .calendar-top,
  .section-title,
  .chart-heading,
  .provider-heading {
    display: block;
  }

  .calendar-tools {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    overflow: hidden;
  }

  .calendar-tools [data-import-demo] {
    width: 100%;
  }

  .chart-legend {
    margin-top: 12px;
  }

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

  .dashboard-cockpit {
    grid-template-columns: 1fr;
  }

  .dashboard-orbit,
  .dashboard-donut {
    margin-inline: auto;
  }

  .type-radar {
    grid-template-columns: 1fr;
  }

  .type-summary-strip,
  .type-insight-metrics {
    grid-template-columns: 1fr;
  }

  .test-projection-grid,
  .test-param-columns {
    grid-template-columns: 1fr;
  }

  .test-zone-list article,
  .test-param-title {
    align-items: start;
    flex-direction: column;
  }

  .test-param-title strong {
    text-align: left;
  }

  .calendar-week {
    grid-template-columns: 1fr;
  }

  .calendar-period {
    grid-template-columns: 40px repeat(var(--period-weeks, 12), minmax(128px, 1fr));
    min-width: 0;
    overflow-x: auto;
    gap: 5px;
  }

  .period-month-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-month {
    grid-template-columns: 40px repeat(var(--month-weeks, 5), minmax(0, 1fr));
    min-width: 0;
    overflow-x: hidden;
    gap: 5px;
  }

  .month-grid-corner,
  .month-week-header,
  .month-day-label {
    min-height: 22px;
    font-size: 8px;
  }

  .month-week-header strong {
    font-size: 8px;
  }

  .month-week-stats {
    gap: 2px;
    font-size: 7px;
    line-height: 1.25;
  }

  .calendar-month .day {
    padding: 7px;
    min-height: 110px;
  }

  .calendar-month .activity {
    padding: 8px;
    border-radius: 6px;
  }

  .calendar-month .activity strong {
    font-size: 10px;
  }

  .calendar-month .activity span,
  .calendar-month .activity small {
    font-size: 8px;
    line-height: 1.35;
  }

  .weekday {
    display: none;
  }

  .day,
  .calendar-day .day {
    min-height: auto;
  }

  .provider-card {
    grid-template-columns: 1fr;
  }

  .provider-meta {
    grid-template-columns: auto 1fr;
  }

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

  .profile-dynamic-grid {
    grid-template-columns: 1fr;
  }

  .profile-dynamic-grid .credential-field:has(textarea),
  .profile-dynamic-grid .profile-check-field {
    grid-column: auto;
  }

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

@media (max-width: 520px) {
  .panel {
    padding: 14px;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .chart-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics,
  .test-timeline,
  .dashboard-goal-card {
    grid-template-columns: 1fr;
  }

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

  .vo2-panel-head,
  .vo2-source-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-orbit {
    width: 156px;
  }

  .dashboard-orbit strong {
    font-size: 32px;
  }

  .dashboard-trend-svg {
    min-height: 180px;
  }

  .focus-projection-head,
  .focus-projection-grid,
  .roadmap-head,
  .roadmap-grid,
  #goalList.goal-list,
  .goal-card-head,
  .goal-metrics {
    grid-template-columns: 1fr;
  }

  .focus-projection-head {
    align-items: start;
  }

  .performance-chart svg {
    min-height: 108px;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar .calendar-view-switch button,
  .calendar-tools .calendar-view-switch button {
    min-width: 0;
    height: 28px;
    padding: 0 3px;
    font-size: 8px;
  }

  .calendar-tools {
    gap: 6px;
  }

  .calendar-month {
    grid-template-columns: 30px repeat(var(--month-weeks, 5), minmax(0, 1fr));
    gap: 4px;
  }

  .calendar-period {
    grid-template-columns: 30px repeat(var(--period-weeks, 12), minmax(108px, 1fr));
    gap: 4px;
  }

  .period-month-list {
    grid-template-columns: 1fr;
  }

  .calendar-month .day {
    padding: 6px;
    min-height: 96px;
  }

  .calendar-month .activity {
    padding: 7px;
  }

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

  .modal-panel,
  .detail {
    padding: 20px;
  }

  .modal-panel .section-title {
    padding-right: 42px;
  }

  .workout-mode-switch {
    width: 100%;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final shadcn/ui monochrome enforcement layer */
html[data-theme="dark"] body,
html[data-theme="dark"] .shell,
html[data-theme="dark"] main,
html[data-theme="light"] body,
html[data-theme="light"] .shell,
html[data-theme="light"] main {
  background: var(--page-background) !important;
  color: var(--foreground) !important;
}

.login-screen {
  background:
    linear-gradient(90deg, rgba(9, 9, 11, 0.92), rgba(9, 9, 11, 0.62)),
    url("assets/hero-runner.png") center / cover no-repeat !important;
}

html[data-theme="light"] .login-screen {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.56)),
    url("assets/hero-runner.png") center / cover no-repeat !important;
}

.login-screen,
.hero-bg,
.brand img,
.login-card img,
.hero-logo {
  filter: none !important;
}

.rail,
.login-card,
.panel,
.metric-card,
.calendar-month .day,
.calendar-period .day,
.period-week-card,
.profile-edit-panel,
.profile-history-panel,
.activity-card,
.goal-card,
.type-card,
.vo2-estimate-card,
.modal-panel,
.detail,
.home-ai-agent,
.home-ai-message,
.timeline-item,
.admin-user-row,
.bulk-editor-shell {
  background: var(--card) !important;
  color: var(--card-foreground) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

input,
select,
textarea {
  background: var(--background) !important;
  color: var(--foreground) !important;
  border-color: var(--input) !important;
}

select option {
  background: var(--popover) !important;
  color: var(--popover-foreground) !important;
}

.primary-action,
.segmented button.is-active,
.system-control-button.is-active,
.calendar-view-switch button.is-active,
nav a.is-active {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-color: var(--primary) !important;
  box-shadow: none !important;
}

.primary-action *,
.segmented button.is-active *,
.system-control-button.is-active *,
.calendar-view-switch button.is-active *,
nav a.is-active * {
  color: var(--primary-foreground) !important;
  stroke: currentColor !important;
}

.secondary-action,
.icon-button,
.close-button,
.menu-toggle,
.theme-toggle,
.calendar-view-switch,
.segmented,
.system-control-button {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

.kicker,
.section-title span,
.app-version,
.metric-label,
.activity-meta,
.muted,
.empty-state,
.timeline-meta,
.form-message,
.login-message {
  color: var(--muted-foreground) !important;
}

.section-title h3,
.page-header h2,
.hero h1,
.modal-panel h3,
.detail h2,
.goal-card h4,
.activity-card strong {
  color: var(--foreground) !important;
  letter-spacing: 0 !important;
}

.theme-toggle {
  width: calc(100% - 32px);
  margin: auto 16px 12px;
  display: inline-flex;
  justify-content: flex-start;
  gap: 10px;
}

.theme-toggle .nav-icon {
  width: 18px;
  height: 18px;
}

.shell.rail-collapsed .theme-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}

.shell.rail-collapsed .theme-toggle .nav-label {
  display: none;
}

.performance-chart path,
.dashboard-hero-chart path,
.activity-chart path,
.goal-projection-chart path,
.sparkline path {
  stroke-width: 1.1 !important;
}

/* shadcn typography and chart contrast pass */
:root,
html[data-theme="dark"] {
  --chart-1: #ff4b0b;
  --chart-2: #f1efe9;
  --chart-3: #a1a1aa;
  --chart-grid: rgba(255, 255, 255, 0.1);
  --chart-text: rgba(250, 250, 250, 0.68);
  --chart-fill: rgba(255, 75, 11, 0.12);
}

html[data-theme="light"] {
  --chart-1: #e1420a;
  --chart-2: #1f2937;
  --chart-3: #64748b;
  --chart-grid: rgba(15, 23, 42, 0.16);
  --chart-text: rgba(17, 24, 39, 0.74);
  --chart-fill: rgba(255, 75, 11, 0.14);
}

.page-header h2,
.hero h1,
.modal-panel .section-title h3,
.detail h2,
.detail h3,
.settings-header h3 {
  font-size: clamp(2rem, 4vw, 3rem) !important;
  line-height: 1.08 !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

.section-title h3,
.calendar-top h3,
.chart-heading h3,
.profile-edit-panel .section-title h3,
.home-ai-agent .section-title h3,
.focus-projection-head h3,
.roadmap-head h3 {
  font-size: clamp(1.125rem, 1.7vw, 1.5rem) !important;
  line-height: 1.2 !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em !important;
}

.kicker,
.section-title span,
.chart-stats span,
.metric-label,
.app-version,
label span,
.calendar-top > span {
  font-size: 0.72rem !important;
  line-height: 1.1 !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase;
}

.primary-action,
.secondary-action,
.system-control-button,
.segmented button,
.calendar-view-switch button,
.theme-toggle,
nav a {
  font-size: 0.875rem !important;
  line-height: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

.dashboard-trend-svg path,
.dashboard-trend-svg polyline,
.performance-chart path,
.test-evolution path,
.test-evolution polyline,
.goal-route path,
.roadmap-chart path,
.vo2-panel-head path,
.sparkline path {
  stroke-width: 1.25 !important;
  vector-effect: non-scaling-stroke;
}

.volume-line,
.dashboard-trend-svg .dash-line-volume,
.roadmap-chart .roadmap-current,
.goal-route .goal-route-optimistic,
.goal-route .goal-route-target {
  stroke: var(--chart-1) !important;
  stroke-opacity: 0.94 !important;
}

.tss-line,
.dashboard-trend-svg .dash-line-tss,
.roadmap-chart .roadmap-required,
.goal-route .goal-route-pessimistic {
  stroke: var(--chart-2) !important;
  stroke-opacity: 0.9 !important;
}

.chart-grid line,
.dashboard-trend-svg line,
.test-evolution line,
.goal-route line,
.roadmap-chart line {
  stroke: var(--chart-grid) !important;
}

.performance-chart text,
.dashboard-trend-svg text,
.test-evolution svg text,
.goal-route text,
.roadmap-chart text,
.chart-labels text {
  fill: var(--chart-text) !important;
}

.volume-area,
.chart-fill,
.dashboard-volume-fill {
  fill: var(--chart-fill) !important;
}

.dashboard-trend-svg circle,
.performance-chart circle,
.test-evolution circle,
.goal-route circle,
.roadmap-chart circle,
.vo2-panel-head circle {
  fill: var(--chart-1) !important;
  stroke: var(--background) !important;
  stroke-width: 1.2 !important;
}

html[data-theme="light"] .dashboard-hero-panel::before,
html[data-theme="light"] .dashboard-panel::before,
html[data-theme="light"] .performance-chart-panel::before {
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 75, 11, 0.12), transparent 24%),
    linear-gradient(105deg, rgba(255, 75, 11, 0.055), transparent 38%),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.035) 0 1px, transparent 1px 76px) !important;
  opacity: 1 !important;
}

html[data-theme="light"] .dashboard-trend-svg .dash-line-tss,
html[data-theme="light"] .performance-chart .tss-line,
html[data-theme="light"] .test-evolution .dash-line-tss {
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.12));
}

html[data-theme="light"] .dashboard-trend-svg .dash-line-volume,
html[data-theme="light"] .performance-chart .volume-line {
  filter: drop-shadow(0 2px 5px rgba(225, 66, 10, 0.18));
}

.dashboard-goal-card svg circle:first-child {
  stroke: var(--chart-grid) !important;
}

.dashboard-goal-card svg circle:last-child {
  stroke: var(--chart-1) !important;
}

.dashboard-goal-card svg text {
  fill: var(--foreground) !important;
}

.metric-card,
.chart-stats div,
.roadmap-metric,
.goal-route-stat,
.vo2-source-card,
.type-card,
.timeline-item,
.admin-user-row {
  background:
    linear-gradient(180deg, rgba(255, 75, 11, 0.035), transparent 64%),
    var(--card) !important;
}

.metric-card strong,
.chart-stats strong,
.roadmap-metric strong,
.vo2-source-card strong,
.type-card strong {
  color: var(--primary) !important;
}

.hero-motivation,
.home-ai-agent,
.dashboard-hero-panel,
.performance-chart-panel {
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 75, 11, 0.12), transparent 28%),
    var(--card) !important;
}

.volume-line,
.dashboard-trend-svg .dash-line-volume,
.goal-route .goal-route-optimistic {
  filter: drop-shadow(0 0 8px rgba(255, 75, 11, 0.18));
}

.activity-card,
.calendar-month .activity,
.calendar-period .activity {
  background:
    linear-gradient(90deg, rgba(255, 75, 11, 0.14), transparent 58%),
    var(--card) !important;
  border-color: rgba(255, 75, 11, 0.28) !important;
}

.activity-card.is-planned,
.calendar-month .activity.is-planned,
.calendar-period .activity.is-planned {
  background:
    linear-gradient(90deg, rgba(255, 75, 11, 0.045), transparent 58%),
    var(--muted-surface) !important;
  border-color: var(--border) !important;
}

.distribution-fill,
.progress-fill,
.type-bar-fill,
.objective-progress {
  background: var(--primary) !important;
}

.danger-action {
  background: transparent !important;
  color: var(--orange-300) !important;
  border-color: rgba(255, 75, 11, 0.5) !important;
}

.danger-action .action-icon {
  stroke: var(--orange-300) !important;
}

@media (max-width: 900px) {
  .page-header h2,
  .hero h1,
  .modal-panel .section-title h3,
  .detail h2,
  .detail h3,
  .settings-header h3 {
    font-size: clamp(1.875rem, 8vw, 2.5rem) !important;
  }

  .section-title h3,
  .calendar-top h3,
  .chart-heading h3,
  .profile-edit-panel .section-title h3,
  .home-ai-agent .section-title h3,
  .focus-projection-head h3,
  .roadmap-head h3 {
    font-size: 1.125rem !important;
  }

  .primary-action,
  .secondary-action,
  .system-control-button,
  .segmented button,
  .calendar-view-switch button,
  .theme-toggle,
  nav a {
    font-size: 0.8125rem !important;
  }
}

@media (max-width: 640px) {
  .page-header {
    gap: 14px !important;
  }

  .page-header h2,
  .hero h1,
  .modal-panel .section-title h3,
  .detail h2,
  .detail h3,
  .settings-header h3 {
    font-size: clamp(1.75rem, 10vw, 2.25rem) !important;
    line-height: 1.12 !important;
  }

  .calendar-view-switch,
  .segmented {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .system-control-button {
    min-height: 40px !important;
    white-space: nowrap;
  }

.performance-chart svg,
.dashboard-trend-svg,
.test-evolution svg {
    min-height: 180px !important;
  }
}

/* 11RUN futuristic flat icon system */
.primary-action,
.secondary-action,
.danger-action,
.icon-button,
.system-control-button,
.segmented button,
.calendar-view-switch button {
  border-radius: 999px !important;
  min-height: 40px;
  padding-inline: 18px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.primary-action,
.system-control-button.is-active,
.segmented button.is-active,
.calendar-view-switch button.is-active {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-color: var(--primary) !important;
}

.secondary-action,
.icon-button,
.system-control-button,
.segmented button,
.calendar-view-switch button {
  background: rgba(255, 75, 11, 0.02) !important;
  color: var(--foreground) !important;
  border: 1px solid var(--line-strong) !important;
}

html[data-theme="light"] .secondary-action,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .system-control-button,
html[data-theme="light"] .segmented button,
html[data-theme="light"] .calendar-view-switch button {
  background: rgba(255, 75, 11, 0.035) !important;
}

.primary-action:hover,
.secondary-action:hover,
.danger-action:hover,
.icon-button:hover,
.system-control-button:hover,
.segmented button:hover,
.calendar-view-switch button:hover {
  transform: translateY(-1px);
  border-color: var(--primary) !important;
}

.action-icon,
.control-icon,
.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.primary-action .action-icon,
.system-control-button.is-active .control-icon,
.segmented button.is-active .control-icon,
.calendar-view-switch button.is-active .control-icon {
  stroke: currentColor !important;
}

nav a .nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 75, 11, 0.22);
  background: rgba(255, 75, 11, 0.04);
  display: grid;
  place-items: center;
}

nav a.is-active .nav-icon {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.12);
}

.panel,
.metric-card,
.calendar-month .day,
.calendar-period .day,
.period-week-card,
.profile-edit-panel,
.profile-history-panel,
.modal-panel,
.detail,
.home-ai-agent {
  position: relative;
}

.panel::after,
.metric-card::after,
.modal-panel::after,
.detail::after,
.home-ai-agent::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 75, 11, 0.24), transparent 22%, transparent 78%, rgba(255, 75, 11, 0.12)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%);
  opacity: 0.28;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.section-title span::before,
.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 8px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 75, 11, 0.08);
  vertical-align: 1px;
}

.chart-legend i,
.status-dot,
.activity::before {
  background: var(--primary) !important;
}

@media (max-width: 640px) {
  .primary-action,
  .secondary-action,
  .danger-action,
  .icon-button,
  .system-control-button,
  .segmented button,
  .calendar-view-switch button {
    min-height: 42px;
    padding-inline: 14px !important;
  }

  .action-icon,
  .control-icon {
    width: 16px;
    height: 16px;
  }
}

/* Home composition guard: keeps the AI panel from breaking the hero layout. */
.home-view .hero {
  min-height: 100dvh;
  display: block;
}

.home-view .hero-content {
  position: absolute;
  z-index: 2;
  left: clamp(28px, 5vw, 74px);
  bottom: clamp(44px, 7vh, 92px);
  width: min(600px, 46vw);
  padding: 0;
}

.home-view .hero-logo {
  width: min(270px, 28vw);
}

.home-view .hero h1 {
  max-width: 560px;
  font-size: clamp(2.35rem, 3.8vw, 3.5rem) !important;
}

.home-view .hero-motivation {
  max-width: 100%;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 75, 11, 0.26);
  border-radius: var(--radius);
  background: rgba(24, 24, 27, 0.62);
  backdrop-filter: blur(12px);
  font-size: clamp(1rem, 1.2vw, 1.25rem) !important;
}

.home-view .home-ai-agent {
  position: absolute !important;
  z-index: 3;
  right: clamp(24px, 4vw, 64px);
  bottom: clamp(42px, 7vh, 92px);
  width: min(430px, 30vw);
  max-height: min(56vh, 520px);
  overflow: hidden;
}

.home-view .home-ai-messages {
  max-height: min(24vh, 220px);
}

@media (max-width: 1180px) {
  .home-view .hero-content {
    width: min(560px, 52vw);
    left: 28px;
  }

  .home-view .home-ai-agent {
    right: 24px;
    width: min(360px, 34vw);
  }
}

@media (max-width: 900px) {
  .home-view .hero {
    min-height: auto;
    display: grid;
    gap: 16px;
    padding: 92px 16px 18px;
  }

  .home-view .hero-bg,
  .home-view .hero-shade {
    position: fixed;
  }

  .home-view .hero-content,
  .home-view .home-ai-agent {
    position: relative !important;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: none;
  }

  .home-view .hero-content {
    padding: 0;
  }

  .home-view .hero-logo {
    width: min(220px, 58vw);
  }

  .home-view .hero h1 {
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 3rem) !important;
  }

  .home-view .hero-motivation {
    font-size: 1rem !important;
  }

  .home-view .home-ai-agent {
    margin: 0;
    max-height: none;
  }
}
