[hidden] { display: none !important; }
/* the themes' tokens: tokens.css (2.1.98) */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.5 var(--font);
  background: var(--bg); color: var(--text);
  padding: 0 16px calc(104px + env(safe-area-inset-bottom));  /* room for the sections bar */
  max-width: 720px; margin-inline: auto;
  font-variant-numeric: tabular-nums;
}
header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 56px; box-sizing: border-box;  /* one line, 56 px (design audit 14.11) */
  padding: 4px var(--header-pad); position: sticky; top: var(--header-gap); z-index: 1;
  margin: var(--header-gap) 0 10px; background: var(--header-bg); color: var(--header-text);
  border-bottom: 1px solid var(--header-line); border-radius: var(--header-radius);
  box-shadow: var(--header-shadow);
}
/* a header bar across the whole window, the page's column staying as it is */
[data-theme="blue"] body > header { box-shadow: 0 0 0 100vmax var(--header-bg); clip-path: inset(0 -100vmax); }
header button.link { color: var(--header-text); text-decoration-color: currentColor; }
h1 { font-size: 16px; margin: 0; letter-spacing: .01em; white-space: nowrap; }
h1::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--logo-bg); margin-right: 8px; border-radius: var(--logo-radius); vertical-align: baseline; box-shadow: 0 0 0 1px var(--logo-ring); }
h1 .brand { font-weight: 700; }
h1 .brand-product { font-weight: 400; font-size: 14px; color: var(--hint); }
/* the theme whose light header is a solid dark bar: the page's grey hint would vanish on it */
[data-theme="blue"]:not([data-mode="dark"]) h1 .brand-product { color: #a9bddd; }
h2 { font-size: 12px; line-height: 16px; margin: 24px 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--hint); font-weight: 600; }
.tools { display: flex; align-items: center; gap: 4px; }
.muted { color: var(--hint); }
.small { font-size: 14px; line-height: 20px; }
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--card-shadow); padding: 12px 16px; margin: 8px 0;
}
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
/* the copy's «Правила лидера»: a short label, a long value wrapped on the right */
.copy-kv > .muted { flex-shrink: 0; }
.copy-kv > :last-child { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.badge {
  font-size: 12px; line-height: 16px; padding: 2px 8px; border-radius: var(--r-s); background: var(--muted-soft);
  color: var(--hint); white-space: nowrap; border: 1px solid var(--badge-border);
}
/* «работает», «сейф открыт», «открыт» цикл — нейтрально: слово и точка; зелёный — только деньги
   (решение владельца 14.11, аудит, вопрос 6) */
.badge.running { color: var(--text); background: var(--muted-soft); display: inline-flex; align-items: center; gap: 6px; }
.badge.running:not(.g2-vault)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
/* 2.1.112 (owner 15.11 13:20: «у нормально работающих ботов серая точка, может для наглядности
   заменить на зелёный цвет, как … прибыль?»): a strategy's «работает» — the dot in the profit's
   green, the word as before; a cycle's «открыт» and the rest stay grey */
.badge.mode.running::before { background: var(--profit); }
.badge.paused, .badge.locked { color: var(--warn); background: var(--warn-soft); }
.badge.emergency, .badge.stopped.danger { color: var(--danger); font-weight: 600; border-color: var(--danger-soft); background: var(--danger-soft); }
.badge.emergency { display: inline-flex; align-items: center; gap: 5px; }
.badge.emergency::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button.primary {
  width: 100%; min-height: 48px; border: 0; border-radius: var(--btn-radius); padding: 12px; margin-top: 10px;
  background: var(--primary); color: var(--on-primary); font-weight: 600; letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px var(--primary-edge);  /* 2.1.107: seen in Gold light only; inside — no size change */
}
button.primary:hover { background: var(--primary-dark); }
button.primary:disabled { background: var(--surface); color: var(--text-disabled); cursor: not-allowed; box-shadow: none; }
button.secondary {
  border: 1px solid var(--field-line); background: var(--card); border-radius: var(--btn-radius);
  min-height: 48px; padding: 8px 16px; font-weight: 500;
}
button.secondary:hover { border-color: var(--text); }
button.secondary:disabled { background: var(--card); color: var(--text-disabled); border-color: var(--line); cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--link); padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
button.link:hover { text-decoration-color: var(--text); }
input, select {
  width: 100%; min-height: 48px; padding: 11px 12px; border-radius: var(--field-radius); border: 1px solid var(--field-line);
  background: var(--field-bg); margin-top: 6px; outline: none;
}
input:focus, select:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
input.bad { border-color: var(--danger); background: var(--danger-soft); }
input[type=password] { letter-spacing: .1em; }
.error { color: var(--danger); margin-top: 8px; }
#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 3;
  background: var(--toast-bg); color: var(--toast-fg); padding: 12px 16px; border-radius: var(--field-radius);
  max-width: 688px; margin-inline: auto; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: 10px; cursor: pointer;  /* 2.1.125 (4.7): a sign before the words; a press closes */
}
#toast .toast-sign { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--toast-fg); color: var(--toast-bg);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; line-height: 1; }
#toast .toast-text { min-width: 0; }
.center { text-align: center; padding-top: 40px; }
/* 2.1.98 (design audit 14.11): the screens' states look alike — loading is the cards' outline
   (the page does not jump when they come), the empty list one quiet card with its way on, no
   answer from the server an amber line under the header */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skeleton { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sk-card { height: 68px; border-radius: var(--radius); background: var(--surface); }
@media (prefers-reduced-motion: no-preference) {
  .sk-card { animation: sk-pulse 1.4s ease-in-out infinite; }
  @keyframes sk-pulse { 50% { opacity: .55; } }
}
.state { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 24px 16px; margin: 8px 0; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--card-border); box-shadow: var(--card-shadow); }
.state-title { margin: 0; font-size: 16px; color: var(--hint); }
.netbar { margin: 0 0 8px; padding: 10px 12px 10px 34px; position: relative; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--text); font-size: 14px; }
.netbar::before { content: ""; position: absolute; left: 12px; top: 12px; width: 15px; height: 15px; background: var(--warn);
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat; }
a.card.block { display: block; color: inherit; text-decoration: none; }
a.card.block:hover { border-color: var(--text); }
a.link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
a.link:hover { text-decoration-color: var(--text); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.filters label { display: flex; flex-direction: column; flex: 1 1 30%; min-width: 100px; font-size: 14px; color: var(--hint); }
select { padding: 8px 12px; border-radius: var(--field-radius); margin-top: 4px; min-height: 48px; appearance: none; -webkit-appearance: none;
  background: var(--field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7079' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 28px; }
.event { padding: 4px 0; border-top: 1px solid var(--line); }
.ev-group + .ev-group { margin-top: 12px; }  /* 2.1.125: the events by cycle */
.ev-group-title { margin-top: 4px; }
.card .row + .row { margin-top: 2px; }
.card strong { display: block; margin-bottom: 6px; }
.row strong { display: inline; margin: 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.buttons button.primary { margin-top: 0; }
.buttons button.secondary { flex: 1 1 auto; }
.buttons .small { flex-basis: 100%; }
.form .field { display: block; margin: 12px 0; font-size: 14px; color: var(--hint); }
.form .field input, .form .field select { width: 100%; color: var(--text); }
.field-label { display: block; }
.field .unit { color: var(--hint); }
.field .hint { display: block; font-size: 12px; line-height: 16px; color: var(--hint); margin-top: 4px; }
.field-error { font-size: 12px; line-height: 16px; color: var(--danger); margin-top: 4px; }
.level { padding: 6px 0; border-top: 1px solid var(--line); }
.level.bad { color: var(--danger); }
.level strong { display: inline; margin: 0; }
.saved-line { background: var(--primary-soft); border-radius: var(--field-radius); padding: 10px 12px; font-weight: 600; }  /* 2.1.119: «сохранено» заметно */
.ok { color: var(--text); }  /* «готово», «сохранено» — не деньги: без зелёного (14.11) */
button.danger { color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
.form button.primary { margin-top: 12px; }
.links { display: flex; gap: 16px; flex-wrap: wrap; }
button.secondary.logout { margin-top: 24px; }  /* «Выйти» in the profile (2.1.98) */
label.card.row input[type=checkbox] { width: auto; margin: 0 0 0 12px; transform: scale(1.3); accent-color: var(--control); }
input[type=checkbox] { accent-color: var(--control); min-height: 0; }

/* segmented switch: one of a few */
.segmented { display: flex; border: 1px solid var(--field-line); border-radius: var(--field-radius); overflow: hidden; margin-top: 6px; background: var(--field-bg); }
.segmented button {
  flex: 1 1 0; border: 0; background: transparent; padding: 10px 8px; color: var(--hint); min-height: 46px;
  font-weight: 500; border-right: 1px solid var(--field-line);
}
.segmented button:last-child { border-right: 0; }
/* 2.1.107 (audit, third pass): the chosen option is --control, as a toggle and a checkbox (was the
   chips' near-black, the yellow on white in Gold light — 1.4:1) */
.segmented button[aria-checked=true] { background: var(--control); color: var(--on-control); }
.segmented button:hover:not([aria-checked=true]) { background: var(--surface); }

/* stepper: − number + */
.stepper { display: flex; align-items: stretch; margin-top: 6px; border: 1px solid var(--field-line); border-radius: var(--field-radius); overflow: hidden; }
.stepper input { border: 0; border-radius: 0; margin: 0; min-height: 46px; text-align: center; flex: 1 1 auto; min-width: 0; background: var(--field-bg); }
.stepper input:focus { box-shadow: inset 0 0 0 1px var(--text); }
.stepper button {
  width: 48px; border: 0; background: var(--surface); color: var(--text); font-size: 18px; line-height: 1;
  flex: 0 0 auto;
}
.stepper button:first-child { border-right: 1px solid var(--field-line); }
.stepper button:last-child { border-left: 1px solid var(--field-line); }
.stepper button:hover { background: var(--line); }

/* toggle */
.toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--text); font-size: 16px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.toggle .track { width: 40px; height: 24px; border-radius: 12px; background: var(--field-line); position: relative; flex: 0 0 auto; transition: background .15s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.toggle input:checked + .track { background: var(--control); }
.toggle input:checked + .track::after { left: 19px; }

/* key figures */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.kpi .card { margin: 0; }
.kpi .value { font-size: 18px; line-height: 24px; font-weight: 600; display: block; }
.kpi .label { font-size: 12px; line-height: 16px; color: var(--hint); }

/* the profile: a theme to pick, each shown in its own colours */
.looks { display: grid; gap: 10px; margin: 8px 0; }
button.look {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin: 0;
  padding: 12px; background: var(--card); color: var(--text); border: 2px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--card-shadow); font: inherit;
}
button.look[aria-checked=true] { border-color: var(--control); }
button.look .name { display: block; font-weight: 600; }
button.look .hint { display: block; font-size: 14px; color: var(--hint); }
button.look .text { flex: 1 1 auto; }
button.look .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field-line); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
button.look[aria-checked=true] .radio { border-color: var(--control); }
button.look[aria-checked=true] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--control); }
.preview {
  width: 64px; height: 50px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.preview .bar { height: 12px; background: var(--header-bg); border-bottom: 1px solid var(--header-line); }
.preview[data-theme="swiss"] .bar { margin: 4px 4px 0; border-radius: 3px; box-shadow: var(--header-shadow); }
.preview .box { margin: 0 6px; height: 13px; background: var(--card); border: 1px solid var(--card-border); border-radius: 4px; }
.preview .key { margin: 0 6px; width: 26px; height: 7px; background: var(--primary); border-radius: 3px; }  /* 2.1.125: the button's colour, not the logo's */

/* the sections bar at the bottom (30.10): large targets instead of small links */
.tabs {
  position: fixed; left: var(--tabs-inset); right: var(--tabs-inset); z-index: 2;
  bottom: calc(var(--tabs-inset) + var(--tabs-lift));
  max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 6px 6px calc(6px + var(--tabs-safe)); background: var(--card);
  border-top: 1px solid var(--tabs-line); border-radius: var(--tabs-radius); box-shadow: var(--tabs-shadow);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; color: var(--hint); text-decoration: none; font-size: 12px; line-height: 16px; font-weight: 500;
  border-radius: var(--r-s);
}
.tabs a[aria-current=page] { color: var(--primary-text); font-weight: 600; }
.tabs a:hover { background: var(--surface); }
/* the profile: the sections that are not on the bar */
a.card.go { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; font-weight: 500; }
a.card.go::after { content: ""; width: 18px; height: 18px; flex: 0 0 auto; background: var(--hint);
  -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat; }
/* Т76: the pair's two halves; «Дополнительно» */
.pair-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-choice .field { margin: 12px 0 4px; }
details.more { margin: 12px 0 4px; border-top: 1px solid var(--line); padding-top: 8px; }
details.more summary { cursor: pointer; font-size: 14px; color: var(--text); padding: 0; }  /* 44 px: the 2.1.99 block */
.form input:disabled { opacity: 0.6; }
/* a long market name on a connection's plate wraps inside the card */
.row .badge { min-width: 0; text-align: right; white-space: normal; }
/* Т78: the charts (owner 01.11): the averagings (DCA and manual) amber, a sale and the TP
   green; labels in a darker shade of their hue (a lighter one in the dark look); the price and
   the gridlines neutral; what is still to come dashed or dotted. 2.1.98 (design audit 14.11):
   the first buy is a square in the colour of the text (was a blue dot — a fourth hue), the
   averagings in the theme's amber `--warn` */
:root {
  --chart-entry: var(--text); --chart-dca: var(--warn); --chart-tp: #16a06f;
  --chart-entry-text: var(--text); --chart-dca-text: #8a5200; --chart-tp-text: #0f6e56;
}
[data-mode="dark"] { --chart-tp: #1baf7a; --chart-dca-text: #f2b85b; --chart-tp-text: #5dcaa5; }
/* Т90-B (14.18): a line or a point is seen at 3:1 against the card — the TP's green one step
   darker on light cards (#1baf7a was 2.8:1); the averagings amber in every theme, never
   near the red of a refused level (owner 01.11) */
svg.chart { display: block; width: 100%; height: auto; margin: 2px 0; overflow: visible; }
/* the labels' measure (chart_labels.js): laid out with the charts' font, never seen */
svg.chart.chart-ruler { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; visibility: hidden; }
.chart text { font-size: 12px; fill: var(--hint); }  /* 2.1.107: 12 px (chart_labels.js EM), was 10 */
.chart text.strong { fill: var(--text); }
.chart text.l-entry { fill: var(--chart-entry-text); }
.chart text.l-dca { fill: var(--chart-dca-text); }
.chart text.l-tp { fill: var(--chart-tp-text); }
.chart text.halo { paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.chart .c-grid { stroke: var(--line); stroke-width: 1; }
.chart .c-price { stroke: var(--hint); stroke-width: 1.5; fill: none; stroke-linejoin: round; }
.chart .c-now { stroke: var(--hint); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .c-tp, .chart-legend .c-tp { stroke: var(--chart-tp); stroke-width: 2; fill: none; }
.chart .c-after, .chart-legend .c-after { stroke: var(--chart-tp); stroke-width: 1.5; stroke-dasharray: 1.5 3; stroke-linecap: round; opacity: .6; }
.chart .c-level, .chart-legend .c-level { stroke: var(--chart-dca); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart circle, .chart-legend circle, .chart rect.p-entry { stroke: var(--card); stroke-width: 2; }
.p-entry { fill: var(--chart-entry); }
.p-dca { fill: var(--chart-dca); }
.p-tp { fill: var(--chart-tp); }
.chart .p-now { fill: var(--text); stroke-width: 1; }
.chart .p-bad { fill: var(--card); stroke: var(--danger); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--hint); margin: 4px 0 2px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chart-legend svg { overflow: visible; }
.chart-caption { margin: 2px 0 6px; }
.chart-box { margin: 6px 0 4px; }

/* Т90-B (Развитие 2, группа B, owner 01.11). 14.19: a dangerous action differs by its shape in
   every theme, not by colour only (in the red themes the accent and the danger are one hue):
   a 2 px frame (Т93-F2, Д8: 1.5 px was drawn as 1 px by Chromium and Telegram on Android; the
   padding 1 px less, so the button keeps the size of its neighbours), bold type, a warning
   triangle before the label and what it does under it (data-note). 14.9: the live environment
   marked red. 14.10: the key's checklist and the IP. */
:root { --warn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2.5 20h19L12 3z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M12 9v5M12 17.5v.5' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
button.danger {
  border-width: 2px; border-style: solid; font-weight: 600;
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 6px;
}
button.secondary.danger { padding: 7px 15px; }
button.danger::before {
  content: ""; width: 15px; height: 15px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat;
}
button.danger[data-note]::after { content: attr(data-note); flex: 1 0 100%; font-size: 12px; font-weight: 400; line-height: 16px; }
/* реальный счёт — жёлтым с треугольником, не красным: красный только «Остановить», убыток, авария
   (решение владельца 14.11, аудит, вопрос 7; заменяет 14.9) */
.segmented.live { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.segmented.live button[aria-checked=true] { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.live-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 8px; padding: 10px 12px;
  color: var(--text); background: var(--warn-soft); border: 2px solid var(--warn); border-radius: var(--field-radius);
}
.live-note::before {
  content: ""; width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; background: var(--warn);
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat;
}
.key-guide { font-size: 14px; background: var(--surface); border-color: var(--line); box-shadow: none; }
.key-guide ul { margin: 0 0 6px; padding-left: 20px; }
.key-guide li { margin: 3px 0; }
.ip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.ip-row code {
  font: 600 16px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 8px 10px; user-select: all;
  background: var(--field-bg); border: 1px solid var(--line); border-radius: var(--field-radius); color: var(--text);
}
.ip-row button.copy { padding: 7px 12px; }
/* Развитие 2, группа C (14.5–14.7): the emergency in words, numbers, the futures risk strip */
.r2c-emergency { border-left: 3px solid var(--danger); padding-left: 10px; margin-top: 6px; }
.card.r2c-emergency { padding-left: 14px; }
/* 2.1.125 (design audit, fourth pass, 1.3): red is the label «Причина аварии:» alone — the reason's
   words in the text's colour (two red lines shouted; the badge and the bar already say the state) */
.r2c-emergency .r2c-reason { color: var(--text); }
.r2c-emergency .r2c-reason strong { display: inline; margin: 0; color: var(--danger); }
.r2c-emergency > div + div { margin-top: 3px; }
.r2c-code { font-size: 12px; color: var(--hint); word-break: break-all; }
/* 2.1.107 (дизайн-аудит, третий проход, 1.3): the reason's code under «Подробнее» — «Код для поддержки» */
details.r2c-more > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer;
  list-style: none; font-size: 14px; line-height: 20px; color: var(--text); }
details.r2c-more > summary::-webkit-details-marker { display: none; }
details.r2c-more > summary::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat;
  transition: transform .15s; }
details.r2c-more[open] > summary::before { transform: rotate(90deg); }
details.r2c-more > .r2c-code { margin: 0 0 4px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.num.tap { cursor: pointer; }  /* 2.1.99: no underline — it read as a link; the dots on hover only */
.num.tap:hover { text-decoration: underline dotted var(--hint); text-underline-offset: 3px; }
/* результат: знак и ▲/▼ рядом с цветом — различим и без цвета (решение владельца 14.11, аудит,
   вопрос 2: цвета прибыли и убытка прежние) */
.r2c-pos { color: var(--profit); font-weight: 600; }
.r2c-neg { color: var(--loss); font-weight: 600; }
.r2c-pos::before, .r2c-neg::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px;
  vertical-align: 1px; background: currentColor; }
.r2c-pos::before { -webkit-mask: var(--icon-up) center / contain no-repeat; mask: var(--icon-up) center / contain no-repeat; }
.r2c-neg::before { -webkit-mask: var(--icon-down) center / contain no-repeat; mask: var(--icon-down) center / contain no-repeat; }
.r2c-risk { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 8px 12px;
  margin: 6px 0; border-radius: var(--radius); background: var(--surface); color: var(--text); }
.r2c-risk span:first-child { font-weight: 600; }
.r2c-risk.r2c-risk-list { padding: 4px 8px; margin: 4px 0; }
/* 2.1.99 (design audit, second pass): far from liquidation is neutral — green is for money only */
.r2c-risk-ok { background: var(--surface); }
.r2c-risk-ok span:nth-child(3) { color: var(--text); font-weight: 600; }
.r2c-risk-warn { background: var(--warn-soft); }
.r2c-risk-warn span:nth-child(3) { color: var(--warn); font-weight: 600; }
.r2c-risk-bad { background: var(--danger-soft); }
.r2c-risk-bad span:nth-child(3) { color: var(--danger); font-weight: 600; }
/* Развитие 2, группа D (14.1): the «?» sign and its window — a sheet from the bottom on a
   phone and in Telegram, a popup at the sign from 600 px; the theme's own colours */
.tip-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin: -13px -13px -13px -6px; padding: 0; border: 0; background: none; color: var(--hint);
  cursor: pointer; vertical-align: middle; -webkit-tap-highlight-color: transparent; }
.tip-sign { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor;
  font-size: 12px; font-weight: 700; line-height: 1; }
.tip-btn:hover, .tip-btn[aria-expanded="true"] { color: var(--primary-text); }
.tip-btn:focus-visible { outline: none; }
.tip-btn:focus-visible .tip-sign { box-shadow: 0 0 0 2px var(--primary-soft); color: var(--primary-text); }
.tip-layer { position: fixed; inset: 0; z-index: 50; }
.tip-layer.tip-dim { background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; justify-content: center; }
.tip-box { box-sizing: border-box; background: var(--card); color: var(--text); border: 1px solid var(--card-border);
  display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 20px; }
.tip-sheet { width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto;
  border-radius: var(--r-l) var(--r-l) 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .18); }
.tip-pop { position: fixed; width: 320px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto;
  border-radius: var(--radius); padding: 12px 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.tip-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto; }
.tip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tip-head h3 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; }
.tip-close { flex: 0 0 auto; width: 44px; height: 44px; margin: -4px -8px -4px 0; border: 0; border-radius: 50%; padding: 0;
  background: var(--surface); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.tip-part { display: flex; flex-direction: column; gap: 4px; }
.tip-part p { margin: 0; }
.tip-label { font-size: 12px; color: var(--hint); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tip-risk { background: var(--warn-soft); border-radius: var(--radius); padding: 8px 10px; }
.tip-risk .tip-label { color: var(--warn); }
.tip-foot { padding-top: 6px; border-top: 1px solid var(--line); }
.tip-foot:empty { display: none; }
.tip-more { color: var(--primary-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
/* 2.1.107: one window for a block of buttons — a part for each button under its name */
.tip-pop.tip-group { width: 400px; }
.tip-group-part { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.tip-group-part h4 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.tip-group-part .tip-foot { padding-top: 0; border-top: 0; }
/* Развитие 2, группа A: the bot form — compact (14.20), the «Итог» (14.3), the warnings (14.4);
   2.1.101: one column, the «Итог» and the grid in the window «Анализ настроек» */
.bot-form .field-label { display: flex; align-items: center; gap: 4px; min-height: 24px; }
.bot-form .tip-slot { margin-left: 2px; display: inline-flex; }  /* 2.1.108: next to its name, not at the far edge */
.pair-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form .pair-cols > .field { margin: 12px 0 0; }
.pair-hint { margin: 4px 0 0; }
.pair-hint:empty { display: none; }
details.more .pair-row + .pair-row { margin-top: 4px; }
.bot-form .stepper button { width: 44px; font-size: 18px; }  /* 2.1.99: a target of 44 px */
.bot-form .stepper input { padding-inline: 4px; }
.buttons .btn-tip { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; }
.buttons .btn-tip > :first-child { flex: 1 1 auto; margin-top: 0; }
.buttons .btn-tip > :not(:first-child) { flex: 0 0 auto; }
.form-warnings {
  background: var(--warn-soft); border: 1px solid var(--warn); border-left-width: 3px;
  border-radius: var(--radius); padding: 6px 12px; margin: 8px 0; font-size: 14px; color: var(--text);
}
.form-warnings p { margin: 4px 0; }
.form-warnings p { position: relative; padding-left: 23px; }  /* a block: a long name still wraps */
.form-warnings p::before { content: ""; position: absolute; left: 0; top: 3px; width: 15px; height: 15px; background: var(--warn);
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat; }
.analysis.stale .form-out { opacity: .55; transition: opacity .15s; }
.warn-note { text-align: center; margin: 4px 0; }
/* 2.1.101 (owner 14.11 20:55 — replaces the two columns of 2.1.98–2.1.100 and the switch of
   2.1.99): the new bot's form and a bot's settings are one column of 720 px at every width, as
   every screen; under the fields — the grid's refusal, the warnings, the buttons; the «Итог»,
   the grid and its levels are the window «Анализ настроек» */
.form-problem { margin: 8px 0; }
.form-problem p { margin: 4px 0; }
/* owner 02.11 (Развитие 5): the sections stay on the bar at the bottom on a computer too, as on
   the phone — fixed at the bottom while the page scrolls (14.20's sections in the header are no more) */
/* Развитие 4, группа F: списки администратора чипами (14.16 А2) */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
/* 2.1.107 (audit, third pass): a chip's corner is the badges' and the landing's tags' (6 px, was a
   pill); its «×» a target of 44 × 44 px — the chip keeps its height, the target reaches its edges;
   removing a filter is not a danger: the «×» darkens, it does not go red */
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 10px; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--text); }
.chip-x { min-width: 44px; min-height: 44px; margin: -4px -3px -4px -2px; padding: 0; border: 0; background: none;
  color: var(--hint); font-size: 18px; line-height: 1; cursor: pointer; border-radius: var(--r-s); }
.chip-x:hover, .chip-x:focus-visible { color: var(--text); }
.form .field .chips input { flex: 1 1 8em; width: auto; min-width: 8em; }
/* Развитие 3 и 4, группа I: «?» в шапке (14.2 О9), «?» у заголовков, строка «почему не сохраняется»
   (Ф8), «Повторить» (Ф11) */
/* Р5.92 (09.11): the «?»'s zone to tap reaches at most half the gap to its neighbours (the
   vault, the language, «Выйти» of a second line) — before, 44 × 44 px reached 3–6 px into them;
   it takes the same 22 × 24 px of the line as before */
.help-here { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin: 0; color: var(--header-text); opacity: .8; text-decoration: none;
  -webkit-tap-highlight-color: transparent; }
.help-here:hover, .help-here:focus-visible { opacity: 1; outline: none; }
.help-here:focus-visible .tip-sign { box-shadow: 0 0 0 2px var(--primary-soft); }
.help-here .tip-sign { width: 22px; height: 22px; font-size: 12px; }
h2 > .tip-btn, strong > .tip-btn { margin-block: -14px; text-transform: none; }
.save-why { margin: 0 0 8px; }  /* under the buttons, in .form-actions (2.1.99) */
.bot-form > .error .retry { margin: 0 0 0 8px; padding: 4px 12px; min-height: 44px; width: auto; }  /* 2.1.107: 44 px */
/* Развитие 3, группа G2 (14.13, 14.14): screen titles 20 px in plain case (О5), the bot's
   buttons by weight and its actions as chips (Б1, О6), the orders' distance (Б4), the
   notices card (Б6), the next settings as changes (Б8), the list's summary and sections
   (Л2), the vault's badge in the header (Л4, О8) */
#view > h2:first-child, #view > a.link:first-child + h2, .center > h2:first-child, h2.screen-title {
  font-size: 22px; line-height: 28px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 700; }
.row > h2.screen-title { margin: 10px 0 4px; }
.g2-tipped { display: flex; align-items: center; min-width: 0; }
.g2-tipped > button:not(.tip-btn), .g2-tipped > a { flex: 1 1 auto; min-width: 0; }
.g2-tipped > .tip-btn { flex: 0 0 auto; margin: 0 -12px 0 -6px; }
.buttons.g2-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; }
.g2-controls button:not(.tip-btn) { min-height: 48px; width: 100%; }
.g2-controls .g2-wide { grid-column: 1 / -1; }
/* 2.1.107 (дизайн-аудит, третий проход; владелец 15.11, В8): a block of the screen's buttons —
   «Управление» (the chips), «Запуск», «Остановка» — under a small heading with ONE «?» beside
   it; the buttons in two columns of one width, a long one on the whole line */
.g2-actions, .g2-start { margin: 12px 0 8px; }
/* 2.1.125: a block's heading inside a card (the connection's «Ключ») — 12 px off the lines above it */
.card > .g2-block-head { margin-top: 12px; }
.g2-block-head { justify-content: flex-start; gap: 4px; min-height: 24px; }
.g2-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; }
.g2-chips > a.chip { width: 100%; min-width: 0; justify-content: center; white-space: normal; text-align: center; }
.g2-chips > .g2-wide { grid-column: 1 / -1; }
.g2-chips > p { margin: 0; }
.g2-chips button.secondary { min-height: 48px; width: 100%; margin: 0; }
/* «Остановить» under the safe buttons of a start (an emergency, a pause): apart — 24 px, a line, 16 px */
.g2-controls .g2-apart { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
/* 2.1.125 (audit, fourth pass, 4.3): the same for the list's group action and the connections' and the
   administration's dangerous buttons — one column, the dangerous one apart */
.g2-controls.g2-group, .g2-controls.g2-one { grid-template-columns: minmax(0, 1fr); }
.g2-controls.g2-group .g2-apart, .g2-controls.g2-one .g2-apart { margin-top: 8px; }
:root {
  --icon-edit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20h4l10-10-4-4L4 16v4zM13 7l4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-history: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 7v5l3 2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 1 7.6 7H.4z'/%3E%3C/svg%3E");
  --icon-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 7 .4 1h7.2z'/%3E%3C/svg%3E");
  --icon-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='10' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}
a.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--field-line); background: var(--card); border-radius: var(--btn-radius);
  font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap;
}
a.chip:hover { border-color: var(--text); }
a.chip::before { content: ""; width: 16px; height: 16px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--chip-icon) center / contain no-repeat; mask: var(--chip-icon) center / contain no-repeat; }
a.chip-edit { --chip-icon: var(--icon-edit); }
a.chip-history { --chip-icon: var(--icon-history); }
a.chip-plus { --chip-icon: var(--icon-plus); }
a.chip-arrow { --chip-icon: var(--icon-arrow); }
.g2-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 14px 0 6px; font-size: 14px; }
.g2-bottom button.link { color: var(--hint); min-height: 44px; }
.g2-card-head { align-items: center; }
.g2-card-head strong { margin: 0; }
.card > .g2-card-head { margin-bottom: 6px; }
a.g2-edit { margin-top: 0; font-size: 14px; font-weight: 500; }
.g2-next { margin-top: 8px; padding: 8px 10px; border-radius: var(--field-radius); background: var(--surface); }
.g2-next > .row { align-items: center; margin-bottom: 4px; }
.g2-next button.secondary { padding: 6px 10px; font-size: 14px; }
.g2-notices .toggle { margin: 0; }
/* 2.1.98 (design audit): the orders in three columns, the numbers to the right */
.g2-orders { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 16px; align-items: baseline; margin-top: 4px; }
.g2-orders > * { padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.g2-orders > .g2-oh { padding: 0 0 4px; border-top: 0; font-size: 12px; color: var(--hint); }
.g2-order { display: flex; flex-direction: column; }
.g2-order .muted, .g2-num .g2-dist { font-size: 12px; }
.g2-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g2-num .g2-dist { display: block; color: var(--hint); }
/* 2.1.98: what matters in a second — the result now, the position, the next step */
.g2-kpi { display: flex; flex-direction: column; gap: 2px; }
.g2-kpi-label, .g2-kpi-sub { font-size: 12px; line-height: 16px; color: var(--hint); }
.g2-kpi-main { font-size: 28px; line-height: 36px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.g2-kpi-main .r2c-pos::before, .g2-kpi-main .r2c-neg::before { width: 14px; height: 14px; margin-right: 6px; }
.g2-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.g2-kpi-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g2-kpi-value { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* 2.1.98: «Управление» — at the very end, apart; «Остановить» narrower and last */
.g2-manage { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.g2-manage .g2-controls { row-gap: 24px; }  /* 2.1.99: «Остановить» farther from its neighbour */
/* 2.1.98: the list's second line — the cycle at a glance and the result now on the right */
.g2-line2 { align-items: baseline; }
.g2-line2 > .muted { min-width: 0; }
.g2-now { white-space: nowrap; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.g2-manage-title { display: block; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--hint); margin-bottom: 4px; }
.g2-dist { color: var(--hint); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g2-lost { font-weight: 600; }
.g2-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.g2-sum-label { font-size: 12px; color: var(--hint); }
.g2-sum-value { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g2-sum-cell { min-width: 0; }
.g2-sum-note { grid-column: 1 / -1; }
/* fix-2149 (the owner's phone, 09.11): a note under the amounts wraps — it ran off the card */
.g2-sum-value .small { white-space: normal; font-weight: 400; }
/* 2.1.107 (audit, third pass): «Требуют внимания» is not a danger — its words in the text's colour,
   its sign amber; the badges inside keep their own colours (an emergency's red) */
h2.g2-attention { display: flex; align-items: center; gap: 6px; color: var(--text); }
h2.g2-attention::before { content: ""; width: 15px; height: 15px; flex: 0 0 auto; background: var(--warn);
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat; }
h2.g2-attention .tip-btn { margin: -14px 0; }
a.g2-new { margin-top: 0; font-weight: 600; }
.g2-new-box { display: flex; flex-direction: row; align-items: center; gap: 4px 16px; margin-left: auto; }  /* 2.1.99: «Архив» on its line */
a.g2-archive { margin-top: 0; }
.badge.g2-vault { display: inline-flex; align-items: center; gap: 6px; }
.badge.g2-vault::before { content: ""; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: var(--icon-lock) center / contain no-repeat; mask: var(--icon-lock) center / contain no-repeat; }
.badge.g2-vault-locked { color: var(--warn); background: var(--warn-soft); border-color: var(--warn); font-weight: 600; }
/* 2.1.98: an open vault — the lock's sign alone, a target of 44 px; its words stay for a reader
   of the screen (the button's aria-label) */
.badge.g2-vault-open { position: relative; width: 44px; height: 44px; padding: 0; justify-content: center;
  background: none; border: 0; color: var(--header-text); opacity: .85; }
.badge.g2-vault-open::before { width: 18px; height: 18px; }
.badge.g2-vault-open > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.badge.g2-vault-open .g2-vault-act { position: absolute; inset: 0; margin: 0; padding: 0; font-size: 0; color: transparent; }
.g2-vault-act { border: 0; background: none; padding: 12px 4px; margin: -12px -4px; color: inherit; font: inherit;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.g2-vault-locked .g2-vault-act { font-weight: 700; }
/* Развитие 3, группа H (14.12): the new connection in three steps, the check's points, the
   key's state on the card (П5), the secret fields' eye and the password's length meter */
.conn-steps { list-style: none; display: flex; gap: 8px; margin: 0 0 12px; padding: 0; font-size: 12px; color: var(--hint); }
.conn-steps li { flex: 1 1 0; border-top: 3px solid var(--line); padding-top: 6px; }
.conn-steps li.done { border-top-color: var(--text); }
.conn-steps li.done::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px;
  background: currentColor; -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat; }
.conn-steps li.now { border-top-color: var(--control); color: var(--text); font-weight: 600; }
.conn-new.live-on .conn-steps li.now { border-top-color: var(--warn); }
.conn-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
/* Спринт 62 (П11); жёлтым — 14.11; 2.1.125: one rule wherever a live account is named (the form's
   line under the connection too) */
.env-live { color: var(--warn); font-weight: 600; }
.env-live::before { content: ""; display: inline-block; width: 13px; height: 13px;
  margin-right: 4px; vertical-align: -1px; background: currentColor;
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat; }
.field-head { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.field-head strong { display: inline; margin: 0; }
.secret-row { display: flex; align-items: stretch; gap: 6px; }
.secret-row input { flex: 1 1 auto; min-width: 0; }
.secret-row .eye { flex: 0 0 auto; margin-top: 6px; min-width: 44px; padding: 0 10px; font-size: 14px;
  border: 1px solid var(--field-line); border-radius: var(--field-radius); background: var(--card); color: var(--hint); }
.secret-row .eye[aria-pressed=true] { color: var(--text); border-color: var(--text); }
.pw-meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pw-meter progress { flex: 0 0 96px; height: 6px; appearance: none; -webkit-appearance: none; border: 0;
  border-radius: 3px; background: var(--muted-soft); overflow: hidden; }
.pw-meter progress::-webkit-progress-bar { background: var(--muted-soft); }
.pw-meter progress::-webkit-progress-value { background: var(--warn); }
.pw-meter progress::-moz-progress-bar { background: var(--warn); }
.pw-meter.ok progress::-webkit-progress-value { background: var(--control); }
.pw-meter.ok progress::-moz-progress-bar { background: var(--control); }
.conn-result { background: var(--surface); box-shadow: none; margin: 10px 0 0; }
.conn-result .points { list-style: none; margin: 0; padding: 0; }
.conn-result .pt { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.conn-result .pt-mark { flex: 0 0 20px; height: 20px; border-radius: 50%; text-align: center; line-height: 20px;
  font-size: 12px; font-weight: 700; }
.conn-result .pt-ok .pt-mark { color: var(--text); background: var(--muted-soft); }
.conn-result .pt-bad .pt-mark { color: var(--danger); background: var(--danger-soft); }
.conn-result .pt-warn .pt-mark { color: var(--warn); background: var(--warn-soft); }
.conn-result .pt-bad { color: var(--danger); }
button.primary.live { background: var(--primary); color: var(--on-primary); }
button.primary.live:hover { background: var(--primary-dark); }
.key-state { margin-top: 2px; }
.key-state .warn-line { color: var(--warn); margin-top: 2px; }
/* the «?» beside a row's buttons stays in the row (группа H) */
.buttons.conn-row { flex-wrap: nowrap; align-items: center; }
.buttons.conn-row > button:not(.tip-btn) { flex: 1 1 0; min-width: 0; width: auto; margin-top: 0; }
.buttons.conn-row > .tip-btn { flex: 0 0 auto; }
/* Развитие 3, группа G1 (14.11, О3, О4): the page's own window for questions and messages —
   a sheet from the bottom on a phone and in Telegram (as the «?» window), a window in the
   middle from 600 px; a dangerous action's button filled red */
.dlg-layer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .4); display: flex; justify-content: center; }
.dlg-layer.dlg-at-bottom { align-items: flex-end; }
.dlg-layer.dlg-in-middle { align-items: center; padding: 16px; }
.dlg-box { box-sizing: border-box; background: var(--card); color: var(--text); border: 1px solid var(--card-border);
  display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 24px; overflow-y: auto; }
.dlg-sheet { width: 100%; max-width: 560px; max-height: 85vh; border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 24px rgba(0, 0, 0, .18); }
.dlg-center { width: 100%; max-width: 440px; max-height: 80vh; border-radius: var(--radius); padding: 16px 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22); }
.dlg-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; overflow-wrap: anywhere; }
.dlg-lines p { margin: 0 0 6px; overflow-wrap: anywhere; }
.dlg-lines:empty { display: none; }
.dlg-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.dlg-buttons .dlg-btn { flex: 1 1 0; min-height: 48px; margin: 0; }
.dlg-buttons.dlg-stack { flex-direction: column; }
.dlg-buttons.dlg-stack .dlg-btn { flex: 0 0 auto; width: 100%; }
.dlg-buttons button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.dlg-buttons button.danger:hover { background: var(--danger); filter: brightness(.94); }
/* Т93-F2 (круг 1 испытаний, владелец 01.11). Д5: the connections of the bot form wrap onto
   lines, each a choice of its own — none cut or scrolled away at 390, 600 and 1024 px. Д7: the
   «?» of the fields and the buttons on «Усреднить вручную» and «Переставить ТП». */
/* 2.1.99 (аудит, второй проход): one even grid — every connection of one width, 14 px; a long
   name wraps inside its own choice */
.segmented.seg-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px;
  border: 0; border-radius: 0; overflow: visible; background: none; }
.segmented.seg-wrap button { min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 20px; padding-inline: 8px;
  border: 1px solid var(--field-line); border-radius: var(--field-radius); background: var(--field-bg); }
.segmented.seg-wrap button[aria-checked=true] { border-color: var(--control); background: var(--control); }
.tip-form .field-label { display: flex; align-items: center; gap: 4px; min-height: 24px; }
.tip-form .tip-slot { margin-left: 2px; display: inline-flex; }
.tip-form > .g2-tipped { margin-top: 12px; }
.tip-form > .g2-tipped > button.primary { margin-top: 0; }
/* Т93-F3: исправления круга 1 (владелец 01.11).
   Д3: a label on a red fill reads at 4.5:1 or more in every theme — white on the light
   modes' deep red, near-black on the dark modes' light red (white on #ff6b70 was 2.8:1) */
:root { --on-danger: #ffffff; }
[data-mode="dark"] { --on-danger: #1a1a1a; }
.dlg-buttons button.danger { color: var(--on-danger); }
/* пожелание c: the live key's button differs by its shape too, not by red only (in swiss the
   plain button is red as well): the warning triangle and a frame around it */
button.primary.live { display: flex; align-items: center; justify-content: center; gap: 6px;
  outline: 2px solid var(--warn); outline-offset: 2px; }
button.primary.live::before { content: ""; width: 15px; height: 15px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat; }
/* пожелание b: the bot's buttons of one row are of one height, a label in two lines or one —
   the cells of the grid stretch (2.1.107: no «?» beside them) */
.buttons.g2-controls > * { align-self: stretch; }
/* Д2: no vault yet — the way to the first connection */
.f3-first p { margin: 0 0 6px; }
.f3-first .link { font-weight: 600; }
/* Т94-W (круг 2): a field's label and its unit are one piece beside the «?» — «Не входить
   выше USDT» wraps as a sentence (the unit after a no-break space), never «USDT» alone */
.field-name { min-width: 0; }
/* Развитие 5 (испытания 02.11). Р5.01, Р5.51–52: a bot's name is one word of up to 64 signs
   (letters, digits, «_») — it wraps at any sign on every screen, and the page is never wider
   than the screen (390 px). A block's text (a screen's title, a line, a warning, a window) breaks
   a word that does not fit its line; in a row the title — a card's <strong>, a screen's <h2>, a
   .name — takes the room left and wraps, while the badge, the sum or the pair beside it keeps its
   size (up to 60 % of the row, wrapping at spaces) and stays whole on the screen. A .names card's
   rows (a name, then a sum with words, as the reports' open cycles) put the sum under the name,
   on the right, when the two do not fit one line. */
body { overflow-wrap: break-word; }
.row > :is(strong, h2, .name), .names .row > :first-child { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.row > :is(strong, h2, .name) ~ * { flex-shrink: 0; max-width: 60%; }
.names .row { flex-wrap: wrap; }
.names .row > :first-child ~ * { margin-left: auto; text-align: right; }
/* Р5.07: the header's tools (the vault, «?», the language, «Выйти») wrap onto a second line
   rather than push «Выйти» off a 390 px screen; a button's label is never cut */
.tools { flex-wrap: wrap; justify-content: flex-end; min-width: 0; row-gap: 4px; }
header button.link { white-space: nowrap; }
/* Развитие 5, круг 2. Р5.81: in a row of a name and a badge (a connection and its market, a bot
   and its state), a name that fits its line whole is not broken to leave room for the badge — the
   badge goes under it, on the right, and wraps at its spaces if it is longer than the line; a name
   longer than the line wraps at any sign (owner 02.11). Rows of a title and its «?» or «Изменить»
   (.g2-card-head) keep them side by side; a browser without :has() keeps the rules above. */
.row:has(> :is(strong, h2, .name)):not(.g2-card-head) { flex-wrap: wrap; row-gap: 2px; }
.row:has(> :is(strong, h2, .name)):not(.g2-card-head) > :is(strong, h2, .name) { max-width: 100%; }
.row:has(> :is(strong, h2, .name)):not(.g2-card-head) > :is(strong, h2, .name) ~ * { flex-shrink: 1; min-width: 0; max-width: 100%; }
.row:has(> :is(strong, h2, .name)):not(.g2-card-head) > :is(strong, h2, .name) + * { margin-left: auto; }
/* Р5.82: on a phone the header's tools stand closer (the «?» takes 22 px of the line), so that in
   the Telegram Mini App (no «Выйти») the vault, «?» and the language fit one line at 390 px, as
   before Р5.07; in a browser «Выйти» still goes onto the second line when there is no room */
@media (max-width: 480px) {
  /* fix-2149: the summary's three parts one under another — two currencies of amounts in a
     column of a third of 390 px ran into the next one; each part: its label, then its amounts */
  .g2-summary { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .g2-sum-value > div { white-space: normal; overflow-wrap: anywhere; }
  /* 2.1.107: a chart (340 × 280 at most) is never taller than 280 px on a phone — at 390 px it is
     267, the form's preview 210 */
  svg.chart { max-height: 280px; }
  .tools { column-gap: 8px; }
  /* 2.1.98 (design audit 14.11): the header is one line on a phone too — the language and
     «Выйти» are in the profile, so «Alphafamilia Algo» keeps its size (Развитие 9 put the
     product under the brand at 13 and 10 px) */
  h1 { min-width: 0; letter-spacing: 0; }
  .g2-vault-locked > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* sprint 30: copying trades — the form's options, the «prices of its own exchange» box, the
   «копия» mark of the list */
.opt { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; margin: 6px 0;
  padding: 12px 14px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--card);
  color: inherit; font: inherit; }
.opt.sel { border-width: 2px; border-color: currentColor; }
.opt .row { display: flex; justify-content: space-between; gap: 8px; }
.opt .opt-line { display: block; }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 10px 12px;
  font-size: 14px; line-height: 20px; margin-top: 6px; }
.chip-copy { border: 1px solid var(--line); border-radius: var(--r-s); padding: 2px 8px; margin-left: 6px; }

/* owner 03.11: the first steps' checklist on the bots list */
.fs-card { display: flex; flex-direction: column; gap: 14px; }
.fs-card > .row { display: flex; justify-content: space-between; align-items: baseline; }
.fs-bar { height: 6px; border-radius: 3px; background: var(--surface); }
.fs-fill { height: 6px; border-radius: 3px; background: var(--control); width: 0; }
.fs-w1 { width: 20%; } .fs-w2 { width: 40%; } .fs-w3 { width: 60%; } .fs-w4 { width: 80%; } .fs-w5 { width: 100%; }
.fs-act button { min-height: 48px; }
.fs-step { display: flex; gap: 12px; align-items: flex-start; }
.fs-dot { flex: 0 0 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 600; box-sizing: border-box; }
.fs-dot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fs-todo { border: 1px solid var(--field-line); color: var(--hint); }
.fs-now { background: var(--text); color: var(--bg); }
.fs-ok { background: var(--control); color: var(--on-control); }
.fs-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.fs-title { margin: 3px 0 0; font-weight: 600; }
.fs-title.dim { color: var(--hint); font-weight: 500; }
.fs-body p { margin: 0; }
.fs-act { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.fs-act .opt { margin: 0; }
.fs-live { color: var(--primary-text); }
.fs-kv { display: flex; flex-direction: column; gap: 6px; width: 100%; box-sizing: border-box;
  background: var(--surface); border-radius: var(--radius); padding: 10px 12px; }
.fs-kv .row { display: flex; justify-content: space-between; gap: 12px; }
a.fs-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px;
  border-radius: var(--btn-radius); background: var(--primary); color: var(--on-primary); font-weight: 600; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--primary-edge); }
.fs-done { background: var(--surface); color: var(--text); }
.fs-done .row { display: flex; justify-content: space-between; align-items: center; }
.fs-done p { margin: 6px 0 0; }
.fs-close { width: 44px; height: 44px; margin: -10px -10px -10px 0; border: 0; background: transparent;
  color: inherit; font-size: 22px; line-height: 1; }

/* sprint 38, part 2 (38.12–38.18): «Уровни», «Усреднить», «ТП» — a phone first (390 px): rows
   as cards, buttons of 44 px and more, the hints right under the fields; the attention reasons */
a.chip-levels { --chip-icon: var(--icon-levels); }
a.chip-tp { --chip-icon: var(--icon-tp); }
:root {
  --icon-levels: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-tp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 18l6-6 4 4 6-8M15 8h5v5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.mv-title { overflow-wrap: anywhere; }
.mv-card { display: flex; flex-direction: column; gap: 8px; }
.mv-row { border-top: 1px solid var(--line); padding: 8px 0 2px; display: flex; flex-direction: column; gap: 2px; }
.mv-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.mv-name { font-weight: 600; overflow-wrap: anywhere; }
.mv-sub, .mv-sum, .mv-forecast { font-variant-numeric: tabular-nums; }
button.mv-act { min-height: 48px; min-width: 104px; margin: 0; white-space: nowrap; }
.mv-row.s-cancelled .mv-name, .mv-row.s-cancelled .mv-sub { text-decoration: line-through; color: var(--hint); }
.mv-row.s-filled .mv-state, .mv-done { color: var(--text); font-weight: 600; }
.mv-row.s-failed .mv-state { color: var(--danger); }
.mv-why { margin: 2px 0 4px; }
.mv-sum { align-items: baseline; }
.mv-sum.error strong, .mv-over { color: var(--danger); font-weight: 600; }
.mv-hrow { border-top: 1px solid var(--line); padding: 6px 0; }
.mv-hrow .mv-line { min-height: 0; }
.mv-res.r-failed { color: var(--danger); }
.mv-res.r-filled { color: var(--text); font-weight: 600; }
.mv-hints { display: flex; flex-direction: column; gap: 4px; }
.mv-hint.h-error { color: var(--danger); font-weight: 600; }
.mv-hint.h-warn { color: var(--warn); }
.mv-hint.h-note { color: var(--hint); }
.mv-forecast { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: var(--field-radius); background: var(--surface); }
.mv-forecast:empty { display: none; }
.mv-forecast .error { font-weight: 600; }
.mv-card .segmented button { min-height: 46px; white-space: nowrap; }
.mv-card input { min-height: 48px; font-size: 18px; }
button.mv-buy, button.mv-move { min-height: 48px; width: 100%; margin-top: 4px; }
button.mv-auto { min-height: 48px; align-self: flex-start; }
.mv-tpnow .row { align-items: baseline; }
.g2-att { border-left: 3px solid var(--warn); }
.g2-att-title { color: var(--warn); }
.g2-att-item + .g2-att-item { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.g2-att-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.badge.g2-att-badge { color: var(--warn); background: var(--warn-soft); font-weight: 600; }
.badge.att-retrying, .badge.att-fault, .badge.att-step_failed { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-soft); }
.dlg-buttons button.dlg-safe { background: var(--text); border-color: var(--text); color: var(--card); box-shadow: none; }
.dlg-buttons button.danger.dlg-outline { background: var(--card); color: var(--danger); border: 2px solid var(--danger); }
.dlg-buttons button.danger.dlg-outline:hover { background: var(--danger-soft); filter: none; }

/* 2.1.99 (аудит, второй проход) — А: форма */
/* the groups of the form under small headings; the line of the result under «ТП | Плечо» */
.form-group-title { margin: 20px 0 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--hint); }
.card.form > .form-group-title:first-child { margin-top: 4px; }
.form-brief { margin: 8px 0 0; font-size: 14px; line-height: 20px; color: var(--hint); }
.form-brief .r2c-neg, .form-brief .r2c-pos { font-weight: 600; }
/* 17.11 (owner): a drawdown on paper — amber, no arrow */
.r2c-warn { color: var(--warn); font-weight: 600; }
/* 2.1.101: the form's buttons — «Анализ настроек» on its own line, the save buttons sharing the
   one under it; in the page's flow, at the end of the form. 2.1.107 (третий проход, В7): two
   equal buttons in one row, a label on one line («Сохранить» | «Запустить»; the copy's «Создать» |
   «Запустить»), no «?» beside them — one link «Что делают кнопки?» under them */
.buttons.form-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.buttons.form-buttons > .btn-wide { grid-column: 1 / -1; }
.buttons.form-buttons > button { width: 100%; min-width: 0; margin-top: 0; line-height: 20px; white-space: nowrap; }
.form-actions > .save-why { margin: 8px 0 0; }
.form-actions > .tip-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }  /* 2.1.125: a link looks as every link */
.form-actions > .tip-link:hover { text-decoration-color: var(--text); }
/* the window «Анализ настроек» (dialog.js view): up to 780 px (17.11: the steps' table fits a
   computer's window whole), its cards flat on the window */
.dlg-box.dlg-wide { max-width: 780px; }
.dlg-body .card { box-shadow: none; border-color: var(--line); margin: 8px 0; }
/* «Подробнее» of the «Итог», «Уровни (N)» of the grid, a warning's rest, «Дополнительно»: a
   line of 44 px with a chevron that turns when open */
:is(details.more, details.levels, details.warn-more) > summary {
  display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; list-style: none;
  font-size: 14px; line-height: 20px; color: var(--text); }
:is(details.more, details.levels, details.warn-more) > summary::-webkit-details-marker { display: none; }
:is(details.more, details.levels) > summary::before {
  content: ""; width: 12px; height: 12px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat;
  transition: transform .15s; }
:is(details.more, details.levels)[open] > summary::before { transform: rotate(90deg); }
details.levels { margin-top: 4px; border-top: 1px solid var(--line); }
details.levels > p { margin: 6px 0; }
/* 17.11 (owner): the steps' table of «Анализ настроек» (steps.js) — wider than a phone it
   scrolls in its own box, the column «Шаг» stays; a unit in every cell, no line breaks inside
   a number; the drawdown in the theme's amber (a paper result, not a loss), the profit green */
div.levels { margin-top: 4px; border-top: 1px solid var(--line); }
div.levels > p { margin: 6px 0; }
.st-title { margin-top: 12px; align-items: center; gap: 4px; justify-content: flex-start; }
.st-wrap { overflow-x: auto; margin-top: 4px; -webkit-overflow-scrolling: touch; }
.st-table { border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.st-table th, .st-table td { padding: 6px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.st-table thead th { font-weight: 600; font-size: 12px; line-height: 16px; color: var(--hint); vertical-align: bottom; white-space: normal; }
.st-table .st-step { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--card); font-weight: 600; }
.st-table thead .st-step { z-index: 2; }
.st-table td.st-drawdown { color: var(--warn); }
.st-table .st-qty { display: block; font-size: 12px; line-height: 16px; color: var(--hint); }
.st-table td.st-profit { color: var(--profit); font-weight: 600; }
.st-table tr.st-refused td.error { text-align: left; white-space: normal; }
/* 18.11 (owner): the running strategy's table — the state under the step's name; the steps
   bought on a tinted background (the sticky column too), a step taken off or passed over muted */
.st-table .st-state { display: block; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--hint); }
.st-table tr.st-done th, .st-table tr.st-done td { background: var(--surface); }
.st-table tr.st-off td.muted { text-align: left; white-space: normal; }
.g2-steps .st-title { margin-top: 0; }
.st-table tbody tr:last-child th, .st-table tbody tr:last-child td { border-bottom: 0; }
/* the price now and the total — one line of 12 px over the chart */
.preview-head { font-size: 12px; line-height: 16px; flex-wrap: wrap; gap: 2px 12px; }
.preview-head > :last-child { margin-left: auto; text-align: right; }
/* a chart of the grid at most 240 px high at any width */
.form-out svg.chart { max-height: 240px; margin-inline: auto; }
/* a warning: its first sentence with the triangle, the rest under it */
.form-warnings details.warn-more > summary { position: relative; display: block; min-height: 0; padding: 4px 0 4px 23px;
  font-size: 14px; line-height: 20px; }
.form-warnings details.warn-more > summary::before { content: ""; position: absolute; left: 0; top: 7px; width: 15px; height: 15px;
  background: var(--warn); -webkit-mask: var(--warn-icon) center / contain no-repeat; mask: var(--warn-icon) center / contain no-repeat; }
.form-warnings details.warn-more > summary::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px;
  vertical-align: 0; background: var(--hint); -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat; transform: rotate(90deg); transition: transform .15s; }
.form-warnings details.warn-more[open] > summary::after { transform: rotate(-90deg); }
.form-warnings details.warn-more > p { padding-left: 23px; margin: 0 0 4px; }
.form-warnings details.warn-more > p::before { content: none; }
/* «Как торгует стратегия» on a phone: both choices on one line, of one height */
@media (max-width: 480px) {
  .mode-switch .segmented button { font-size: 14px; white-space: nowrap; padding-inline: 4px; }
}

/* 2.1.99 (аудит, второй проход) — Б: экран стратегии и список */
/* a dangerous button of the controls is 48 px like its neighbours: what it does is a line under
   it, not inside it; in «Остановка» 24 px below the safe one, of its width (2.1.109; before, in
   the right column — half the width) */
.g2-controls button.danger[data-note]::after { content: none; }
.g2-danger-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.g2-danger-note { margin: 0; line-height: 16px; font-size: 12px; }
/* «Последние циклы»: five rows, the result and its % in columns of their own, to the right */
.g2-results { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 16px; align-items: baseline; margin-top: 6px; }
.g2-results > * { padding: 6px 0; border-top: 1px solid var(--line); min-width: 0; }
.g2-results .g2-res-pct { color: var(--hint); }
.g2-results a { color: inherit; text-decoration: none; }
.g2-results a.g2-res-cycle::after { content: "\00a0›"; color: var(--hint); }
a.g2-all-cycles { font-size: 14px; }
/* a refused command at the place of its button (owner 14.11, question 7) */
.g2-fail { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 8px;
  border-left: 3px solid var(--danger); }
.g2-fail-text { color: var(--text); padding-top: 4px; overflow-wrap: anywhere; }
.g2-fail-x { width: 44px; height: 44px; margin: -10px -10px 0 0; border: 0; background: none; color: var(--hint);
  font-size: 22px; line-height: 1; cursor: pointer; }
.g2-fail-again { grid-column: 1 / -1; justify-self: start; }
.card .g2-fail-title { margin: 0 0 2px; }  /* 2.1.107: a form's failed save — what failed, then why */

/* 2.1.99 (аудит, второй проход) — В: токены и общий вид. Видимый фокус с клавиатуры: кольцо 2 px
   цвета --focus снаружи у кнопок, ссылок, раскрывашек, тумблеров (у полей — своя рамка, выше);
   у кнопок внутри рамки с overflow: hidden (переключатель, степпер) — кольцо внутрь, иначе
   его срежет. «?» и знак сейфа в шапке — со своим видом фокуса (правила выше сильнее). */
:is(button, a, summary, [role="button"]):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.segmented button:focus-visible, .stepper button:focus-visible { outline-offset: -2px; }
.toggle input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
/* выключенное — цветами, без прозрачности (текст --text-disabled, подложка --surface) */
.segmented button:disabled, .stepper button:disabled { color: var(--text-disabled); cursor: not-allowed; }
.segmented button:disabled:hover { background: transparent; }
.stepper button:disabled:hover { background: var(--surface); }

/* 2.1.107 (дизайн-аудит, третий проход) — Б: числа, перенос строк, список, отчёты */
/* the list card's result now: a column of its own at the top right, of one width in every card;
   the line beside it flows on under it at the card's full width and breaks only between its
   parts (list_screen.js: no-break spaces inside a part) — two lines, not three, on a phone */
.row.g2-line2 { display: flow-root; font-size: 14px; line-height: 20px; }
.g2-line2 > .g2-now { float: right; min-width: 96px; margin-left: 12px; text-align: right; }
/* 2.1.126 (owner 16.11): the next averaging — a line of its own under it, never broken off it */
.g2-next-line { font-size: 14px; line-height: 20px; }
/* the code of an emergency is for the support: under «Подробнее», a line of 44 px */
details.r2c-code-more > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer;
  list-style: none; color: var(--hint); }
details.r2c-code-more > summary::-webkit-details-marker { display: none; }
details.r2c-code-more > summary::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat;
  transition: transform .15s; }
details.r2c-code-more[open] > summary::before { transform: rotate(90deg); }
details.r2c-code-more > .r2c-code { margin: -6px 0 4px 18px; word-break: normal; }
.r2c-code code { font: inherit; word-break: break-all; }
/* 2.1.125 (design audit, fourth pass, 1.5): a level's «результат здесь ▼ −0,40 USDT» stays whole —
   at a narrow card it goes under «Вложено всего», on the right, as one piece */
.level-risk { flex-wrap: wrap; }
.level-risk > .level-result { white-space: nowrap; margin-left: auto; }
/* reports: «к бюджету 0,96 %» a line of its own under the sum, small and grey; on a phone each
   row of a report's card is its name over its value, the value on the right — never «Прибыль,⏎RUB»
   or «%» alone on a line; the open cycles all in one layout */
.rep-sum { display: inline-flex; flex-direction: column; align-items: flex-end; text-align: right; }
.rep-budget { font-size: 12px; line-height: 16px; color: var(--hint); }
@media (max-width: 480px) {
  .report-card > .row { flex-direction: column; align-items: stretch; gap: 0; }
  .report-card > .row > :first-child { max-width: 100%; }
  .report-card > .row > :last-child { align-self: flex-end; margin-left: 0; max-width: 100%; text-align: right; }
  .card.report-card > .row + .row { margin-top: 8px; }
}

/* 2.1.108 (owner 15.11 09:17): on a wide screen a name and its value stand side by side — the
   names in a column of 200 px (the grid's levels 260 px), the value right after it, to the left;
   before, the value stood at the card's far edge, ~650 px from its name. On a phone (< 600 px)
   they keep the two edges. The doubled classes outweigh `.row:has(> strong) > strong + *`
   (margin-left: auto), which would push the value back to the edge of its grid cell. */
@media (min-width: 600px) {
  .row.kv.kv, .level > .row.small.small {
    display: grid; grid-template-columns: var(--kv-name, 200px) minmax(0, 1fr); column-gap: 16px;
    justify-content: start; justify-items: start; align-items: baseline; text-align: left;
  }
  .level > .row.small.small { --kv-name: 260px; }
  .row.kv.kv > *, .level > .row.small.small > * { margin-left: 0; max-width: none; text-align: left; }
  /* a report's sums: a column of their own right after the names, right-aligned in it — the
     kopecks under one another (2.1.99), no longer at the card's far edge */
  .report-card { --kv-name: 220px; }
  .report-card > .row.kv.kv { grid-template-columns: var(--kv-name) minmax(160px, max-content); }
  .report-card > .row.kv.kv > :last-child { justify-self: end; text-align: right; }
  /* the open cycles: a line of words, not a sum — right after the name, like the cycle's card */
  .report-card.names > .row.kv.kv { grid-template-columns: var(--kv-name) minmax(0, 1fr); }
  .report-card.names > .row.kv.kv > :last-child { justify-self: start; text-align: left; }
}

/* 2.1.125 (design audit, fourth pass, 4.7; owner 16.11): the pressed button after a success — «Сохранено ✓»
   for 1.5 s on the soft main colour (it is disabled meanwhile: these rules stand after :disabled's) */
button.primary.saved, button.secondary.saved { color: var(--text); background: var(--primary-soft); border-color: var(--primary-soft); box-shadow: none; }

/* 2.1.125 (design audit, fourth pass, В6; owner 16.11): the reports — on a phone the groups are cards of
   three rows with «Подробнее»; from 600 px one table, the figures to the right, the kopecks under one another */
.rep-table-box { display: none; }
/* 2.1.126 (owner 16.11): open cycles — on a phone two lines from the left (the name and its cycle,
   the result and the break-even), a free line between the cycles; from 600 px a table */
.rep-open-list { display: grid; gap: 20px; margin-top: 12px; font-size: 16px; line-height: 24px; }
.rep-open-name { overflow-wrap: anywhere; font-weight: 600; }
.rep-open-now { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-open-table { display: none; }
.rep-more > summary { color: var(--hint); }
.rep-more .row { padding: 2px 0; }
.rep-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.rep-table th, .rep-table td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.rep-table th { font-size: 12px; line-height: 16px; color: var(--hint); font-weight: 600; border-top: 0; }
.rep-table th:first-child, .rep-table td:first-child { padding-left: 0; overflow-wrap: anywhere; }
.rep-table th:last-child, .rep-table td:last-child { padding-right: 0; }
.rep-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-cell { display: flex; flex-direction: column; align-items: flex-end; }
@media (min-width: 600px) {
  .rep-table-box { display: block; }
  .rep-group-cards { display: none; }
  .rep-open-table { display: block; margin-top: 4px; }
  .rep-open-list { display: none; }
}
