/* Coach — тёмные металл-плашки на светлом фоне.
   Фон #eef1f5 · плашки #242b35→#1a2028 · акцент #0066ff · шрифт Inter. */

:root {
  --page: #eef1f5;
  --page-2: #e5e9ef;
  --ink: #151a21;
  --ink-2: #5c6773;
  --line: #d7dce4;

  --metal-1: #242b35;
  --metal-2: #1a2028;
  --metal-edge: #3a4450;
  --metal-ink: #eff3f7;
  --metal-ink-2: #9ba8b7;
  --metal-line: #333c47;

  --accent: #0066ff;
  --accent-soft: #5b9dff;
  --accent-ink: #ffffff;

  --ok: #12a150;
  --ok-m: #3ddc84;
  --warn: #b7791f;
  --warn-m: #f5b544;
  --bad: #d13b3b;
  --bad-m: #ff6b6b;

  --r: 14px;
  --r-sm: 10px;
  --shadow-panel: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 3px rgba(10, 15, 22, .18);
  --shadow-lift: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px rgba(16, 24, 40, .09);
  --z-header: 100;
}

@property --n {
  syntax: "<integer>";
  initial-value: 0;
  inherits: false;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  font-synthesis-weight: none;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: min(100% - 24px, 740px); margin-inline: auto; }
header .wrap { width: min(100% - 24px, 900px); }

/* ── Шапка ─────────────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(238, 241, 245, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: 10px;
}

nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand-logo {
  display: block;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tabs a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color .16s ease-out, color .16s ease-out;
}
.tabs a:hover { color: var(--ink); background: #fff; }
.tabs a.on { color: var(--accent-ink); background: var(--accent); }
.tabs a.out:hover { color: var(--bad); background: #fdecec; }

.topnav .tabs:not(.right) { flex: 1; }
.topnav .tabs.right { margin-left: auto; }

/* ── Push-переключатель (шапка, тренер) ────────────────────────────── */

.push-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  cursor: pointer;
}
.push-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.push-switch .track {
  position: relative;
  width: 38px;
  height: 23px;
  border-radius: 999px;
  background: #c6cdd8;
  box-shadow: inset 0 1px 2px rgba(10, 15, 22, .16);
  transition: background-color .16s ease-out;
}
.push-switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .28);
  transition: transform .16s ease-out;
}
.push-switch input:checked + .track { background: var(--accent); }
.push-switch input:checked + .track::after { transform: translateX(15px); }
.push-switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.push-switch input:disabled + .track { opacity: .55; cursor: default; }
.push-switch .bell { font-size: 16px; filter: grayscale(1); opacity: .5; transition: filter .16s ease-out, opacity .16s ease-out; }
.push-switch:has(input:checked) .bell { filter: none; opacity: 1; }
@media (max-width: 719px) {
  .topnav { gap: 6px 8px; }
  .brand { order: 1; }
  .topnav .tabs.right { display: contents; }
  .topnav .tabs.right a { order: 2; }
  .topnav .tabs.right a:first-of-type { margin-left: auto; }
  .runner-pick { order: 3; width: 100%; }
  .runner-pick select { flex: 1; width: auto; max-width: none; }
  .topnav .tabs:not(.right) { order: 4; flex: 0 0 100%; justify-content: space-between; }
  .topnav .tabs:not(.right) a { padding: 0 10px; }
  .topnav .push-switch {
    order: 2;
    justify-content: center;
    width: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
  }
  .topnav .push-switch .track { display: none; }
  .topnav .push-switch .bell { font-size: 18px; }
  .topnav .push-switch:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
}

.runner-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.runner-pick .pick-label { font-size: 13px; color: var(--ink-2); }
.runner-pick select {
  width: auto;
  min-width: 170px;
  max-width: 240px;
  height: 34px;
  border: 0;
  padding: 0 26px 0 26px;
  text-align: center;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background-color: transparent;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right 10px top 50%, right 5px top 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  box-shadow: none;
}
.runner-pick select option { color: var(--ink); background: #fff; }
.runner-pick select:focus { border: 0; box-shadow: none; }

main { padding: 24px 0 72px; }

h1, h2, h3 { text-wrap: balance; font-weight: 650; }
h1 { font-size: clamp(22px, 5vw, 28px); margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 12px; margin: 0 0 14px; text-transform: uppercase; color: var(--metal-ink-2); font-weight: 600; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--warn-m); }

p { margin: 0 0 8px; text-wrap: pretty; }
a { color: var(--accent); }
.muted { color: var(--ink-2); font-size: 14px; }

/* ── Вход ──────────────────────────────────────────────────────────── */

body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(110deg, rgba(8, 14, 22, .72), rgba(8, 14, 22, .28)),
    url("/static/running-login-hero.jpg") 68% center / cover no-repeat;
}
.login-page main {
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding-block: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
}
.login { width: min(100%, 380px); margin: 0 auto; }
.login-card {
  background: linear-gradient(180deg, rgba(36, 43, 53, .94), rgba(18, 24, 32, .94));
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--r);
  box-shadow: 0 24px 70px rgba(5, 10, 18, .38);
  backdrop-filter: blur(14px);
  padding: 26px 22px;
  color: var(--metal-ink);
}
.login-card h1 { font-size: 30px; margin-bottom: 4px; }
.login-card .muted { color: var(--metal-ink-2); }
.login-card .stack { text-align: left; }
.login .head { text-align: center; margin-bottom: 18px; }

/* ── Формы ─────────────────────────────────────────────────────────── */

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

input, select, textarea {
  width: 100%;
  background: #10151b;
  border: 1px solid var(--metal-line);
  border-radius: var(--r-sm);
  padding: 12px;
  color: var(--metal-ink);
  outline: none;
  transition: border-color .16s ease-out, box-shadow .16s ease-out;
}
input::placeholder, textarea::placeholder { color: #7f8b99; }
input:hover, select:hover, textarea:hover { border-color: #46515f; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, .18);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--metal-ink-2) 50%),
                    linear-gradient(135deg, var(--metal-ink-2) 50%, transparent 50%);
  background-position: right 16px top 50%, right 11px top 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
textarea { resize: vertical; line-height: 1.55; }
input.pin {
  width: 100%;
  max-width: 220px;
  height: 40px;
  align-self: center;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .3em;
  text-indent: .3em;
  padding: 0;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--metal-ink-2); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 620px) {
  .grid3 { grid-template-columns: 1.2fr 1.2fr 1fr; }
}

fieldset { border: 1px solid var(--metal-line); border-radius: var(--r-sm); padding: 12px; margin: 0; }
legend { font-size: 13px; color: var(--metal-ink-2); padding: 0 6px; font-weight: 500; }

.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--metal-ink-2);
  border: 1px solid var(--metal-edge);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: background-color .16s ease-out, border-color .16s ease-out, color .16s ease-out;
}
.radio:hover { border-color: var(--accent-soft); color: var(--metal-ink); }
.radio input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.radio:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
/* Статусные пилюли окрашиваются в цвета статусов (как бейджи st-*) */
.radio:has(input[value="planned"]:checked) {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .28);
  color: var(--metal-ink);
}
.radio:has(input[value="done"]:checked) {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--accent-ink);
}
.radio:has(input[value="skipped"]:checked) {
  background: var(--bad);
  border-color: var(--bad);
  color: var(--accent-ink);
}
.radio:has(input[value="moved"]:checked) {
  background: var(--warn);
  border-color: var(--warn);
  color: var(--accent-ink);
}
.radio:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--metal-ink-2); }
/* Чекбоксы — тёмные, в стиле остальных контролов на плашках */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--metal-edge);
  border-radius: 5px;
  background: rgba(0, 0, 0, .25);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background-color .16s ease-out, border-color .16s ease-out;
}
input[type="checkbox"]:hover { border-color: #46515f; }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  margin-top: -2px;
}
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check input { width: 18px; height: 18px; flex: none; }

/* ── Кнопки ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--metal-edge);
  color: var(--metal-ink);
  border-radius: var(--r-sm);
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: background-color .16s ease-out, border-color .16s ease-out;
}
.btn:hover { background: rgba(255, 255, 255, .12); border-color: #4d5866; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #0057e0; border-color: #0057e0; color: var(--accent-ink); }
.btn.danger { background: transparent; border-color: #5c3232; color: var(--bad-m); }
.btn.danger:hover { background: rgba(255, 107, 107, .1); border-color: var(--bad-m); color: var(--bad-m); }
.btn.big { width: 100%; padding: 14px; font-size: 16px; }
.btn.tiny { padding: 7px 11px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.wrap-actions .btn { flex: 1 1 auto; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Плашки-сообщения ──────────────────────────────────────────────── */

.flash {
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 14px;
  border: 1px solid transparent;
  text-wrap: pretty;
}
.flash.ok { background: #e7f6ed; border-color: #bde5cb; color: #0b6b38; }
.flash.err { background: #fdecec; border-color: #f4c4c4; color: #a02020; }
.flash.warn { background: #fdf5e5; border-color: #efdcb2; color: #8a5a10; }

/* ── Неделя: заголовок, полоса дней ────────────────────────────────── */

.week-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.week-title { text-align: center; }
.week-title h1 { font-size: clamp(19px, 4.5vw, 24px); margin-bottom: 2px; }
.arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  transition: border-color .16s ease-out, color .16s ease-out, transform .18s ease-out;
}
.arrow:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.arrow.off { opacity: .35; pointer-events: none; }

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}
.dcell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .16s ease-out, transform .18s ease-out, box-shadow .2s ease-out;
}
.dcell:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.dcell .dw { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 550; }
.dcell .dd { font-size: 14px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dcell .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin-top: 1px; }
.dcell.done .dot { background: var(--ok); }
.dcell.skip .dot { background: var(--bad); }
.dcell.move .dot { background: var(--warn); }
.dcell.planned .dot { background: var(--ink-2); }
.dcell.today {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  animation: pulse 2.4s ease-out infinite;
}
.dcell.today .dw { color: rgba(255, 255, 255, .75); }
.dcell.today .dot { background: var(--accent-ink); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 102, 255, .32); }
  70% { box-shadow: 0 0 0 9px rgba(0, 102, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0); }
}

/* ── Тёмные плашки ─────────────────────────────────────────────────── */

.metal {
  background: linear-gradient(180deg, var(--metal-1), var(--metal-2));
  border: 1px solid var(--metal-edge);
  border-radius: var(--r);
  box-shadow: var(--shadow-panel);
  color: var(--metal-ink);
}
.note, .summary, .panel { padding: 18px; margin-bottom: 18px; }
.form.metal { padding: 18px; margin-bottom: 18px; }
.metal .muted { color: var(--metal-ink-2); }
.metal .flash.ok, .login-card .flash.ok { background: rgba(61, 220, 132, .12); border-color: rgba(61, 220, 132, .3); color: #79ecb0; }
.metal .flash.err, .login-card .flash.err { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .32); color: #ffadad; }
.metal .flash.warn, .login-card .flash.warn { background: rgba(245, 181, 68, .12); border-color: rgba(245, 181, 68, .3); color: #ffdc99; }
.metal a { color: var(--accent-soft); }
.note-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--metal-ink-2);
  margin-bottom: 6px;
  font-weight: 600;
}
.summary ul, .alerts ul { margin: 0; padding-left: 18px; font-size: 14px; }
.summary li { margin-bottom: 4px; }
.summary b { font-variant-numeric: tabular-nums; font-weight: 650; }
.alerts ul { color: var(--warn-m); }
.alerts a { color: var(--warn-m); }

.weekly-summary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 230px;
  background:
    linear-gradient(90deg, rgba(14, 20, 28, .98) 0%, rgba(20, 27, 36, .91) 48%, rgba(20, 27, 36, .34) 100%),
    url("/static/running-weekly-banner.jpg") 64% center / cover no-repeat;
}
.weekly-summary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 35%);
  pointer-events: none;
}
.weekly-summary > * { max-width: 72%; }
.weekly-summary .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weekly-summary .alerts {
  padding: 1px 12px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-sm);
  background: rgba(10, 15, 22, .55);
  backdrop-filter: blur(8px);
}

/* ── Атмосферные баннеры разделов ─────────────────────────────────── */

.image-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 205px;
  display: flex;
  align-items: center;
}
.plan-banner {
  background:
    linear-gradient(90deg, rgba(12, 18, 26, .98) 0%, rgba(17, 24, 34, .9) 48%, rgba(17, 24, 34, .18) 100%),
    url("/static/running-plan-banner.jpg") 61% center / cover no-repeat;
}
.history-banner {
  background:
    linear-gradient(90deg, rgba(12, 18, 26, .98) 0%, rgba(17, 24, 34, .88) 46%, rgba(17, 24, 34, .16) 100%),
    url("/static/running-history-banner.jpg") 62% center / cover no-repeat;
}
.image-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), transparent 36%);
  pointer-events: none;
}
.image-banner-content { width: min(62%, 430px); }
.image-banner h1, .image-banner h2 { margin-bottom: 5px; color: var(--metal-ink); }
.image-banner h1 { font-size: clamp(28px, 5vw, 38px); }
.image-banner h2 { font-size: clamp(22px, 4vw, 29px); }
.image-banner-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-soft);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.image-banner-copy { margin: 0; color: var(--metal-ink-2); font-size: 14px; }
.image-banner-stats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.image-banner-stats > span {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(8, 13, 20, .46);
  color: var(--metal-ink-2);
  font-size: 12px;
  backdrop-filter: blur(7px);
}
.image-banner-stats b { color: var(--metal-ink); font-variant-numeric: tabular-nums; }
.image-banner-stats .image-banner-state { color: var(--accent-soft); }

/* ── Плитки-цифры (внутри тёмных плашек) ───────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
  margin: 2px 0 14px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--metal-line);
  border-radius: 10px;
  padding: 11px 13px;
}
.tile .tl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--metal-ink-2);
  font-weight: 550;
}
.tile .tv {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.tile .tv small { font-size: 12px; color: var(--metal-ink-2); font-weight: 500; letter-spacing: 0; }
.tile-sub { font-size: 12px; color: var(--metal-ink-2); }
.bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); margin-top: 7px; overflow: hidden; }
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: left;
  animation: grow .9s .25s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes grow { from { transform: scaleX(0); } }

/* Счётчик процентов: --tick-v задаётся инлайном в шаблоне */
.tick { counter-reset: n var(--n); animation: count 1.1s .25s cubic-bezier(.25, .8, .3, 1) forwards; }
.tick::after { content: counter(n); }
@keyframes count { to { --n: var(--tick-v, 0); } }

/* ── Дни и карточки тренировок ─────────────────────────────────────── */

.days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.day { scroll-margin-top: 96px; border-radius: var(--r); }
.day:target .day-head .dow { color: var(--accent); }
.day-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.dow { font-weight: 650; font-size: 15px; }
.date { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.day-body { display: flex; flex-direction: column; gap: 10px; }
.rest {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, .5);
}
.rest .muted { color: var(--ink-2); }
.add-link { text-decoration: none; font-weight: 500; }
.add-link:hover { text-decoration: underline; }
.day-add { display: flex; justify-content: flex-end; }
.day-add .add-link { font-size: 13px; }

.card { padding: 16px; border-left: 3px solid var(--metal-edge); }
.card.st-done { border-left-color: var(--ok-m); }
.card.st-skipped { border-left-color: var(--bad-m); opacity: .72; }
.card.st-moved { border-left-color: var(--warn-m); }
.card.st-planned { border-left-color: var(--accent-soft); }

.card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.link { font-size: 14px; text-decoration: none; font-weight: 550; }
.link:hover { text-decoration: underline; }

/* Цифры-герои: главный объём карточки */
.hero { display: flex; align-items: baseline; gap: 6px; margin: 0 0 4px; }
.hero-num {
  font-size: clamp(24px, 7vw, 30px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.hero-unit { font-size: 13px; color: var(--metal-ink-2); font-weight: 600; }
.hero-sub { font-size: 12px; color: var(--metal-ink-2); margin-left: 4px; }
.card.st-planned .hero-num { color: var(--accent-soft); }
.card.st-skipped .hero-num { color: var(--metal-ink-2); text-decoration: line-through; }
.card.st-moved .hero-num { color: var(--warn-m); }

/* Плитки-метрики на странице тренировки */
.hero-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.hero-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 84px;
  box-shadow: var(--shadow-lift);
}
.hero-cell .hv { font-size: 20px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hero-cell .hl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 550; }

/* Бейджи: вид и статус — полупрозрачные чипы на тёмной плашке */
.badge {
  font-size: 12px;
  font-weight: 550;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--metal-line);
  color: var(--metal-ink-2);
  white-space: nowrap;
}
.kind-easy { color: #9ecbff; border-color: #1f3a55; }
.kind-long { color: #d2a8ff; border-color: #3a2a55; }
.kind-tempo { color: #ffb877; border-color: #4d3216; }
.kind-interval { color: #ff8f88; border-color: #55231f; }
.kind-recovery { color: #7ee787; border-color: #1d4a2f; }
.kind-cross { color: #a5d6ff; border-color: #1f3a55; }
.kind-race { color: var(--warn-m); border-color: #5a4a1a; }
.kind-rest { color: var(--metal-ink-2); }

.badge.st-done { background: rgba(61, 220, 132, .12); border-color: rgba(61, 220, 132, .3); color: #79ecb0; }
.badge.st-skipped { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .32); color: #ffadad; }
.badge.st-moved { background: rgba(245, 181, 68, .12); border-color: rgba(245, 181, 68, .3); color: #ffdc99; }
.badge.st-planned { background: rgba(255, 255, 255, .07); border-color: var(--metal-line); color: var(--metal-ink-2); }
.badge.origin-runner { color: var(--accent-soft); border-color: #2f4a70; border-style: dashed; }
.badge.origin-strava { color: #ff8a4c; border-color: #7c3f1d; border-style: dashed; }

.target { font-weight: 600; margin-bottom: 5px; text-wrap: pretty; font-size: 15px; }
.actual { color: var(--metal-ink-2); font-size: 13.5px; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.rpe { display: inline-block; font-size: 13px; color: var(--metal-ink-2); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.comment { font-size: 14px; color: var(--metal-ink-2); font-style: italic; margin-bottom: 8px; text-wrap: pretty; }
.card-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-form select { width: auto; padding: 7px 28px 7px 10px; font-size: 13px; background-position: right 14px top 50%, right 9px top 50%; }

/* Каскадное появление; задержка --d задаётся инлайном */
.rise { animation: rise .55s cubic-bezier(.2, .7, .3, 1) both; animation-delay: var(--d, 0s); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ── Страница тренировки ───────────────────────────────────────────── */

.workout-head { margin-bottom: 20px; }
.back { display: inline-block; font-size: 14px; text-decoration: none; margin-bottom: 10px; color: var(--ink-2); }
.back:hover { color: var(--accent); }
.wo-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.wo-meta > span:not(.badge) { color: var(--ink-2); font-size: 14px; }
.pace { font-size: 15px; color: var(--metal-ink-2); margin: -2px 0 2px; }
.pace b { color: var(--accent-soft); font-variant-numeric: tabular-nums; }

/* ── Чат ───────────────────────────────────────────────────────────── */

.chat { padding: 18px; margin-bottom: 18px; }
.msgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg {
  border: 1px solid var(--metal-line);
  border-left: 3px solid var(--metal-edge);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .22);
  padding: 10px 12px;
}
.msg.coach { border-left-color: var(--accent-soft); }
.msg.runner { border-left-color: var(--ok-m); }
.msg.mine { background: rgba(255, 255, 255, .05); }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.msg-head .who { font-size: 13px; font-weight: 650; }
.msg.coach .who { color: var(--accent-soft); }
.msg.runner .who { color: var(--ok-m); }
.msg-head .when { font-size: 12px; color: var(--metal-ink-2); font-variant-numeric: tabular-nums; }
.msg-body { font-size: 14px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-del {
  background: none;
  border: 0;
  padding: 0;
  color: var(--metal-ink-2);
  font-size: 12px;
  cursor: pointer;
}
.msg-del:hover { color: var(--bad-m); text-decoration: underline; }
.chat-form { display: flex; flex-direction: column; gap: 10px; }
.chat-form textarea { width: 100%; }
.chat-form .btn { align-self: flex-end; }

/* ── Планирование ──────────────────────────────────────────────────── */

.editor-day { border-top: 1px solid var(--metal-line); padding-top: 14px; margin-top: 14px; }
.editor-day:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.editor-day .day-head { color: var(--metal-ink); }
.editor-day .date { color: var(--metal-ink-2); }
.editor-day .muted { color: var(--metal-ink-2); }
.edit { border: 1px solid var(--metal-line); border-radius: var(--r-sm); margin-bottom: 10px; background: rgba(0, 0, 0, .22); }
.edit summary { padding: 13px 14px; cursor: pointer; font-size: 15px; border-radius: var(--r-sm); }
.edit summary::marker { color: var(--metal-ink-2); }
.edit form { padding: 0 14px 14px; }
.edit[open] summary { border-bottom: 1px solid var(--metal-line); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ── Бегуны: каждый бегун — отдельная плашка ───────────────────────── */

.runner-list { margin-bottom: 18px; }
.runner-item { padding: 4px 14px 10px; margin-bottom: 14px; }
.runner-item:last-child { margin-bottom: 0; }
.runner-item > details { margin-bottom: 0; border: 0; background: transparent; }
.runner-item > details summary { padding-top: 10px; padding-bottom: 10px; }
.runner-item > details form { padding-bottom: 10px; }
.runner-item .edit .edit { border: 1px solid var(--metal-line); background: rgba(0, 0, 0, .22); }
.runner-item .edit[open] > summary { border-bottom: 0; }

/* ── Таблицы ───────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--metal-line); }
th { color: var(--metal-ink-2); font-weight: 550; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .16s ease-out; }
tbody tr:hover { background: rgba(255, 255, 255, .05); }
.metal td { color: var(--metal-ink); }

/* ── Графики ───────────────────────────────────────────────────────── */

.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: rgba(255, 255, 255, .09); stroke-width: 1; }
.chart .ax { fill: var(--metal-ink-2); font-size: 11px; }
.chart .val { fill: var(--metal-ink); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); }
.chart .bar.ghost { fill: rgba(255, 255, 255, .16); }
.chart .line { fill: none; stroke: var(--accent-soft); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--accent-soft); }
.legend {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--metal-ink-2);
  margin-top: 6px;
}
.lg { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg.plan { background: rgba(255, 255, 255, .16); margin-left: 12px; }
.lg.done { background: var(--accent); }

/* ── Пустые состояния ──────────────────────────────────────────────── */

.empty { text-align: center; padding: 9vh 0; }
.empty .btn { margin-top: 16px; background: #fff; border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-lift); }
.empty .btn:hover { border-color: var(--accent); color: var(--accent); }
.empty .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty .btn.primary:hover { background: #0057e0; border-color: #0057e0; color: var(--accent-ink); }
.empty h1 { margin-bottom: 4px; }

/* ── Адаптив и доступность ─────────────────────────────────────────── */

@media (min-width: 640px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .btn.big { width: auto; min-width: 260px; }
  .panel, .note, .summary { padding: 22px; }
}

@media (max-width: 560px) {
  body.login-page {
    /* Keep the runner, who is near the right edge of the photo, in frame. */
    background-position: center, right center;
  }
  .login-card {
    background: linear-gradient(180deg, rgba(36, 43, 53, .97), rgba(18, 24, 32, .97));
  }
  .weekly-summary {
    min-height: 0;
    background:
      linear-gradient(90deg, rgba(14, 20, 28, .98), rgba(20, 27, 36, .74)),
      url("/static/running-weekly-banner.jpg") 68% center / cover no-repeat;
  }
  .weekly-summary > * { max-width: none; }
  .image-banner {
    min-height: 190px;
    padding: 18px;
  }
  .plan-banner {
    background:
      linear-gradient(90deg, rgba(12, 18, 26, .98), rgba(17, 24, 34, .66)),
      url("/static/running-plan-banner.jpg") 66% center / cover no-repeat;
  }
  .history-banner {
    background:
      linear-gradient(90deg, rgba(12, 18, 26, .98), rgba(17, 24, 34, .62)),
      url("/static/running-history-banner.jpg") 68% center / cover no-repeat;
  }
  .image-banner-content { width: 78%; }
  .image-banner-copy { font-size: 13px; }
  .image-banner-stats { margin-top: 14px; gap: 5px; }
  .image-banner-stats > span { padding: 4px 7px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .rise { animation: none; }
  .bar i { animation: none; }
  .tick { animation: none; --n: var(--tick-v, 0); }
  .dcell.today { animation: none; }
}
