/* Rover — школа робототехніки. Напрям A «Креслення». */

:root {
  --bg: #0E1A2B; --surface: #15263D; --text: #EAF1F8; --muted: #9FB3C8;
  --cta: #FF8A3D; --cta-ink: #0E1A2B; --line: #5CC8E8; --err: #FF9B8A;
  --grid: rgba(92, 200, 232, .07); --rule: rgba(159, 179, 200, .28); --ph: #1B3049;
  --accent-bg: #172F42;
  --cut: 8px; --gutter: clamp(16px, 4vw, 56px); --max: 1328px;
  --sk: clamp(28px, 7vw, 100px); /* зріз смуги ≈ 4° */
  --sans: "IBM Plex Sans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F2F5F8; --surface: #FFFFFF; --text: #0E1A2B; --muted: #4A5D72;
  --line: #1F6F94; --err: #B42318;
  --grid: rgba(31, 111, 148, .07); --rule: rgba(74, 93, 114, .3); --ph: #DCE4EC;
  --accent-bg: #DCE7EE;
  color-scheme: light;
}
/* Китайська та японська: латиниця з Plex, ієрогліфи з Noto (підвантажує app.js) або системних шрифтів */
html:lang(zh-Hans) { --sans: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; --mono: "IBM Plex Mono", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", monospace; }
html:lang(ja) { --sans: "IBM Plex Sans", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif; --mono: "IBM Plex Mono", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", monospace; }
html:lang(zh-Hans) :is(h1, h2, h3, .wordmark), html:lang(ja) :is(h1, h2, h3, .wordmark) { letter-spacing: 0; }
/* Перенос CJK: ー, малые кана и знаки препинания не начинают строку; японские заголовки и кнопки
   переносятся по смысловым фразам (Chrome/Edge 119+; в других браузерах — обычный перенос). */
html:lang(zh-Hans), html:lang(ja) { line-break: strict; }
html:lang(ja) :is(h1, h2, h3, .btn, .data, figcaption, .tag, summary, dt, dd, label, nav a) { word-break: auto-phrase; }

* { box-sizing: border-box; }
html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; font: 400 17px/1.55 var(--sans); color: var(--text); background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; overflow-x: hidden;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
h2 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
h3 { font-size: 20px; line-height: 1.25; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--line); outline-offset: 3px; }
main:focus { outline: 0; }

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 50; background: var(--surface); color: var(--text); padding: 12px 16px; font-weight: 600; }
.skip:focus { top: 16px; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 7vw, 104px); }
.sub { color: var(--muted); max-width: 40em; margin-top: 16px; }
.note { color: var(--muted); font-size: 15px; margin-top: 24px; }
.data { font: 500 14px/1.4 var(--mono); color: var(--line); margin-bottom: 16px; }
.head-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 56px; align-items: end; margin-bottom: 40px; }
.head-row .sub { margin-top: 0; }

/* ---------- Фаска і контур ---------- */
.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
/* Контур зі скосом: лінія йде і по діагоналях фаски */
.ol { position: relative; isolation: isolate; background: var(--olc, var(--rule)) !important; }
.ol::before {
  content: ""; position: absolute; inset: var(--olw, 1.5px); z-index: -1; background: var(--olbg, var(--bg));
  clip-path: polygon(calc(var(--cut) - .6px) 0, 100% 0, 100% calc(100% - var(--cut) + .6px), calc(100% - var(--cut) + .6px) 100%, 0 100%, 0 calc(var(--cut) - .6px));
}
a.ol:hover, button.ol:hover { --olc: var(--line); }
.ol:focus-visible { outline: 0; --olc: var(--text); --olw: 3px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 48px; padding: 10px 24px; border: 0; font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--cta); color: var(--cta-ink); }
.btn-primary:hover { background: #FFA466; }
.btn-primary:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--cta-ink); }
.btn-line { color: var(--text); }
.icon-btn { width: 44px; min-height: 44px; padding: 0; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }


/* ---------- Шапка ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--rule); }
.top-in { display: flex; align-items: center; gap: 28px; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding: 14px var(--gutter); }
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; flex: none; }
.wordmark { font: 700 26px/1 var(--sans); letter-spacing: -.02em; }
.logo { display: none; height: 40px; width: auto; }
.foot .logo { height: 36px; }
[data-theme="dark"] .brand.has-dark .wordmark, [data-theme="light"] .brand.has-light .wordmark { display: none; }
[data-theme="dark"] .brand.has-dark .logo-dark, [data-theme="light"] .brand.has-light .logo-light { display: block; }
.main-nav { display: flex; gap: 16px; margin-left: auto; }
.main-nav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 11px 4px; min-width: 44px; text-align: center; }
.main-nav a:hover { color: var(--text); }
.tools { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.menu-panel { border-top: 1px solid var(--rule); padding: 8px var(--gutter) 20px; background: var(--bg); }
.menu-panel[hidden] { display: none; }
.menu-panel nav { display: grid; margin-bottom: 16px; }
.menu-panel nav a { padding: 12px 0; min-height: 44px; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--rule); }
/* Мова: у шапці — кнопка зі списком посилань, у мобільному меню — ті самі посилання сіткою */
/* Перемикач теми: таблетка зі скосами, бігунок — скошений брусок кольору лінії креслення */
.theme-sw { display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; justify-items: center; flex: none;
  width: 88px; height: 44px; padding: 4px; border: 0; color: var(--muted); cursor: pointer; }
.theme-knob { position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px); background: var(--line); transition: transform .2s ease; }
.theme-sw[aria-checked="true"] .theme-knob { transform: translateX(100%); }
.theme-ico { position: relative; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; transition: color .2s ease; }
.ti-hidden { stroke-dasharray: 1.4 1.8; stroke-linecap: butt; }
.theme-sw[aria-checked="false"] .ti-light, .theme-sw[aria-checked="true"] .ti-dark { color: var(--bg); }
.theme-sw[aria-checked="true"]:hover .ti-light, .theme-sw[aria-checked="false"]:hover .ti-dark { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .theme-knob, .theme-ico { transition: none; } }

.lang-pick { position: relative; }
.lang-btn { min-height: 44px; padding: 0 14px 0 16px; gap: 12px; color: var(--text); font: 500 14px/1 var(--mono); }
.lang-arrow { width: 7px; height: 7px; margin-top: -4px; border: solid var(--line); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lang-btn[aria-expanded="true"] .lang-arrow { transform: rotate(-135deg); margin-top: 4px; }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 1.5px; list-style: none; min-width: 200px; --olbg: var(--surface); }
.lang-list[hidden] { display: none; }
.lang-list li + li { border-top: 1px solid var(--rule); }
.lang-list a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--muted); text-decoration: none; font-weight: 500; }
.lang-list a:hover { color: var(--text); background: var(--bg); }
.lang-list a[aria-current] { color: var(--text); box-shadow: inset 3px 0 0 var(--line); }
.lang-list a:focus-visible { outline: 0; color: var(--text); box-shadow: inset 0 0 0 3px var(--text); }
.menu-panel nav.lang-links { margin: 0; }
.lang-links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 0 16px; }
.menu-panel .lang-links a { display: flex; align-items: center; border: 0; color: var(--muted); }
.menu-panel .lang-links a[aria-current] { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- 1. Перший екран (концепція 1 «Аркуш») ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 56px; align-items: center;
  padding-top: clamp(32px, 4.5vw, 64px);
}
.hero h1 { font-size: clamp(36px, 4vw, 58px); line-height: 1.06; letter-spacing: -.025em; font-weight: 700; margin-bottom: 24px; max-width: 13em; }
.lead { color: var(--muted); max-width: 34em; margin-bottom: 32px; font-size: 18px; }

.sheet { position: relative; padding: 28px 0 0 28px; }
.frame { position: relative; overflow: hidden; }
.frame img, .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { display: block; background: var(--ph); }
img.is-missing { visibility: hidden; }
.dim-top, .dim-left { position: absolute; color: var(--line); }
.dim-top { left: 28px; right: 0; top: 8px; height: 1px; background: currentColor; }
.dim-top::before, .dim-top::after, .dim-left::before, .dim-left::after { content: ""; position: absolute; background: currentColor; }
.dim-top::before, .dim-top::after { width: 1px; height: 11px; top: -5px; }
.dim-top::before { left: 0; } .dim-top::after { right: 0; }
.dim-left { top: 28px; bottom: 0; left: 8px; width: 1px; background: currentColor; }
.dim-left::before, .dim-left::after { height: 1px; width: 11px; left: -5px; }
.dim-left::before { top: 0; } .dim-left::after { bottom: 0; }

.callouts { list-style: none; margin: 0; padding: 0; }
.callout { position: absolute; display: flex; align-items: center; font: 500 14px/1.3 var(--sans); }
.callout .pin { width: 12px; height: 12px; border: 2px solid var(--cta); background: var(--bg); flex: none; transform: rotate(45deg); }
.callout .lead-line { height: 1.5px; width: 48px; background: var(--cta); flex: none; }
.callout .tag { background: var(--surface); padding: 8px 12px; box-shadow: inset 0 0 0 1px var(--rule); white-space: nowrap; }
.callout .tag b { display: block; font: 500 12px/1.2 var(--mono); color: var(--line); }
.callout .tag span { display: block; }
/* Точки прив'язані до деталей фото hero-workshop: гвинт, колесо, макетна плата */
.c-hands { right: calc(48% - 20px); top: 56%; flex-direction: row-reverse; }
.c-wheel { right: calc(54% - 22px); top: 77%; flex-direction: row-reverse; }
.c-board { left: calc(28px + 66%); top: 64%; }
.c-board { right: 0; }
.c-board .lead-line { width: 20px; }
.c-board .tag { white-space: normal; flex: 1; min-width: 0; }

/* ---------- 2. Штамп формату ---------- */
.format { margin-top: 48px; }
.stamp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border: 1px solid var(--rule); background: var(--bg); }
.stamp div { padding: 14px 20px; border-left: 1px solid var(--rule); }
.stamp div:first-child { border-left: 0; }
.stamp dt { font: 500 12px/1.3 var(--mono); color: var(--muted); }
.stamp dd { margin: 4px 0 0; font-weight: 600; font-size: 18px; }

/* ---------- Іконки (маска SVG, колір з теми) ---------- */
.ico { display: block; width: 48px; height: 48px; flex: none; background: var(--line); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ico:not([style]) { background: transparent; -webkit-mask: none; mask: none; }
.ico.as-img { background: transparent; -webkit-mask: none; mask: none; }
.ico.as-img img { display: block; width: 100%; height: 100%; }
[data-theme="dark"] .ico.as-img img { filter: invert(1) brightness(.94); }
.ico.is-missing { background: transparent; -webkit-mask: none; mask: none; box-shadow: inset 0 0 0 1px var(--rule); }
/* Іконки інтерфейсу (Codex, assets/icons/ui-*): колір кнопки; без файлу — текстовий знак */
.ico-ui { width: 22px; height: 22px; background: currentColor; }
.rv-pencil .ico-ui { width: 20px; height: 20px; }
.rv-pencil .ico.as-img img { filter: none; }
.ico-ui.is-missing { box-shadow: none; display: grid; place-items: center; font: 600 18px/1 var(--sans); }
.ico-ui.is-missing::after { content: attr(data-fb); }

/* ---------- 3. Переваги ---------- */
.why h2 { max-width: 16em; margin-bottom: 40px; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.why-list li { padding: 28px 24px 0 0; display: grid; gap: 12px; align-content: start; }
.why-list li + li { padding-left: 24px; border-left: 1px solid var(--rule); }
.why-list p { color: var(--muted); }

/* ---------- 4. Про школу + круглі фото ---------- */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: center; padding-top: 0; }
.about-text h2 { margin-bottom: 24px; }
.about-text p { color: var(--muted); max-width: 36em; }
.about-text p + p { margin-top: 16px; }
.ticks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; border: 2px solid var(--line); transform: rotate(45deg); }

.disc { position: relative; width: min(100%, 460px); aspect-ratio: 1; margin: 18px auto; justify-self: center; }
.disc .ring { position: absolute; inset: -18px; border: 1px solid var(--line); border-radius: 50%; pointer-events: none; }
.disc .ring::before, .disc .ring::after { content: ""; position: absolute; background: var(--line); }
.disc .ring::before { left: 50%; top: -10px; width: 1px; height: 20px; }
.disc .ring::after { top: 50%; right: -10px; height: 1px; width: 20px; }
.disc .photo { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.disc.small { width: min(100%, 340px); }
.disc.mid { width: min(100%, 400px); }

/* ---------- Смуги зі зрізаним краєм ---------- */
.band {
  --olbg: var(--surface); background: var(--surface);
  clip-path: polygon(0 var(--sk), 100% 0, 100% calc(100% - var(--sk)), 0 100%);
  padding-block: var(--sk); margin-block: calc(var(--sk) * -.35);
  position: relative;
}
.band > .section { padding-block: clamp(32px, 4vw, 64px); }
.band.accent { --olbg: var(--accent-bg); background: var(--accent-bg); }
.band .sub, .band .note { color: var(--muted); }

/* ---------- 5. Курси: вкладки віку ---------- */
.ask { font: 500 14px/1.4 var(--mono); color: var(--line); margin-bottom: 12px; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 40px; max-width: 760px; }
.tab { min-height: 72px; border: 0; padding: 12px 16px; color: var(--text); font: 600 24px/1 var(--mono); cursor: pointer; text-align: left; }
.tab small { display: block; font: 400 13px/1.2 var(--sans); color: var(--muted); margin-top: 6px; }
.tab[aria-selected="true"] { --olc: var(--cta); --olbg: var(--cta); color: var(--cta-ink); }
.tab[aria-selected="true"] small { color: var(--cta-ink); }
.tab[aria-selected="true"]:hover { --olc: var(--cta); }
.tab[aria-selected="true"]:focus-visible { --olc: var(--text); }
.panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.panel[hidden] { display: none; }
.panel:focus-visible { outline-offset: 8px; }
.panel-text h3 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.015em; margin-bottom: 16px; }
.panel-text > p:not(.data) { color: var(--muted); max-width: 34em; }
.panel-text h4 { font: 500 13px/1.3 var(--mono); color: var(--muted); margin-top: 28px; text-transform: lowercase; }
.panel-text .ticks { margin-top: 12px; margin-bottom: 32px; }

/* ---------- 6. Як проходить ---------- */
.lesson { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: start; }
.steps { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: s; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 20px; padding: 20px 0; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps h3::before { content: "0" counter(s) " "; font: 500 14px/1 var(--mono); color: var(--line); margin-right: 6px; }
.steps p { color: var(--muted); margin-top: 6px; }
.tall { margin: 0; position: sticky; top: 120px; }

/* ---------- 7. Команда (ролі) ---------- */
.team { padding-top: 0; }
.roles { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.roles li { display: grid; gap: 12px; align-content: start; padding: 24px; background: var(--surface); }
.roles p { color: var(--muted); }

/* ---------- 8. Галерея моделей ---------- */
.models { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
.models figure { margin: 0; }
.models figcaption { display: grid; gap: 4px; margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--line); }
.models figcaption span { font: 400 13px/1.45 var(--mono); color: var(--muted); }

/* ---------- 9. Ціни ---------- */
.plans { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.plan { padding: 28px; display: grid; gap: 12px; align-content: start; }
.plan .price { font: 600 32px/1.1 var(--mono); letter-spacing: -.02em; }
.plan .price small { font: 400 14px/1 var(--sans); color: var(--muted); letter-spacing: 0; }
.plan p:last-child { color: var(--muted); }

/* ---------- 10. Набір груп ---------- */
.groups { padding-top: 0; }
.rows { list-style: none; margin: 32px 0 0; padding: 0; }
.row { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 16px 32px; align-items: center; padding: 20px 0; border-top: 1px solid var(--rule); }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row .when { font: 500 15px/1.3 var(--mono); color: var(--line); }
.row p:not(.when) { color: var(--muted); margin-top: 4px; font-family: var(--mono); font-size: 14px; }

/* ---------- 11. Запис ---------- */
.trial { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: center; }
.trial-form h2 { margin-bottom: 16px; }
form { margin-top: 32px; display: grid; gap: 20px; max-width: 640px; }
.field { display: grid; gap: 8px; }
.field.two { grid-template-columns: 1fr 1fr; gap: 20px; }
.field.two > div { display: grid; gap: 8px; align-content: start; }
label { font-weight: 600; font-size: 15px; }
.ctl { display: block; --olc: var(--muted); }
.ctl:hover { --olc: var(--line); }
.ctl:focus-within { --olc: var(--line); --olw: 3px; }
.ctl input, .ctl select {
  display: block; width: 100%; min-height: 50px; border: 0; background: transparent; color: var(--text);
  font: 400 17px/1.3 var(--sans); padding: 12px 16px; border-radius: 0; appearance: none; -webkit-appearance: none;
}
.ctl input:focus, .ctl select:focus { outline: 0; }
.ctl select option { background: var(--surface); color: var(--text); }
.ctl.is-select::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--line); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.ctl.is-select select { padding-right: 44px; cursor: pointer; }
.ctl.invalid { --olc: var(--err); }
.err { color: var(--err); font-size: 14px; font-weight: 500; }
form .btn { justify-self: start; }
.result { margin-top: 32px; padding: 28px; display: grid; gap: 14px; max-width: 640px; }
.result:focus { outline: 0; }
.result p { color: var(--muted); }
.result pre { margin: 0; padding: 16px; background: var(--bg); font: 400 14px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.status { font: 500 14px/1.4 var(--mono); color: var(--line); min-height: 1.4em; }

/* ---------- 12. Питання ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px 56px; align-items: start; }
.qa { border-top: 1px solid var(--rule); }
details { border-bottom: 1px solid var(--rule); }
summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 56px; padding: 14px 0; font-weight: 600; font-size: 18px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 500 22px/1 var(--mono); color: var(--line); flex: none; width: 24px; text-align: center; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); padding-bottom: 20px; max-width: 42em; }

/* ---------- 13. Контакти ---------- */
.contacts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 56px; align-items: start; }
.contacts h2 { margin-bottom: 28px; }
.cdata { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.cdata div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.cdata dt { font: 500 13px/1.6 var(--mono); color: var(--muted); }
.cdata dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.cdata a { color: var(--line); display: inline-block; padding-block: 10px; margin-block: -10px; }
.contacts .room { margin: 28px 0 0; }
/* Карта: OpenStreetMap через Leaflet (vendor/leaflet), підвантажується в map.js, коли блок близько до екрана */
.place { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.osm-frame { padding: 1.5px; }
.osm-frame:focus-within { --olc: var(--line); padding: 3px; }
.osm { position: relative; width: 100%; aspect-ratio: 16 / 11; background: var(--ph); overflow: hidden; z-index: 0; outline: 0; }
.osm:focus-visible { outline: 0; }
@media (max-width: 640px) { .osm { aspect-ratio: auto; height: 340px; } }
.osm-fallback { margin: 0; padding: 20px; display: grid; gap: 8px; align-content: center; height: 100%; font-weight: 500; }
.osm.is-ready .osm-fallback { display: none; }
.osm-link { color: var(--line); display: inline-block; padding-block: 10px; justify-self: start; }
.place-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.place-hint { margin: 0; font: 400 13px/1.45 var(--mono); color: var(--muted); }
.place .osm.leaflet-container { font: 400 14px/1.4 var(--sans); background: var(--ph); }
[data-theme="dark"] .place .osm .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) saturate(.45) brightness(.82) contrast(.92); }
[data-theme="light"] .place .osm .leaflet-tile-pane { filter: saturate(.7); }
.place .osm .leaflet-bar { border: 1px solid var(--rule); border-radius: 0; box-shadow: none; }
.place .osm .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font: 600 22px/44px var(--sans); background: var(--surface); color: var(--text); border-color: var(--rule); border-radius: 0 !important; }
.place .osm .leaflet-bar a:hover { background: var(--bg); }
.place .osm .leaflet-bar a:focus-visible { outline: 3px solid var(--line); outline-offset: -3px; }
.place .osm .leaflet-bar a.leaflet-disabled { background: var(--surface); color: var(--muted); }
.place .osm .leaflet-control-attribution { background: var(--surface); color: var(--muted); font-size: 12px; padding: 2px 6px; }
.place .osm .leaflet-control-attribution a { color: var(--line); }
.place .osm .leaflet-popup-content-wrapper, .place .osm .leaflet-popup-tip { background: var(--surface); color: var(--text); border-radius: 0; box-shadow: 0 0 0 1px var(--rule); }
.place .osm .leaflet-popup-content { margin: 12px 16px; font-weight: 500; }
.place .osm a.leaflet-popup-close-button { width: 44px; height: 44px; font: 400 22px/44px var(--sans); color: var(--muted); }
/* Маркер — колір кнопки шаблону */
.place .rv-pin { display: grid; place-items: center; background: none; border: 0; }  /* зона натискання 44 px, видима точка 36 px з обведенням */
.place .rv-pin::before { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--cta); box-shadow: 0 0 0 4px var(--cta-ink), 0 0 0 6px var(--cta); }
.place .rv-pin:focus-visible { outline: 3px solid var(--line); outline-offset: 0; }

/* ---------- Підвал ---------- */
.foot { margin-top: 24px; }
.foot-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 40px; align-items: center; padding-block: 32px; }
.foot-in p { color: var(--muted); font-size: 15px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 8px; grid-column: 1 / -1; margin-inline: -8px; }
.foot nav a { color: var(--muted); text-decoration: none; padding: 11px 8px; min-width: 44px; text-align: center; }
.foot nav a:hover { color: var(--text); }
.foot .copy { font: 400 13px/1 var(--mono); }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .main-nav { display: none; }
  .menu-btn { display: inline-flex; }
  .tools { margin-left: auto; }
  .why-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why-list li:nth-child(3) { border-left: 0; padding-left: 0; }
  .why-list li:nth-child(n+3) { padding-top: 32px; }
  /* Виноски під фото: на вузькому фото вони закривали б кадр */
  .callouts { display: grid; gap: 8px; margin-top: 16px; }
  .callout { position: static; flex-direction: row !important; }
  .callout .lead-line { width: 16px !important; }
  .callout .tag { white-space: normal; flex: 1; }
  .c-hands .lead-line, .c-wheel .lead-line { transform-origin: left !important; }
}
@media (min-width: 1181px) { .menu-panel { display: none !important; } }
@media (max-width: 960px) {
  .hero, .about, .lesson, .trial, .faq, .contacts, .head-row, .panel { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 32px; }
  .hero h1 { max-width: 16em; }
  .sheet { padding: 20px 0 0 20px; }
  .dim-top { left: 20px; top: 6px; } .dim-left { top: 20px; left: 6px; }
  .stamp { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stamp div:nth-child(4) { border-left: 0; }
  .stamp div:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .panel { gap: 40px; }
  .panel .disc { order: 0; }
  .tall { position: static; max-width: 520px; }
  .roles, .plans { grid-template-columns: minmax(0, 1fr); }
  .models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head-row { gap: 12px; }
  .about .disc { width: min(78vw, 400px); }
}
@media (max-width: 720px) {
  .head-cta { display: none; }
  .top-in { gap: 12px; padding-block: 10px; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .row .btn { justify-self: start; margin-top: 8px; }
  .field.two { grid-template-columns: minmax(0, 1fr); }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .why-list, .models { grid-template-columns: minmax(0, 1fr); }
  .why-list li, .why-list li + li { padding: 24px 0 0; border-left: 0; }
  .why-list li + li { border-top: 1px solid var(--rule); margin-top: 24px; }
  .stamp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stamp div:nth-child(n) { border-left: 0; border-top: 1px solid var(--rule); }
  .stamp div:nth-child(-n+2) { border-top: 0; }
  .stamp div:nth-child(even) { border-left: 1px solid var(--rule); }
  .stamp div:last-child { grid-column: 1 / -1; }
  .actions .btn, form .btn { flex: 1 1 100%; width: 100%; }
  .disc.small, .disc.mid { width: min(72vw, 300px); }
  .cdata div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .plan { padding: 24px; }
  .result { padding: 20px; }
}
@media (max-width: 520px) { .top .tools > .lang-pick { display: none; } }

/* ---------- Рух ---------- */
@media (prefers-reduced-motion: no-preference) {
  .callout .lead-line { transform-origin: left; animation: draw .6s .2s ease-out both; }
  .c-hands .lead-line, .c-wheel .lead-line { transform-origin: right; }
  .callout .tag { animation: fade .3s .7s ease-out both; }
  @keyframes draw { from { transform: scaleX(0); } }
  @keyframes fade { from { opacity: 0; } }
  .btn, .tab, .ol, .main-nav a { transition: background-color .15s ease, color .15s ease; }
}

/* ---------- Режим редагування (editor.js) ---------- */
.rv-editing [data-k], .rv-editing [data-slot] { cursor: pointer; }
.rv-editing [data-k]:hover, .rv-editing .rv-hover { outline: 2px dashed var(--cta); outline-offset: 2px; }
.rv-editing img[data-slot]:focus-visible { outline: 3px solid var(--cta); outline-offset: -3px; }
/* A slot without a photo stays clickable in the editor, so the owner can add one. */
.rv-editing img[data-slot].is-missing { visibility: visible; color: transparent; background: color-mix(in srgb, var(--cta) 10%, transparent); outline: 2px dashed var(--cta); outline-offset: -2px; }
.rv-pencil {
  position: absolute; z-index: 55; width: 44px; height: 44px; display: grid; place-items: center; border: 0; cursor: pointer;
  background: var(--cta); color: var(--cta-ink); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.rv-pencil[hidden] { display: none; }
.rv-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; width: min(calc(100% - 32px), 760px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; background: var(--surface); color: var(--text);
  box-shadow: 0 0 0 1px var(--rule), 0 12px 32px rgba(0, 0, 0, .35); font-size: 15px;
}
.rv-bar .rv-msg { flex: 1 1 200px; color: var(--muted); }
.rv-bar .btn { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.rv-dialog { border: 0; padding: 0; background: var(--surface); color: var(--text); width: min(calc(100% - 32px), 560px); box-shadow: 0 0 0 1px var(--rule), 0 16px 40px rgba(0, 0, 0, .4); }
.rv-dialog::backdrop { background: rgba(5, 10, 18, .6); }
.rv-dialog form { margin: 0; padding: 24px; max-width: none; }
.rv-dialog h2 { font-size: 24px; }
.rv-dialog textarea {
  width: 100%; min-height: 120px; padding: 12px; border: 2px solid var(--muted); background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--sans); resize: vertical;
}
.rv-dialog textarea:focus { outline: 0; border-color: var(--line); }
.rv-dialog .rv-hint { color: var(--muted); font-size: 14px; }
