/* тренер-секундомер, «Сегодня», «Прогресс», графики, статус облака */
:root { --move: #1f6feb; --hold: #d9822b; --rest: #2f9e6e; }
[data-theme="dark"] { --move: #60a5fa; --hold: #f0a14d; --rest: #4cc38a; }

.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.sync.ok .sync-dot { background: var(--rest); }
.sync.offline .sync-dot { background: var(--hold); }
.sync.login .sync-dot { background: var(--work); }
.sync button { padding: 3px 10px; font-size: 14px; }
.sync { flex-wrap: wrap; }
.sync-form { display: inline-flex; gap: 6px; align-items: center; }
.sync-form input { font: inherit; font-size: 15px; padding: 4px 8px; width: 150px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.sync-err { color: var(--work); font-size: 14px; }

/* ---------- экран тренера ---------- */
.runner { width: 100vw; max-width: 720px; height: 100vh; height: 100dvh; max-height: 100dvh; margin: auto; padding: 0; border: 0; background: var(--card); color: var(--ink); }
.runner::backdrop { background: rgba(2, 6, 23, .7); }
.runner[open] { display: flex; flex-direction: column; overflow: hidden; }
.r-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.r-ttl { display: flex; flex-direction: column; }
.r-ttl b { font-size: 19px; }
.r-ttl span { color: var(--muted); font-size: 13px; }
.r-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.r-stage { position: relative; background: var(--stage); border: 1px solid var(--line); border-radius: 12px; }
#r-svg { width: 100%; height: auto; max-height: 34vh; display: block; }
.r-side { position: absolute; top: 8px; left: 10px; font-weight: 700; color: var(--hold); }
.r-now { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.r-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.r-ring-bg { fill: none; stroke: var(--line); stroke-width: 9; }
.r-ring-fg { fill: none; stroke: var(--move); stroke-width: 9; stroke-linecap: round; transition: stroke .3s; }
.r-ring-fg.hold { stroke: var(--hold); }
.r-ring-fg.rest, .r-ring-fg.relax, .r-ring-fg.switch { stroke: var(--rest); }
.r-ring-fg.prep { stroke: var(--muted); }
.r-big { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.r-label { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; max-width: 160px; line-height: 1.15; }
.r-num { font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.r-of { font-size: 16px; color: var(--muted); min-height: 20px; }
.runner[data-kind="hold"] .r-label { color: var(--hold); }
.runner[data-kind="rest"] .r-label, .runner[data-kind="relax"] .r-label { color: var(--rest); }
.r-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 12px; }
.r-dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.r-dots i.on { background: var(--move); border-color: var(--move); }
.r-dots i.cur { border-color: var(--move); }
.r-bar { position: relative; height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.r-bar-in { height: 100%; background: var(--move); border-radius: 6px; }
.r-bar-marks i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--card); }
.r-info { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; }
.r-next { text-align: center; font-size: 16px; color: var(--muted); min-height: 22px; }
.r-ctrl { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; margin-top: auto; }
.r-ctrl button { padding: 14px 6px; font-size: 17px; }
.r-main { font-weight: 700; }
.r-start { width: 100%; padding: 16px; font-size: 20px; font-weight: 700; border-radius: 12px; }
.v-run { margin-bottom: 10px; }
.r-lvl { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 10px; text-align: center; background: var(--soft); border-radius: 12px; padding: 12px; }
.r-lvl button { font-size: 24px; padding: 8px 0; }
.r-lvl-n { font-size: 20px; font-weight: 700; }
.r-lvl-t { font-size: 16px; }
.r-lvl-d { font-size: 14px; color: var(--muted); }
.r-w { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; }
.r-w input { width: 90px; font: inherit; font-size: 22px; text-align: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.r-w button { font-size: 22px; width: 52px; padding: 8px 0; }
.r-prefs { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: 15px; }
.r-prefs input { width: 18px; height: 18px; vertical-align: -3px; }
.r-sug { background: var(--goldbg); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; }
.r-sug.down { border-color: var(--work); }
.r-sug-b { display: flex; gap: 8px; margin-top: 8px; }
.r-stop { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.r-stop-in { background: var(--card); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; }
.r-stop-in b { font-size: 19px; }
.r-stop-in button { padding: 14px; font-size: 17px; }
.r-fin { display: flex; flex-direction: column; gap: 12px; text-align: center; padding-top: 10px; }
.r-fin-t { font-size: 34px; font-weight: 800; color: var(--rest); }
.r-fin-s { font-size: 17px; color: var(--muted); }
.r-fin-q { font-size: 19px; font-weight: 700; margin-top: 6px; }
.r-rate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.r-rate button { padding: 16px 6px; font-size: 18px; background: var(--card); color: var(--ink); border-color: var(--line); }
.r-rate button.on { background: var(--move); border-color: var(--move); color: var(--card); }
.r-rate button.pain.on { background: var(--work); border-color: var(--work); }
.r-fin-hint { color: var(--muted); font-size: 15px; min-height: 20px; }
.r-undo { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--soft); border-radius: 10px; padding: 8px; }

/* ---------- сегодня ---------- */
.t-week { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.t-week-sum { margin-bottom: 8px; }
.t-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 86px; }
.t-day { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.t-day i { width: 70%; min-height: 3px; background: var(--move); border-radius: 4px 4px 0 0; }
.t-day span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.t-day.now span { color: var(--ink); font-weight: 700; }
.t-day em { position: absolute; top: 0; font-style: normal; font-size: 12px; color: var(--muted); }
.t-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.t-col, .t-tail, .t-check { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.t-list { margin: 0; padding-left: 22px; }
.t-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.t-row:last-child { border-bottom: 0; }
.t-row.done .t-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rest); }
.t-lv { font-size: 13px; color: var(--muted); }
.t-st { font-size: 13px; color: var(--rest); font-weight: 700; }
.t-go { padding: 6px 14px; font-size: 15px; }
.t-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--soft); color: var(--ink); border-color: var(--line); border-radius: 18px; padding: 6px 12px; font-size: 15px; }
.t-check label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; }
.t-check input { width: 90px; font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); text-align: center; }

/* ---------- прогресс и графики ---------- */
.p-block { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.p-head { display: flex; align-items: center; gap: 10px; }
.p-head h3 { margin: 0; flex: 1; }
.p-ct { font-size: 14px; color: var(--muted); margin: 4px 0; }
.p-grid, .p-tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.p-tadd { display: flex; gap: 6px; margin-top: 4px; }
.p-tadd input { width: 100px; font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.p-tab { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.p-tab th, .p-tab td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.p-del { padding: 2px 8px; font-size: 13px; }
svg.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-ax { font-size: 11px; fill: var(--muted); }
.c-line { fill: none; stroke: var(--move); stroke-width: 2; stroke-linejoin: round; }
.c-dot { fill: var(--move); stroke: var(--card); stroke-width: 2; }
.c-dot.pain { fill: var(--work); }
.c-mark { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.c-tip { position: absolute; display: none; z-index: 50; background: var(--ink); color: var(--card); font-size: 13px; padding: 5px 8px; border-radius: 6px; pointer-events: none; max-width: 210px; }

.lv-list { margin: 4px 0; padding-left: 24px; }
.lv-list li { margin: 3px 0; }
.lv-list li.cur { font-weight: 700; }
.lv-list li.cur b { color: var(--rest); font-size: 13px; }
.lv-list li.past { color: var(--muted); }

@media (min-width: 700px) { .runner { height: 94vh; height: 94dvh; border-radius: 14px; } }
