/* Справка программы — те же цвета, что в программе (RAL 5024 — акцент), светлая и тёмная тема. */
:root {
  --accent: #6093ac;
  --accent-strong: #3f7590;
  --accent-soft: #e3eef4;
  --on-accent: #ffffff;
  --page: #f3f4f6;
  --surface: #ffffff;
  --side: #ffffff;
  --text: #1f2328;
  --muted: #667085;
  --border: #dde1e6;
  --chip: #eef1f4;
  --hover: #f2f6f9;
  --error: #c4314b;
  --error-soft: #fdecef;
  --success: #2e7d4f;
  --success-soft: #e6f4ea;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --mark: #ffe58a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
  --dim: rgba(15, 23, 42, .38);
  --bb: #dbeafe; --bbt: #1d4f91; --bg: #dcf3e3; --bgt: #1d6b3d; --bgr: #e7eaee; --bgrt: #4a5462; --bo: #ffe8cc; --bot: #8a4b00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #6f9fb6; --accent-strong: #8db6ca; --accent-soft: #1f3440; --on-accent: #ffffff;
    --page: #1b1d20; --surface: #26292d; --side: #222428; --text: #e8eaed; --muted: #a0a6ae;
    --border: #3a3f45; --chip: #30343a; --hover: #2d3137;
    --error: #ff7b8a; --error-soft: #3b2328; --success: #6fcf97; --success-soft: #1f3529;
    --warn: #f0c050; --warn-soft: #3a3120; --mark: #6b5a1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25); --dim: rgba(0, 0, 0, .45);
    --bb: #1e3350; --bbt: #9cc3ff; --bg: #1c3a29; --bgt: #8fdcab; --bgr: #33373d; --bgrt: #c3c8cf; --bo: #43311a; --bot: #ffc27a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #6f9fb6; --accent-strong: #8db6ca; --accent-soft: #1f3440; --on-accent: #ffffff;
  --page: #1b1d20; --surface: #26292d; --side: #222428; --text: #e8eaed; --muted: #a0a6ae;
  --border: #3a3f45; --chip: #30343a; --hover: #2d3137;
  --error: #ff7b8a; --error-soft: #3b2328; --success: #6fcf97; --success-soft: #1f3529;
  --warn: #f0c050; --warn-soft: #3a3120; --mark: #6b5a1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25); --dim: rgba(0, 0, 0, .45);
    --bb: #1e3350; --bbt: #9cc3ff; --bg: #1c3a29; --bgt: #8fdcab; --bgr: #33373d; --bgrt: #c3c8cf; --bo: #43311a; --bot: #ffc27a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--text);
  font: 15px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top" "side main";
}
a { color: var(--accent-strong); }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .45em; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; background: var(--surface); font: 600 .85em/1.55 "Segoe UI", system-ui, sans-serif; text-align: center;
}
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- верх: название и поиск ---------- */
.top {
  grid-area: top; display: flex; align-items: center; gap: 16px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; white-space: nowrap; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-size: 18px;
}
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input {
  width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--page); color: var(--text); font: inherit;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
.search::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border: 2px solid var(--muted); border-radius: 50%;
}
.search::after {
  content: ""; position: absolute; left: 24px; top: 50%; width: 6px; height: 2px; margin-top: 4px;
  background: var(--muted); transform: rotate(45deg);
}
.tour-link {
  border: 1px solid var(--accent); background: transparent; color: var(--accent-strong); border-radius: 8px;
  padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tour-link:hover { background: var(--accent-soft); }

/* ---------- слева: оглавление ---------- */
.toc { grid-area: side; overflow-y: auto; background: var(--side); border-right: 1px solid var(--border); padding: 14px 12px 24px; }
.toc h4 { margin: 14px 10px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--text);
  text-decoration: none; position: relative;
}
.toc a:hover { background: var(--hover); }
.toc a.on { background: var(--accent-soft); font-weight: 600; }
.toc a.on::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent);
}
.toc .ico { width: 20px; text-align: center; color: var(--accent-strong); font: 15px "Segoe Fluent Icons", "Segoe MDL2 Assets"; }

/* ---------- статья ---------- */
main { grid-area: main; overflow-y: auto; scroll-behavior: smooth; }
.content { max-width: 920px; margin: 0 auto; padding: 28px 40px 60px; }
article { display: none; }
article.on { display: block; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
article h1 { font-size: 28px; line-height: 1.25; margin: 0 0 6px; }
article .lead { font-size: 16.5px; color: var(--muted); margin: 0 0 22px; }
article h2 { font-size: 20px; margin: 30px 0 8px; padding-top: 6px; }
article h3 { font-size: 16.5px; margin: 20px 0 6px; }
article ul, article ol { padding-left: 22px; }
article li { margin: 3px 0; }
.ui { font-weight: 600; white-space: nowrap; }
.ui::before { content: "«"; font-weight: 400; }
.ui::after { content: "»"; font-weight: 400; }
.path { font-weight: 600; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin: 14px 0;
  box-shadow: var(--shadow);
}
.note, .warn, .tip {
  border-radius: 10px; padding: 12px 16px 12px 46px; margin: 14px 0; position: relative; border: 1px solid transparent;
}
.note::before, .warn::before, .tip::before {
  position: absolute; left: 14px; top: 11px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
}
.note { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.note::before { content: "i"; background: var(--accent); font-style: italic; font-family: Georgia, serif; }
.tip { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.tip::before { content: "✓"; background: var(--success); }
.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.warn::before { content: "!"; background: var(--warn); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.grid2 > div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.grid2 b { display: block; margin-bottom: 2px; }

table.keys, table.plain { border-collapse: collapse; width: 100%; margin: 12px 0; background: var(--surface); border-radius: 10px; overflow: hidden; }
table.keys td, table.plain td, table.plain th { border-bottom: 1px solid var(--border); padding: 8px 14px; vertical-align: top; }
table.plain th { text-align: left; background: var(--chip); font-weight: 600; }
/* a group of rows (the sections of Настройки: Сервис, Подключения, Данные, Программа) */
table.plain tr.group td { color: var(--muted); padding-top: 14px; }
table.keys td:first-child { width: 150px; white-space: nowrap; }
table.keys tr:last-child td, table.plain tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 0 9px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.7; }
.b-blue, .m-badge.blue { background: var(--bb); color: var(--bbt); }
.b-green, .m-badge.green { background: var(--bg); color: var(--bgt); }
.b-grey, .m-badge.grey { background: var(--bgr); color: var(--bgrt); }
.b-orange { background: var(--bo); color: var(--bot); }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.flow span.arrow { color: var(--muted); }

figure.shot { margin: 16px 0; }
figure.shot img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); display: block; }
figure.shot figcaption, .player-title { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
/* Screens of the phone: narrow, side by side */
figure.shot.phones .row { display: flex; gap: 14px; flex-wrap: wrap; }
figure.shot.phones img { width: 240px; max-width: calc(50% - 7px); }

/* ---------- частые вопросы ---------- */
.faq-group { margin-top: 26px; }
details.qa {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin: 8px 0; overflow: hidden;
}
details.qa summary {
  cursor: pointer; padding: 11px 16px 11px 42px; font-weight: 600; list-style: none; position: relative;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before {
  content: ""; position: absolute; left: 18px; top: 18px; width: 7px; height: 7px;
  border-right: 2px solid var(--accent-strong); border-bottom: 2px solid var(--accent-strong); transform: rotate(-45deg);
  transition: transform .15s;
}
details.qa[open] summary::before { transform: rotate(45deg); }
details.qa summary:hover { background: var(--hover); }
details.qa .a { padding: 0 18px 12px 42px; }
details.qa.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }

/* ---------- результаты поиска ---------- */
#results h1 { font-size: 22px; }
.hit { display: block; padding: 12px 16px; margin: 8px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; }
.hit:hover { border-color: var(--accent); }
.hit b { display: block; }
.hit small { color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); }
.pager a { text-decoration: none; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); max-width: 48%; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); }

/* ---------- пошаговый показ (анимация) ---------- */
.player { margin: 18px 0 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.player-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.player-head b { flex: 1; }
.player-head button {
  border: 1px solid var(--border); background: var(--page); color: var(--text); border-radius: 7px; min-width: 34px; height: 30px;
  cursor: pointer; font: 600 14px "Segoe UI", system-ui, sans-serif;
}
.player-head button:hover { border-color: var(--accent); }
.player-head .count { color: var(--muted); font-size: 13px; min-width: 70px; text-align: right; }
.stage {
  position: relative; aspect-ratio: 16 / 9.4; overflow: hidden; background: var(--page); container-type: inline-size; user-select: none;
}
.scene { position: absolute; inset: 0; opacity: 0; transition: opacity .35s; pointer-events: none; }
.scene.on { opacity: 1; }
.spot {
  position: absolute; border: 2.5px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 200vmax var(--dim);
  transition: all .55s cubic-bezier(.4, .1, .2, 1); opacity: 0; pointer-events: none; z-index: 5;
}
.spot.on { opacity: 1; }
.cursor {
  position: absolute; width: 4.2cqw; height: 4.2cqw; z-index: 7; pointer-events: none; opacity: 0;
  transition: left .7s cubic-bezier(.4, .1, .2, 1), top .7s cubic-bezier(.4, .1, .2, 1), opacity .3s;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}
.cursor.on { opacity: 1; }
.cursor svg { width: 100%; height: 100%; }
.ripple {
  position: absolute; z-index: 6; width: 5cqw; height: 5cqw; margin: -2.5cqw 0 0 -2.5cqw; border-radius: 50%;
  border: .4cqw solid var(--accent); animation: ripple .6s ease-out forwards; pointer-events: none;
}
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.caption { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; min-height: 64px; border-top: 1px solid var(--border); }
.caption .n {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.caption .t { padding-top: 2px; }
.dots { display: flex; gap: 6px; padding: 0 16px 12px 56px; }
.dots i { width: 22px; height: 5px; border-radius: 3px; background: var(--border); cursor: pointer; }
.dots i.done { background: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.dots i.on { background: var(--accent); }
.player ol.steps { display: none; }

/* макет окна программы — нарисован, а не снят: одинаково в светлой и тёмной теме */
.mock {
  position: absolute; inset: 3cqw 3cqw 3cqw 3cqw; background: var(--page); border: 1px solid var(--border); border-radius: 1.2cqw;
  display: flex; overflow: hidden; font-size: 1.45cqw; line-height: 1.35; color: var(--text); box-shadow: var(--shadow);
}
.m-side { width: 19cqw; background: var(--side); border-right: 1px solid var(--border); padding: 1.4cqw 1cqw; display: flex; flex-direction: column; gap: .3cqw; }
.m-logo { font-weight: 700; font-size: 1.7cqw; padding: 0 .6cqw 1cqw; display: flex; align-items: center; gap: .7cqw; }
.m-logo::before { content: ""; width: 2.2cqw; height: 2.2cqw; border-radius: .5cqw; background: var(--accent); }
.m-nav { padding: .55cqw .8cqw; border-radius: .6cqw; }
.m-nav.on { background: var(--accent-soft); font-weight: 600; box-shadow: inset .3cqw 0 0 var(--accent); }
.m-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5cqw; }
.m-foot .m-btn { text-align: center; }
.m-small { font-size: 1.15cqw; color: var(--muted); }
.m-main { flex: 1; padding: 1.6cqw 2cqw; display: flex; flex-direction: column; gap: 1cqw; min-width: 0; position: relative; }
.m-head { display: flex; align-items: center; gap: 1cqw; }
.m-head b { font-size: 2.3cqw; flex: 1; }
.m-q { width: 2.6cqw; height: 2.6cqw; border-radius: 50%; border: .2cqw solid var(--accent); color: var(--accent-strong); display: grid; place-items: center; font-weight: 700; }
.m-bar { display: flex; flex-wrap: wrap; gap: .7cqw; align-items: center; }
.m-btn { padding: .5cqw 1.1cqw; border: 1px solid var(--border); border-radius: .6cqw; background: var(--surface); white-space: nowrap; }
.m-btn.acc { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.m-btn.red { color: var(--error); border-color: var(--error); }
.m-seg { display: flex; border: 1px solid var(--border); border-radius: .6cqw; overflow: hidden; background: var(--surface); }
.m-seg span { padding: .5cqw 1cqw; border-left: 1px solid var(--border); }
.m-seg span:first-child { border-left: 0; }
.m-seg span.on { background: var(--accent); color: var(--on-accent); }
.m-input { flex: 1; min-width: 10cqw; padding: .5cqw .9cqw; border: 1px solid var(--border); border-radius: .6cqw; background: var(--surface); color: var(--muted); min-height: 2.6cqw; }
.m-input.filled, .m-input .typed:not(:empty) { color: var(--text); }
.typed:not(:empty)::after { content: "|"; color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: .1cqw; }
.typed.done::after { content: none; }
@keyframes blink { 50% { opacity: 0; } }
.m-table { background: var(--surface); border: 1px solid var(--border); border-radius: .8cqw; overflow: hidden; }
.m-tr { display: grid; grid-template-columns: var(--cols, 1fr 2fr 2fr 1fr); gap: 1cqw; padding: .6cqw 1cqw; border-top: 1px solid var(--border); align-items: center; }
.m-tr:first-child { border-top: 0; }
.m-th { background: var(--chip); color: var(--muted); font-weight: 600; }
.m-tr.sel { background: var(--accent-soft); }
.m-tr.red { background: var(--error-soft); }
.m-tr.yellow { background: var(--warn-soft); }
.m-r { text-align: right; }
.m-badge { display: inline-block; padding: 0 .8cqw; border-radius: 9cqw; font-size: 1.15cqw; font-weight: 600; }
.m-plate { color: var(--muted); font-size: 1.15cqw; } /* the госномер: plain grey text, as in the program (26.10.2026) */
.m-muted { color: var(--muted); }
.m-red { color: var(--error); font-weight: 600; }
.m-green { color: var(--success); font-weight: 600; }
.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: .9cqw; padding: 1cqw 1.3cqw; }
.m-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1cqw; }
.m-tile { background: var(--surface); border: 1px solid var(--border); border-radius: .9cqw; padding: 1cqw 1.3cqw; }
.m-tile b { display: block; font-size: 2.6cqw; }
.m-alert { background: var(--error-soft); border: .2cqw solid var(--error); border-radius: .9cqw; padding: 1cqw 1.4cqw; font-weight: 600; color: var(--error); }
.m-tabs { display: flex; gap: 1.6cqw; border-bottom: 1px solid var(--border); }
.m-tabs span { padding: .4cqw 0; color: var(--muted); }
.m-tabs span.on { color: var(--text); font-weight: 600; box-shadow: inset 0 -.3cqw 0 var(--accent); }
.m-total { margin-left: auto; text-align: right; }
.m-total small { display: block; color: var(--muted); font-size: 1.1cqw; }
.m-total b { font-size: 2.6cqw; }
.m-row { display: flex; gap: 1cqw; align-items: center; }
.m-grow { flex: 1; }
.m-suggest { position: absolute; z-index: 2; background: var(--surface); border: 1px solid var(--accent); border-radius: .6cqw; box-shadow: var(--shadow); min-width: 30cqw; }
.m-suggest div { padding: .5cqw 1cqw; }
.m-suggest div:first-child { background: var(--accent-soft); }

/* окно поверх макета */
.m-dialog {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52cqw; background: var(--surface);
  border: 1px solid var(--border); border-radius: 1.2cqw; box-shadow: 0 1cqw 4cqw rgba(0, 0, 0, .3); padding: 1.8cqw 2.2cqw;
  display: flex; flex-direction: column; gap: 1cqw; font-size: 1.45cqw;
}
.m-dialog h5 { margin: 0; font-size: 2cqw; }
.m-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .15); z-index: 2; }
.m-paytiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8cqw; }
.m-paytiles span { border: 1px solid var(--border); border-radius: .7cqw; padding: .8cqw; text-align: center; }
.m-paytiles span.on { border: .25cqw solid var(--accent); background: var(--accent-soft); font-weight: 600; }

/* запись: сетка постов */
.m-cal { flex: 1; display: grid; grid-template-columns: 6cqw repeat(3, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: .8cqw; overflow: hidden; position: relative; }
.m-cal > div { border-left: 1px solid var(--border); position: relative; }
.m-cal .m-hours { border-left: 0; color: var(--muted); font-size: 1.1cqw; }
.m-cal .m-hours span, .m-cal .m-col span.h { display: block; height: 4.2cqw; border-top: 1px solid var(--border); padding: .2cqw .5cqw; }
.m-cal .m-colhead { height: 3.2cqw; padding: .4cqw .8cqw; font-weight: 600; border-bottom: 1px solid var(--border); background: var(--chip); font-size: 1.25cqw; }
.m-rec { position: absolute; left: .5cqw; right: .5cqw; border-radius: .6cqw; padding: .4cqw .7cqw; font-size: 1.15cqw; background: var(--accent-soft); border-left: .4cqw solid var(--accent); transition: top .8s cubic-bezier(.4, .1, .2, 1), height .8s; }
.m-rec.green { background: var(--success-soft); border-left-color: var(--success); }
.m-cal > .m-now { position: absolute; left: 6cqw; right: 0; height: .3cqw; background: #e5484d; z-index: 1; border-left: 0; }

/* то, что появляется по ходу показа */
.later { visibility: hidden; opacity: 0; transition: opacity .35s; }
.later.shown { visibility: visible; opacity: 1; }
.later-d:not(.shown) { display: none; }
.gone { display: none !important; }

@media (max-width: 860px) {
  body { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .toc { display: none; }
  .content { padding: 20px 18px 50px; }
  .top { flex-wrap: wrap; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body { display: block; background: #fff; }
  .top, .toc, .pager, .player-head, .dots { display: none; }
  article { display: block !important; page-break-after: always; }
  main { overflow: visible; }
}

/* ИИ-помощник: a soft violet mark next to a heading (the colours of the program: AiSurface / AiText) */
.badge-ai { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 9px; font-size: 12px; font-weight: 600;
  vertical-align: middle; background: #F4F0FE; color: #5F4BB6; border: 1px solid #D8CEFA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-ai { background: #252040; color: #B8A6FA; border-color: #443A70; } }
:root[data-theme="dark"] .badge-ai { background: #252040; color: #B8A6FA; border-color: #443A70; }
