/* FIT Studio density system
   Aligns every application surface with the compact training-analysis view. */
:root {
  --compact-gap-1: 5px;
  --compact-gap-2: 8px;
  --compact-gap-3: 12px;
  --compact-gap-4: 16px;
  --compact-radius: 11px;
  --compact-shadow: 0 5px 18px var(--shadow);
}

body { font-size: 13px; line-height: 1.42; }
.topbar { height: 56px; padding-inline: max(16px, calc((100vw - 1460px) / 2)); }
.brand { font-size: 18px; }
.main-nav { gap: 4px; }
.main-nav button { min-height: 40px; padding: 9px 14px; font-size: 12px; }
.user-actions { gap: 6px; }
.account-button, .theme-toggle, .logout-button { min-height: 34px; padding: 6px 9px; font-size: 10px; }
.account-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  flex: 0 0 26px;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 10px;
}
main { padding: 22px 18px 42px; }

button, .button { min-height: 34px; padding: 8px 12px; border-radius: 8px; font-size: 11px; }
.ghost { padding: 6px 9px; }
input, select, textarea { min-height: 36px; padding: 8px 10px; border-radius: 8px; font-size: 11px; }
label { gap: 4px; font-size: 10px; }
.eyebrow { font-size: 8px !important; letter-spacing: .13em; }

/* Icon-only controls retain their original circular geometry. The shared
   button minimum height must never stretch them into pills. */
:is(.analysis-info-button, .analysis-value-info-button, .metric-info-button,
  .info-tooltip, .integration-info-button) {
  min-width: var(--circle-size);
  width: var(--circle-size);
  min-height: var(--circle-size);
  height: var(--circle-size);
  flex: 0 0 var(--circle-size);
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
}
.analysis-info-button { --circle-size: 29px; }
.analysis-value-info-button { --circle-size: 19px; }
.metric-info-button { --circle-size: 30px; }
.panel#summary .metric-info-button { --circle-size: 26px; }
.info-tooltip { --circle-size: 25px; }
.integration-info-button { --circle-size: 32px; }

.hero, .activities-hero, .dashboard-hero, .coach-home-hero {
  margin-bottom: 16px;
  gap: 16px;
}
.hero h1, .activities-hero h1, .dashboard-hero h1, .coach-home-hero h1 {
  font-size: clamp(30px, 3.5vw, 42px);
}
.hero p, .activities-hero p, .dashboard-hero p, .coach-home-hero p { margin-block: 4px; font-size: 11px; }
.actions, .calendar-actions, .dashboard-actions { gap: 6px; }

.dropzone { min-height: 245px; border-radius: 14px; }
.dropzone .upload-icon { font-size: 40px; }
.dropzone h2 { font-size: 18px; }
.dropzone p { font-size: 10px; }
.status { margin-bottom: 9px; padding: 9px 11px; font-size: 11px; }

.tabs { border-radius: var(--compact-radius) var(--compact-radius) 0 0; }
.tabs button { min-height: 42px; padding: 10px 7px; font-size: 11px; }
.panel { min-height: 420px; padding: 16px; }
.section-head { gap: 14px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head label { max-width: 185px; }

.cards { gap: 9px; }
.card { min-height: 82px; padding: 12px; gap: 10px; border-radius: var(--compact-radius); box-shadow: var(--compact-shadow); }
.card .icon, .card .material-symbols-rounded { font-size: 21px; }
.card small { font-size: 9px; }
.card strong { font-size: 16px; }
.file-details { margin-bottom: 12px; border-radius: var(--compact-radius); }
.file-details div { padding: 11px 12px; }
.file-details small { font-size: 9px; }

.table-card, .editor, .profile-card, .coach-roster-card, .activity-calendar {
  border-radius: var(--compact-radius);
  box-shadow: var(--compact-shadow);
}
.table-head { padding: 11px 13px; }
.table-head h2 { font-size: 17px; }
.table-scroll { max-height: 520px; }
th, td { padding: 8px 10px; }
th { font-size: 9px; letter-spacing: .04em; }
td { font-size: 10.5px; }
.editor { max-width: 980px; padding: 16px; }
.editor h2 { font-size: 20px; }
.form-grid { gap: 10px; margin: 14px 0; }
hr { margin: 14px 0; }

/* Coach home */
.coach-roster-help { padding: 9px 12px; font-size: 9px; }
.coach-roster-table th { padding: 8px 11px; font-size: 8px; }
.coach-roster-table td { padding: 9px 11px; font-size: 10px; }
.coach-athlete-avatar { width: 29px; height: 29px; flex-basis: 29px; font-size: 10px; }
.coach-athlete-name { gap: 8px; }
.coach-athlete-name b { font-size: 11px; }
.coach-status { gap: 5px; padding: 4px 7px; font-size: 8px; }
.coach-roster-empty { padding: 28px 15px; }

/* Calendar */
.calendar-heading { margin-bottom: 9px; }
.calendar-heading h2 { font-size: 19px; }
.calendar-legend { gap: 10px; font-size: 9px; }
.calendar-weekdays span { padding: 8px 6px; font-size: 8px; }
.calendar-day { min-height: 105px; padding: 6px; }
.calendar-week-summary { padding: 8px; }
.calendar-activity { margin-top: 4px !important; }
.calendar-profile { height: 28px; margin-top: 3px; }

/* Dashboard */
.dashboard-top-grid, .dashboard-bottom-grid { gap: 10px; }
.dashboard-status-card, .today-plan-card, .dashboard-section { border-radius: var(--compact-radius); box-shadow: var(--compact-shadow) !important; }
.dashboard-status-card { min-height: 128px; padding: 15px; gap: 13px; }
.dashboard-status-card .status-orb { width: 48px; height: 48px; flex-basis: 48px; }
.dashboard-status-card h2 { font-size: 20px; }
.dashboard-status-card p { font-size: 10px; }
.dashboard-status-card strong { margin-top: 7px; font-size: 10px; }
.today-plan-card { padding: 15px; }
.today-plan-card header h2 { font-size: 18px; }
.today-plan-card header > .material-symbols-rounded { width: 34px; height: 34px; border-radius: 9px; font-size: 19px; }
.today-plan-item { margin-top: 9px; padding: 9px; }
.today-plan-item b { font-size: 12px; }
.dashboard-section { margin-top: 10px; padding: 14px; }
.dashboard-section-head { margin-bottom: 10px; }
.dashboard-section-head h2 { font-size: 18px; }
.athlete-snapshot { gap: 7px; margin-bottom: 10px; }
.athlete-snapshot > div, .wellness-latest > div { min-height: 62px; padding: 9px; border-radius: 9px; }
.athlete-snapshot small, .wellness-latest small { color: var(--accent) !important; font-size: 8px; font-weight: 900; letter-spacing: .12em; line-height: 1.2;}
.athlete-snapshot strong, .wellness-latest strong { margin-top: 3px; font-size: 18px; }
.wellness-charts { gap: 8px; margin-top: 8px; }
.wellness-charts article { padding: 9px; border-radius: 9px; }
.wellness-charts svg { height: 84px; }
.dashboard-power-chart { padding: 7px; border-radius: 9px; }
.dashboard-power-chart svg { height: 235px; }
.dashboard-power-table { margin-top: 8px; }
.dashboard-findings, .dashboard-activities { gap: 6px; }
.dashboard-findings article, .dashboard-activities article { gap: 8px; padding: 8px 9px; border-radius: 8px; }

/* Summary, intervals, climbs and sensors */
.athlete-comment-card, .activity-wellness-card { margin: 10px 0; padding: 12px; border-radius: var(--compact-radius); }
.activity-wellness-card header { margin-bottom: 9px; }
.profile-card { margin-top: 11px; padding: 13px; }
.profile-head { gap: 12px; }
.profile-head h3 { font-size: 16px; }
.profile-tools { gap: 7px; }
.axis-control { gap: 6px; font-size: 9px; }
.axis-toggle button { min-width: 64px; min-height: 28px; padding: 5px 8px; font-size: 9px; }
.elevation-profile { min-height: 220px; margin-top: 10px; }
.shift-summary { gap: 7px; }
.shift-summary > div { padding: 9px; }

/* Profile and all modal surfaces */
dialog { max-height: calc(100dvh - 24px); border-radius: 14px !important; }
:is(.profile-dialog-content, .activity-dialog, .users-dialog-content,
  .metric-info-dialog, .cp-history-dialog, .interval-structure-dialog) {
  border-radius: 14px;
}
:is(.metric-info-dialog-head, .cp-history-dialog-head, .activity-dialog-head,
  .zone-dialog-head) { padding: 12px 14px; }
:is(.metric-info-dialog-head, .cp-history-dialog-head, .activity-dialog-head,
  .zone-dialog-head) h2 { font-size: 19px; }
.profile-dialog-layout { min-height: 0; }
.profile-sidebar { padding: 12px; }
.profile-sidebar nav { gap: 4px; }
.profile-sidebar nav button { min-height: 34px; padding: 7px 9px; font-size: 10px; }
.profile-content { padding: 15px; }
.profile-content h2, .profile-content h3 { margin-block: 0 8px; }
.integration-card { padding: 12px; border-radius: 10px; }
.integration-brand { gap: 9px; }
.integration-brand h3 { font-size: 14px; }
.integration-brand p { font-size: 9px; }
.cp-history-dialog-body { padding: 12px 14px; }
.users-dialog-content { padding: 14px; }
.users-table { margin-top: 10px; }

/* Analysis remains the reference density and only receives shared radii. */
.performance-insights { border-radius: var(--compact-radius); }
.performance-insights-head { gap: 10px; margin-bottom: 9px; }
.performance-insights-head h2 { font-size: 19px; }
.performance-card { border-radius: var(--compact-radius); box-shadow: var(--compact-shadow); }

/* Login is part of the same product, but retains a clear primary action. */
.login-card { width: min(390px, calc(100% - 24px)); padding: 24px; border-radius: 16px; }
.login-card .logo { width: 42px; height: 42px; border-radius: 11px; }
.login-card h1 { font-size: 34px; }
.login-card form { gap: 11px; margin-top: 16px; }

@media (max-width: 900px) {
  main { padding-inline: 12px; }
  .topbar { height: auto; min-height: 54px; padding: 8px 12px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .main-nav button { min-height: 38px; padding: 8px 12px; flex: 0 0 auto; }
  .dashboard-power-chart svg { height: 205px; }
}

@media (max-width: 650px) {
  body { font-size: 12px; }
  main { padding: 14px 8px 28px; }
  .topbar { gap: 6px; }
  .brand { font-size: 16px; }
  .user-actions { margin-left: auto; }
  .account-button #accountName, .theme-toggle-label, .logout-button span:last-child { display: none; }
  .hero, .activities-hero, .dashboard-hero, .coach-home-hero { margin-bottom: 11px; }
  .hero h1, .activities-hero h1, .dashboard-hero h1, .coach-home-hero h1 { font-size: 28px; }
  .panel { padding: 8px; }
  .tabs button { min-width: 135px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { min-height: 72px; }
  .calendar-day { min-height: 58px; }
  .dashboard-section { padding: 10px; }
  .dashboard-status-card, .today-plan-card { padding: 11px; }
  .athlete-snapshot, .wellness-latest, .activity-wellness-card .wellness-latest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: 7px 8px; }
  .profile-content, .users-dialog-content { padding: 10px; }
}

/* Dashboard overview: four consistent, accent-led summary tiles. */
.dashboard-top-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}
.dashboard-overview-card {
  position: relative;
  min-width: 0;
  min-height: 210px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--compact-radius);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 46%), var(--panel) !important;
  box-shadow: var(--compact-shadow) !important;
}
.dashboard-overview-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
}
.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.dashboard-card-head small {
  display: block;
  color: var(--accent) !important;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.2;
}
.dashboard-card-head h2,
.dashboard-status-card .dashboard-card-head h2,
.today-plan-card .dashboard-card-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}
.dashboard-card-head > .material-symbols-rounded {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 13%, var(--panel-raised)) !important;
  color: var(--accent) !important;
  font-size: 19px;
}
.dashboard-status-card {
  display: block;
  min-height: 210px;
  padding: 15px;
}
.dashboard-status-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dashboard-status-card .status-orb {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-width: 8px;
}
.dashboard-status-card h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
}
.dashboard-status-card p {
  font-size: 9px;
  line-height: 1.45;
}
.dashboard-status-card strong {
  margin-top: 7px;
  font-size: 9px;
  line-height: 1.4;
}
.dashboard-overview-card .dashboard-findings,
.dashboard-overview-card .dashboard-activities,
.dashboard-overview-card #todayPlan {
  width: 100%;
  max-height: 178px;
  overflow: auto;
  scrollbar-width: thin;
}
.dashboard-overview-card .dashboard-findings article,
.dashboard-overview-card .dashboard-activities article {
  padding: 8px;
  background: var(--panel-raised);
}
.dashboard-overview-card .dashboard-findings b,
.dashboard-overview-card .dashboard-activities b {
  font-size: 10px;
  line-height: 1.35;
}
.dashboard-overview-card .dashboard-findings p,
.dashboard-overview-card .dashboard-activities span,
.dashboard-overview-card .dashboard-activities small {
  font-size: 8px;
}
.dashboard-overview-card .dashboard-findings article > .material-symbols-rounded {
  font-size: 17px;
}
.dashboard-overview-card .dashboard-good {
  padding: 10px;
  font-size: 10px;
}
.dashboard-overview-card .today-plan-item {
  margin-top: 0;
  padding: 9px;
  border: 1px solid var(--line);
}
.dashboard-overview-card .today-plan-item + .today-plan-item {
  margin-top: 7px;
}
.dashboard-overview-card .today-plan-item b {
  font-size: 11px;
}
.dashboard-overview-card .today-plan-item span,
.dashboard-overview-card .today-plan-item small {
  font-size: 8px;
}
.dashboard-overview-card .today-plan-item .calendar-profile,
.dashboard-overview-card .dashboard-activity-open .calendar-profile {
  height: 34px;
  margin-block: 6px 4px;
}
.dashboard-overview-card .today-plan-item .calendar-profile {
  width: calc(100% + 18px);
  max-width: none;
  margin-inline: -9px;
  border-radius: 0;
}
.dashboard-latest-card .dashboard-calendar-link {
  margin-top: 9px;
  padding: 7px 9px;
  font-size: 9px;
}
@media (max-width: 1100px) {
  .dashboard-top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .dashboard-top-grid { grid-template-columns: 1fr; }
  .dashboard-overview-card,
  .dashboard-status-card { min-height: 0; padding: 12px; }
}

/* Calendar period navigation: one control, with native keyboard/touch pickers. */
.calendar-heading { gap: 16px; flex-wrap: wrap; }
.calendar-date-navigation { display: flex; align-items: center; gap: 10px; min-width: 0; }
.calendar-heading .calendar-date-announcement {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.calendar-date-control {
  display: flex; align-items: center; padding: 4px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  box-shadow: 0 2px 6px var(--shadow);
}
.calendar-date-control .calendar-date-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 40px; width: 40px; height: 44px; padding: 0; border: 0;
  border-radius: 11px; background: transparent; color: var(--muted); box-shadow: none;
  transition: background .15s ease, color .15s ease;
}
.calendar-date-control .calendar-date-arrow:hover:not(:disabled) {
  background: var(--soft); color: var(--ink); transform: none;
}
.calendar-date-arrow .material-symbols-rounded { font-size: 24px; }
.calendar-date-fields { display: flex; align-items: center; margin: 0 3px; }
.calendar-date-field { position: relative; display: block; margin: 0; border-radius: 9px; }
.calendar-date-year { width: 89px; }
.calendar-date-month { width: 139px; border-left: 1px solid var(--line); border-radius: 0 9px 9px 0; }
.calendar-date-caption {
  position: absolute; left: 12px; top: 5px; z-index: 1; pointer-events: none;
  color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .09em;
  line-height: 12px; text-transform: uppercase;
}
.calendar-date-field select {
  appearance: none; display: block; width: 100%; height: 48px; min-height: 48px;
  margin: 0; padding: 18px 28px 4px 12px; border: 0; border-radius: inherit;
  background: transparent; color: var(--ink); box-shadow: none;
  font: inherit; font-size: 15px; font-weight: 750; line-height: 22px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.calendar-date-field select:hover { background: var(--panel-raised); }
.calendar-date-field select option { background: var(--panel); color: var(--ink); }
.calendar-date-chevron {
  position: absolute; right: 8px; top: 23px; pointer-events: none;
  color: var(--muted); font-size: 16px;
}
.calendar-date-navigation .calendar-today-button {
  min-width: 48px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); color: var(--ink); font-size: 12px; font-weight: 700;
  box-shadow: none; white-space: nowrap;
}
.calendar-date-navigation .calendar-today-button:hover { background: var(--soft); transform: none; }
.calendar-date-navigation .calendar-today-button[aria-current="date"] {
  color: var(--accent); border-color: var(--accent);
}
.calendar-date-navigation button:focus-visible,
.calendar-date-field select:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
@media (max-width: 600px) {
  .calendar-date-navigation { width: 100%; gap: 8px; }
  .calendar-date-control { flex: 1; min-width: 0; border-radius: 13px; }
  .calendar-date-fields { flex: 1; min-width: 0; margin: 0; }
  .calendar-date-year { width: 80px; flex-shrink: 0; }
  .calendar-date-month { flex: 1; width: auto; min-width: 105px; }
  .calendar-date-control .calendar-date-arrow { flex-basis: 32px; width: 32px; }
  .calendar-date-field select { font-size: 14px; padding-left: 9px; padding-right: 22px; }
  .calendar-date-caption { left: 9px; }
  .calendar-date-chevron { right: 4px; }
  .calendar-heading .calendar-legend { width: 100%; justify-content: flex-end; font-size: 10px; }
}
@media (max-width: 360px) {
  .calendar-date-navigation { flex-wrap: wrap; }
  .calendar-date-control { flex-basis: 100%; }
  .calendar-date-navigation .calendar-today-button { margin-left: auto; }
}
