/* iSEO monthly report — an SEO agency's analytics report on the departure-board layout.
   Cool graphite on a light page, white section panels, a modular 12-column grid, hairlines; colour is a system code only.
   Scene: read at a desk by daylight, shown on a meeting-room screen, printed to PDF — so light, no dark theme. */

:root {
  --page-bg: #f3f4f7;       /* the page under the section panels */
  --paper: #ffffff;         /* panels, tooltips, control fills */
  --tint: #f1f3f6;          /* data columns, quiet bands */
  --ink: #161b26;
  --ink-2: #424958;
  --muted: #646d7d;         /* 5:1 on white, 4.6:1 on the page */
  --hair: #e3e6eb;
  --rule: #cdd2da;          /* structural lines: column heads, the rail, panel edges */
  --radius: 12px;           /* panels */
  --radius-s: 8px;          /* controls, bands, the strip */
  --client: #1f4fd8;        /* replaced per project from the profile */
  --client-ink: #ffffff;
  --client-band: var(--client);   /* deeper shade for bands with white text, set from JS to >= 4.5:1 */
  --client-wash: color-mix(in srgb, var(--client) 20%, transparent);
  --yandex: var(--ink);
  --google: #2b6cf6;
  --peer: #b7bdc8;
  --peer-1: #868e9c;        /* several competitors step through these, nearest first */
  --peer-2: #a7aeba;
  --peer-3: #c8cdd6;
  --serp-mid: #7a8292;      /* positions 4–10 in the SERP stack (TOP-3 is ink) */
  --serp-low: #d3d7de;      /* positions 11 and below */
  --good: #087a3c;
  --bad: var(--ink);        /* declines are ink + ▼: red belongs to the client */
  --loss: #6b7383;          /* loss bars */
  --gutter: 24px;
  --page: 1360px;
  --mast-h: 0px;
  font-family: "Golos Text", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-size: 15px; line-height: 1.5; }
::selection { background: var(--client); color: var(--client-ink); }
:focus-visible { outline: 2px solid var(--client); outline-offset: 2px; }
/* inside a clipping row (toggles, the month strip, the rail) the ring is drawn inside the control, or it would be cut off;
   on a client band it is white */
.toggle button:focus-visible, .strip button:focus-visible, .chapters a:focus-visible { outline-offset: -3px; }
.strip button[aria-current="true"]:focus-visible, .toggle button[aria-pressed="true"]:focus-visible { outline-color: var(--client-ink); }
* { scrollbar-color: var(--peer) transparent; scrollbar-width: thin; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.defs { position: absolute; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- masthead */
.mast { max-width: var(--page); margin: 0 auto; padding: 14px var(--gutter) 0; }
.mast-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mast-brand { display: flex; align-items: center; gap: 14px; }
/* the agency's own logo (web/brand/iseo.svg, from iseo.ru): fixed, never recoloured for a client */
.wordmark { display: block; height: 20px; width: auto; flex: none; align-self: center; }
.mast-kind { color: var(--ink-2); font-size: 14px; }
.mast-tools { display: flex; gap: 10px; align-items: center; }
/* the chapters of the issue and their order: the «Главы» section of the settings panel */
.blocks-list { list-style: none; margin: 0 0 10px; padding: 0; }
.blocks-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.blocks-list li label { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; font-size: 14px; cursor: pointer; }
.blocks-list li label small { grid-column: 2; }
.blocks-list li label input { accent-color: var(--ink); }
.blocks-list li small { font-size: 12px; color: var(--muted); }
.blocks-list li.off label { color: var(--muted); cursor: default; }
.blocks-list .moves { display: flex; gap: 4px; }
.blocks-list .mv { width: 28px; height: 26px; border: 1px solid var(--hair); border-radius: 6px; background: var(--paper); cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.blocks-list .mv svg { width: 12px; height: 12px; }
.blocks-list .mv:hover:not(:disabled) { border-color: var(--ink); }
.blocks-list .mv:disabled { color: var(--hair); cursor: default; }
/* a chapter unfolds to its blocks; each one switches off on its own */
.blocks-list .unfold { font-size: 12px; margin-right: 4px; white-space: nowrap; }
.blocks-list li.subs { display: block; padding: 2px 0 6px 26px; }
.blocks-list li.subs ul { list-style: none; margin: 0; padding: 0; }
.blocks-list li.subs li { padding: 4px 0; border-bottom: 0; }
.blocks-list li.subs label { font-size: 13px; }
.blocks-list li.fixed label { cursor: default; }
.setup .foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 13px; }
/* a node's directions: all of them or the report of one */
.dir-pick[hidden] { display: none; }
.dir-pick select { height: 36px; min-width: 200px; max-width: 70vw; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink); font-weight: 600; }
.btn {
  height: 36px; padding: 0 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; border-radius: var(--radius-s);
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--ink-2); border-color: var(--ink-2); }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover:not(:disabled) { background: var(--tint); border-color: var(--ink-2); }
.btn[hidden] { display: none; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* the agency's crumbs over the title: Клиенты / winline.ru / [дашборд ▾] · Все дашборды */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.crumbs[hidden] { display: none; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { color: var(--peer); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }
.crumbs .crumb-pick select { height: 30px; max-width: min(60vw, 420px); padding: 0 28px 0 8px; border: 1px solid var(--rule); border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14px; }
.crumbs .crumb-pick select:hover { border-color: var(--ink-2); }
.crumbs .crumb-all { margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--rule); }
.crumbs + .mast-title { margin-top: 8px; }
@media print { .crumbs { display: none !important; } }
@media (max-width: 720px) { .crumbs .crumb-pick select { height: 44px; } }
.mast-title { margin-top: 18px; padding-top: 0;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); align-items: end; }
.mast-title h1 { grid-column: 1 / span 8; margin: 0; font-size: clamp(1.75rem, 2.7vw, 2.5rem); line-height: 1.05;
  letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
.mast-title h1 { display: flex; align-items: center; gap: 0.32em; }
/* the client's logo, as given: sized to the name's cap height, never recoloured */
.client-logo { height: 0.92em; width: auto; max-width: 3.4em; object-fit: contain; flex: none; }
.client-logo[hidden] { display: none; }
.mast-project { display: block; font-weight: 500; color: var(--ink-2); letter-spacing: -0.02em; font-size: 0.62em; margin-top: 6px; }
.mast-issue { grid-column: 9 / span 4; margin: 0; text-align: right; font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.15; }
/* the label over the month: this is the reporting period of a client report */
.mast-period { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: 2px; }
.mast-site { display: block; font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px;
  overflow-wrap: anywhere; }   /* a database name has no break points: «Alfabank_Debetovye_karty_clickhouse» is wider than 4 columns at 768px */

/* the period of the issue over the strip: month, quarter, year, the year to date */
.strip-head { display: flex; margin-top: 16px; }
.strip-head + .strip { margin-top: 8px; }
/* a quarter or a year not over yet: its months so far, under its name */
.mast-partial { display: block; font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
/* the strip: one cell per issue — 13 months, 8 quarters or the years; the current one is the client's colour */
.strip { display: grid; grid-template-columns: repeat(var(--cells, 13), 1fr); margin-top: 16px; background: var(--paper); border: 1px solid var(--hair);
  border-radius: var(--radius-s); overflow: hidden; }
.strip button {
  border: 0; border-right: 1px solid var(--hair); background: none; padding: 6px 8px 7px; text-align: left; cursor: pointer;
  font-size: 12px; color: var(--ink-2); line-height: 1.2; min-width: 0;
}
.strip button:last-child { border-right: 0; }
.strip button { overflow: hidden; }   /* a figure never runs into the next month */
.strip button b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.strip button:hover { background: var(--tint); }
.strip button .sv { display: block; margin-top: 4px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.strip button.hit .sv::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 4px; background: currentColor; vertical-align: 1px; }
.strip button[aria-current="true"] { background: var(--client-band); color: var(--client-ink); }
.strip button[aria-current="true"] .sv { color: var(--client-ink); }
.strip button[aria-current="true"] b { color: var(--client-ink); }
.strip button:disabled { color: var(--hair); cursor: default; background: none; }
.strip button:disabled b { color: var(--hair); }

/* ---------------------------------------------------------------- chapter rail */
.chapters {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page-bg) 92%, transparent); border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(1.4) blur(8px);
}
.chapters-in { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.chapters a {
  flex: none; padding: 12px 12px 11px; text-decoration: none; font-size: 13px; color: var(--ink-2); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.chapters a:hover { color: var(--ink); }
.chapters a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--client); font-weight: 600; }

/* ---------------------------------------------------------------- chapters */
.issue { max-width: var(--page); margin: 0 auto; padding: 20px var(--gutter) 64px; display: grid; gap: 20px; }
.chapter { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); padding: 28px 32px 36px;
  box-shadow: 0 1px 2px rgba(22, 27, 38, 0.04); scroll-margin-top: 64px;
  min-width: 0; }   /* a grid item: without it a wide scrolling table would widen the panel and the page */
.chapter.first { padding-top: 22px; }
.placeholder { color: var(--muted); font-style: normal; }
.chapter-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); align-items: end;
  margin-bottom: 32px; row-gap: 10px; }
.chapter-head h2 { grid-column: 1 / span 7; margin: 0; font-size: clamp(1.3rem, 1.8vw, 1.75rem); letter-spacing: -0.02em; line-height: 1.15;
  font-weight: 650; display: flex; gap: 0.5em; align-items: baseline; text-wrap: balance; }
.chapter-head .lede { grid-column: 1 / span 7; margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; max-width: 72ch; letter-spacing: -0.005em; }
.chapter-head .lede[hidden] { display: none; }
.chapter-head .lede b { font-weight: 650; color: var(--ink); }
/* a chapter that reads only a month, in a quarter or a year: one line under its title, no tools */
.chapter.folded { padding-bottom: 22px; }
.chapter.folded .chapter-tools { display: none; }
.month-only { margin: 0; color: var(--muted); font-size: 14px; }
/* a quarter on the board: its three months under the sum */
.board small.was.months3 { display: block; margin: 4px 0 0; white-space: normal; }
.chapter-tools { grid-column: 8 / span 5; grid-row: 1 / span 2; justify-self: end; min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: flex-end; align-items: end; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--col-gap, var(--gutter)); row-gap: 56px; }
/* air on a wide screen: the panel's own margins, the gap between blocks side by side, the space between panels */
@media (min-width: 1280px) {
  .chapter { padding: 36px 44px 48px; }
  .chapter-head { margin-bottom: 40px; }
  .issue { --col-gap: 40px; gap: 28px; }
}
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.block { min-width: 0; }   /* grid items may shrink below a wide table: the table scrolls inside .tbl-wrap */
/* a table wider than its column scrolls; the paper covers the edge shadow until there is more to see */
.tbl-wrap { overflow-x: auto;
  background: linear-gradient(to right, var(--paper) 40%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 40%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(18, 18, 18, 0.16), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(18, 18, 18, 0.16), transparent) right / 12px 100% no-repeat scroll; }
.block h3 { margin: 0 0 4px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.block .sub { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.chart { height: 320px; width: 100%; }
.chart.short { height: 220px; }

/* controls: plain grotesk toggles on a hairline, the active one in ink */
.toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; }
.toggle button { border: 0; background: var(--paper); padding: 6px 12px; font-size: 13px; cursor: pointer; }
.toggle button + button { border-left: 1px solid var(--rule); }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toggle button:hover:not([aria-pressed="true"]) { background: var(--tint); }
.pick { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); max-width: 100%; }
/* a select is as wide as its longest option: a Topvisor group name can run to 60 characters, so it is capped */
.pick select { height: 32px; border: 1px solid var(--hair); background: var(--paper); padding: 0 8px; border-radius: var(--radius-s); color: var(--ink);
  min-width: 120px; max-width: 320px; text-overflow: ellipsis; }   /* a fixed cap: a percentage would not limit the column's own width */
.pick select:hover { border-color: var(--ink-2); }

/* ---------------------------------------------------------------- the board */
.board { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.board th { text-align: right; font-weight: 500; font-size: 13px; color: var(--muted); padding: 0 16px 6px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.board th:first-child { text-align: left; padding-left: 0; }
.board th .th-note { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.board td { padding: 7px 14px 6px; border-bottom: 1px solid var(--hair); text-align: right; vertical-align: baseline; white-space: nowrap; }
.board td:first-child { text-align: left; padding-left: 0; white-space: normal; width: 34%; }
.board .metric { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.board .metric small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 1px;
  max-width: 44ch; text-wrap: pretty; }   /* wraps rather than cuts: «4 из 7 направлений» is part of the figure */
.board small.was { display: inline; font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.planbar small.was { grid-column: auto; margin-left: 0; }
.board small.lfl { display: block; font-size: 12px; color: var(--muted); white-space: normal; margin-top: 2px; }
.board tr.lead small.lfl { color: var(--client-ink); }
.planbar small.lfl { grid-column: 1 / -1; text-align: right; }
.board .fig { font-size: clamp(1.6rem, 3.2vw, 2.8rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.board .val { font-size: clamp(1.05rem, 1.5vw, 1.35rem); font-weight: 600; letter-spacing: -0.02em; }
/* the lead row carries the month; the other rows step down a size so the eye lands on it first */
.board tr:not(.lead) .fig { font-size: clamp(1.35rem, 2.3vw, 2.05rem); letter-spacing: -0.025em; }
.board tr.lead td { padding-top: 14px; padding-bottom: 12px; }
.board tr.lead td { background: var(--client-band); color: var(--client-ink); border-bottom-color: var(--client-band); }
.board tr.lead td:first-child { padding-left: 18px; border-radius: var(--radius-s) 0 0 var(--radius-s); }
.board tr.lead td:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.board tr.lead .metric small, .board tr.lead .na, .board tr.lead small.was { color: var(--client-ink); }
.board tr.lead .delta { color: var(--client-ink); }
.board .na { color: var(--muted); font-weight: 500; font-size: 15px; }
/* the bar is at least 96px and takes the width a long sub-label gives the cell («план 158 167 · −27,9 % к августу»),
   so it never stands apart from its per cent */
.planbar { display: inline-grid; grid-template-columns: minmax(96px, 1fr) auto auto; gap: 10px; align-items: center; justify-content: end; }
.planbar i { display: block; height: 8px; background: color-mix(in srgb, currentColor 22%, transparent); position: relative; border-radius: 4px; }
.planbar i b { position: absolute; inset: 0 auto 0 0; background: currentColor; max-width: 100%; border-radius: 4px; }
.planbar i em { position: absolute; top: -4px; bottom: -4px; left: 100%; width: 2px; background: currentColor; }

.delta { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 600; }
.delta svg { width: 10px; height: 10px; align-self: center; flex: none; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); } .delta.flat { color: var(--muted); }
.delta.neutral { color: var(--ink-2); }
.board tr.lead .delta.neutral { color: var(--client-ink); }

/* «Главное»: one line per finding, square marks (client band = a warning), the explanation folded under the line */
.board-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.keys { margin-top: 28px; border-top: 1px solid var(--hair); padding-top: 16px; }
.keys h3 { margin: 0 0 10px; font-size: 15px; font-weight: 650; }
.keys ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px var(--gutter); }
.keys li { position: relative; padding-left: 18px; font-size: 16px; line-height: 1.4; }
.keys li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }
.keys li.warn::before { background: var(--client-band); }
.keys li.gain::before { background: var(--good); }
.keys li b { font-weight: 650; }
.keys li p { margin: 0; }
.keys details summary { cursor: pointer; list-style: none; padding: 2px 22px 4px 0; position: relative; }
.keys details summary::-webkit-details-marker { display: none; }
.keys details summary::after { content: ""; position: absolute; right: 4px; top: 0.55em; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform 160ms ease-out; }
.keys details[open] summary::after { transform: translate(0, 3px) rotate(-135deg); }
.keys details summary:hover::after { border-color: var(--ink); }
.keys details p { font-size: 14px; color: var(--ink-2); padding: 0 0 8px; max-width: 68ch; }
.keys .line { padding: 2px 0 4px; }

/* landing pages of a goal: the page's title over its path, a goal switch beside the heading */
.goal-pages .gp-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.goal-pages .gp-head h3 { margin: 0; }
.tbl .page { display: grid; gap: 2px; }
.tbl .page b { font-weight: 600; color: var(--ink); }
.tbl .page .path { font-size: 12px; color: var(--muted); }

/* facts instead of sentences: a muted label, a bold figure, a short note */
.facts { margin: 0; display: grid; gap: 0; }
.facts > div { padding: 10px 0; border-bottom: 1px solid var(--hair); display: grid; gap: 2px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.facts dd b { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.facts dd small { font-size: 13px; color: var(--ink-2); }
.facts.row { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: 18px; }
.facts.row > div { border-bottom: 0; border-top: 1px solid var(--hair); }
/* a row of facts: every value on one line across the row, its note always under it (a taller neighbour must not push
   the value down: the cell's content keeps to its top) */
.facts > div { align-content: start; }
.facts.row dd { flex-direction: column; align-items: flex-start; gap: 4px; }
button.link.reset { align-self: center; font-size: 13px; }

/* events: numbered verticals on the charts, the same numbers in a list under them */
.events { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; border-top: 1px solid var(--hair); padding-top: 10px; }
.events li { display: grid; grid-template-columns: 22px 54px 1fr; gap: 10px; align-items: baseline; font-size: 14px; }
.ev-n { display: inline-grid; place-items: center; width: 20px; height: 18px; border: 1px solid var(--ink-2); border-radius: 4px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-m { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* plan track: a timetable of months, the report month in the client band, months ahead in tint */
.plantrack { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.plantrack th, .plantrack td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.plantrack thead th { font-weight: 500; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--rule); }
.plantrack tbody th { text-align: left; font-weight: 600; padding-left: 0; }
.plantrack thead th:first-child { text-align: left; padding-left: 0; }
.plantrack .cur { background: var(--client-band); color: var(--client-ink); font-weight: 600; }
.plantrack thead .cur { color: var(--client-ink); }
.plantrack .future { background: var(--tint); color: var(--muted); }
.plantrack .total { font-weight: 700; border-left: 1px solid var(--rule); }
/* a plan by engine: each engine's three rows apart from the next */
.plantrack tbody + tbody tr:first-child > * { border-top: 1px solid var(--rule); }
.pp-kind + .pp-kind { margin-top: 20px; }
/* a folded list: «Ещё 8» under it, in the table's own left edge */
.fold-more { margin: 10px 0 0; font-size: 13px; }
.fold-more .link { color: var(--ink-2); }
.fold-more .link:hover { color: var(--ink); }
@media print { .fold-more { display: none; } }
.summary.single.cols { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: 16px; }
button.link { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }

/* split-flap settle: each digit drops into place once */
.flap { display: inline-block; overflow: hidden; vertical-align: bottom; }
.flap > span { display: inline-block; }
/* visible by default: no delay and no fill, so a paused or skipped animation still shows the figure */
.flap.roll > span { animation: flap var(--d, 480ms) cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes flap { from { transform: translateY(-0.85em); opacity: 0.15; filter: blur(2px); } to { transform: none; opacity: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) { .flap.roll > span { animation: none; } html { scroll-behavior: auto; } }

.summary { margin: 14px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--gutter); }
.summary li { border-top: 1px solid var(--rule); padding-top: 12px; font-size: 17px; line-height: 1.45; letter-spacing: -0.005em; max-width: 46ch; }
.summary li b { font-weight: 700; }
.auto-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- data column beside charts */
.datacol { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; background: var(--tint); }
.datacol th, .datacol td { padding: 5px 10px; text-align: right; white-space: nowrap; }
.datacol th { font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--rule); padding-top: 9px; }
.datacol th:first-child, .datacol td:first-child { text-align: left; }
.datacol tr.cur td { background: var(--client-band); color: var(--client-ink); font-weight: 600; }
.datacol tr.hot td { background: var(--ink); color: var(--paper); }
.datacol tr.cur.hot td { background: var(--ink); }
.datacol td.mark { color: var(--muted); }

/* ---------------------------------------------------------------- tables */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.tbl th { text-align: right; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 10px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl .l { text-align: left; }
.tbl td.text { text-align: left; white-space: normal; max-width: 520px; overflow-wrap: normal; word-break: normal; }
.tbl td.muted { color: var(--muted); }
.summary.single { grid-template-columns: 1fr; margin-top: 0; row-gap: 14px; }
.summary.single li { max-width: 52ch; }
.tbl tr.own td { background: var(--client-band); color: var(--client-ink); font-weight: 600; }
.tbl tr.own td .delta { color: var(--client-ink); }
.tbl tr.own td .bar i { background: var(--client-ink); }
.tbl tr.own td .bar { background: color-mix(in srgb, var(--client-ink) 25%, transparent); }
.tbl tbody tr:hover:not(.own) td { background: var(--tint); }
.rank { font-weight: 700; width: 2.4em; }
.move { display: inline-flex; gap: 3px; align-items: center; font-size: 12px; color: var(--muted); min-width: 2.6em; margin-left: 4px; }
.move svg { width: 8px; height: 8px; flex: none; }
.tbl tr.own .move { color: var(--client-ink) !important; }
.bar { display: inline-block; width: 120px; height: 8px; background: var(--tint); vertical-align: middle; margin-right: 10px; position: relative; border-radius: 4px; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.divbar { display: inline-block; width: 180px; height: 10px; position: relative; vertical-align: middle; margin-right: 8px; }   /* a full bar never touches its figure */
.divbar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--rule); }
.divbar i { position: absolute; top: 0; bottom: 0; }
.divbar i.up { left: 50%; background: var(--good); }
.divbar i.dn { right: 50%; background: var(--loss); }

/* waterfall bridge as rows: start, steps, end */
.bridge { display: grid; gap: 0; }
.bridge-row { display: grid; grid-template-columns: 170px 1fr 120px; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }
.bridge-row:first-child { border-top: 1px solid var(--rule); }
.bridge-row .lbl { font-weight: 600; }
.bridge-row .lbl small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.bridge-row .track { position: relative; height: 22px; }
.bridge-row .track i { position: absolute; top: 0; bottom: 0; }
.bridge-row .amt { text-align: right; font-weight: 600; }
.bridge-row.total .track i { background: var(--ink); }
.bridge-row.total.now .track i { background: var(--client-band); }
.bridge-row.step .track i.up { background: var(--good); }
.bridge-row.step .track i.dn { background: var(--loss); }

.lists { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap, var(--gutter)); }
.lists.stack { grid-template-columns: 1fr; row-gap: 28px; }
/* two lists side by side: the page path keeps room, the bar gives way */
.lists td.text { min-width: 200px; }
.span-7 .lists, .span-6 .lists, .span-5 .lists { grid-template-columns: 1fr; row-gap: 24px; }
.lists .divbar { width: 96px; }
.empty { color: var(--muted); padding: 24px 0; border-top: 1px solid var(--hair); }
.loading { color: var(--muted); padding: 24px 0; }
.loading::after { content: ""; display: block; height: 2px; margin-top: 10px; background: linear-gradient(90deg, var(--hair), var(--ink-2), var(--hair)); background-size: 200% 100%; animation: load 1.2s linear infinite; }
@keyframes load { to { background-position: -200% 0; } }

.note { margin-top: 10px; font-size: 12px; color: var(--muted); max-width: 90ch; }
.note sup, .fn { color: var(--ink); font-weight: 700; }
.marks { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.marks span { display: inline-flex; gap: 8px; align-items: center; }
.swatch { width: 18px; height: 10px; display: inline-block; }
.swatch.hatch { color: var(--ink); background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 6px); }
.swatch.hollow { width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin: 0 0 10px; }
.legend span { display: inline-flex; gap: 7px; align-items: center; }
.legend i { width: 16px; height: 3px; display: inline-block; }
.legend i.box { height: 10px; }

/* conclusions: the agency's own words */
.words { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: var(--gutter); }
.words section { border-top: 1px solid var(--rule); padding-top: 12px; }
.words h3 { margin: 0 0 8px; font-size: 16px; }
.words p { margin: 0; color: var(--muted); max-width: 60ch; }

/* method & sources */
.method { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--gutter); row-gap: 20px; font-size: 14px; }
.method section, .method details { border-top: 1px solid var(--hair); padding-top: 10px; }
.method details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding-bottom: 6px; }
.method details[open] summary { margin-bottom: 4px; }
.method details > p, .method details > ul, .method details > div { margin-bottom: 10px; }
.method details.fold { margin-top: 8px; padding-top: 6px; }
.method details.fold summary { font-weight: 500; color: var(--ink-2); }
.method h3 { margin: 0 0 6px; font-size: 14px; }
.method p, .method li { color: var(--ink-2); margin: 0; }
.method ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 3px; }
.method li b { color: var(--ink); font-weight: 600; }

.colophon { max-width: var(--page); margin: 0 auto; padding: 8px var(--gutter) 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.colophon b { color: var(--ink); }

/* tooltip */
.tt { font-size: 12px; min-width: 170px; font-family: "Golos Text", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.tt-h { color: var(--muted); margin-bottom: 4px; }
.tt-r { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.tt-r span { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.tt-r i { width: 12px; height: 3px; display: inline-block; }
.tt-r b { font-weight: 650; color: var(--ink); }

/* ---------------------------------------------------------------- responsive */
/* the report's widths are its own, not the window's: the settings panel takes 380px beside it (.page is the container) */
.page { container-type: inline-size; }
/* a laptop: the board keeps to its panel — tighter cells, «было» under the change, a shorter plan bar */
@container (max-width: 1280px) {
  .chapter { padding: 24px 24px 30px; }
  .board th { padding: 0 10px 6px; }
  .board td { padding: 5px 10px 4px; }
  .board small.was { display: block; margin-left: 0; margin-top: 2px; }
  .planbar { grid-template-columns: minmax(72px, 1fr) auto; }
  .planbar small.was { grid-column: 1 / -1; text-align: right; }
  .strip button .sv { font-size: 11px; }
  .plantrack th, .plantrack td { padding: 8px 6px; }
}
@container (max-width: 1180px) {
  .lists { grid-template-columns: 1fr; row-gap: 24px; }
}
@container (max-width: 1080px) {
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .summary { grid-template-columns: 1fr; row-gap: 16px; }
  .method { grid-template-columns: 1fr 1fr; }
  .chapter-tools { grid-column: 1 / -1; grid-row: auto; justify-self: start; justify-content: flex-start; }
  .chapter-head h2, .chapter-head .lede { grid-column: 1 / -1; }
  .keys ul, .facts.row { grid-template-columns: 1fr; }
}
/* a tablet and a phone: the board becomes rows of label and figures, it no longer fits as five columns */
@container (max-width: 900px) {
  .board thead { display: none; }
  .board, .board tbody, .board tr, .board td { display: block; width: 100%; }
  .board tr { border-bottom: 1px solid var(--hair); padding: 10px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .board tr.lead { padding: 12px 14px; background: var(--client-band); border-radius: var(--radius-s); }
  .board tr.lead td { border-radius: 0 !important; }
  .board td { border: 0; padding: 0; text-align: left; }
  .board td:first-child { grid-column: 1 / -1; width: auto; }
  .board td[data-k]::before { content: attr(data-k); display: block; font-size: 11px; color: var(--muted); }
  .board td.noplan { display: none; }
  .board small.was { display: block; margin-left: 0; }
  .planbar { grid-template-columns: minmax(84px, 1fr) auto; width: 100%; }
  .planbar small.was { grid-column: 1 / -1; }
  .board tr:not(.lead) { grid-template-columns: 1.4fr 1fr 1fr; }
  .board tr.lead td:first-child { padding-left: 0; }
  .board tr.lead td[data-k]::before { color: var(--client-ink); }
  /* a row with a plan has four figures: one line of four on a tablet, two by two on a phone (as the lead row) */
  .board tr:not(.lead):not(:has(> td.noplan)) { grid-template-columns: 1.2fr 1.5fr 1fr 1fr; }
  /* the figures keep the timetable scale of the page's width, not the window's */
  .board tr.lead .fig { font-size: clamp(1.6rem, 6.5cqi, 2.25rem); }
  .board tr:not(.lead) .fig { font-size: clamp(1.35rem, 4.2cqi, 1.75rem); }
  .planbar small.was { text-align: left; }
  .planbar small.was, .planbar small.lfl { white-space: normal; text-align: left; }   /* «план 158 167 · −27,9 % к августу» wraps in a phone's half */
  .mast-tools { flex-wrap: wrap; justify-content: flex-end; }
  .bar { width: 72px; }
  .strip { grid-template-columns: repeat(var(--cells, 13), minmax(88px, 1fr)); overflow-x: auto; }   /* «169,8 тыс.» and the plan mark fit */
}
@container (max-width: 560px) {
  .board tr:not(.lead):not(:has(> td.noplan)) { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .issue { padding-left: 10px; padding-right: 10px; gap: 14px; }
  .chapter { padding: 20px 16px 28px; border-radius: 10px; }
  body { font-size: 14px; }
  .mast-title { grid-template-columns: 1fr; }
  .mast-title h1, .mast-issue { grid-column: 1; text-align: left; }
  .strip button .sv { white-space: nowrap; font-size: 11px; }
  .lists, .words, .method { grid-template-columns: 1fr; row-gap: 20px; }
  .bridge-row { grid-template-columns: 110px 1fr 84px; }
  .tbl td.text { min-width: 168px; }
  .board .metric small { white-space: normal; }
  .bar { width: 64px; }
  .mast-tools { width: 100%; }
  /* phone: the direction takes its own row, the buttons share the next */
  .mast-tools { flex-wrap: wrap; }
  .dir-pick { flex: 1 1 100%; }
  .dir-pick select { width: 100%; }
  .mast-tools .btn { flex: 1 1 0; text-align: center; white-space: nowrap; padding-left: 8px; padding-right: 8px; font-size: 13px; }
  .toggle button { min-height: 44px; }
  .gp-head .toggle { flex-direction: column; width: 100%; }
  .gp-head .toggle button { text-align: left; }
  .gp-head .toggle button + button { border-left: 0; border-top: 1px solid var(--rule); }
  .pick select { height: 44px; }
  /* touch: every control and fold is at least 44px tall on a phone */
  .btn, .dir-pick select { height: 44px; }
  .setup-close { width: 44px; height: 44px; }
  .blocks-list .mv { width: 44px; height: 44px; }
  .blocks-list .unfold { display: inline-flex; align-items: center; min-height: 44px; }
  .method details summary { padding: 11px 0; }
  .tbl td button.link { padding: 11px 0; margin: -11px 0; }
  .keys details summary, .keys .line { padding-top: 10px; padding-bottom: 10px; }
  .keys details summary { padding-right: 26px; }
  .keys details summary::after { top: calc(8px + 0.55em); }
  .summary.single.cols { grid-template-columns: 1fr; }
  .events li { grid-template-columns: 22px 48px 1fr; font-size: 13px; }
  .datacol th, .datacol td { padding-left: 6px; padding-right: 6px; }   /* six-digit node sums fit at 375 */
  .datacol th { white-space: normal; }
}

/* ---------------------------------------------------------------- print: A4 landscape, a cover and one chapter per page
   What a client gets by mail as a PDF. The page is 273mm of paper (about 1030px) wide: the report's container queries are off,
   so the 12-column grid keeps its 8 + 4 blocks, and the few rules the laptop width needs are repeated here. Charts are re-fitted
   to this width in JS (issue.js, wirePrint) — they are drawn at the screen's width otherwise. */
@page {
  size: A4 landscape; margin: 12mm 12mm 16mm;
  @bottom-left { content: "iSEO · отчёт по органическому поиску"; font: 400 9px/1 "Golos Text", sans-serif; color: #646d7d; vertical-align: top; padding-top: 3mm; }
  @bottom-right { content: counter(page); font: 500 9px/1 "Golos Text", sans-serif; color: #646d7d; vertical-align: top; padding-top: 3mm; }
}
@page :first { @bottom-left { content: none; } @bottom-right { content: none; } }
@media print {
  :root { --gutter: 16px; background: #fff; }
  html { scroll-behavior: auto; }
  body { font-size: 11pt; background: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page { container-type: normal; }
  /* not for paper: the rail, the controls, the settings panel, the month strip */
  .chapters, .mast-tools, .chapter-tools, .strip, .strip-head, .setup, .dir-pick, .chapter-head .lede[hidden], button.link.reset, .empty button.link { display: none !important; }
  button.link { text-decoration: none; }   /* a direction's name is a link on screen, plain text on paper */
  .flap > span { animation: none !important; }
  .mast, .issue, .colophon { max-width: none; padding-left: 0; padding-right: 0; }
  .issue { display: block; padding-top: 0; padding-bottom: 0; }
  body.setup-open .page { margin-right: 0; }

  /* the cover: the page that opens the letter — agency, report, client, period, site */
  .mast { display: flex; flex-direction: column; height: 176mm; padding: 0; break-after: page; }
  .mast-row, .mast-brand { display: contents; }
  .wordmark { height: 40px; order: 0; align-self: flex-start; }
  .mast-kind { order: 1; margin-top: auto; font-size: 24px; font-weight: 600; color: var(--ink-2); letter-spacing: -0.015em; }
  .mast-title { order: 2; display: block; margin-top: 14px; }
  .mast-title h1 { font-size: 58px; line-height: 1.05; display: flex; align-items: center; gap: 0.3em; }
  .mast-project { font-size: 0.42em; margin-top: 10px; }
  .mast-issue { margin: 40px 0 0; text-align: left; font-size: 38px; }
  .mast-period { font-size: 14px; margin-bottom: 4px; }
  .mast-partial { font-size: 18px; margin-top: 6px; }
  .mast-site { font-size: 18px; margin-top: 10px; }
  .mast::after { content: ""; order: 3; display: block; height: 14px; margin-top: 44px; background: var(--client-band); }

  /* chapters: each opens a page; a long one breaks between blocks and rows, never through a chart or a line */
  .chapter { border: 0; border-radius: 0; box-shadow: none; background: none; padding: 0; break-before: page; }
  .chapter:first-child, .chapter.first { break-before: auto; }
  .chapter-head { margin-bottom: 14px; break-after: avoid; }
  .chapter-head h2 { grid-column: 1 / span 9; font-size: 26px; }
  /* sizes in the window's units would follow the screen the page was open on, and a wide board would stretch the print layout */
  .board .fig { font-size: 34px; }
  .board tr.lead td { padding-top: 8px; padding-bottom: 7px; }
  .board .metric small { line-height: 1.35; }
  .board tr:not(.lead) .fig { font-size: 28px; }
  .board .val { font-size: 20px; }
  .chapter-head .lede { grid-column: 1 / span 9; max-width: 80ch; }
  .grid { row-gap: 20px; }
  .dirs { margin-top: 28px; }
  /* a block stays whole; one that holds a long table may break between its rows, its heading and first rows stay together */
  .block:not(:has(.tbl)) { break-inside: avoid; }
  .dirs { break-inside: avoid; }   /* a node's directions and their plan are read whole: a few rows, never split */
  .tbl tbody tr:nth-child(-n+2) { break-after: avoid; }
  .block h3, .block .sub, .legend, .gp-head { break-after: avoid; }
  .bridge-row, .tbl tr, .plantrack tr, .datacol tr, .board tr, .facts > div, .events li, .keys li, .summary li, .method > * { break-inside: avoid; }
  .tbl thead, .datacol thead, .board thead { display: table-header-group; }
  /* a table does not leave one or two rows alone on the next page */
  .tbl tbody tr:nth-last-child(2), .tbl tbody tr:last-child { break-before: avoid; }
  .keys { margin-top: 10px; padding-top: 10px; }
  .keys li, .keys li p { font-size: 14px; }
  .keys details p { font-size: 12.5px; }
  .keys h3 { break-after: avoid; }
  .keys details summary::after { display: none; }
  .keys details p { padding-bottom: 4px; }
  .method details summary { cursor: default; list-style: none; }
  .method details summary::-webkit-details-marker { display: none; }
  .tbl-wrap { overflow: visible; background: none; }
  /* a table keeps to its column: long cells wrap, cells sit closer */
  .tbl th, .tbl td { padding-left: 6px; padding-right: 6px; }
  /* tables sit closer on paper (13px, 1.4) so a list of 15 fits a page and does not leave three rows alone on the next one */
  .tbl { font-size: 13px; line-height: 1.4; }
  .tbl td { padding-top: 3px; padding-bottom: 2px; }
  .tbl th { padding-bottom: 5px; }
  .datacol th, .datacol td { padding-top: 4px; padding-bottom: 4px; }
  .tbl td.text { white-space: normal; min-width: 0; max-width: 380px; }
  .span-7 .tbl th, .span-7 .tbl td, .span-5 .tbl th, .span-5 .tbl td { padding-left: 4px; padding-right: 4px; }
  .delta { gap: 4px; }
  .span-7 .bar { width: 36px; margin-right: 4px; }
  .bar { width: 48px; margin-right: 6px; }
  .divbar { width: 96px; }
  .lists .divbar { width: 72px; }
  /* a chart is drawn at the screen's width until JS fits it to the paper: its box clips it meanwhile, so the print layout is not
     stretched by it (Chrome would lay the whole page out wider and shrink it) */
  .chart { height: 240px; width: 100%; overflow: hidden; }
  .chart.short { height: 180px; }
  .chart > div { width: 100% !important; height: 100% !important; }
  /* the width of the laptop layout */
  .board th { padding: 0 10px 6px; }
  .board td { padding: 3px 10px 3px; }
  .board small.was { display: block; margin-left: 0; margin-top: 2px; }
  .planbar { grid-template-columns: minmax(72px, 1fr) auto; }
  .planbar small.was { grid-column: 1 / -1; text-align: right; }
  .plantrack th, .plantrack td { padding: 8px 6px; }
  .lists { grid-template-columns: 1fr; row-gap: 24px; }
  .colophon { break-before: avoid; margin-top: 24px; padding: 12px 0 0; border-top: 1px solid var(--rule); }
}

/* ---------------------------------------------------------------- the issue's settings (agency view)
   Beside the issue from 1360px (the page gives it its width), over the issue below that. Never in a client link. */
.setup { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: 380px; display: flex; flex-direction: column;
  background: var(--paper); border-left: 1px solid var(--hair); }
.setup[hidden] { display: none; }
@media (min-width: 1360px) { body.setup-open .page { margin-right: 380px; } }
@media (max-width: 1359px) { .setup { width: min(400px, 100vw); box-shadow: -12px 0 32px rgba(22, 27, 38, 0.14); } }
.setup-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--hair); }
.setup-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.setup-close { width: 36px; height: 36px; flex: none; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--paper); cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--ink); }
.setup-close:hover { background: var(--tint); border-color: var(--ink-2); }
.setup-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 32px; }
.setup-sec { padding: 18px 0; border-bottom: 1px solid var(--hair); }
.setup-sec:last-child { border-bottom: 0; }
.setup-sec h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.setup .sub { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.setup .sub.first, .setup .srcs.first { margin-top: 0; }
.setup .sub:empty { display: none; }
.setup .scen { margin: 0; font-size: 14px; }
.setup .scen b { font-weight: 600; }
.setup .gaps { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.setup .gaps li + li { margin-top: 2px; }
.setup .srcs { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 14px 0 0; font-size: 13px; }
.setup .srcs dt { color: var(--ink-2); }
.setup .srcs dd { margin: 0; font-variant-numeric: tabular-nums; }
.setup .srcs .off { color: var(--muted); }
.setup .srcs small, .brand-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.brand-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.brand-logo { height: 32px; width: auto; max-width: 96px; object-fit: contain; flex: none; }
.brand-logo.none { height: auto; padding: 6px 8px; font-size: 12px; color: var(--muted); border: 1px dashed var(--rule); border-radius: 6px; }
.swatch-lg { width: 28px; height: 28px; flex: none; border-radius: 6px; }
.setup textarea { display: block; width: 100%; min-height: 150px; margin-top: 10px; padding: 10px 12px; resize: vertical;
  font: inherit; font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-s); }
.setup textarea:hover { border-color: var(--ink-2); }
.setup textarea::placeholder { color: var(--muted); }
.setup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.notes-draft p { margin: 0 0 6px; }
/* the conclusions draft: one bordered item per point, its kind as the key-findings mark, the numbers' sources folded */
.draft-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.draft-list > li { border: 1px solid var(--hair); border-radius: var(--radius-s); padding: 8px 10px 10px; }
.draft-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.draft-list .kind { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.draft-list .kind::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }
.draft-list li.gain .kind::before { background: var(--good); }
.draft-list li.problem .kind::before { background: var(--client-band); }
.draft-list li.work .kind::before { background: var(--peer); }
.draft-list li.next .kind::before { background: transparent; border: 1.5px solid var(--ink-2); }
.draft-list > li > p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; }
.setup .draft-list textarea { min-height: 0; margin-top: 0; font-size: 13px; padding: 8px 10px; resize: none; overflow: hidden; }
.setup-close.small { width: 28px; height: 28px; font-size: 16px; border-color: var(--hair); }
.draft-list .flag { margin: 6px 0 0; padding-left: 14px; position: relative; font-size: 12px; font-weight: 600; color: var(--ink); }
.draft-list .flag::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 7px; height: 7px; background: var(--client-band); }
.draft-list .src summary { margin-top: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.draft-list .src ul { margin: 4px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.draft-list .src li + li { margin-top: 3px; }
.keys-note { margin: -4px 0 10px; font-size: 12px; color: var(--muted); }
.worklist { margin: 0; padding-left: 18px; max-width: 64ch; }
.worklist li + li { margin-top: 6px; }
@media print { .setup { display: none !important; } body.setup-open .page { margin-right: 0; } }

/* a node: its directions under «Главное»; a child direction is inside its parent */
.dirs { margin-top: 56px; }
.tbl tr.child td { color: var(--muted); }
.tbl tr.child td:first-child { padding-left: 18px; }
.dirs .tbl td.text { white-space: nowrap; }   /* «в т. ч. Интернет-эквайринг» on one line; the table scrolls on a phone */
/* plan and fact by direction: the month, then the year so far; the total is the board's figure */
.dirs + .plan-dirs { margin-top: 40px; }
.plan-dirs .planbar { grid-template-columns: 72px auto; }
.plan-dirs .tbl .sep { border-left: 1px solid var(--hair); }
.plan-dirs .tbl tr.group th { padding-bottom: 4px; border-bottom: 0; color: var(--ink-2); font-weight: 600; }
.plan-dirs .tbl tr.total td { font-weight: 700; border-top: 1px solid var(--rule); }
.plan-dirs .tbl tr.noplan td { color: var(--muted); }

/* ---------------------------------------------------------------- the filters of the current chapter under the rail
   The rail and the bar share one sticky wrapper; the bar hangs under the rail over the content, so docking the tools
   (issue.js, dockTools) never moves the page. On a phone the bar is one «Фильтры» button that opens the tools. */
.rail { position: sticky; top: 0; z-index: 20; }
.rail > .chapters { position: relative; }
.chapter-bar { position: absolute; left: 0; right: 0; top: 100%; border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--page-bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); }
.chapter-bar[hidden] { display: none; }
.bar-in { max-width: var(--page); margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 8px 16px; }
.bar-name { flex: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chapter-bar .chapter-tools { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: flex-end; align-items: center; }
.chapter-bar .pick { flex-direction: row; align-items: center; gap: 8px; }
.bar-toggle { display: none; }
/* the place the tools leave in the head while they are docked */
.chapter-tools-slot { grid-column: 8 / span 5; grid-row: 1 / span 2; }
@container (max-width: 1080px) { .chapter-tools-slot { grid-column: 1 / -1; grid-row: auto; } }

/* a long list (more than 30 values) as a field with a search and a list under it; the select's frame and size */
.combo { position: relative; width: 280px; max-width: 100%; }
.combo-input { display: block; width: 100%; height: 32px; padding: 0 28px 0 8px; border: 1px solid var(--hair); border-radius: var(--radius-s);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23646d7d' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink); text-overflow: ellipsis; caret-color: var(--client); }
.combo-input:hover { border-color: var(--ink-2); }
.combo-input::placeholder { color: var(--muted); }
.combo-list { position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px 0; list-style: none;
  max-height: min(340px, 55vh); overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius-s); box-shadow: 0 8px 24px rgba(22, 27, 38, 0.12); font-size: 13px; line-height: 1.35; color: var(--ink); }
.combo-list[hidden] { display: none; }
.combo-list [role="option"] { padding: 6px 12px; cursor: pointer; overflow-wrap: anywhere; }
.combo-list [role="option"][data-active] { background: var(--tint); }
.combo-list [role="option"][aria-selected="true"] { font-weight: 600; box-shadow: inset 3px 0 var(--ink); }
.combo-list [role="option"] b { font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.combo-sep { padding: 10px 12px 4px; font-size: 11px; color: var(--muted); }
.combo-sep + .combo-sep, [role="option"] + .combo-sep { margin-top: 4px; border-top: 1px solid var(--hair); }
.combo-none { padding: 8px 12px; color: var(--muted); }

@media (max-width: 720px) {
  .pick:has(> .combo) { flex: 1 1 100%; }   /* a group's name runs long: the field takes the phone's width */
  .combo { width: 100%; }
  .combo-input { height: 44px; }
  .combo-list [role="option"] { padding: 12px; }
  .bar-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 var(--gutter); border: 0; background: none;
    font-size: 14px; text-align: left; cursor: pointer; }
  .bar-toggle .bar-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
  .bar-toggle::after { content: ""; flex: none; width: 7px; height: 7px; margin: -4px 2px 0 4px; border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
  .chapter-bar.open .bar-toggle::after { margin-top: 4px; transform: rotate(-135deg); }
  .bar-toggle:focus-visible { outline-offset: -3px; }
  .chapter-bar:not(.open) .bar-in { display: none; }
  .bar-in { flex-direction: column; align-items: stretch; padding-top: 10px; padding-bottom: 14px; border-top: 1px solid var(--hair); }
  .bar-name { display: none; }
  .chapter-bar .chapter-tools { justify-content: flex-start; align-items: flex-end; }
  .chapter-bar .pick { flex-direction: column; align-items: stretch; gap: 3px; }
}
@media print { .chapter-bar, .chapter-tools-slot { display: none !important; } }

/* the logo in the settings: the picture as the masthead draws it, then its actions */
.setup .logo-acts { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* «Замечание»: the testers' button, out of the way in the corner of every agency screen; never on paper */
.fb-open { position: fixed; right: 16px; bottom: 16px; z-index: 30; height: 36px; padding: 0 14px; border: 1px solid var(--rule);
  border-radius: var(--radius-s); background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 24px rgba(22, 27, 38, 0.12); }
.fb-open:hover { color: var(--ink); border-color: var(--ink-2); }
.fb-open[hidden] { display: none; }
body.setup-open .fb-open { right: 396px; }
.fb { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper);
  color: var(--ink); box-shadow: 0 24px 64px rgba(22, 27, 38, 0.22); }
.fb::backdrop { background: rgba(22, 27, 38, 0.32); }
.fb-in { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; }
.fb h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.fb-sub { margin: 0; font-size: 13px; color: var(--muted); }
.fb textarea, .fb input { width: 100%; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--radius-s); font: inherit; font-size: 14px;
  color: var(--ink); background: var(--paper); caret-color: var(--client); resize: vertical; }
.fb input { height: 36px; }
.fb-say { margin: 0; font-size: 13px; color: var(--ink-2); min-height: 1em; }
.fb-foot { display: flex; justify-content: flex-end; gap: 10px; }
@media print { .fb-open, .fb { display: none !important; } }
@media (max-width: 720px) { .fb-open { height: 44px; } body.setup-open .fb-open { display: none; } }
