/* Коуч — мини-приложение Telegram. Стиль по спецификации редизайна (28.09). */

/* --- Шрифты (локально, OFL; см. fonts/OFL.txt) --- */

/* Unbounded — заголовки, крупные цифры, вкладки; вес 600 */
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/unbounded-600-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/unbounded-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Golos Text — весь остальной текст; переменный шрифт 400–500 */
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(../fonts/golos-text-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(../fonts/golos-text-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Атрибут hidden перебивается селекторами класса — переопределяем принудительно */
[hidden] { display: none !important; }

/* --- Токены стиля --- */
:root {
  --c-text: #0A0A0A;
  --c-secondary: #6B6B6B;
  --c-line: #E6E6E6;
  --c-accent: #0047FF;
  --c-food: #FF6A1A;
  --c-missed: #FF6A1A;
  --c-bg: #FFFFFF;
  --c-surface: #F6F6F7;
  --z-recovery: #DCE6FF;
  --z-z2: #9DB8FF;
  --z-threshold: #0047FF;
  --z-vo2: #0A1F66;
  --z-strength: #C9CCD3;
  --f-head: "Unbounded", system-ui, sans-serif;
  --f-text: "Golos Text", system-ui, sans-serif;
  --tap: 44px;
  --tabbar-h: calc(var(--tap) + 1px);
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-text);
  font-size: 16px;
  line-height: 1.45;
}

/* --- Обёртка: только телефон (НФ-08) --- */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Строка предупреждений --- */
.warnings {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--c-secondary);
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface);
}

/* --- Экраны --- */
.screens {
  flex: 1;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}

.screen {
  display: none;
  padding: 16px;
}

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

.screen-title {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.screen-stub {
  font-size: 15px;
  color: var(--c-secondary);
  margin: 0;
}

/* --- Экран ошибки --- */
.error-title {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  margin: 24px 0 8px;
}

.error-text {
  font-size: 15px;
  color: var(--c-secondary);
  margin: 0 0 16px;
}

/* --- Вкладки --- */
.tablist {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 10;
  display: flex;
  background: var(--c-bg);
  border-top: 1px solid var(--c-line);
  padding-bottom: var(--safe-b);
}

.tab {
  flex: 1;
  min-height: var(--tap);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 13px;
  color: var(--c-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.tab.is-active {
  color: var(--c-text);
  border-bottom-color: var(--c-accent);
}

/* --- Сегодня --- */
[data-screen="today"] {
  padding: 0;
  font-variant-numeric: tabular-nums;
}

.today-header {
  padding: 24px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.today-header h1 {
  margin: 0;
  font-family: var(--f-head);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.6px;
}

.today-header > span,
.today-loading {
  font-size: 14px;
  color: var(--c-secondary);
}

.today-loading {
  padding: 0 24px;
}

.today-workout {
  display: block;
  text-decoration: none;
  background: var(--c-accent);
  color: #FFFFFF;
  padding: 20px 24px 8px;
}

.today-workout:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: -4px;
}

.today-workout h2,
.day-name,
.day-header h1 {
  text-wrap: balance;
}

.today-eyebrow {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: var(--c-secondary);
}

.today-workout .today-eyebrow,
.today-stat-label,
.today-captions {
  color: #C9D7FF;
}

.today-workout h2,
.today-rest h2 {
  font-family: var(--f-head);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.today-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.today-stat-value {
  font-family: var(--f-head);
  font-size: 26px;
}

.today-stat-label {
  font-size: 13px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.today-workout svg,
.today-rest svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 18px;
}

.today-captions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 13px;
  margin-top: 6px;
}

.today-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  margin-top: 6px;
  font-size: 16px;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.today-rest {
  background: #EEF2FF;
  padding: 20px 24px 8px;
}

.today-rest .today-eyebrow {
  color: #3A4A80;
}

.today-rest h2 {
  font-size: 26px;
}

.today-rest svg {
  margin-top: 12px;
}

.today-rest p {
  margin: 8px 0 0;
  color: #1F2A4D;
  overflow-wrap: anywhere;
}

.today-rest .today-details {
  color: var(--c-accent);
}

.today-food {
  padding: 22px 24px 16px;
}

.today-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--c-secondary);
}

.today-left-value {
  font-family: var(--f-head);
  font-size: 48px;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--c-text);
}

.today-food.is-over .today-left-value {
  color: var(--c-food);
}

.food-bar,
.macro-bar {
  background: #F1F1F1;
  overflow: hidden;
}

.food-bar {
  height: 12px;
  border-radius: 6px;
  margin-top: 14px;
}

.food-bar-fill {
  height: 100%;
  background: var(--c-food);
}

.today-food-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--c-secondary);
  margin-top: 6px;
}

.today-macros {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.today-macro-label,
.today-macro-amount > span + span {
  font-size: 13px;
  color: var(--c-secondary);
}

.today-macro-amount {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.today-macro-amount > span:first-child {
  font-family: var(--f-head);
  font-size: 20px;
}

.macro-bar {
  height: 3px;
  margin-top: 6px;
}

.macro-bar-fill {
  height: 100%;
  background: var(--c-text);
}

.today-macros > div:first-child .macro-bar-fill {
  background: var(--c-food);
}

.today-food-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 16px;
  font-size: 14px;
}

.today-hint {
  background: var(--c-food);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.today-meals {
  color: var(--c-secondary);
}

.today-evening {
  color: var(--c-text);
  margin: 0;
  margin-top: 12px;
  font-size: 14px;
}

.today-food details {
  margin-top: 12px;
  border-top: 1px solid var(--c-line);
  padding-top: 10px;
}

.today-food summary {
  font-size: 15px;
  font-weight: 500;
  min-height: var(--tap);
  cursor: pointer;
}

.today-food details p {
  font-size: 14px;
  color: var(--c-secondary);
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
}

.today-weather {
  margin: 0 24px;
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  border-top: 1px solid var(--c-line);
  min-height: var(--tap);
  color: var(--c-text);
  text-decoration: none;
}

.today-temp {
  font-family: var(--f-head);
  font-size: 28px;
  letter-spacing: -1px;
}

.today-weather-copy {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.today-weather-copy > span {
  display: block;
}

.today-weather-copy .today-window-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--c-secondary);
  margin-top: 2px;
}

.today-window-hours {
  font-size: 14px;
  font-weight: 500;
  background: var(--c-accent);
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 999px;
}

/* --- Погода --- */
[data-screen="weather"] {
  padding: 0 0 16px;
  font-variant-numeric: tabular-nums;
}

.weather-header {
  padding: 10px 24px 18px;
}

.weather-back {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: 16px;
  font-weight: 500;
  color: var(--c-accent);
  text-decoration: none;
}

.weather-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.weather-header h1 {
  margin: 0;
  font-family: var(--f-head);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.6px;
}

.weather-sub,
.weather-now-detail {
  font-size: 14px;
  color: var(--c-secondary);
  margin: 4px 0 0;
}

.weather-now {
  text-align: right;
}

.weather-now-temp {
  font-family: var(--f-head);
  font-size: 56px;
  letter-spacing: -3px;
  line-height: 1;
}

.weather-now > span {
  display: block;
}

.weather-window {
  background: var(--c-accent);
  color: #FFFFFF;
  padding: 18px 24px;
}

.weather-window h2 {
  font-family: var(--f-head);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.weather-window p {
  font-size: 15px;
  margin: 6px 0 0;
}

.weather-today {
  padding: 22px 24px 8px;
}

.weather-chart-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
}

.weather-today h2,
.weather-tomorrow h2 {
  font-family: var(--f-head);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.weather-chart-heading > span {
  font-size: 13px;
  color: var(--c-secondary);
}

.weather-chart,
.weather-wind-row {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

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

.weather-temp {
  fill: none;
  stroke: var(--c-text);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.weather-rain {
  fill: var(--c-accent);
}

.weather-band {
  fill: var(--z-recovery);
}

.weather-baseline {
  stroke: var(--c-line);
}

.weather-wind {
  stroke: var(--c-secondary);
  stroke-width: 1.5;
  fill: none;
}

.weather-hour,
.weather-wind-speed,
.weather-temp-scale {
  font-family: var(--f-text);
  font-size: 13px;
  fill: var(--c-secondary);
}

.weather-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--c-secondary);
  margin-top: 8px;
}

.weather-legend > span:first-child::before,
.weather-legend > span:nth-child(2)::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 3px;
  background: var(--c-text);
  margin-right: 6px;
  vertical-align: middle;
}

.weather-legend > span:nth-child(2)::before {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--c-accent);
}

.weather-tomorrow {
  padding: 18px 24px 8px;
}

.weather-tomorrow-hours {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}

.weather-tomorrow-hour {
  padding: 12px 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.weather-tomorrow-hour + .weather-tomorrow-hour {
  border-left: 1px solid var(--c-line);
}

.weather-tomorrow-time,
.weather-tomorrow-precip {
  color: var(--c-secondary);
}

.weather-tomorrow-temp {
  font-family: var(--f-head);
  font-size: 22px;
  margin: 4px 0;
}

.weather-tomorrow-precip {
  margin-top: 2px;
}

.weather-radar {
  margin: 10px 24px 0;
  min-height: var(--tap);
  padding: 4px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--c-text);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--c-text);
  text-decoration: none;
}

.weather-loading {
  padding: 0 24px;
  font-size: 14px;
  color: var(--c-secondary);
}

.weather-header,
.weather-window,
.weather-chart-heading,
.weather-radar {
  overflow-wrap: anywhere;
}

/* --- Тренировки --- */
[data-screen="workouts"] {
  padding: 0 0 16px;
  font-variant-numeric: tabular-nums;
}

.workouts-header {
  padding: 24px 24px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.workouts-header h1 {
  margin: 0;
  font-family: var(--f-head);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.6px;
}

.workouts-header > span,
.workouts-loading,
.workouts-empty {
  font-size: 14px;
  color: var(--c-secondary);
}

.workouts-loading,
.workouts-empty {
  padding: 0 24px;
}

.week-current .week-overview {
  padding: 12px 24px 16px;
}

.week-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 10px;
}

.week-heading h2 {
  font-family: var(--f-head);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.week-heading > span {
  font-size: 14px;
  color: var(--c-secondary);
}

.week-heading b {
  font-weight: 500;
  color: var(--c-text);
}

.week-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
}

.week-baseline {
  stroke: var(--c-line);
}

.week-dot {
  fill: var(--z-strength);
}

.week-chart text {
  font-family: var(--f-text);
  font-size: 13px;
  fill: var(--c-secondary);
}

.week-chart text.is-today {
  fill: var(--c-accent);
  font-weight: 500;
}

.week-bar.zone-recovery { fill: var(--z-recovery); }
.week-bar.zone-z2 { fill: var(--z-z2); }
.week-bar.zone-threshold { fill: var(--z-threshold); }
.week-bar.zone-vo2 { fill: var(--z-vo2); }
.week-bar.zone-strength { fill: var(--z-strength); }
.week-bar.zone-missed { fill: var(--c-missed); }

.week-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--c-secondary);
}

.week-legend > span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.day-zone.zone-recovery,
.week-legend .zone-recovery { background: var(--z-recovery); }
.day-zone.zone-z2,
.week-legend .zone-z2 { background: var(--z-z2); }
.day-zone.zone-threshold,
.week-legend .zone-threshold { background: var(--z-threshold); }
.day-zone.zone-vo2,
.week-legend .zone-vo2 { background: var(--z-vo2); }
.day-zone.zone-strength,
.week-legend .zone-strength { background: var(--z-strength); }
.day-zone.zone-missed { background: var(--c-missed); }

.day-row {
  display: grid;
  grid-template-columns: 10px 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 4px 0;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-text);
  text-decoration: none;
  box-sizing: border-box;
}

.day-zone {
  width: 10px;
  height: 28px;
  border-radius: 3px;
}

.day-label,
.day-right {
  font-size: 14px;
  color: var(--c-secondary);
}

.day-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.day-name {
  display: block;
  font-size: 16px;
}

.day-row[data-status="rest"] .day-name {
  font-size: 15px;
  color: var(--c-secondary);
}

.day-row[data-status="missed"] .day-name {
  text-decoration: line-through;
  color: var(--c-secondary);
}

.week-current .week-rows {
  padding: 0 24px;
}

.week-current .week-rows .day-row:not([data-status="rest"]) {
  min-height: 52px;
}

.day-row.is-today {
  min-height: 68px;
  padding: 8px 24px;
  background: var(--c-accent);
  color: #FFFFFF;
  border: 0;
}

.week-current .week-rows .day-row.is-today {
  margin: 0 -24px;
  min-height: 68px;
}

.day-row.is-today .day-zone {
  height: 36px;
  background: #FFFFFF;
}

.day-row.is-today .day-label,
.day-row.is-today .day-right {
  color: inherit;
  font-weight: 500;
}

.day-row.is-today .day-name {
  font-size: 17px;
  font-weight: 500;
}

.day-meta {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: #C9D7FF;
}

.week-past {
  margin-top: 14px;
  background: var(--c-surface);
  padding: 20px 24px 12px;
}

.week-past .week-rows {
  margin-top: 10px;
}

.week-past .day-row {
  min-height: 48px;
}

.week-rows .day-row:last-child {
  border-bottom: 0;
}

.week-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.week-count {
  font-family: var(--f-head);
  font-size: 30px;
  letter-spacing: -1px;
}

.week-count > span {
  font-size: 20px;
  color: var(--c-secondary);
}

.week-segments {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}

.week-seg {
  height: 8px;
  border-radius: 2px;
  background: var(--c-missed);
}

.week-seg.is-done {
  background: var(--c-accent);
}

.week-done-label {
  font-size: 13px;
  color: var(--c-secondary);
  margin-top: 4px;
}

.badge-missed {
  display: inline-block;
  background: var(--c-missed);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
}

.icon-done {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.replan {
  margin: 16px 24px 0;
  padding: 8px 12px;
  min-height: 52px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--c-text);
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.workouts-header,
.week-heading,
.replan {
  overflow-wrap: anywhere;
}

/* --- День тренировки --- */
[data-screen="day"] {
  padding: 0 0 16px;
  font-variant-numeric: tabular-nums;
}

.day-header { padding: 10px 24px 14px; }
.day-back {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: 16px;
  font-weight: 500;
  color: var(--c-accent);
  text-decoration: none;
}
.day-date { font-size: 14px; color: var(--c-secondary); margin: 0; }
.day-header h1 {
  margin: 6px 0 0;
  font-family: var(--f-head);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.6px;
  overflow-wrap: anywhere;
}
.day-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.day-stat-value { font-family: var(--f-head); font-size: 24px; }
.day-stat-label { font-size: 13px; color: var(--c-secondary); overflow-wrap: anywhere; }
.day-chart { background: #EEF2FF; padding: 16px 24px 14px; }
.day-chart svg { display: block; width: 100%; height: auto; }
.step-bar.zone-recovery { fill: var(--z-recovery); }
.step-bar.zone-z2 { fill: var(--z-z2); }
.step-bar.zone-threshold { fill: var(--z-threshold); }
.step-bar.zone-vo2 { fill: var(--z-vo2); }
.step-bar.zone-strength { fill: var(--z-strength); }
.ftp-line { stroke: #3A4A80; stroke-dasharray: 2 4; }
.step-baseline { stroke: var(--z-z2); }
.step-label, .ftp-label { font-family: var(--f-text); font-size: 13px; }
.step-label { fill: var(--c-text); font-weight: 500; }
.ftp-label { fill: #3A4A80; }
.step-axis { display: flex; justify-content: space-between; font-size: 13px; color: #3A4A80; margin-top: 4px; }
.day-steps { padding: 8px 24px 0; }
.step-row {
  display: grid;
  grid-template-columns: 10px 76px minmax(0, 1fr);
  gap: 10px;
  min-height: 40px;
  align-items: center;
  border-bottom: 1px solid var(--c-line);
  font-size: 15px;
  padding: 4px 0;
  overflow-wrap: anywhere;
}
.step-row:last-child { border-bottom: 0; }
.step-marker { width: 10px; height: 20px; border-radius: 2px; background: var(--z-recovery); }
.step-row.is-work .step-marker { background: var(--z-threshold); }
.step-duration { color: var(--c-secondary); }
.day-notes, .day-done, .applied, .day-loading { margin: 12px 24px; font-size: 14px; overflow-wrap: anywhere; }
.day-notes, .day-loading { color: var(--c-secondary); }
.applied { color: var(--c-accent); }
.day-review { margin: 16px 24px; font-size: 15px; overflow-wrap: anywhere; }
.day-review h2 { font-family: var(--f-head); font-size: 15px; margin: 0; }
.day-review p { margin: 8px 0; }
.day-review > span { font-size: 13px; color: var(--c-secondary); }
.discuss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  margin: 0 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--c-accent);
  text-decoration: none;
}
.day-actions { margin: 12px 24px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.day-actions button {
  min-height: var(--tap);
  padding: 8px;
  border: 1px solid var(--c-text);
  border-radius: 10px;
  background: var(--c-bg);
  color: var(--c-text);
  font: 500 15px var(--f-text);
  overflow-wrap: anywhere;
}
.day-actions button:first-child { background: var(--c-text); color: #FFFFFF; }
.day-dialog-host { position: fixed; inset: 0; z-index: 20; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 10, 0.4); touch-action: none; }
.draft, .day-picker, .day-variants, .day-loading-dialog {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--c-bg);
  border-radius: 18px 18px 0 0;
  padding: 16px 24px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.day-dialog-host h2 { font-family: var(--f-head); font-size: 18px; font-weight: 600; margin: 0; }
.day-dialog-host button {
  min-height: var(--tap);
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font: 500 16px var(--f-text);
  color: var(--c-text);
  background: var(--c-surface);
  overflow-wrap: anywhere;
}
.day-dialog-host button[disabled] { opacity: 0.55; }
.day-dialog-host .cancel { background: transparent; }
.day-dialog-host .apply { background: var(--c-accent); color: #FFFFFF; }
.apply[disabled] { opacity: 0.55; }
.date-choices, .variant-choices { display: flex; flex-direction: column; gap: 8px; }
.date-choices button, .variant-choices button { text-align: left; }
.variant-name, .variant-meta, .variant-why { display: block; }
.variant-name { font-weight: 500; }
.variant-meta { font-size: 13px; color: var(--c-secondary); margin-top: 4px; }
.variant-why { font-size: 14px; margin-top: 6px; }
.draft-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.draft-before, .draft-after { background: var(--c-surface); border-radius: 12px; padding: 12px; }
.draft-after { background: var(--c-accent); color: #FFFFFF; }
.draft-comparison h3 { font-family: var(--f-text); font-size: 13px; font-weight: 400; margin: 0; color: var(--c-secondary); }
.draft-after h3 { color: #C9D7FF; }
.draft-comparison p { margin: 6px 0 0; }
.draft-note, .draft-warning { margin: 0; }
.draft-warning { color: var(--c-missed); }

/* --- Динамика --- */
[data-screen="dynamics"] { padding: 0 0 16px; font-variant-numeric: tabular-nums; }
.dynamics-header { padding: 10px 24px 0; }
.dynamics-header h1 { margin: 0; font-family: var(--f-head); font-size: 26px; font-weight: 600; letter-spacing: -0.6px; }
.dynamics-loading { padding: 0 24px; color: var(--c-secondary); }
.dynamics-ranges { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 24px 16px; }
.range-btn { min-height: var(--tap); padding: 0 14px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-bg); color: var(--c-text); font: inherit; font-size: 14px; cursor: pointer; }
.range-btn[aria-pressed="true"] { background: var(--c-text); color: #FFFFFF; border-color: var(--c-text); font-weight: 600; }
.range-btn[disabled] { opacity: 0.55; cursor: wait; }
.form-block { background: var(--c-accent); color: #FFFFFF; padding: 20px 24px 18px; }
.form-block h2, .weight-block h2, .rides h2, .records h2 { margin: 0; font-family: var(--f-text); font-size: 13px; font-weight: 500; color: var(--c-secondary); }
.form-block h2 { color: #C9D7FF; }
.form-value, .weight-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.form-value { gap: 12px; }
.form-value strong, .weight-value strong { font-family: var(--f-head); font-weight: 600; font-size: 44px; letter-spacing: -1.5px; line-height: 1; }
.form-value span { font-size: 15px; }
.form-status { display: flex; gap: 20px; margin-top: 6px; color: #C9D7FF; font-size: 14px; }
.form-status b { color: #FFFFFF; font-weight: 600; }
.form-block svg, .weight-block svg, .monthly svg { display: block; width: 100%; height: auto; overflow: visible; margin-top: 14px; }
.form-grid { stroke: #FFFFFF; stroke-opacity: 0.18; }
.form-area { fill: #FFFFFF; opacity: 0.14; }
.form-atl { fill: none; stroke: #9DB8FF; stroke-width: 1.5; }
.form-ctl, .form-forecast { fill: none; stroke: #FFFFFF; stroke-width: 2.5; }
.form-forecast { stroke-dasharray: 4 4; }
.form-today { fill: #FFFFFF; }
.form-today-line { stroke: #FFFFFF; stroke-opacity: 0.5; stroke-dasharray: 2 3; }
.form-block text { fill: #C9D7FF; font-family: var(--f-text); font-size: 13px; }
.form-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 13px; color: #C9D7FF; }
.form-legend span { display: flex; align-items: center; gap: 6px; }
.form-legend i { display: inline-block; width: 16px; height: 3px; background: #FFFFFF; }
.form-legend .legend-atl { height: 2px; background: #9DB8FF; }
.weight-block { padding: 22px 24px 20px; }
.weight-value > span { font-size: 16px; color: var(--c-secondary); }
.weight-trend { margin-left: auto; padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--c-accent); color: #FFFFFF; }
.weight-line { fill: none; stroke: var(--c-text); stroke-width: 2; }
.weight-point { fill: var(--c-text); }
.weight-latest { fill: var(--c-accent); }
.weight-plan { stroke: var(--c-secondary); stroke-width: 1; stroke-dasharray: 4 4; }
.weight-block text { fill: var(--c-secondary); font-family: var(--f-text); font-size: 13px; }
.weight-caption { margin: 4px 0 0; font-size: 13px; color: var(--c-secondary); }
.rides { padding: 4px 24px 18px; }
.ride { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; min-height: var(--tap); border-bottom: 1px solid var(--c-surface); color: var(--c-text); text-decoration: none; }
.ride:last-child { border-bottom: 0; }
.ride-marker { width: 10px; height: 40px; border-radius: 3px; background: var(--z-z2); }
.ride-copy { min-width: 0; overflow-wrap: anywhere; }
.ride-title, .ride-line, .ride-extra, .ride-review { display: block; }
.ride-title { font-size: 16px; font-weight: 600; }
.ride-line { font-size: 14px; margin-top: 2px; }
.ride-extra, .ride-review { font-size: 13px; color: var(--c-secondary); margin-top: 2px; }
.ride-review { color: var(--c-accent); }
.ride-tss { text-align: right; }
.ride-tss b { display: block; font-family: var(--f-head); font-size: 18px; font-weight: 600; }
.ride-tss > span { font-size: 13px; color: var(--c-secondary); }
.records { padding: 20px 24px; background: var(--c-surface); }
.record-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.record-cells strong { display: block; font-family: var(--f-head); font-size: 28px; font-weight: 600; letter-spacing: -1px; }
.record-cells span, .records p { font-size: 13px; color: var(--c-secondary); }
.records p { margin: 10px 0 0; }
.dynamics-details { padding: 0 24px; }
.dynamics-details details { border-bottom: 1px solid var(--c-line); padding: 14px 0; }
.dynamics-details details:last-child { border-bottom: 0; }
.dynamics-details details > summary { min-height: 24px; cursor: pointer; font-size: 16px; font-weight: 500; }
.dynamics-details p { margin: 8px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.month-bar { fill: var(--c-accent); }
.monthly text { font-family: var(--f-text); font-size: 13px; fill: var(--c-secondary); }
.monthly-total { color: var(--c-secondary); }
.chain-content { padding-top: 10px; }
.chain-bar { height: 6px; border-radius: 3px; background: #EEF2FF; overflow: hidden; }
.chain-fill { height: 6px; border-radius: 3px; background: var(--c-accent); }
.chain-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; font-size: 14px; }
.tire p { font-size: 13px; color: var(--c-secondary); }
.dialog-error { padding: 10px 12px; background: var(--c-surface); border-left: 3px solid var(--c-missed); }
.dialog-error strong, .dialog-error span { display: block; }
.dialog-error span { margin-top: 4px; }

/* Обновление вкладки: заголовок и кнопка в одной строке, дата ниже. */
.today-header, .workouts-header, .dynamics-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
}
.today-header > span, .workouts-header > span { grid-column: 1 / -1; }
.refresh-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  background: none;
  border: 0;
  color: var(--c-secondary);
  font-size: 24px;
  cursor: pointer;
}
.refresh-btn[disabled] { opacity: 0.55; cursor: wait; }
