:root {
  --bg: #f4f6f3; --surface: #ffffff; --surface2: #eef3ef; --ink: #14231f; --muted: #5d6d68; --line: #dbe4df;
  --brand: #0f6b5c; --brand2: #128c7e; --brand-soft: #dff2ec; --wa-me: #d9fdd3; --wa-bot: #ffffff; --wa-bg: #efeae2;
  --warn: #b26b00; --warn-soft: #fff3dc; --bad: #b3261e; --bad-soft: #fde7e5; --ok: #1d7f45; --ok-soft: #e1f4e8;
  --info: #2459a8; --info-soft: #e5eefb; --shadow: 0 1px 2px rgba(20,35,31,.06), 0 6px 20px rgba(20,35,31,.06);
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513; --surface: #17201d; --surface2: #1d2925; --ink: #e5eeea; --muted: #97a8a2; --line: #2a3833;
    --brand: #3cc4a8; --brand2: #2fb09a; --brand-soft: #173a33; --wa-me: #134d37; --wa-bot: #1f2c28; --wa-bg: #0b1210;
    --warn: #f0b455; --warn-soft: #3a2c12; --bad: #f08a82; --bad-soft: #3d1a17; --ok: #6fd296; --ok-soft: #15331f;
    --info: #8fb4f0; --info-soft: #1a2a44; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --surface: #17201d; --surface2: #1d2925; --ink: #e5eeea; --muted: #97a8a2; --line: #2a3833;
  --brand: #3cc4a8; --brand2: #2fb09a; --brand-soft: #173a33; --wa-me: #134d37; --wa-bot: #1f2c28; --wa-bg: #0b1210;
  --warn: #f0b455; --warn-soft: #3a2c12; --bad: #f08a82; --bad-soft: #3d1a17; --ok: #6fd296; --ok-soft: #15331f;
  --info: #8fb4f0; --info-soft: #1a2a44; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; overflow-x: clip; }
body { font: 16px/1.55 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 28px 0 10px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 34px 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.lead { font-size: 17px; color: var(--muted); max-width: 760px; }
.muted { color: var(--muted); }
.note { font-size: 13px; margin-top: 8px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand2); outline-offset: 2px; border-radius: 8px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 14px; min-height: 58px; }
.logo { font-weight: 800; font-size: 18px; white-space: nowrap; color: var(--brand); display: flex; align-items: center; gap: 6px; }
.logo small { font-weight: 600; font-size: 13px; color: var(--muted); }
.logo-mark { font-size: 20px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 8px 12px; border-radius: 999px; white-space: nowrap; font-weight: 600; color: var(--muted); }
.tabs button:hover { background: var(--surface2); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .tabs button[aria-selected="true"] { color: #062b24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs button[aria-selected="true"] { color: #062b24; } }
.theme { border: 1px solid var(--line); background: var(--surface); width: 36px; height: 36px; border-radius: 50%; flex: none; }
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .logo small { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .theme { margin-left: auto; }
}

.pane { padding-bottom: 40px; animation: fade .25s ease; }
@keyframes fade { from { transform: translateY(4px); } to { transform: none; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-top: 14px; }
.btn { border: 0; background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; }
:root[data-theme="dark"] .btn:not(.ghost) { color: #062b24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost) { color: #062b24; } }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.sm { padding: 6px 14px; font-size: 14px; }
.btn:disabled { opacity: .4; cursor: default; }
.next-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* обзор */
.hero { padding: 6px 0 4px; }
.actors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .actors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.actor { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px 12px; text-align: left; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.actor:hover { transform: translateY(-2px); }
.actor[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.actor .ico { font-size: 26px; display: block; margin-bottom: 6px; }
.actor b { display: block; font-size: 15px; }
.actor small { color: var(--muted); font-size: 13px; }
.actor-detail ul, .stage-detail ul, .outcome-detail ul { margin: 6px 0 0; padding-left: 20px; }
.actor-detail li, .stage-detail li, .outcome-detail li { margin: 4px 0; }
.rules { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .rules { grid-template-columns: 1fr; } }
.rule { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.rule > b { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 17px; }
.rule p { color: var(--muted); font-size: 15px; margin: 0; }

/* этапы */
.timeline { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; top: 27px; left: 16%; right: 16%; height: 3px; background: var(--line); }
@media (max-width: 700px) { .timeline { grid-template-columns: 1fr; gap: 10px; } .timeline::before { display: none; } }
.tl-btn { width: 100%; border: 0; background: none; text-align: center; padding: 0 8px 8px; position: relative; }
.tl-dot { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-size: 24px;
  background: var(--surface); border: 3px solid var(--line); position: relative; z-index: 1; transition: .2s; }
.tl-btn[aria-pressed="true"] .tl-dot { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.08); }
.tl-btn b { display: block; font-size: 16px; }
.tl-btn small { color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  .tl-btn { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
  .tl-dot { margin: 0; width: 44px; height: 44px; font-size: 20px; flex: none; }
}
.stage-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface2); color: var(--muted); }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.info { background: var(--info-soft); color: var(--info); } .tag.bad { background: var(--bad-soft); color: var(--bad); }
.checklist { list-style: none; padding: 0 !important; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 4px; top: 0; color: var(--brand); font-weight: 800; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; } }

/* вход */
.scen-pick { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.scen { border: 1.5px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.scen[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.login-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 880px) { .login-grid { grid-template-columns: 1fr; } }
.steps { list-style: none; padding: 0; margin: 12px 0 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 10px 12px 10px 46px; border-radius: 12px; margin: 4px 0; cursor: pointer; transition: background .15s; }
.steps li::before { content: counter(s); position: absolute; left: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface2); color: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.steps li:hover { background: var(--surface2); }
.steps li.done::before { background: var(--brand-soft); color: var(--brand); }
.steps li.cur { background: var(--brand-soft); }
.steps li.cur::before { background: var(--brand); color: #fff; }
.steps li b { display: block; font-size: 15px; }
.steps li span { color: var(--muted); font-size: 14px; display: block; }
.steps li .who { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.steps li.alt span { color: var(--warn); }

.phone-wrap { position: sticky; top: 76px; }
@media (max-width: 880px) { .phone-wrap { position: static; } }
.phone { border-radius: 30px; border: 8px solid #1b2421; background: var(--wa-bg); overflow: hidden; box-shadow: var(--shadow); max-width: 360px; margin: 0 auto; display: flex; flex-direction: column; height: 600px; }
@media (max-width: 880px) { .phone { height: 520px; } }
.phone-top { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: #075e54; color: #fff; }
.phone-top .ava { width: 34px; height: 34px; border-radius: 50%; background: #fff2; display: grid; place-items: center; font-size: 18px; }
.phone-top small { display: block; opacity: .75; font-size: 12px; }
.chat { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; }
.msg { max-width: 85%; padding: 7px 10px 6px; border-radius: 10px; font-size: 14.5px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.08); animation: pop .22s ease; white-space: pre-line; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.me { align-self: flex-end; background: var(--wa-me); border-top-right-radius: 3px; }
.msg.bot { align-self: flex-start; background: var(--wa-bot); border-top-left-radius: 3px; }
.msg.sys { align-self: center; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; text-align: center; max-width: 92%; }
.msg.tg { align-self: flex-start; background: var(--info-soft); color: var(--ink); border-left: 3px solid var(--info); }
.msg .bt { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.msg .bt span { display: block; text-align: center; padding: 6px; border-top: 1px solid var(--line); color: #0b8a6f; font-weight: 600; font-size: 14px; }
:root[data-theme="dark"] .msg .bt span { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg .bt span { color: var(--brand); } }
.msg .bt span.pick { background: var(--brand-soft); border-radius: 6px; }
.msg .lbl { display: block; font-size: 11px; font-weight: 700; opacity: .65; margin-bottom: 2px; }
.phone-ctl { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; background: var(--surface); border-top: 1px solid var(--line); }

/* неделя */
.week-flow { display: flex; align-items: stretch; gap: 8px; margin: 18px 0 6px; }
.wf-step { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.wf-step b { display: block; font-size: 13px; color: var(--brand); }
.wf-step p { font-size: 14px; margin: 2px 0 0; }
.wf-ico { font-size: 22px; }
.wf-arrow { align-self: center; color: var(--muted); font-size: 20px; }
@media (max-width: 760px) { .week-flow { flex-direction: column; } .wf-arrow { transform: rotate(90deg); } }
.outcomes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
@media (max-width: 900px) { .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.oc { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); position: relative; }
.oc[aria-pressed="true"] { border-color: currentColor; }
.oc .n { font-size: 26px; font-weight: 800; display: block; }
.oc b { display: block; font-size: 14.5px; color: var(--ink); }
.oc small { color: var(--muted); font-size: 12.5px; }
.oc.ok { color: var(--ok); } .oc.info { color: var(--info); } .oc.warn { color: var(--warn); } .oc.bad { color: var(--bad); } .oc.new { color: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1.2; }
.kpi span { font-size: 13px; color: var(--muted); }
.mini-chat { background: var(--wa-bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-width: 420px; }

/* отключение */
.off-card { padding-top: 24px; }
.off-track { position: relative; height: 64px; margin: 0 10px 8px; }
.off-track .bar { position: absolute; top: 28px; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--line); }
.off-track .fill { position: absolute; top: 28px; left: 0; height: 6px; border-radius: 3px; background: var(--brand); transition: width .2s; }
.off-track .mark { position: absolute; top: 0; transform: translateX(-50%); text-align: center; font-size: 12px; color: var(--muted); width: 90px; }
.off-track .mark i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); margin: 24px auto 0; }
.off-track .mark.first { transform: translateX(-7px); text-align: left; }
.off-track .mark.first i { margin-left: 0; }
.off-track .mark.hit i { border-color: var(--brand); background: var(--brand); }
.off-track .mark span { position: absolute; top: 0; left: 0; right: 0; }
@media (max-width: 560px) { .off-track .mark span { font-size: 10.5px; } }
.off-range { display: block; margin: 6px 10px 0; }
.off-range span { font-size: 14px; color: var(--muted); }
.off-range input { width: 100%; accent-color: var(--brand); margin-top: 6px; }
.off-state { margin: 14px 10px 0; padding: 14px; border-radius: 12px; background: var(--surface2); }
.off-state h3 { margin-bottom: 4px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }

/* роли */
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
table.roles { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 14.5px; }
.roles th, .roles td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.roles th:first-child, .roles td:first-child { text-align: left; }
.roles thead th { background: var(--surface2); font-size: 13px; color: var(--muted); position: sticky; top: 0; }
.roles td.y { color: var(--brand); font-weight: 800; font-size: 18px; }
.roles td.n { color: var(--muted); font-size: 16px; }
.roles tr.grp td { background: var(--surface2); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; }

.foot { color: var(--muted); font-size: 13px; padding-top: 10px; padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== одностраничная версия (01.12.2026): три блока подряд ===== */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
.tabs a { padding: 8px 12px; border-radius: 999px; white-space: nowrap; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabs a:hover { background: var(--surface2); color: var(--ink); }
.block { padding: 8px 0 36px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block h1 { margin-top: 36px; }

.cycle { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; position: relative; }
.cycle::before { content: ""; position: absolute; top: 36px; left: 12%; right: 12%; height: 3px; background: linear-gradient(90deg, var(--brand) 0%, var(--brand2) 100%); opacity: .35; }
.cy { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 18px; box-shadow: var(--shadow); text-align: center; }
.cy-ico { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; background: var(--brand-soft); font-size: 22px; position: relative; z-index: 1; }
.cy-n { position: absolute; top: 10px; left: 12px; font-weight: 800; font-size: 13px; color: var(--brand); }
.cy b { display: block; font-size: 16px; margin-bottom: 4px; }
.cy p { color: var(--muted); font-size: 14.5px; margin: 0; }
.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 820px) {
  .cycle { grid-template-columns: 1fr; gap: 10px; }
  .cycle::before { top: 30px; bottom: 30px; left: 37px; right: auto; width: 3px; height: auto; }
  .cy { text-align: left; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 14px; }
  .cy-ico { grid-row: span 3; margin: 0; }
  .cy-n { display: none; }
  .chips { justify-content: flex-start; grid-column: 2; }
}

.week-demo { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 26px; }
@media (max-width: 820px) { .week-demo { grid-template-columns: 1fr; } }
.mini-phone { border-radius: 26px; border: 8px solid #1b2421; background: var(--wa-bg); overflow: hidden; box-shadow: var(--shadow); max-width: 360px; width: 100%; }
.chat.static { overflow: visible; padding: 14px 10px 16px; }
.admin { margin-top: 0; display: flex; flex-direction: column; gap: 4px; max-width: 440px; }
.admin-ico { font-size: 28px; }
.admin ul { margin: 4px 0 0; padding-left: 20px; color: var(--muted); }
.admin li { margin: 4px 0; }

/* страница руководителя внутри макета телефона */
.msg .bt .lnk { border: 0; background: none; color: #0b8a6f; font-weight: 700; padding: 6px; border-top: 1px solid var(--line); width: 100%; }
:root[data-theme="dark"] .msg .bt .lnk { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg .bt .lnk { color: var(--brand); } }
.mini-phone { min-height: 440px; display: flex; flex-direction: column; }
.web { background: var(--surface); flex: 1; display: flex; flex-direction: column; }
.web-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface2); font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.web-x { border: 0; background: none; font-size: 16px; padding: 2px 4px; }
.web-body { padding: 14px; }
.web-body h3 { font-size: 17px; }
.web-body .muted { font-size: 13.5px; }
.web-grp { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.emp { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; cursor: pointer; }
.emp input { width: 20px; height: 20px; accent-color: var(--bad); flex: none; }
.emp b { display: block; font-size: 15px; }
.emp small { color: var(--muted); font-size: 12.5px; }
.emp:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); }
.btn.deact { width: 100%; margin-top: 12px; background: var(--bad); color: #fff; }
[hidden] { display: none !important; }
.more { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 8px 2px; font-size: 14px; }
