/* =========================================================
   Зал — стиль «Империя» по доске Empire в Pinterest Михаила:
   чёрно-белая гравюра, антиква с разрядкой (Playfair Display),
   мелкие технические подписи моноширинным (IBM Plex Mono), тонкие линейки,
   прямые углы. Цвет у ощущений (бронза — «тяжело», кровь — «отказ») и у фото упражнений.
   Светлая и тёмная: по настройке телефона или кнопкой «день/ночь» в углу.
   ========================================================= */
:root {
  --bg: #f3f1ec;
  --card: #fbfaf7;
  --fg: #0e0e0e;
  --muted: #6b6862;
  --line: #d8d4cc;
  --edge: #0e0e0e;
  --bw: 1px;
  --accent: #0e0e0e;
  --accent-fg: #f3f1ec;
  --accent-soft: #e6e2da;
  --chip: #efece6;
  --warn: #7a5b1e;
  --warn-soft: #ece4d3;
  --bad: #8b1a1a;
  --good: #4a4a4a;
  --on-color: #f3f1ec;
  --photo: #ffffff;
  --shadow: none;
  --glow: none;
  --display: "Playfair Display", Georgia, serif;
  --body: "PT Serif", Georgia, serif;
  --num: "IBM Plex Mono", Consolas, monospace;
  --dw: 800;
  --h1: 32px;
  --h2: 22px;
  --h-style: normal;
  --r-card: 0px;
  --r-ctl: 0px;
  --r-tag: 0px;
  --r-pill: 0px;
  --r-round: 0px;
  --tabbar-h: 64px;
  --mono: "IBM Plex Mono", Consolas, monospace;
  color-scheme: light;
}
/* Тёмный режим: по настройке телефона, пока кнопка «день/ночь» не нажата; после — как выбрано. */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #0b0b0b;
    --card: #131313;
    --fg: #ecebe6;
    --muted: #8f8b83;
    --line: #262524;
    --edge: #ecebe6;
    --accent: #ecebe6;
    --accent-fg: #0b0b0b;
    --accent-soft: #222120;
    --chip: #1a1a19;
    --warn: #c9a45c;
    --warn-soft: #2a2316;
    --bad: #c0392b;
    --good: #9a9a9a;
    --on-color: #0b0b0b;
    --photo: #e9e7e2;
    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --bg: #0b0b0b;
  --card: #131313;
  --fg: #ecebe6;
  --muted: #8f8b83;
  --line: #262524;
  --edge: #ecebe6;
  --accent: #ecebe6;
  --accent-fg: #0b0b0b;
  --accent-soft: #222120;
  --chip: #1a1a19;
  --warn: #c9a45c;
  --warn-soft: #2a2316;
  --bad: #c0392b;
  --good: #9a9a9a;
  --on-color: #0b0b0b;
  --photo: #e9e7e2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 var(--body);
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 18px)
    calc(env(safe-area-inset-right, 0px) + 16px)
    calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 28px)
    calc(env(safe-area-inset-left, 0px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.has-timer .wrap { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 96px); }
.loading, .empty { color: var(--muted); text-align: center; padding: 28px 8px; }

/* ---------- Заголовки ---------- */
.page-head { display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font: 500 12px/1.3 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
h1 { font: var(--dw) var(--h1)/1.08 var(--display); font-style: var(--h-style); letter-spacing: .01em; margin: 0; text-transform: uppercase; text-wrap: balance; }
h2 { font: var(--dw) var(--h2)/1.15 var(--display); font-style: var(--h-style); margin: 0; text-wrap: balance; }
h3 { font: var(--dw) 16px/1.2 var(--display); font-style: var(--h-style); margin: 10px 0 0; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.sub { color: var(--muted); font-size: 15px; }
.muted-p { margin: 0; color: var(--muted); font-size: 15px; }
.foot, .hint { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- Полоска дней ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 0 4px 6px 0; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.chip-day {
  flex: 1 0 auto; min-width: 78px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  border: var(--bw) solid var(--edge); background: var(--card); border-radius: var(--r-ctl); padding: 6px 8px;
}
.chip-day b { font: var(--dw) 14px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.chip-day small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.chip-day .ft { font-size: 11px; font-weight: 700; }
.chip-day.train .ft { color: var(--accent); }
.chip-day.morning .ft { color: var(--warn); }
.chip-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: var(--glow); }
.chip-day[aria-pressed="true"] small, .chip-day[aria-pressed="true"] .ft { color: inherit; opacity: .85; }

/* ---------- Плашки ---------- */
.note-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: var(--bw) solid var(--edge); border-radius: var(--r-ctl); padding: 10px 14px; font-size: 15px;
}
.note-card .ic { flex: none; margin-top: 2px; color: var(--accent); }
.note-card.warn { background: var(--warn-soft); border-color: transparent; }
.note-card.warn .ic { color: var(--warn); }
.rule { background: var(--accent-soft); border-radius: var(--r-ctl); padding: 10px 14px; font-size: 15px; }
.rule.deload { background: var(--warn-soft); }
.rule b { color: var(--accent); }
.rule.deload b { color: var(--warn); }

/* ---------- Кадры упражнения ---------- */
.pics { position: relative; aspect-ratio: 3 / 2; background: var(--photo); cursor: pointer; overflow: hidden; }
.pics > div, .pics img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pics img { object-fit: contain; }
.pics svg { display: block; width: 100%; height: 100%; }
.pics .b { animation: flip 2.4s steps(1) infinite; }
@keyframes flip { 0% { opacity: 0 } 50% { opacity: 1 } }
.pics.paused .b { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .pics .b { animation: none; opacity: 0; } }
.num, .where, .note-tag {
  position: absolute; font-size: 12px; background: var(--card); color: var(--muted); border-radius: var(--r-tag); padding: 2px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.num { left: 10px; top: 10px; font: var(--dw) 15px var(--num); color: var(--fg); padding: 2px 9px; }
.where { right: 10px; top: 10px; }
.note-tag { right: 10px; bottom: 10px; }

/* ---------- Разминка ---------- */
.warm { background: var(--card); border: var(--bw) dashed var(--edge); border-radius: var(--r-card); padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.wrow, .srow { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; }
.wrow .pics, .srow .pics, .prow .pics { border-radius: var(--r-tag); }
.wrow p, .srow p { margin: 0; min-width: 0; font-size: 15px; }
.srow { grid-template-columns: 96px 1fr; }
.srow .mini-btn { margin-top: 6px; }

/* ---------- Карточка упражнения ---------- */
.ex { background: var(--card); border: var(--bw) solid var(--edge); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.ex.done { border-color: var(--accent); }
.ex .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tag { font: 500 12px var(--body); font-style: normal; text-transform: none; letter-spacing: 0; background: var(--warn-soft); color: var(--warn); border-radius: var(--r-tag); padding: 2px 7px; vertical-align: middle; }
.warmline { font-size: 14px; color: var(--muted); }
.warmline b { color: var(--fg); }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat { background: var(--accent-soft); color: var(--fg); border-radius: var(--r-tag); padding: 4px 10px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.muted { background: var(--chip); color: var(--muted); font-weight: 400; }
.stat.fail { background: var(--warn-soft); color: var(--warn); font-weight: 400; }
.note { margin: 0; font-size: 14px; color: var(--muted); }
.prev { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.prev .ic { flex: none; margin-top: 2px; }
.prev b { color: var(--fg); }
.hint-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; border-radius: var(--r-ctl); padding: 8px 12px; font-size: 14px; background: var(--accent-soft); }
.hint-card span { flex: 1 1 200px; }
.hint-card.stall { background: var(--warn-soft); }

/* ---------- Подходы ---------- */
.sets { display: flex; flex-direction: column; gap: 6px; }
.set { display: flex; align-items: center; gap: 8px; }
.sn { flex: none; width: 22px; text-align: center; font: var(--dw) 15px var(--num); color: var(--muted); display: grid; place-items: center; }
.x { color: var(--muted); }
.grow { flex: 1; }
.fld {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 4px;
  background: var(--chip); border: var(--bw) solid var(--edge); border-radius: var(--r-ctl); padding: 0 10px; height: 46px;
}
.fld input { width: 100%; min-width: 0; border: 0; background: none; outline: none; font: 700 19px var(--num); font-variant-numeric: tabular-nums; padding: 0; }
.fld input::placeholder { color: var(--muted); opacity: .6; font-weight: 400; }
.fld span { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.fld:focus-within { border-color: var(--accent); }
.fld.bw { justify-content: center; color: var(--muted); font-size: 14px; }
.chk {
  flex: none; width: 46px; height: 46px; border-radius: var(--r-ctl);
  display: grid; place-items: center; border: max(1.5px, var(--bw)) solid var(--edge); color: var(--muted); background: var(--card);
}
.chk[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: var(--glow); }
.set.done .fld { background: var(--accent-soft); border-color: transparent; }
/* На узких телефонах подписи «кг» и «раз» прячем: числу нужнее место. */
@media (max-width: 360px) {
  .set .fld { padding: 0 8px; }
  .set .fld span { display: none; }
}
.add-set { align-self: flex-start; }

/* ---------- Раскрывашки ---------- */
details.more { border-top: 1px dashed var(--line); padding-top: 8px; }
details.more summary {
  cursor: pointer; list-style: none; font: 500 13px var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  display: flex; align-items: center; gap: 6px; min-height: 32px;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "▸"; font-size: 12px; transition: transform .15s; }
details.more[open] summary::before { transform: rotate(90deg); }
details.more[open] { display: flex; flex-direction: column; gap: 10px; }
ul.tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-ctl); border: var(--bw) solid var(--edge); background: var(--card); font-weight: 700;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: var(--glow); }
.mini-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: var(--r-tag); background: var(--card); border: var(--bw) solid var(--edge); white-space: nowrap;
}
.link { color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; min-height: 32px; }
.note-card .link, .muted-p .link { display: inline; min-height: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--bad); }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-round); display: grid; place-items: center; color: var(--muted); }
.btn.start, .btn.big { width: 100%; min-height: 58px; font: var(--dw) 18px var(--display); font-style: var(--h-style); text-transform: uppercase; letter-spacing: .03em; }
.hint.center, .link.center { text-align: center; align-self: center; }
.finish { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0; }
.js-elapsed { font-variant-numeric: tabular-nums; }

/* ---------- План до старта: строка на упражнение с маленькими кадрами ---------- */
.plan { background: var(--card); border: var(--bw) solid var(--edge); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.prow { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.pt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pt b { font-size: 15px; line-height: 1.25; }
.pt small { color: var(--muted); font-size: 13px; }
.pt small.pp { color: var(--fg); opacity: .8; }
.pt small.up { color: var(--accent); font-weight: 700; }

/* ---------- Идущая тренировка ---------- */
.ex.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--glow), var(--shadow); }
.now-tag { position: absolute; left: 50px; top: 10px; font: var(--dw) 12px var(--display); text-transform: uppercase; letter-spacing: .06em; background: var(--accent); color: var(--accent-fg); border-radius: var(--r-tag); padding: 3px 8px; }
.ex.mini { box-shadow: none; }
.mini-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; }
.num-s { flex: none; width: 30px; height: 30px; border-radius: var(--r-round); display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); }
.lt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lt small { color: var(--muted); font-size: 13px; }
.chev { color: var(--muted); flex: none; }

/* Как дался подход */
.feel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 4px 30px; }
.feel.day { margin: 14px 0 0; }
.feel-q { flex-basis: 100%; font-size: 13px; color: var(--warn); font-weight: 700; }
.feel-b { font-size: 13px; padding: 6px 11px; border-radius: var(--r-pill); border: var(--bw) solid var(--edge); background: var(--card); color: var(--muted); }
.feel.day .feel-b { font-size: 15px; padding: 9px 14px; }
.feel-b[aria-pressed="true"] { color: var(--on-color); border-color: transparent; font-weight: 700; }
.feel-b.easy[aria-pressed="true"], .feel-b.great[aria-pressed="true"] { background: var(--good); }
.feel-b.ok[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.feel-b.hard[aria-pressed="true"], .feel-b.tired[aria-pressed="true"] { background: var(--warn); }
.feel-b.fail[aria-pressed="true"], .feel-b.bad[aria-pressed="true"] { background: var(--bad); }

/* Заметки */
textarea {
  width: 100%; font: inherit; color: inherit; resize: vertical;
  background: var(--chip); border: var(--bw) solid var(--edge); border-radius: var(--r-ctl); padding: 10px 12px; outline: none;
}
textarea:focus { border-color: var(--accent); }
.ta { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.ta > span { font: 500 12px var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

/* ---------- Таблицы ---------- */
.tbl { overflow-x: auto; background: var(--card); border: var(--bw) solid var(--edge); border-radius: var(--r-ctl); }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 12px var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--chip); }
tr:last-child td { border-bottom: 0; }
tr.cur td { background: var(--accent-soft); }
tr.total td { font-weight: 700; }
td small { color: var(--muted); }
.nw { white-space: nowrap; }

/* ---------- Секундомер отдыха ---------- */
.timer-bar {
  position: fixed; z-index: 30;
  left: calc(env(safe-area-inset-left, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 12px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 10px);
  max-width: 656px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--fg); color: var(--bg); border-radius: var(--r-card); padding: 8px 8px 8px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.timer-bar .tl { display: flex; flex-direction: column; line-height: 1.1; }
.timer-bar small { font: 500 11px var(--display); text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.timer-bar b { font: var(--dw) 26px var(--num); font-variant-numeric: tabular-nums; }
.timer-bar .tgo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.timer-bar .tgt { text-transform: none; letter-spacing: 0; font: 13px var(--body); opacity: .75; }
.timer-bar .tp { height: 6px; border-radius: var(--r-tag); background: rgba(127, 127, 127, .35); overflow: hidden; }
.timer-bar .tp i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-tag); }
.timer-bar.ready { background: var(--accent); color: var(--accent-fg); box-shadow: var(--glow), 0 10px 30px rgba(0, 0, 0, .25); }
.timer-bar.ready .tp i { background: var(--accent-fg); }
.timer-bar .icon-btn { color: inherit; }
.timer-bar.work { padding-right: 14px; }

/* ---------- Нижняя панель ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border-top: var(--bw) solid var(--edge);
  padding: 4px calc(env(safe-area-inset-right, 0px) + 8px) calc(env(safe-area-inset-bottom, 0px) + 4px) calc(env(safe-area-inset-left, 0px) + 8px);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted); font-size: 11px; min-height: 52px; justify-content: center; }
.tab.on { color: var(--accent); font-weight: 700; }

/* ---------- Шторка ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); animation: fade .2s; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: var(--r-card) var(--r-card) 0 0; border-top: var(--bw) solid var(--edge);
  padding: 18px 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  animation: up .25s ease-out;
}
.sheet h2 { font-size: calc(var(--h2) + 5px); margin-top: 2px; text-transform: uppercase; }
.sheet .close { float: right; width: 40px; height: 40px; border-radius: var(--r-round); background: var(--chip); display: grid; place-items: center; margin: -4px -6px 0 8px; }
.sheet-lead { margin: 6px 0 0; color: var(--muted); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.sheet-actions .btn { flex: 1 1 180px; }
.report { white-space: pre-wrap; background: var(--chip); border-radius: var(--r-ctl); padding: 12px 14px; font: 14px/1.5 var(--body); margin: 14px 0 0; }
body.sheet-open { overflow: hidden; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(30px); opacity: 0 } }

/* ---------- Тост ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px + var(--install-h, 0px));
  transform: translate(-50%, -20px); opacity: 0; visibility: hidden;
  background: var(--fg); color: var(--bg); border-radius: var(--r-ctl); padding: 10px 16px; font-size: 15px; max-width: calc(100% - 32px);
  transition: transform .3s, opacity .3s, visibility 0s .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; transition: transform .3s, opacity .3s, visibility 0s; }
.toast button { color: var(--accent-soft); font-weight: 700; text-decoration: underline; margin-left: 8px; }

@media (min-width: 560px) {
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: var(--r-card); border: var(--bw) solid var(--edge); animation: fade .2s; }
}

/* ---------- Детали «Империи» ---------- */
.eyebrow, .chip-day small,
th, details.more summary, .timer-bar small,
.where, .stat.muted { font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; }
h1 { letter-spacing: .08em; font-weight: 900; }
h2 { letter-spacing: .02em; }
h3 { font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: .3em; }
.page-head { border-bottom: 1px solid var(--edge); padding-bottom: 12px; position: relative; }
.page-head::after { content: "PER ASPERA AD ASTRA"; font: italic 600 12px/1 var(--display); letter-spacing: .38em; color: var(--muted); margin-top: 6px; }
.chip-day b, .btn.start { font-family: var(--display); letter-spacing: .14em; }
.btn.start { font-weight: 800; }
.ex, .plan, .tbl, .note-card,
.chip-day, .fld, .chk,
.feel-b, .btn, .mini-btn, textarea { border-width: 1px; }
.fld, textarea { background: transparent; border-color: var(--line); border-bottom: 1px solid var(--edge); }
.rule { background: transparent; border-left: 3px solid var(--edge); border-radius: 0; font-style: italic; }
.rule b { font-style: normal; color: var(--fg); font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.num { font-family: var(--display); font-weight: 900; }
.num::before { content: "№ "; font-size: 11px; font-weight: 400; }
.now-tag { font-family: var(--mono); font-weight: 600; letter-spacing: .2em; }
.ex.current { box-shadow: 0 0 0 1px var(--edge), 6px 6px 0 var(--edge); }
.timer-bar { background: var(--fg); color: var(--bg); border: 0; box-shadow: none; border-radius: 0; }
.timer-bar.ready { background: var(--bg); color: var(--fg); outline: 2px solid var(--fg); }
.timer-bar.ready .tp i { background: var(--fg); }
.timer-bar .tp i { background: var(--bg); }
.stat { background: transparent; border: 1px solid var(--edge); font-family: var(--mono); font-weight: 500; font-size: 13px; }
.stat.fail { border-color: var(--warn); }
.tab { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }

/* ---------- Поля по бокам на ПК ---------- */
/* На широком экране по бокам от колонки — типографика как на пине из доски Empire, по-русски:
   вертикальное ДИСЦИПЛИНА, мелкие подписи моноширинным, девизы, тонкие линейки. */
.side { display: none; }
@media (min-width: 1100px) {
  .side {
    position: fixed; top: 0; bottom: var(--tabbar-h); width: calc((100vw - 680px) / 2);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
    color: var(--fg); pointer-events: none; user-select: none; overflow: hidden;
  }
  .side-l { left: 0; flex-direction: row; gap: 22px; }
  .side-r { right: 0; }
  .vword { display: flex; flex-direction: column; align-items: center; font: 900 clamp(40px, 6vh, 64px)/1 var(--display); gap: .1em; }
  .vword span { display: block; }
  .vnote { writing-mode: vertical-rl; transform: rotate(180deg); font: italic 14px/1.4 var(--body); color: var(--muted); max-height: 60vh; border-left: 1px solid var(--edge); padding-left: 10px; }
  .side-mark { position: absolute; bottom: 24px; font: 500 11px var(--mono); letter-spacing: .3em; color: var(--muted); }
  .side-l .side-mark { left: 50%; transform: translateX(-50%); }
  .tagline { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .tagline .box { font: 500 10px var(--mono); letter-spacing: .2em; border: 1px solid var(--edge); padding: 2px 6px; }
  .tagline b { font: 900 34px/1 var(--display); letter-spacing: .16em; }
  .tagline i { font: italic 15px var(--body); color: var(--muted); }
  .vline { width: 1px; height: 14vh; background: var(--edge); position: relative; }
  .vline::before, .vline::after { content: ""; position: absolute; left: -4px; width: 7px; height: 7px; border: 1px solid var(--edge); border-radius: 50%; background: var(--bg); }
  .vline::before { top: -8px; }
  .vline::after { bottom: -8px; }
  .motto { font: 600 12px var(--mono); letter-spacing: .2em; white-space: nowrap; }
  .vmotto { writing-mode: vertical-rl; font: italic 600 14px var(--display); letter-spacing: .5em; color: var(--muted); }
}

/* ---------- Кнопка «день/ночь» ---------- */

/* ---------- Настройки ---------- */
.set-group { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.set-group h3 { margin: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--edge); background: var(--card); }
.seg button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 76px; padding: 12px 6px;
  font: 500 10px/1.35 var(--mono); letter-spacing: .12em; text-transform: uppercase; text-align: center; color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--edge); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }

/* ---------- Плашка «Установить» ---------- */
/* Выезжает сверху, как уведомление, пока сайт открыт во вкладке браузера. Под шторкой (40), над остальным. */
.install {
  position: fixed; z-index: 35;
  left: calc(env(safe-area-inset-left, 0px) + 10px); right: calc(env(safe-area-inset-right, 0px) + 10px);
  top: calc(env(safe-area-inset-top, 0px) + 10px); max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 10px 4px 10px 10px;
  background: var(--card); color: var(--fg); border: 1px solid var(--edge); box-shadow: 5px 5px 0 var(--edge);
  transform: translateY(calc(-100% - 30px)); visibility: hidden;
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.1), visibility 0s .4s;
}
.install.show { transform: none; visibility: visible; transition: transform .4s cubic-bezier(.2, .9, .3, 1.1), visibility 0s; }
.install img { flex: none; width: 44px; height: 44px; }
.install .it { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install .it small { font: 500 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.install .it b { font: 800 15px/1.15 var(--display); }
.install .it span { font-size: 13px; line-height: 1.3; color: var(--muted); }
.install .btn { flex: none; min-height: 40px; padding: 0 12px; font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.install .icon-btn { flex: none; width: 32px; height: 40px; }
.steps { margin: 14px 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.steps svg { vertical-align: -3px; }

.pics .nopic { display: grid; place-items: center; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #8f8b83; }
