:root {
  --bg: #f2f2f7; --cell: #ffffff; --surface: #ffffff; --text: #000000; --hint: #8e8e93; --subtle: #8e8e93;
  --link: #007aff; --accent: #3478f6; --on-accent: #ffffff; --accent-text: var(--accent); --section-head: #6d6d72;
  --sep: #c6c6c8; --danger: #ff3b30; --header: var(--bg); --bar: var(--bg);
  --ok: #34c759; --warn: #ff9f0a; --err: #ff3b30;
  --fill: rgba(118, 118, 128, .12); --fill-2: rgba(118, 118, 128, .2); --press: rgba(0, 0, 0, .06);
  --seg-on: #ffffff; --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 1px rgba(0, 0, 0, .04);
  --dim: rgba(0, 0, 0, .4); --toast: rgba(28, 28, 30, .94);
  --sa-top: env(safe-area-inset-top, 0px); --sa-bottom: env(safe-area-inset-bottom, 0px);
  --sa-left: env(safe-area-inset-left, 0px); --sa-right: env(safe-area-inset-right, 0px);
  --csa-top: 0px; --csa-bottom: 0px; --csa-left: 0px; --csa-right: 0px;
  --top: calc(var(--sa-top) + var(--csa-top));
  --r-cell: 12px; --r-card: 16px;
  --fs-body: 17px; --fs-sub: 13px; --fs-foot: 13px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);
  /* Цвета плиток — системные цвета iOS; «оранжевый Claude» — фирменный терракотовый для подписки. */
  --t-violet: #af52de; --t-blue: #007aff; --t-amber: #ff9500; --t-green: #34c759; --t-gray: #8e8e93; --t-slate: #636366;
  --t-orange: #d97757; --t-brown: #a2845e; --t-indigo: #5856d6; --t-teal: #30b0c7; --t-red: #ff3b30; --t-purple: #bf5af2;
  --t-black: #1c1c1e; --ava-2: #8e5cf7;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --cell: #1c1c1e; --surface: #1c1c1e; --text: #ffffff; --hint: #8d8d93; --subtle: #8d8d93;
  --link: #0a84ff; --accent: #0a84ff; --section-head: #8d8d93; --sep: #38383a; --danger: #ff453a;
  --ok: #30d158; --warn: #ffd60a; --err: #ff453a;
  --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .32); --press: rgba(255, 255, 255, .08);
  --seg-on: #636366; --shadow: none; --dim: rgba(0, 0, 0, .6); --toast: rgba(58, 58, 60, .96);
  --t-black: #3a3a3c;
  color-scheme: dark;
}
/* До запуска модуля (data-theme ещё нет) — тема системы. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000000; --cell: #1c1c1e; --surface: #1c1c1e; --text: #ffffff; --hint: #8d8d93; --sep: #38383a; --accent: #0a84ff;
    --fill: rgba(118, 118, 128, .24); color-scheme: dark;
  }
}
/* Производные от темы Telegram — где браузер умеет смешивать цвета (старый Qt WebEngine в Telegram Desktop — нет: там
   остаются значения выше). */
:root { --sel: rgba(52, 120, 246, .14); --accent-soft: rgba(52, 120, 246, .12); --danger-soft: rgba(255, 59, 48, .12); --warn-soft: rgba(255, 159, 10, .16); --hint-line: rgba(142, 142, 147, .35); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --sel: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
    --danger-soft: color-mix(in srgb, var(--danger) 12%, transparent);
    --warn-soft: color-mix(in srgb, var(--warn) 16%, transparent);
    --hint-line: color-mix(in srgb, var(--hint) 35%, transparent);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text); font: 400 var(--fs-body)/1.3 var(--font); letter-spacing: -.2px;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
  min-height: 100vh; min-height: 100dvh;
}
button { font: inherit; color: inherit; letter-spacing: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-size: .9em; letter-spacing: 0; }
.sel { -webkit-user-select: all; user-select: all; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.noscript { padding: 24px; text-align: center; color: var(--hint); }
.ic { width: 20px; height: 20px; flex: none; display: block; }
.ic.small { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; }
.ok-t { color: var(--ok); }

/* ── заставка до модуля ─────────────────────────────────────────────────────────────────────────────────────────── */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot .ava { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.96); } }

/* ── аватар Джесики: буква на градиенте акцента в кольце из цветов разделов ─────────────────────────────────────── */
.ava { flex: none; display: grid; place-items: center; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 210deg, var(--t-violet), var(--t-blue), var(--t-amber), var(--t-green), var(--t-gray), var(--t-slate), var(--t-violet)); }
.ava span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--bg);
  background: linear-gradient(140deg, var(--accent) 0%, var(--ava-2) 100%); color: #fff; font-weight: 700; line-height: 1; letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.ava-xl { width: 90px; height: 90px; font-size: 40px; }
.ava-md { width: 42px; height: 42px; font-size: 19px; padding: 2px; }
.ava-md span { border-width: 1.5px; }

/* ── раскладка ──────────────────────────────────────────────────────────────────────────────────────────────────── */
.app { padding-left: var(--sa-left); padding-right: var(--sa-right); }
.layout { padding-top: var(--top); min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.main { min-width: 0; }
.stage { padding: 0 0 calc(var(--sa-bottom) + var(--csa-bottom) + 32px); }
.topbar { display: none; padding: 8px 8px 0; }
.own-back .main:not([data-depth="top"]) .topbar { display: block; }
.back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent-text); padding: 6px 8px; font-size: 17px; cursor: pointer; border-radius: 8px; }
.back .ic { width: 22px; height: 22px; margin-left: -4px; }
.pg { animation-duration: .3s; animation-timing-function: var(--ease); animation-fill-mode: both; }
.pg.in-fwd { animation-name: pg-fwd; }
.pg.in-back { animation-name: pg-back; }
@keyframes pg-fwd { from { opacity: 0; transform: translate3d(28px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes pg-back { from { opacity: 0; transform: translate3d(-20px, 0, 0); } to { opacity: 1; transform: none; } }

/* ── крупный заголовок ──────────────────────────────────────────────────────────────────────────────────────────── */
.lt { padding: 14px 20px 18px; }
.lt-t { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .2px; }
.lt-s { margin: 4px 0 0; color: var(--hint); font-size: 15px; line-height: 20px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ── группы и строки ────────────────────────────────────────────────────────────────────────────────────────────── */
.grp { margin: 0 16px 28px; }
.grp-h { margin: 0; padding: 0 16px 7px; font-size: var(--fs-sub); line-height: 18px; font-weight: 400; color: var(--section-head); text-transform: uppercase; letter-spacing: -.08px; }
.grp-b { background: var(--cell); border-radius: var(--r-cell); overflow: hidden; }
.grp-f { margin: 0; padding: 7px 16px 0; font-size: var(--fs-foot); line-height: 18px; color: var(--hint); }
.grp-b > * { position: relative; --inset: 16px; }
.grp-b > .has-tile, .grp-b > .nav-i, .grp-b > .step { --inset: 58px; }
.grp-b > * + *::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset); border-top: 1px solid var(--sep); pointer-events: none; z-index: 1; }
@media (min-resolution: 2dppx) { .grp-b > * + *::before { transform: scaleY(.5); transform-origin: 0 0; } }

.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 7px 16px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); }
.row.is-btn { cursor: pointer; transition: background-color .15s; }
.row.is-btn:active { background: var(--press); }
.row.is-btn:disabled, .row.is-off { opacity: .45; cursor: default; }
.row.is-btn:focus-visible { outline-offset: -3px; border-radius: var(--r-cell); }
.row.center { justify-content: center; }
.row.col { flex-direction: column; align-items: stretch; gap: 10px; padding: 11px 16px; }
.row-m { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-t { display: flex; align-items: center; gap: 7px; font-size: var(--fs-body); line-height: 22px; overflow-wrap: anywhere; }
.row-t.accent { color: var(--accent-text); }
.row-t.danger { color: var(--danger); }
.row-s { font-size: var(--fs-sub); line-height: 17px; color: var(--hint); overflow-wrap: anywhere; }
.row-s.wrap { white-space: normal; }
.row-v { flex: 0 1 auto; max-width: 52%; color: var(--hint); font-size: var(--fs-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.row-v.accent { color: var(--accent-text); font-size: 15px; }
.chev { flex: none; color: var(--hint); opacity: .55; margin-right: -6px; }
.chev .ic { width: 17px; height: 17px; }

.tile { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--t-gray); }
.tile .ic { width: 18px; height: 18px; stroke-width: 2; }
.t-violet { background: var(--t-violet); } .t-blue { background: var(--t-blue); } .t-amber { background: var(--t-amber); }
.t-green { background: var(--t-green); } .t-gray { background: var(--t-gray); } .t-slate { background: var(--t-slate); }
.t-orange { background: var(--t-orange); } .t-brown { background: var(--t-brown); } .t-indigo { background: var(--t-indigo); }
.t-teal { background: var(--t-teal); } .t-red { background: var(--t-red); } .t-purple { background: var(--t-purple); }
.t-black { background: var(--t-black); } .t-accent { background: var(--accent); color: var(--on-accent); }

.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--hint); display: inline-block; }
.d-ok { background: var(--ok); } .d-warn { background: var(--warn); } .d-err { background: var(--err); }
.d-idle { background: var(--hint-line); }
.d-busy { background: var(--accent); animation: busy 1.4s ease-in-out infinite; }
@keyframes busy { 50% { opacity: .35; transform: scale(.8); } }
.badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 13px; line-height: 20px; font-weight: 600; text-align: center; letter-spacing: 0; }

/* переключатель как в iOS */
.sw { flex: none; position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill-2); transition: background-color .25s; }
.sw-k { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s var(--ease); }
[aria-checked="true"] > .sw { background: var(--ok); }
[aria-checked="true"] > .sw .sw-k { transform: translate3d(20px, 0, 0); }
.row[role="switch"]:active .sw-k { transform: scaleX(1.12); }
.row[role="switch"][aria-checked="true"]:active .sw-k { transform: translate3d(17px, 0, 0) scaleX(1.12); }

/* сегменты */
.seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 2px; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg-i { border: 0; background: none; border-radius: 7px; padding: 6px 4px; min-height: 30px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color .2s; }
.seg-i[aria-checked="true"] { background: var(--seg-on); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
.seg-i:disabled { opacity: .4; }

/* кнопки */
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acts.tight { margin-top: 10px; }
.scr > .acts, .pg > .acts { margin: 0 16px 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 9px 16px; border: 0; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; background: var(--fill); color: var(--accent-text); transition: transform .12s, opacity .15s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.small { min-height: 30px; padding: 5px 12px; font-size: 14px; border-radius: 8px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn .ic { width: 18px; height: 18px; }
.b-primary { background: var(--accent); color: var(--on-accent); }
.b-plain { background: var(--accent-soft); color: var(--accent-text); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.icon-btn { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: -6px -8px -6px 0; border: 0; border-radius: 8px; background: none; color: var(--accent-text); cursor: pointer; }
.icon-btn .ic { width: 18px; height: 18px; }

/* отметки, плашки, ошибки, пустые */
.mk { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.mk .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.mk-ok { background: var(--ok); } .mk-no { background: var(--err); }
.banner, .err { display: flex; align-items: flex-start; gap: 10px; margin: 0 16px 24px; padding: 12px 14px; border-radius: var(--r-cell); font-size: 15px; line-height: 20px; }
.banner .ic, .err .ic { margin-top: 1px; }
.bn-calm, .bn-info { background: var(--accent-soft); color: var(--text); }
.bn-calm .ic, .bn-info .ic { color: var(--accent-text); }
.bn-warn { background: var(--warn-soft); }
.bn-warn .ic { color: var(--warn); }
.err { background: var(--danger-soft); align-items: center; margin-top: 8px; }
.err .ic { color: var(--danger); margin: 0; }
.err-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.empty { display: flex; flex: 1; align-items: center; gap: 10px; padding: 8px 0; color: var(--hint); font-size: 15px; line-height: 20px; }
.empty .ic { opacity: .6; }

/* заглушка загрузки */
.skel { padding-top: 14px; }
.sk-title { height: 34px; width: 46%; margin: 0 20px 26px; border-radius: 8px; background: var(--fill); animation: sk 1.2s ease-in-out infinite; }
.sk-h { height: 12px; width: 30%; margin: 0 16px 9px; border-radius: 4px; background: var(--fill); animation: sk 1.2s ease-in-out infinite; }
.sk-b { background: var(--fill) !important; animation: sk 1.2s ease-in-out infinite; }
.sk-l { display: block; height: 12px; width: 62%; border-radius: 4px; background: var(--fill); animation: sk 1.2s ease-in-out infinite; }
.sk-l.short { width: 36%; margin-top: 7px; height: 10px; }
@keyframes sk { 50% { opacity: .45; } }

/* ── главный экран ──────────────────────────────────────────────────────────────────────────────────────────────── */
.hero { padding: 26px 20px 24px; display: flex; justify-content: center; }
.ident { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hero .ident { flex-direction: column; gap: 14px; text-align: center; }
.ident-m { min-width: 0; }
.ident-t { font-size: 17px; font-weight: 600; line-height: 22px; }
.hero .ident-t { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: .2px; }
.ident-s { color: var(--hint); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .ident-s { font-size: 15px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px 28px; }
.card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; padding: 12px 14px 13px; border: 0; border-radius: var(--r-card); background: var(--cell); text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s var(--ease); }
.card:active { transform: scale(.975); }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-h .tile { width: 26px; height: 26px; border-radius: 7px; }
.card-h .tile .ic { width: 15px; height: 15px; }
.card-t { flex: 1; font-size: 13px; color: var(--hint); font-weight: 500; }
.card-big { font-size: 19px; line-height: 24px; font-weight: 600; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-s { font-size: 13px; line-height: 17px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot { display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin: 4px 32px 0; color: var(--hint); font-size: 13px; line-height: 18px; text-align: center; }

/* ── чертоги: карточки решений ──────────────────────────────────────────────────────────────────────────────────── */
.item { padding: 12px 16px 14px; transition: opacity .2s; }
.item.is-busy { opacity: .5; pointer-events: none; }
.item-h { display: flex; align-items: flex-start; gap: 10px; }
.item-t { flex: 1; min-width: 0; font-size: 16px; line-height: 21px; font-weight: 600; overflow-wrap: anywhere; }
.item-m { margin-top: 3px; font-size: 13px; line-height: 17px; color: var(--hint); }
.item-x { margin: 7px 0 0; font-size: 15px; line-height: 20px; white-space: pre-line; overflow-wrap: anywhere; }

/* ── шторки ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
.ov { position: fixed; inset: 0; z-index: 100; }
.ov-bg { position: absolute; inset: 0; background: var(--dim); opacity: 0; transition: opacity .25s; }
.ov.open .ov-bg { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: calc(100% - var(--top) - 28px);
  background: var(--bg); border-radius: 14px 14px 0 0; transform: translate3d(0, 104%, 0); transition: transform .32s var(--ease);
  padding-bottom: max(var(--sa-bottom), 12px); box-shadow: 0 -8px 30px rgba(0, 0, 0, .12); }
.ov.open .sheet { transform: none; }
.sheet:focus-visible { outline: none; }
.sheet.is-busy { cursor: progress; }
.sh-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 6px auto 0; flex: none; }
.sh-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px 6px 20px; flex: none; }
.sh-t { flex: 1; margin: 0; font-size: 20px; line-height: 25px; font-weight: 700; }
.sh-x { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill); color: var(--hint); display: grid; place-items: center; cursor: pointer; }
.sh-x .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.sh-b { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 20px 16px; }
.sh-b .grp { margin: 4px 0 8px; }
.sh-f { flex: none; padding: 8px 20px 4px; }
.sh-f .btn.wide { margin-top: 0; min-height: 50px; font-size: 17px; border-radius: 12px; }
.sh-p { margin: 10px 0; font-size: 15px; line-height: 21px; }
.sh-note { margin: 10px 0; font-size: 13px; line-height: 18px; color: var(--hint); }
.sh-note .ic { margin-right: 5px; }
.sh-status { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--cell); font-size: 14px; line-height: 19px; }
.sh-status .ic.ok { color: var(--ok); margin-top: 1px; }
.sh-status b { font-weight: 600; }
.steps { margin: 8px 0 14px; padding: 0; list-style: none; counter-reset: st; }
.steps li { position: relative; padding: 0 0 10px 34px; font-size: 15px; line-height: 21px; counter-increment: st; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 23px; height: 23px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700; line-height: 23px; text-align: center; }
.cmd { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--cell); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cmd code { font-size: 12.5px; line-height: 17px; word-break: break-all; color: var(--text); }
.perm { margin: 0 0 12px; padding: 0; list-style: none; border-radius: 10px; background: var(--cell); overflow: hidden; }
.perm li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: 14px; line-height: 19px; }
.perm li + li { border-top: 1px solid var(--sep); }
.perm b { font-weight: 500; color: var(--hint); text-align: right; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; color: var(--hint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--sep); }
.fld { display: block; margin: 12px 0; }
.fld-l { display: block; margin: 0 4px 6px; font-size: 13px; color: var(--hint); }
.fld-i { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--sep); border-radius: 10px; background: var(--cell); color: var(--text); font: 400 16px/1.25 var(--font); -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
.fld-i.mono { font-family: var(--mono); font-size: 15px; }
.fld-i::placeholder { color: var(--hint); opacity: .8; }
.fld-i:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.fld-h { display: block; margin: 6px 4px 0; font-size: 13px; line-height: 17px; color: var(--hint); }
.pick .pick-m { flex: none; width: 22px; color: var(--accent-text); }
.pick[aria-pressed="true"] .row-t { font-weight: 600; }

/* всплывающее сообщение */
.toast { position: fixed; left: 50%; bottom: calc(var(--sa-bottom) + 20px); z-index: 200; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 14px; background: var(--toast); color: #fff; font-size: 15px; line-height: 20px; pointer-events: none;
  opacity: 0; transform: translate3d(-50%, 14px, 0); transition: opacity .2s, transform .28s var(--ease); box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.toast.show { opacity: 1; transform: translate3d(-50%, 0, 0); }
.toast .ic { width: 18px; height: 18px; color: var(--ok); }
.toast.tst-err .ic { color: #ff6961; }
.toast.tst-info .ic { color: #64d2ff; }

/* ── возможности (29.11.2026): поиск, разделы, карточки, зарисовки ──────────────────────────────────────────────────
   Зарисовки — на мягком фоне «как обои чата»: переписка пузырями Telegram, шаги с линией, цепочка со стрелками, сообщение с
   инлайн-кнопками. Цвета статусов — спокойные плашки; красный здесь не используется (в приложении он значит «ждёт решения»). */
/* Текст плашек статуса темнее системных зелёного и оранжевого в светлой теме: мелкий текст на светлой подложке иначе бледный. */
:root { --ok-soft: rgba(52, 199, 89, .14); --fx-wall: var(--fill); --fx-kb: var(--fill-2); --st-ok: #248a3d; --st-beta: #c45f00; }
:root[data-theme="dark"] { --st-ok: #30d158; --st-beta: #ff9f0a; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --ok-soft: color-mix(in srgb, var(--ok) 15%, transparent);
    --fx-wall: linear-gradient(155deg, color-mix(in srgb, var(--accent) 14%, var(--bg)) 0%, color-mix(in srgb, var(--t-violet) 12%, var(--bg)) 100%);
    --fx-kb: color-mix(in srgb, var(--cell) 74%, transparent);
  }
}
.st { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 9px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-works { color: var(--st-ok); background: var(--ok-soft); }
.st-beta { color: var(--st-beta); background: var(--warn-soft); }
.st-planned { color: var(--hint); background: var(--fill); }
.pill-new { flex: none; padding: 2px 8px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.row .pill-new { margin-left: 4px; }

.fx-tools { display: flex; flex-direction: column; gap: 12px; margin: 0 16px 22px; }
.fx-search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; background: var(--fill); color: var(--hint); cursor: text; }
.fx-search .ic { width: 18px; height: 18px; }
.fx-q { flex: 1; min-width: 0; padding: 9px 0; border: 0; background: none; color: var(--text); font: 400 16px/1.25 var(--font); -webkit-appearance: none; appearance: none; }
.fx-q::placeholder { color: var(--hint); opacity: .9; }
.fx-q:focus { outline: none; }
.fx-search:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.fx-chips { display: flex; gap: 8px; margin: 0 -16px; padding: 2px 16px 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.fx-chips::-webkit-scrollbar { display: none; }
.fx-chip-b { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 12px; border: 0; border-radius: 16px; background: var(--cell); color: var(--text); font-size: 14px; line-height: 18px; white-space: nowrap; cursor: pointer; box-shadow: var(--shadow); transition: background-color .15s, color .15s; }
.fx-chip-b .n { color: var(--hint); font-size: 12px; font-weight: 600; }
.fx-chip-b[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.fx-chip-b[aria-pressed="true"] .n { color: inherit; opacity: .8; }

.fx-sec { margin: 0 0 28px; }
.fx-sh { display: flex; align-items: center; gap: 10px; margin: 0 20px 4px; font-size: 20px; line-height: 25px; font-weight: 700; letter-spacing: .1px; }
.fx-sh .tile { width: 28px; height: 28px; border-radius: 8px; }
.fx-sh .tile .ic { width: 16px; height: 16px; }
.fx-sht { flex: 0 1 auto; min-width: 0; }
.fx-shn { color: var(--hint); font-size: 15px; font-weight: 500; }
.fx-sl { margin: 0 20px 12px; color: var(--hint); font-size: 14px; line-height: 19px; }
.fx-found { margin: 0 20px 10px; color: var(--hint); font-size: 13px; line-height: 18px; }
.fx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 16px; }
.fx-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; padding: 13px 14px 14px; border: 0; border-radius: var(--r-card); background: var(--cell); color: var(--text); text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s var(--ease); }
.fx-card:active { transform: scale(.98); }
.fx-ch { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 2px; }
.fx-ch .tile { width: 28px; height: 28px; border-radius: 8px; }
.fx-ch .tile .ic { width: 16px; height: 16px; }
.fx-cat { flex: 1; min-width: 0; color: var(--hint); font-size: 13px; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-t { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.2px; overflow-wrap: anywhere; }
.fx-l { color: var(--hint); font-size: 14px; line-height: 19px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fx-none { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 0 20px; }
.fx-news { display: none; }

/* шторка возможности */
.fx-d { padding-bottom: 6px; }
.fx-dh { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.fx-dc { color: var(--hint); font-size: 14px; line-height: 18px; font-weight: 500; }
.fx-dl { margin: 0 0 6px; font-size: 16px; line-height: 22px; }
.fx-h3 { margin: 20px 0 8px; color: var(--section-head); font-size: 13px; line-height: 18px; font-weight: 400; text-transform: uppercase; letter-spacing: -.08px; }
.fx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-tagrow { margin-top: 16px; }
.fx-chip { display: inline-flex; align-items: flex-start; gap: 6px; max-width: 100%; padding: 7px 11px; border-radius: 10px; background: var(--cell); font-size: 14px; line-height: 19px; overflow-wrap: anywhere; }
.fx-chip .ic { color: var(--accent-text); margin-top: 2px; }
.fx-tag { padding: 3px 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; line-height: 18px; }
.fx-dates { margin: 16px 0 0; color: var(--hint); font-size: 13px; line-height: 18px; }
.fx-docs { margin: 6px 0 0; color: var(--hint); font-size: 12px; line-height: 17px; opacity: .85; overflow-wrap: anywhere; }

/* зарисовки */
.fx-sk { padding: 14px 12px; border-radius: var(--r-card); background: var(--fx-wall); overflow: hidden; }
.fx-chat { display: flex; flex-direction: column; gap: 3px; }
.fx-msg { display: flex; align-items: flex-end; gap: 7px; }
.fx-msg.tail { margin-bottom: 7px; }
.fx-msg.tail:last-child { margin-bottom: 0; }
.fx-msg.me { justify-content: flex-end; }
.fx-bub { max-width: 82%; padding: 7px 11px 8px; border-radius: 17px; font-size: 15px; line-height: 20px; white-space: pre-line; overflow-wrap: anywhere; }
.me .fx-bub { background: var(--accent); color: var(--on-accent); }
.me.tail .fx-bub { border-bottom-right-radius: 5px; }
.them .fx-bub { background: var(--cell); color: var(--text); box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.them.tail .fx-bub { border-bottom-left-radius: 5px; }
.fx-name { display: block; margin-bottom: 1px; font-size: 13px; line-height: 17px; font-weight: 600; }
.n-agent { color: var(--t-indigo); }
.n-person { color: var(--t-teal); }
.ava-xs { width: 30px; height: 30px; font-size: 13px; padding: 1.5px; }
.ava-xs span { border-width: 1.5px; }
.fx-av, .fx-gap { flex: none; width: 30px; height: 30px; }
.fx-av { display: grid; place-items: center; border-radius: 50%; color: #fff; }
.fx-av .ic { width: 16px; height: 16px; stroke-width: 2; }
.av-agent { background: var(--t-indigo); }
.av-person { background: var(--t-teal); }
.fx-cardw { flex: 0 1 auto; min-width: 0; max-width: 86%; display: flex; flex-direction: column; }
.fx-cardw .fx-bub { max-width: none; }
.fx-ct { display: block; margin-bottom: 2px; font-weight: 600; }
.fx-cr { display: block; }
.fx-kb { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.fx-kbr { display: flex; gap: 4px; }
.fx-kbb { flex: 1 1 0; min-width: 0; min-height: 36px; display: grid; place-items: center; padding: 6px 10px; border-radius: 10px; background: var(--fx-kb); color: var(--accent-text); font-size: 14px; line-height: 18px; font-weight: 500; text-align: center; overflow-wrap: anywhere; }
.fx-steps { margin: 0; padding: 2px 4px; list-style: none; }
.fx-steps li { position: relative; display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; }
.fx-steps li:last-child { padding-bottom: 0; }
.fx-steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--accent); opacity: .3; }
.fx-sn { flex: none; position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700; letter-spacing: 0; }
.fx-st { padding-top: 4px; font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.fx-flow { display: flex; flex-direction: column; align-items: stretch; }
.fx-node { padding: 10px 14px; border: 1px solid var(--sep); border-radius: 12px; background: var(--cell); color: var(--text); font-size: 15px; line-height: 20px; text-align: center; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.fx-node.first { border-color: var(--accent); }
.fx-node.last { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.fx-arr { display: grid; place-items: center; height: 26px; color: var(--accent-text); opacity: .7; }
.fx-arr .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.sheet .steps { margin-bottom: 4px; }

/* ── компьютер: боковое меню и колонка ──────────────────────────────────────────────────────────────────────────── */
.only-narrow { display: block; }
@media (min-width: 900px) {
  :root { --fs-body: 15px; --fs-sub: 12px; --fs-foot: 12px; }
  .layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top));
    overflow-y: auto; padding: 18px 0 16px; border-right: 1px solid var(--sep); background: var(--bg); }
  .side-top { padding: 0 12px 14px; }
  .side-id { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; }
  .side-nav .grp { margin: 0 12px 12px; }
  .side-nav .grp-b { background: none; }
  .side-nav .grp-b > * + *::before { display: none; }
  .side-nav .row { border-radius: 10px; min-height: 40px; padding: 6px 10px; }
  .side-nav .nav-i.cur .row { background: var(--sel); }
  .side-nav .nav-i.cur .row-t { color: var(--accent-text); font-weight: 600; }
  .side-nav .chev { display: none; }
  .side-nav .tile { width: 28px; height: 28px; border-radius: 7px; }
  .side-foot { margin-top: auto; padding: 0 12px; }
  .side-foot .row { border-radius: 10px; min-height: 38px; padding: 6px 10px; }
  .stage { max-width: 860px; margin: 0 auto; padding: 28px 32px 48px; }
  .only-narrow { display: none; }
  .topbar { padding: 16px 32px 0; max-width: 860px; margin: 0 auto; }
  .own-back .main[data-depth="section"] .topbar { display: none; }
  .lt { padding: 4px 16px 20px; }
  .lt-t { font-size: 28px; line-height: 34px; }
  .row-v.accent, .btn { font-size: 14px; }
  .row-t { line-height: 20px; }
  .row { min-height: 42px; }
  .hero { justify-content: flex-start; padding: 8px 16px 26px; }
  .hero .ident { flex-direction: row; text-align: left; gap: 18px; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .ov { display: grid; place-items: center; padding: calc(var(--top) + 24px) 24px 24px; }
  .sheet { position: relative; left: auto; right: auto; bottom: auto; width: min(560px, 100%); max-height: min(760px, calc(100vh - var(--top) - 48px)); border-radius: 16px;
    transform: translate3d(0, 12px, 0) scale(.97); opacity: 0; transition: transform .26s var(--ease), opacity .2s; padding-bottom: 12px; box-shadow: 0 24px 64px rgba(0, 0, 0, .28); }
  .ov.open .sheet { transform: none; opacity: 1; }
  .sh-grab { display: none; }
  .sh-h { padding-top: 16px; }
  .toast { bottom: 28px; }
}
@media (min-width: 1400px) {
  .layout { grid-template-columns: 340px minmax(0, 1fr); }
  .stage { padding: 40px 56px 64px; }
  .topbar { padding: 24px 56px 0; }
}
/* Возможности на компьютере: шире колонка (сетка в две-три карточки), разделы переносом строки, цепочка — в строку, когда
   влезает, «Что нового» под карточками главного экрана. Ширина — у колонки этого экрана (data-screen на .main), а не у всех. */
@media (min-width: 600px) {
  .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .main[data-screen="features"] .stage, .main[data-screen="features"] .topbar { max-width: 1180px; }
  .fx-tools { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .fx-search { flex: 1 1 320px; }
  .fx-tools .seg { flex: 0 0 auto; width: 360px; }
  .fx-chips { order: 3; flex: 1 1 100%; flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
  .fx-chip-b { min-height: 30px; padding: 4px 11px; font-size: 13px; }
  .fx-t { font-size: 16px; line-height: 21px; }
  .fx-l { font-size: 13px; line-height: 18px; }
  .sheet.wide { width: min(640px, 100%); }
  .fx-flow.fl-h { flex-direction: row; align-items: stretch; }
  .fx-flow.fl-h .fx-node { flex: 1 1 0; min-width: 0; display: grid; place-items: center; padding: 10px; }
  .fx-flow.fl-h .fx-arr { width: 24px; height: auto; flex: none; }
  .fx-flow.fl-h .fx-arr .ic { transform: rotate(-90deg); }
  .fx-news { display: block; margin: -6px 16px 28px; }
  .fx-news-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
  .fx-news .grp-h { padding-bottom: 0; }
  .fx-news .fx-grid { margin: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fx-news .fx-l { -webkit-line-clamp: 2; }
}
@media (min-width: 1200px) {
  .main[data-screen="features"] .fx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Наведение — у мыши, а не по ширине: окно мини-приложения в Telegram Desktop по умолчанию узкое (раскладка телефона). */
@media (hover: hover) and (pointer: fine) {
  .row.is-btn:not(:disabled):hover, .side-id:hover { background: var(--press); }
  .card:hover, .fx-card:hover { transform: translateY(-1px); }
  .fx-chip-b:not([aria-pressed="true"]):hover { opacity: .8; }
  .btn:not(:disabled):hover, .icon-btn:hover { opacity: .86; }
  .seg-i:not([aria-checked="true"]):hover { background: var(--press); }
}
/* Полный экран Telegram Desktop: кнопки клиента лежат поверх верха — их отступ уже в --csa-top; меню не уходит под них. */
.is-fullscreen .side { padding-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
