/* Second Wind — дизайн-система «Гума і магнезія» (DESIGN-DIRECTION.md, розділ 6).
   Колір категорії — диск на штанзі; категорія завжди підписана словом. */
:root {
  --bg: #101113; --surface: #1A1C1F; --surface-2: #24272B; --line: #34383D;
  --text: #F3F2EE; --muted: #A9ADB3;
  --accent: #FF5A3C; --on-accent: #101113; --err: #FF8A75;
  --c-strength: #FF5A3C; --c-cardio: #5B9BFF; --c-func: #F4C542; --c-recovery: #45C983;
  --font-display: "Fira Sans Extra Condensed", "Arial Narrow", sans-serif;
  --font-text: "Golos Text", system-ui, sans-serif;
  --r: 4px; --r-img: 2px;
  --wrap: 1280px; --gutter: clamp(16px, 4vw, 48px);
  --sec: clamp(64px, 8vw, 120px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F2F3F4; --surface: #FFFFFF; --surface-2: #E6E8EA; --line: #C9CDD2;
  --text: #131417; --muted: #4E535A;
  --accent: #B8321C; --on-accent: #FFFFFF; --err: #B8321C;
  --c-strength: #C23A22; --c-cardio: #1F5FCC; --c-func: #8A6400; --c-recovery: #1C7A48;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.55 var(--font-text); }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; margin: 0; }
ul, ol { margin: 0; padding: 0; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -100px; z-index: 60; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--r); font-weight: 600; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; box-shadow: 0 0 0 2px var(--bg); }
main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Кнопки й контроли: одне сімейство, радіус 4 px ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--r); border: 2px solid transparent; font: 600 16px/1.15 var(--font-text); text-decoration: none; cursor: pointer; text-align: center; transition: background-color .15s, color .15s, filter .15s; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
:root[data-theme="light"] .btn-primary:hover { filter: brightness(.88); }
.btn-line { border-color: var(--text); color: var(--text); background: transparent; }
.btn-line:hover { background: var(--text); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { flex: none; width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1.5px solid var(--line); border-radius: var(--r); background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--text); }
.icon-btn .ico { --cc: var(--text); width: 20px; height: 20px; }
.ico-fb { font: 600 13px/1 var(--font-text); }
.icon-btn:not(.has-ico) { width: auto; min-width: 44px; padding: 0 10px; }
.icon-btn:not(.has-ico) .ico, .sw-pencil:not(.has-ico) .ico, .has-ico > .ico-fb { display: none; }
.sw-pencil .ico { --cc: var(--on-accent); width: 18px; height: 18px; }
.sw-pencil .ico-fb { font-size: 18px; }

/* ---------- Шапка ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.brand .logo { height: 40px; width: auto; }
.brand.has-dark .wordmark, .brand.has-light .wordmark { display: none; }
:root[data-theme="dark"] .brand .logo-light, :root[data-theme="light"] .brand .logo-dark { display: none; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 800 26px/1 var(--font-display); white-space: nowrap; margin: 0; }
.disk { width: 22px; height: 22px; border-radius: 50%; border: 5px solid var(--accent); flex: none; }
.main-nav { margin-left: auto; display: flex; gap: 2px; }
.main-nav a { text-decoration: none; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: var(--r); font-weight: 500; font-size: 16px; }
.main-nav a:hover { background: var(--surface-2); }
.tools { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }

/* Мова: <details> зі звичайними посиланнями на сторінки перекладу; шеврон — рамка CSS */
.lang { position: relative; }
.lang > summary { list-style: none; width: auto; min-width: 52px; padding: 0 10px 0 11px; display: inline-flex; gap: 7px; font: 800 19px/1 var(--font-display); letter-spacing: .02em; }
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.lang[open] > summary { border-color: var(--text); }
.lang[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; list-style: none; min-width: 188px; padding: 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.lang-list a { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 2px; background: transparent; color: var(--text); font: 400 16px/1.2 var(--font-text); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.lang-list a:hover { background: var(--surface-2); }
.lang-list a[aria-current] { font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
/* Рядок як на табло розкладу: код мови вузьким шрифтом, як час заняття, і назва; поточна мова — смуга ліворуч */
.lang-list li + li { border-top: 1px solid var(--line); }
.lang-short { flex: none; width: 26px; font: 800 18px/1 var(--font-display); letter-spacing: .02em; color: var(--muted); }
.lang-list a[aria-current] .lang-short { color: var(--text); }
/* Тема: «таблетка» з двома половинами (день / ніч); повзунок — суцільна плашка кольору тексту, як позначка «зараз» на табло */
.theme-btn { position: relative; flex: none; display: inline-grid; grid-template-columns: 1fr 1fr; width: 88px; height: 44px; padding: 3px; border: 1.5px solid var(--line); border-radius: var(--r); background: transparent; color: var(--text); cursor: pointer; }
.theme-btn:hover { border-color: var(--text); }
.theme-knob { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 2px; background: var(--text); transition: transform .2s cubic-bezier(.7, 0, .3, 1); }
:root[data-theme="dark"] .theme-knob { transform: translateX(100%); }
.theme-side { position: relative; display: grid; place-items: center; }
.theme-side .ico { --cc: var(--muted); width: 18px; height: 18px; transition: color .2s; }
:root[data-theme="light"] .theme-day .ico, :root[data-theme="dark"] .theme-night .ico { --cc: var(--bg); }
.theme-side .ico.is-missing { width: 12px; height: 12px; border-width: 3px; opacity: 1; }
.theme-night .ico.is-missing { background: currentColor; }
@media (max-width: 420px) { .top-in { gap: 12px; } .lang { position: static; } .lang-list { right: 16px; top: calc(100% - 6px); } .theme-btn { width: 64px; } .theme-side .ico { width: 16px; height: 16px; } .tools { gap: 6px; } }

/* Китайська та японська: латиниця й цифри — фірмові шрифти, ієрогліфи — Noto Sans SC/JP; без від'ємного трекінгу, перенос за фразами */
:root:lang(zh) { --font-display: "Fira Sans Extra Condensed", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif; --font-text: "Golos Text", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif; }
:root:lang(ja) { --font-display: "Fira Sans Extra Condensed", "Noto Sans JP", "Yu Gothic", "Hiragino Sans", sans-serif; --font-text: "Golos Text", "Noto Sans JP", "Yu Gothic", "Hiragino Sans", sans-serif; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { letter-spacing: 0; word-break: auto-phrase; line-break: strict; }
:lang(zh) body, :lang(ja) body { line-break: strict; }
:lang(zh) .hero h1, :lang(ja) .hero h1 { line-height: 1.12; font-size: clamp(38px, 5.4vw, 76px); max-width: 12em; }
@media (max-width: 1180px) { .main-nav { display: none; } .menu-btn { display: inline-grid; } .tools { margin-left: auto; } }
@media (max-width: 560px) { .top .head-cta { display: none; } .wordmark { font-size: 24px; } }

.menu { border: 0; padding: 0; margin: 0 0 0 auto; width: min(100%, 420px); height: 100%; max-height: none; background: var(--bg); color: var(--text); }
.menu::backdrop { background: rgba(0, 0, 0, .6); }
.menu-in { padding: 14px var(--gutter) 32px; display: flex; flex-direction: column; gap: 8px; }
.menu-close { align-self: flex-end; }
.menu nav { display: flex; flex-direction: column; }
.menu nav a { text-decoration: none; font: 700 30px/1.1 var(--font-display); min-height: 52px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.menu .btn { margin-top: 20px; }

/* ---------- Картинки: заглушка тієї ж пропорції ---------- */
.ph { position: relative; overflow: hidden; border-radius: var(--r-img); background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph img.is-missing { visibility: hidden; }
/* У редакторі слот без файлу лишається клікабельним: видно рамку, текст alt прозорий */
.sw-editing .ph img.is-missing { visibility: visible; color: transparent; }
.sw-editing [data-sw-edit].is-missing { outline-offset: -4px; }

/* ---------- Іконки: маска кольору теми (http) або картинка (file://) ---------- */
.ico { display: inline-block; width: 40px; height: 40px; flex: none; color: var(--cc, var(--text)); background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ico:not([style*="--icon"]) { background: transparent; }
.ico.as-img { background: none; }
.ico.as-img img { width: 100%; height: 100%; }
:root[data-theme="dark"] .ico.as-img img { filter: invert(1); }
.ico.is-missing { border: 2px solid currentColor; border-radius: 50%; opacity: .5; }

/* ---------- Метки категорій ---------- */
.tag, .cat { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1.2 var(--font-text); white-space: nowrap; }
.tag::before, .cat::before, .dot { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3.5px solid var(--cc, var(--muted)); flex: none; display: inline-block; }
.tag-strength, .cat-strength { --cc: var(--c-strength); } .tag-cardio, .cat-cardio { --cc: var(--c-cardio); }
.tag-func, .cat-func { --cc: var(--c-func); } .tag-recovery, .cat-recovery { --cc: var(--c-recovery); }

/* ---------- Розділи ---------- */
.sec { padding: var(--sec) 0; }
.sec-surface { background: var(--surface); }
.sec-surface .ph { background: linear-gradient(135deg, var(--surface-2), var(--bg)); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; align-items: end; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head h2 { font-weight: 800; font-size: clamp(38px, 4.6vw, 64px); line-height: .98; }
.sec-head p { margin: 0; color: var(--muted); max-width: 54ch; }
.meta { color: var(--muted); font-size: 15px; }
.note { color: var(--muted); font-size: 15px; margin: 20px 0 0; }
.kicker { margin: 0 0 12px; font-weight: 600; color: var(--muted); }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; } }

/* 1. Hero */
.hero { padding: clamp(32px, 5vw, 72px) 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: start; padding-bottom: clamp(32px, 4vw, 56px); }
.eyebrow { font-weight: 600; font-size: 15px; color: var(--muted); margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.open-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.open-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-recovery); }
.open-dot.is-closed::before { background: var(--muted); }
.hero h1 { font-weight: 800; font-size: clamp(46px, 6.6vw, 96px); line-height: .92; letter-spacing: -.02em; max-width: 13ch; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin: 24px 0 0; max-width: 44ch; font-size: clamp(17px, 1.4vw, 19px); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.bar { list-style: none; margin: 44px 0 0; padding: 18px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; border-top: 2px solid var(--text); }
.bar li { position: relative; }
.bar li::before { content: ""; position: absolute; top: -26px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3.5px solid var(--cc); }
.bar .v { display: block; font: 700 clamp(22px, 2vw, 28px)/1.05 var(--font-display); font-variant-numeric: tabular-nums; }
.bar .k { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.bar .k-line { display: block; white-space: nowrap; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 22px 20px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.board-head h2 { font-size: 28px; font-weight: 700; }
.board-head span { color: var(--muted); font-size: 15px; }
.slots { list-style: none; display: grid; grid-template-columns: 72px max-content minmax(0, 1fr); column-gap: 14px; }
.slot { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 2px; padding: 14px 0 14px 14px; border-top: 1px solid var(--line); position: relative; }
.slot::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 2px; background: var(--cc); }
.slot .t { font: 700 24px/1 var(--font-display); font-variant-numeric: tabular-nums; grid-row: span 3; }
.slot .t small { display: block; font: 500 13px/1.2 var(--font-text); color: var(--muted); margin-top: 5px; }
.slot .n { grid-column: 2 / -1; font-weight: 600; line-height: 1.25; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.slot .m { grid-column: 2 / -1; display: grid; grid-template-columns: subgrid; font-size: 14px; color: var(--muted); white-space: nowrap; }
/* Рівна сітка: у кожному рядку «категорія | тренер», нижче зала на всю ширину; обрізання лише як запобіжник, повна назва — у підказці й для читалок */
.slot .m > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.slot .m > span:last-child { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .slots { grid-template-columns: 60px minmax(0, 1fr); }
  .slot .m > span { grid-column: 1 / -1; }
}
.slot .m .cat { font-size: 14px; color: var(--text); }
.now { font: 700 12px/1 var(--font-text); text-transform: uppercase; letter-spacing: .06em; color: var(--on-accent); background: var(--accent); padding: 4px 6px; border-radius: 2px; }
.board-empty { color: var(--muted); border-top: 1px solid var(--line); margin: 0; padding: 16px 0; }
.board-more { width: 100%; margin-top: 12px; }
.band { aspect-ratio: 16 / 6; }
@media (max-width: 1080px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .board { max-width: 640px; } }
@media (max-width: 760px) {
  .hero h1 { max-width: none; }
  .bar { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 38px; }
}
@media (max-width: 560px) {
  /* На телефоні табло одразу під фактами: друга кнопка дублює «Увесь розклад» у табло */
  .hero .actions .btn-line { display: none; }
  .hero .lead { margin-top: 16px; }
  .actions { margin-top: 20px; }
  .bar { margin-top: 34px; row-gap: 38px; }
  .hero-grid { gap: 20px; }
  .board { padding: 16px 16px 16px; }
  .board-head { margin-bottom: 4px; }
  .board-head h2 { font-size: 24px; }
  .band { aspect-ratio: 4 / 3; }
}

/* 2. Напрями */
.cats { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.cat-card { display: flex; flex-direction: column; gap: 14px; }
.cat-card .ph { aspect-ratio: 4 / 5; border-bottom: 6px solid var(--cc); }
.cat-card h3.tag { font: 700 28px/1 var(--font-display); }
.cat-card h3.tag::before { width: 18px; height: 18px; border-width: 5px; }
.cat-card dl { margin: 0; }
.cat-card dt { font-weight: 700; margin-top: 12px; }
.cat-card dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.cat-card dd .meta { display: block; margin-top: 2px; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 1080px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; } }
@media (max-width: 560px) { .cats { grid-template-columns: 1fr; } .cat-card .ph { aspect-ratio: 16 / 10; } }

/* 3. Розклад */
.sec-board { background: var(--surface); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; border-bottom: 2px solid var(--text); }
.days [role="tab"] { min-height: 60px; border: 0; background: transparent; color: var(--muted); font: 600 17px/1.1 var(--font-text); cursor: pointer; border-radius: var(--r) var(--r) 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 2px; }
.days [role="tab"] small { font-size: 13px; font-weight: 500; }
.days [role="tab"][aria-selected="true"] { background: var(--text); color: var(--bg); }
.days [role="tab"]:hover:not([aria-selected="true"]) { background: var(--surface-2); color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.chip { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: transparent; color: var(--text); font: 500 15px var(--font-text); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--text); background: var(--surface-2); font-weight: 700; box-shadow: inset 0 -3px 0 var(--text); }
.day-panel { border-radius: var(--r); }
.rows { list-style: none; }
.row { display: grid; grid-template-columns: 112px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px 20px; align-items: center; padding: 16px 0 16px 16px; border-bottom: 1px solid var(--line); position: relative; }
.row::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 2px; background: var(--cc); }
.row .t { font: 700 28px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.row .t small { display: block; font: 500 13px var(--font-text); color: var(--muted); margin-top: 5px; }
.row .n { font-weight: 700; font-size: 18px; line-height: 1.25; }
.row .n .cat { display: flex; margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: normal; }
.row .x { color: var(--muted); font-size: 15px; }
.row .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.empty { padding: 32px 0; margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .days [role="tab"] small { display: none; }
  .days { gap: 2px; }
  .days [role="tab"] { font-size: 15px; min-height: 52px; }
  .row { grid-template-columns: 70px minmax(0, 1fr); align-items: start; gap: 4px 14px; }
  .row .t { font-size: 24px; grid-row: span 4; }
  .row .x { grid-column: 2; font-size: 14px; }
  .row .btn { grid-column: 2; justify-self: start; margin-top: 8px; }
}

/* 4. Зони */
.zones { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.zone-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.zone-list [role="tab"] { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: 600 18px/1.2 var(--font-text); text-align: left; cursor: pointer; position: relative; }
.zone-list [role="tab"] .ico { width: 32px; height: 32px; }
.zone-list [role="tab"]:hover { background: var(--surface-2); }
.zone-list [role="tab"][aria-selected="true"] { background: var(--surface); box-shadow: inset 4px 0 0 var(--cc); }
.zone-panel { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.zone-panel[hidden] { display: none; }
.zone-panel .ph { aspect-ratio: 4 / 3; border-radius: 0; }
.zone-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.zone-body h3 { font-size: 34px; font-weight: 700; line-height: 1; }
.zone-body ul { padding-left: 20px; }
.zone-body li { margin: 4px 0; }
.zone-body .meta { margin: 0; }
@media (max-width: 1080px) { .zones { grid-template-columns: 1fr; } .zone-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; } }
@media (max-width: 760px) { .zone-panel { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .zone-list { grid-template-columns: 1fr; } }

/* 5. Переваги */
.benefits { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.benefits li { border-top: 2px solid var(--text); padding-top: 20px; }
.benefits .ico { --cc: var(--accent); width: 44px; height: 44px; }
.benefits h3 { font-size: 26px; font-weight: 700; margin: 14px 0 8px; line-height: 1.05; }
.benefits p { margin: 0; color: var(--muted); }
@media (max-width: 1080px) { .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .benefits { grid-template-columns: 1fr; } }

/* 6. Персональні */
.personal { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.personal .ph { aspect-ratio: 4 / 5; }
.personal h2 { font-weight: 800; font-size: clamp(40px, 5vw, 72px); line-height: .95; max-width: 13ch; }
.personal-text > p:not(.kicker) { color: var(--muted); max-width: 52ch; margin: 20px 0 0; }
.pt-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 32px 0; border-top: 2px solid var(--text); padding-top: 16px; }
.pt-prices dt { color: var(--muted); font-size: 15px; }
.pt-prices dd { margin: 4px 0 0; font: 700 30px/1 var(--font-display); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .personal { grid-template-columns: 1fr; } .personal .ph { aspect-ratio: 16 / 11; } }
@media (max-width: 420px) { .pt-prices { grid-template-columns: 1fr 1fr; } }

/* 7. Тренери */
.team { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.team .ph { aspect-ratio: 4 / 5; margin-bottom: 16px; }
.team h3 { font-size: 28px; font-weight: 700; line-height: 1.05; }
.team .tags { margin: 8px 0; }
.team p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 1080px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; } }
@media (max-width: 480px) { .team { grid-template-columns: 1fr; } }

/* 8. Як почати: гриф із дисками */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: s; position: relative; }
.steps li { position: relative; padding-top: 40px; counter-increment: s; }
.steps li::before { content: ""; position: absolute; top: 12px; left: 0; right: -32px; height: 2px; background: var(--text); }
.steps li:last-child::before { right: 0; }
.steps li::after { content: counter(s); position: absolute; top: 0; left: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); font: 700 13px/18px var(--font-text); text-align: center; color: var(--text); }
.steps .ico { --cc: var(--text); }
.steps h3 { font-size: 28px; font-weight: 700; margin: 12px 0 8px; }
.steps p { margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { padding: 0 0 32px 48px; }
  .steps li::before { top: 0; bottom: 0; left: 12px; right: auto; width: 2px; height: auto; }
  .steps li:last-child::before { bottom: auto; height: 26px; }
  .steps li::after { top: 0; }
}

/* 9. Абонементи */
.plans { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 22px; display: flex; flex-direction: column; gap: 6px; }
.plan h3 { font-size: 28px; font-weight: 700; }
.plan .sum { margin: 10px 0 0; font: 800 clamp(40px, 3.6vw, 52px)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.plan .per { margin: 0 0 12px; color: var(--muted); }
.plan ul { list-style: none; margin-bottom: 20px; flex: 1; }
.plan li { padding: 8px 0 8px 24px; border-top: 1px solid var(--line); position: relative; font-size: 16px; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--accent); }
.plan-pick { border: 2px solid var(--text); position: relative; }
.pick { margin: 0 0 4px; font-weight: 700; font-size: 14px; color: var(--accent); }
:root[data-theme="dark"] .pick { color: var(--accent); }
.extras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 32px 0 0; border-top: 2px solid var(--text); padding-top: 16px; }
.extras dt { color: var(--muted); font-size: 15px; }
.extras dd { margin: 4px 0 0; font: 700 26px/1 var(--font-display); }
@media (max-width: 1080px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .plans, .extras { grid-template-columns: 1fr; } }

/* 10. Пробне: форма */
.trial { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.trial h2 { font-weight: 800; font-size: clamp(40px, 5vw, 72px); line-height: .95; }
.trial-side > p { color: var(--muted); margin: 20px 0 28px; max-width: 46ch; }
.trial-side .ph { aspect-ratio: 4 / 3; }
.form { display: flex; flex-direction: column; gap: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 3vw, 32px); }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; padding: 0; }
.ctl { display: block; position: relative; }
.ctl input, .ctl select { width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); font: 400 17px var(--font-text); appearance: none; }
.ctl input:hover, .ctl select:hover { border-color: var(--muted); }
.ctl input:focus-visible, .ctl select:focus-visible { border-color: var(--text); }
.ctl.is-select select { padding-right: 48px; }
.ctl.is-select::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.ctl.invalid input { border-color: var(--err); }
.err { margin: 0; color: var(--err); font-size: 15px; font-weight: 500; }
.seg-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-choice label { position: relative; }
.seg-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r); font-weight: 500; cursor: pointer; }
.seg-choice input:checked + span { border-color: var(--text); background: var(--text); color: var(--bg); font-weight: 600; }
.seg-choice input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 2px; }
.form > .btn { align-self: flex-start; }
.hint { margin: -6px 0 0; color: var(--muted); font-size: 14px; }
.result { border-top: 2px solid var(--text); padding-top: 20px; }
.result:focus { outline: none; }
.result h3 { font-size: 28px; }
.result p { color: var(--muted); margin: 8px 0 12px; }
.result pre { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; font: 400 15px/1.5 var(--font-text); margin: 0; }
.result .actions { margin-top: 16px; }
.status { min-height: 1.5em; font-weight: 600; }
@media (max-width: 960px) { .trial { grid-template-columns: 1fr; } .trial-side .ph { display: none; } }

/* 11. Відгуки (вимкнено на демо) */
.reviews { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.reviews li { background: var(--surface); border-radius: var(--r); padding: 24px; }
.reviews blockquote { margin: 0 0 12px; font-size: 18px; }
.reviews p { margin: 0; color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .reviews { grid-template-columns: 1fr; } }

/* 12. Галерея */
.gallery { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 12px; }
.gallery .ph { aspect-ratio: 1; height: 100%; }
.gallery .g-tall { grid-row: span 2; }
.gallery .g-tall .ph { aspect-ratio: auto; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* 13. Статті */
.articles { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.articles .ph { aspect-ratio: 3 / 2; margin-bottom: 16px; }
.articles h3 { font-size: 26px; font-weight: 700; line-height: 1.05; }
.articles li > p { color: var(--muted); margin: 8px 0 4px; }
.articles details p { color: var(--text); margin: 8px 0 0; }
summary { cursor: pointer; }
.articles summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; list-style: none; }
.articles summary::-webkit-details-marker, .qa summary::-webkit-details-marker { display: none; }
.articles summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); }
.articles details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
@media (max-width: 960px) { .articles { grid-template-columns: 1fr; max-width: 640px; } }

/* 14. FAQ */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 48px; }
.faq h2 { font-weight: 800; font-size: clamp(38px, 4.6vw, 64px); line-height: .98; }
.qa { border-top: 2px solid var(--text); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; padding: 12px 0; font-weight: 600; font-size: 18px; }
.qa summary::after { content: "+"; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: var(--r); font: 500 22px/1 var(--font-text); }
.qa details[open] summary::after { content: "−"; }
.qa details p { margin: 0 0 20px; color: var(--muted); max-width: 64ch; }
@media (max-width: 860px) { .faq { grid-template-columns: 1fr; } }

/* 15. Контакти */
.contacts { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.contacts .ph { aspect-ratio: 16 / 10; }
.contacts h2 { font-weight: 800; font-size: clamp(38px, 4.6vw, 64px); line-height: .98; }
.addr { font-size: 19px; font-weight: 600; margin: 16px 0 20px; }
.hours { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-variant-numeric: tabular-nums; }
.hours caption { text-align: left; font-weight: 600; color: var(--muted); padding-bottom: 6px; }
.hours th, .hours td { padding: 10px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 500; }
.hours td { text-align: right; font: 700 22px/1 var(--font-display); }
.links { list-style: none; margin-bottom: 24px; }
.links li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.links span { color: var(--muted); }
.links a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; text-underline-offset: 4px; overflow-wrap: anywhere; }
@media (max-width: 960px) { .contacts { grid-template-columns: 1fr; } }

/* Підвал */
.foot { border-top: 1px solid var(--line); padding: 32px 0; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px; }
.foot nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; text-decoration: none; border-radius: var(--r); }
.foot nav a:hover { background: var(--surface-2); }
.copy { margin: 0 0 0 auto; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .copy { margin: 0; } }

/* ---------- Редактор (лише ?edit=1 локально) ---------- */
.sw-editing [data-sw-edit] { outline: 1px dashed transparent; outline-offset: 3px; cursor: pointer; }
.sw-editing [data-sw-edit].sw-hover, .sw-editing [data-sw-edit]:focus-visible { outline: 2px dashed var(--accent); }
.sw-pencil { position: absolute; z-index: 40; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--bg); background: var(--accent); color: var(--on-accent); pointer-events: auto; cursor: pointer; }
.sw-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: min(calc(100% - 24px), 1040px); background: var(--surface); border: 2px solid var(--text); border-radius: var(--r); padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.sw-bar .btn { min-height: 44px; padding: 0 14px; font-size: 15px; }
.sw-msg { flex: 1 1 240px; margin: 0; font-size: 14px; }
.sw-dialog { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); width: min(calc(100% - 24px), 640px); padding: 24px; }
.sw-dialog::backdrop { background: rgba(0,0,0,.6); }
.sw-dialog form { display: flex; flex-direction: column; gap: 12px; }
.sw-dialog h2 { font-size: 30px; }
.sw-dialog textarea, .sw-dialog select, .sw-dialog input[type="file"] { width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font-text); padding: 10px 12px; }
.sw-dialog textarea { min-height: 140px; resize: vertical; }
.sw-dialog textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; min-height: 320px; }
.sw-hint { color: var(--muted); font-size: 14px; margin: 0; }
.sw-dialog .err { min-height: 1.4em; }
.sw-dialog .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-dialog label.chk { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.sw-dialog label.chk input { width: 22px; height: 22px; }
