/* ===== Дизайн-система парсера Beoma ===== */
:root {
  --ground: #FFF6FA; --ground-2: #F7E6EF; --surface: #FFFFFF; --surface-2: #F9EEF4; --surface-3: #F3E3EA;
  --ink: #241A21; --ink-soft: #6B5A64; --ink-faint: #75616D; --line: #EDDAE4; --line-strong: #DDC3D0;
  --accent: #C92D63; --accent-hover: #B02454; --accent-soft: #FFE4EC; --accent-ink: #8D1A44; --grad-a: #F9A8C9; --grad-b: #FDE2EC; --on-accent: #FFFFFF;
  --good: #1B6B45; --good-soft: #DEF0E6; --warn: #8A5300; --warn-soft: #F7EEDE; --bad: #9A2432; --bad-soft: #F6E2E5;
  --info: #2A4E9C; --info-soft: #E3EAF8;
  --shadow: 0 1px 2px rgba(36,26,33,.06), 0 6px 20px rgba(36,26,33,.08);
  --shadow-lg: 0 10px 40px rgba(36,26,33,.18);
  --sans: "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px; --radius-sm: 6px;
  --row-h: 40px; --cell-py: 8px;
  --sidebar-w: 232px; --panel-w: 560px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ground: #1B1219; --ground-2: #241424; --surface: #241722; --surface-2: #2D1D2A; 
  --surface-3: #362433; --ink: #F3E8EE; --ink-soft: #C4ABB8; --ink-faint: #B69EAB; --line: #3C2938; --line-strong: #4E3648;
  --accent: #FF84A5; --accent-hover: #FF9AB6; --accent-soft: #452132; --accent-ink: #FFB3C8; --grad-a: #7A2E4E; --grad-b: #3A1B2B; --on-accent: #1B1219;
  --good: #6FCB98; --good-soft: #16301F; --warn: #E9A94A; --warn-soft: #2C2418; --bad: #F08A96; --bad-soft: #3A1C21;
  --info: #8FB0F5; --info-soft: #1E2A44;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --ground: #1B1219; --ground-2: #241424; --surface: #241722; --surface-2: #2D1D2A; --surface-3: #362433;
  --ink: #F3E8EE; --ink-soft: #C4ABB8; --ink-faint: #B69EAB; --line: #3C2938; --line-strong: #4E3648;
  --accent: #FF84A5; --accent-hover: #FF9AB6; --accent-soft: #452132; --accent-ink: #FFB3C8; --grad-a: #7A2E4E; --grad-b: #3A1B2B; --on-accent: #1B1219;
  --good: #6FCB98; --good-soft: #16301F; --warn: #E9A94A; --warn-soft: #2C2418; --bad: #F08A96; --bad-soft: #3A1C21;
  --info: #8FB0F5; --info-soft: #1E2A44;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-density="compact"] { --row-h: 34px; --cell-py: 4px; }
:root { --row-h: 44px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--ink-soft); } .faint { color: var(--ink-faint); }
.small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Каркас ===== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.15; }
.brand-sub { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-faint); }
.brand .sidebar-close { display: none; margin-left: auto; }
.nav { padding: 4px 10px 10px; overflow-y: auto; flex: 1; }
.nav-group { margin: 10px 6px 3px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; line-height: 1.3; border-radius: 8px; color: var(--ink-soft); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a .ico { width: 22px; font-size: 17px; text-align: center; opacity: .85; }
.nav a .badge { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; }
.user-chip:hover { background: var(--surface-2); }
.avatar { position: relative; overflow: hidden; width: 30px; height: 30px; border-radius: 50%; background: var(--ground-2); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px 0; }
.page-title { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar .menu-btn { display: none; }
.content { padding: 14px 24px 40px; min-width: 0; }
.scrim, .panel-scrim { position: fixed; inset: 0; background: rgba(20,10,16,.35); z-index: 30; }

/* ===== Кнопки и поля ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 34px; min-width: 34px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; }
.btn.sm.ghost { font-size: 20px; padding: 0 10px; min-width: 40px; height: 40px; }
:is(.actions, .modal-f, .pop-f) > .btn { max-width: 100%; min-height: 34px; height: auto; padding-top: 6px; padding-bottom: 6px; white-space: normal; text-align: center; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.icon-btn { width: 42px; height: 42px; font-size: 20px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-soft); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.input, .select, textarea.input { height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); min-width: 0; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--ink-faint); }
.input.sm { height: 34px; font-size: 13.5px; }
.search { position: relative; }
.search .input { padding-left: 30px; width: 260px; }
.search::before { content: "⌕"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%) scaleX(-1); color: var(--ink-faint); font-size: 16px; pointer-events: none; }
/* Переносится сам, когда не влезает: медиазапрос смотрит на ширину экрана, а узким бывает
   контейнер — окно карточки исполнителя около 340 пикселей даже на широком телефоне.
   Раньше ряд просто обрезался, и до последней кнопки было не добраться: overflow: hidden
   запрещает ещё и прокрутку пальцем.

   Разделители — не границы кнопок, а щели в один пиксель, сквозь которые виден фон самой
   группы. На границах при переносе получалось неопрятно: последняя кнопка верхнего ряда оставалась
   с чертой справа в пустоту, а между рядами черты не было вовсе. Щели рисуются в обе стороны сами.
   Кнопки тянутся (flex: 1 0 auto) — иначе недобранный хвост нижнего ряда был бы серой полосой фона. */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 1px; border: 1px solid var(--line-strong);
  border-radius: 8px; overflow: hidden; background: var(--line); }
.seg button { flex: 1 0 auto; height: 32px; padding: 0 11px; border: 0; background: var(--surface); cursor: pointer;
  color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.seg button.active { background: var(--accent-soft); color: var(--accent-ink); }
.seg button:hover:not(.active) { background: var(--surface-2); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--ink-faint); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 40px; height: 24px; appearance: none; background: var(--line-strong); border-radius: 10px; position: relative; transition: background .15s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); } .switch input:checked::after { left: 18px; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 0; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* ===== Тулбар и чипы ===== */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; min-height: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 500; }
.chip b { font-weight: 600; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 24px; height: 24px; font-size: 14px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; line-height: 1; }
.chip button:hover { background: rgba(0,0,0,.08); }
.chip.neutral { background: var(--surface-2); color: var(--ink-soft); }
.creator-sku-chip { max-width: 100%; height: auto; min-height: 30px; padding-top: 3px; padding-bottom: 3px; flex-wrap: wrap; }
.creator-sku-chip .mono { flex: 0 0 auto; }
.creator-sku-product { min-width: 0; flex: 1 1 140px; overflow-wrap: anywhere; }
.creator-sku-chip button { flex: 0 0 auto; }
.chip button.chip-action { width: auto; min-width: 24px; padding: 0 7px; border-radius: 6px; white-space: nowrap; }

/* ===== Карточки, плашки ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.card-b { padding: 16px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; border: 1px solid transparent; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.info { background: var(--info-soft); color: var(--info); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.info { background: var(--info-soft); color: var(--info); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.stat .k { font-size: 11.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .v { font-size: 20px; font-weight: 600; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.empty .actions { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ===== Таблица ===== */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow: auto; max-height: calc(100vh - 230px); position: relative; }
table.tbl { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.tbl th, .tbl td { padding: var(--cell-py) 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; height: var(--row-h); vertical-align: middle; }
.tbl th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); color: var(--ink-soft); font-weight: 600; font-size: 12px; user-select: none; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--ink); }
.tbl th .th-in { display: inline-flex; align-items: center; gap: 4px; }
.tbl th .arrow { font-size: 12px; opacity: .55; } .tbl th[aria-sort] .arrow { opacity: 1; color: var(--accent); }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.grp-start, .tbl td.grp-start { border-left: 1px solid var(--line); }
.tbl th.sticky-col, .tbl td.sticky-col { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.tbl th.sticky-col { z-index: 4; background: var(--surface-2); }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr.selected td { background: var(--accent-soft); }
.tbl tbody tr.selected td.sticky-col { background: var(--accent-soft); }
.tbl tbody tr:hover td.sticky-col { background: var(--surface-2); }
.tbl tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.tbl tfoot td.sticky-col { z-index: 4; background: var(--surface-2); }
.tbl td .sub { display: block; font-size: 11.5px; color: var(--ink-faint); line-height: 1.2; font-weight: 400; }
.tbl td.dim { color: var(--ink-faint); }
.tbl .neg { color: var(--bad); }
.tbl td.est { color: var(--ink-soft); font-style: italic; }
.tbl th.est { color: var(--warn); }
.tbl.static tbody tr { cursor: default; }
.tbl.static tbody tr:hover td { background: transparent; }
.cell-acc { display: flex; align-items: center; gap: 8px; max-width: 260px; }
.cell-acc .avatar { width: 32px; height: 32px; font-size: 12px; }
.cell-acc .txt { min-width: 0; } .cell-acc .h { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; font-weight: 500; }
.plat { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; vertical-align: -5px; font-size: 11px; font-weight: 700; flex: none; }
.plat svg { width: 14px; height: 14px; display: block; }
.plat.youtube { background: #FF0000; }
.plat.tiktok { background: #00A9B5; }
.plat.vk { background: #0077FF; }
.plat.instagram { background: radial-gradient(circle at 30% 107%, #FDF497 0%, #FDF497 5%, #FD5949 45%, #D6249F 60%, #285AEB 90%); }
.plat-lbl { display: inline-flex; align-items: center; gap: 6px; }
.theme-btn svg { width: 22px; height: 22px; display: block; }
.theme-btn { flex: none; }
.card { min-width: 0; }
.card-b:has(> table), .card:has(> table) { overflow-x: auto; }
.stack { min-width: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.gray { background: var(--ink-faint); }
.spark { vertical-align: middle; margin-left: 8px; }
.spark .bar { fill: var(--accent); opacity: .75; } .spark .bar.miss { fill: var(--line-strong); opacity: 1; } .spark .bar.neg { fill: var(--bad); }
.tbl-foot { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); flex-wrap: wrap; }
.pager { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.pager .btn { min-width: 36px; padding: 0 8px; justify-content: center; font-variant-numeric: tabular-nums; line-height: 1; }
.pager .btn[aria-label] { font-size: 16px; padding-bottom: 2px; }
.skeleton td > span { display: inline-block; height: 12px; width: 70%; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.rowcards { display: none; }

/* ===== Выпадающие панели ===== */
.pop { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 240px; max-width: min(92vw, 720px); }
.pop-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.pop-b { padding: 12px 14px; max-height: 60vh; overflow: auto; }
.pop-b.pop-b-open { overflow: visible; max-height: none; }
.pop-b-open .combo-list { max-height: 220px; }
.pop-f { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); justify-content: flex-end; }
.col-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 20px; }
.col-group h4 { margin: 0 0 4px; font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.col-group h4.est { color: var(--warn); }
.menu { padding: 6px; min-width: 200px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu .k { margin-left: auto; color: var(--ink-faint); font-size: 12px; }

/* комбобокс с поиском */
.hit-drop-active { outline: 2px dashed var(--accent); outline-offset: 3px; }
tr[data-hit-video] { cursor: grab; }
tr.hit-row-dragging { opacity: .5; cursor: grabbing; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.combo-list .opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.combo-list .opt:hover, .combo-list .opt.focus { background: var(--surface-2); }
.combo-list .opt.sel { color: var(--accent-ink); font-weight: 500; }
.combo-list .opt .sub { margin-left: auto; color: var(--ink-faint); font-size: 12px; }
.combo-list-floating .opt { display: block; overflow-wrap: anywhere; }
.combo-list-floating .opt .sub { display: block; margin-left: 0; }
.combo-list .none { padding: 8px 10px; color: var(--ink-faint); }
.combo-sel { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* ===== Боковая панель ===== */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-w); max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 35; display: flex; flex-direction: column; transform: translateX(0); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .6 } to { transform: none; opacity: 1 } }
.panel-h { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-h h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.panel-b { padding: 14px 18px 28px; overflow: auto; flex: 1; }
.panel-sec { margin-bottom: 18px; }
.panel-sec h3 { margin: 0 0 8px; font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.kv > div { min-width: 0; overflow-wrap: anywhere; }
.kv .k { font-size: 11.5px; color: var(--ink-faint); } .kv .v { font-weight: 600; font-size: 15px; }
.chart-box { width: 100%; min-width: 0; }
.chart { width: 100%; height: 100%; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .area { fill: var(--accent); opacity: .12; }
.chart .bar { fill: var(--accent); opacity: .8; } .chart .bar.miss { fill: var(--line-strong); }
/* восстановленная часть прироста: дни между замерами, распределённые равномерно */
.chart .bar.est { fill: var(--surface); opacity: .55; stroke: var(--accent); stroke-width: .5; stroke-dasharray: 2 2; }
.chart .bar2 { fill: var(--info); opacity: .75; }
.chart text { font: 11.5px var(--mono); fill: var(--ink-faint); }
.chart .tick { stroke: var(--line-strong); }
.caption-box { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; }
.caption-box mark { background: var(--accent-soft); color: var(--accent-ink); padding: 0 3px; border-radius: 3px; font-weight: 600; }
.hist { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.hist th, .hist td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.hist th { color: var(--ink-faint); font-weight: 500; font-size: 11.5px; }
.hist td.num, .hist th.num { text-align: right; }

/* ===== Модальные окна ===== */
.modal-root:empty { display: none; }
/* Колонка сетки задана явно: при `auto` трек подстраивается под содержимое, и `width: 100%` у окна
   считался от ширины широкой таблицы внутри, а не от экрана. Окно выезжало за край телефона, и до
   правой части было не добраться — прокрутки у затемнения нет. */
.modal-scrim { position: fixed; inset: 0; background: rgba(20,10,16,.45); z-index: 60;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-width: 100%; justify-self: center; max-height: 90vh; display: flex; flex-direction: column; animation: pop .15s ease-out; }
.modal.wide { width: min(820px, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-h { display: flex; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 16px; }
.modal-b { padding: 16px 20px; overflow: auto; min-width: 0; }
/* Длинный идентификатор канала не должен распирать окно: пусть переносится. */
.modal-b .hist td { overflow-wrap: anywhere; }
.modal-f { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.modal-f .left { margin-right: auto; }
.code { font-family: var(--mono); background: var(--surface-2); padding: 8px 10px; border-radius: 6px; word-break: break-all; font-size: 12.5px; user-select: all; }

/* ===== Тосты ===== */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: center; animation: pop .15s ease-out; max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; } .toast.good { background: var(--good); color: #fff; }

/* ===== Вход ===== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr);
  place-items: center; padding: 20px; }   /* колонка явная: см. .modal-scrim */
.login { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login h1 { margin: 12px 0 4px; font-size: 22px; }
.login p { margin: 0 0 18px; color: var(--ink-soft); }
.login .field { margin-bottom: 12px; }
.login .btn { width: 100%; justify-content: center; height: 40px; margin-top: 6px; }
.login .err { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ===== Сетки страниц ===== */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.settings-group { margin-bottom: 18px; }
.settings-group h3 { margin: 0 0 8px; font-size: 14px; }
.setting { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting .name { font-weight: 500; } .setting .desc { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.setting .key { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.setting .ctl { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.setting .ctl .input { width: 100%; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); align-items: stretch; grid-auto-rows: 1fr; gap: 8px; }
.step { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); cursor: pointer; }
.step:hover { background: var(--surface-2); }
.step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.step-heading { display: flex; align-items: start; gap: 8px; }
.step .t { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.step-status { flex: none; color: var(--ink-soft); font-weight: 700; }
.step.ok .step-status { color: var(--good); } .step.error .step-status { color: var(--bad); } .step.running .step-status { color: var(--warn); }
.step .n { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); margin-top: 5px; overflow-wrap: anywhere; }
.step .m { font-size: 11.5px; color: var(--ink-soft); line-height: 1.45; margin-top: 4px; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.step.ok { border-color: color-mix(in srgb, var(--good) 30%, var(--line)); }
.step.error { border-color: var(--bad); background: var(--bad-soft); }
.step.running { border-color: var(--warn); } .step.skipped { opacity: .7; }
.step .prog { display: grid; gap: 6px; margin-top: 6px; }
.step .prog-l { font-size: 12px; } .step .prog-s { margin-top: 2px; }
.step .bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 3px; }
.step .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.bar-h { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.bar-h span { display: block; height: 100%; }
.bar-h .ok { background: var(--good); } .bar-h .nd { background: var(--warn); } .bar-h .er { background: var(--bad); }
.share { font-weight: 600; } .share.good { color: var(--good); } .share.bad { color: var(--bad); }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-soft); }
.diff { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.diff .old { color: var(--bad); } .diff .new { color: var(--good); }
.inline-edit { display: inline-flex; gap: 6px; align-items: center; }

/* ===== Адаптив ===== */
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } .setting { grid-template-columns: 1fr; } .setting .ctl { justify-content: flex-start; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 31; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .18s; }
  .sidebar.open { transform: none; }
  .brand .sidebar-close { display: inline-grid; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 14px 0; } .content { padding: 12px 14px 60px; }
  .page-title { font-size: 17px; }
  .search .input { width: 160px; }
  .toolbar .flex { flex-wrap: wrap; }
  .rowcard .top .faint { white-space: nowrap; }
  .panel { width: 100vw; }
  .table-scroll { max-height: none; }
  .tbl.responsive { display: none; }
  .rowcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  .rowcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); cursor: pointer; min-width: 0; overflow: hidden; }
  .rowcard .kv > div { min-width: 0; } .rowcard .kv .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rowcard .top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .rowcard .kv { grid-template-columns: repeat(2, 1fr); }
  .rowcard .kv .v { font-size: 14px; }
  .rowcard .more { margin-top: 6px; display: none; } .rowcard.open .more { display: grid; }
  .pager { margin-left: 0; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media print { .sidebar, .topbar, .toolbar, .tbl-foot, .panel { display: none !important; } .app { grid-template-columns: 1fr; } .table-scroll { max-height: none; overflow: visible; } }

/* ===== Дашборд ===== */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 12px; align-items: start; }
.legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-item .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.toplist { display: flex; flex-direction: column; }
.top-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.top-row:last-child { border-bottom: 0; }
.top-row:hover { background: var(--surface-2); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.top-row .rank { width: 18px; color: var(--ink-faint); font-size: 12px; text-align: right; }
.top-row .avatar { width: 30px; height: 30px; overflow: hidden; }
.top-row .avatar img, .avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.top-row .ttl { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-wide .chart-box { min-height: 260px; }
/* раскрывающиеся строки */
.tbl tr.child td { background: var(--surface-2); font-size: 12.5px; height: 32px; padding-top: 4px; padding-bottom: 4px; }
.tbl tr.child td:first-child { padding-left: 34px; }
.tbl tr.child td.sticky-col { background: var(--surface-2); }
.expander { display: inline-block; width: 22px; font-size: 20px; color: var(--ink-faint); transition: transform .12s; }
.expander.open { transform: rotate(90deg); }
.avatar-group { display: flex; }
.avatar-group .avatar { width: 24px; height: 24px; font-size: 10px; margin-left: -6px; border: 2px solid var(--surface); overflow: hidden; }
.avatar-group .avatar:first-child { margin-left: 0; }
.inline-select { height: 34px; font-size: 13.5px; max-width: 220px; }

table.hist.clickable tbody tr:hover td { background: var(--surface-2); }

.res-cell { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.tbl tbody tr.no-report:hover td { background: transparent; }

.login-or { text-align: center; color: var(--ink-faint); font-size: 12px; margin: 12px 0 8px; position: relative; }
.login-or::before, .login-or::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--line); }
.login-or::before { left: 0; } .login-or::after { right: 0; }
.btn.google { width: 100%; justify-content: center; gap: 10px; height: 42px; }
.g-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #4285F4; font-weight: 700; border: 1px solid var(--line-strong); }

.tbl th .col-rs { position: absolute; top: 0; right: 0; width: 10px; height: 100%; cursor: col-resize; z-index: 6; touch-action: none; }
.tbl th .col-rs::after { content: ''; position: absolute; top: 25%; bottom: 25%; right: 0; width: 1px; background: var(--line-strong); opacity: 0; transition: opacity .15s; }
.tbl th:hover .col-rs::after, .tbl th .col-rs.on::after { opacity: 1; }
.tbl th .col-rs.on::after { background: var(--accent); width: 2px; }
.tbl th.clip, .tbl td.clip { overflow: hidden; text-overflow: ellipsis; }
.tbl td.clip > * { max-width: 100%; }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; font: inherit; font-size: 12.5px; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }

.stat.clickable:hover { border-color: var(--accent); background: var(--accent-soft); }

.chart .bar.link { cursor: pointer; } .chart .bar.link:hover { opacity: 1; filter: brightness(1.15); }
.stat.link { cursor: pointer; } .stat.link:hover { border-color: var(--accent); background: var(--accent-soft); }
.legend-item.link, tr.link { cursor: pointer; } .legend-item.link:hover { color: var(--accent-ink); }

.chips-label { font-size: 12.5px; color: var(--ink-faint); margin-right: 4px; align-self: center; }

.chip.count { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-size: 13px; }
.chip.count b { font-family: var(--mono); font-size: 14px; }

.btn.sugg { height: auto; min-height: 32px; padding: 4px 10px; gap: 8px; font-size: 12.5px; white-space: normal; text-align: left; }
.btn.sugg .mk { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; background: #CB11AB; color: #fff; border-radius: 4px; padding: 1px 5px; }
.btn.sugg .nm { color: var(--ink-soft); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.sugg .act { color: var(--accent-ink); font-weight: 600; white-space: nowrap; }

.chart-tip { position: fixed; z-index: 1000; pointer-events: none; background: var(--ink); color: var(--surface); font: 12.5px/1.45 var(--sans); padding: 6px 9px; border-radius: 7px; box-shadow: var(--shadow); white-space: normal; overflow-wrap: anywhere; width: max-content; max-width: min(320px, calc(100vw - 32px)); box-sizing: border-box; }
:root[data-theme="dark"] .chart-tip { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart-tip { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-strong); } }
.donut path.seg:hover { opacity: .85; filter: brightness(1.08); cursor: default; }
.chart .hit { cursor: default; }

.neg-why { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; border-radius: 50%; font-size: 10px; font-weight: 700; background: var(--bad-soft); color: var(--bad); cursor: help; vertical-align: 1px; }

/* ===== Палитры персонализации (data-palette на <html>); розовая — по умолчанию в :root ===== */
:root[data-palette="lavender"] { --ground: #F8F6FD; --ground-2: #ECE7F8; --surface-2: #F3EFFB; --surface-3: #EAE3F6; --line: #E3DCF1; --line-strong: #CFC3E6; --accent: #6D4FC2; --accent-hover: #5B40A8; --accent-soft: #ECE4FB; --accent-ink: #4B338F; --grad-a: #C4B3F2; --grad-b: #F0E6FF; --on-accent: #FFFFFF; }
:root[data-palette="lavender"][data-theme="dark"] { --ground: #17141F; --ground-2: #1F1A2B; --surface: #201B2C; --surface-2: #29233A; --surface-3: #332C46; --line: #3B3350; --line-strong: #4D4466; --accent: #B7A3F3; --accent-hover: #C7B7F7; --accent-soft: #2E2547; --accent-ink: #D4C7FA; --grad-a: #4A3A7A; --on-accent: #17141F; --grad-b: #241C3A; }
@media (prefers-color-scheme: dark) { :root[data-palette="lavender"]:not([data-theme="light"]) { --ground: #17141F; --ground-2: #1F1A2B; --surface: #201B2C; --surface-2: #29233A; --surface-3: #332C46; --line: #3B3350; --line-strong: #4D4466; --accent: #B7A3F3; --accent-hover: #C7B7F7; --accent-soft: #2E2547; --accent-ink: #D4C7FA; --grad-a: #4A3A7A; --on-accent: #17141F; --grad-b: #241C3A; } }
:root[data-palette="mint"] { --ground: #F4FAF8; --ground-2: #E2F1EC; --surface-2: #EEF7F3; --surface-3: #E2F0EA; --line: #D9E9E2; --line-strong: #C0DAD0; --accent: #17705A; --accent-hover: #125A49; --accent-soft: #DDF3EB; --accent-ink: #14584A; --grad-a: #A9E6D1; --grad-b: #E3F7F0; --on-accent: #FFFFFF; }
:root[data-palette="mint"][data-theme="dark"] { --ground: #101917; --ground-2: #152220; --surface: #172320; --surface-2: #1E2E2A; --surface-3: #263935; --line: #2E443F; --line-strong: #3D5850; --accent: #6ED3B4; --accent-hover: #86DEC2; --accent-soft: #1D3A33; --accent-ink: #A9E9D4; --grad-a: #245C4C; --on-accent: #101917; --grad-b: #142A25; }
@media (prefers-color-scheme: dark) { :root[data-palette="mint"]:not([data-theme="light"]) { --ground: #101917; --ground-2: #152220; --surface: #172320; --surface-2: #1E2E2A; --surface-3: #263935; --line: #2E443F; --line-strong: #3D5850; --accent: #6ED3B4; --accent-hover: #86DEC2; --accent-soft: #1D3A33; --accent-ink: #A9E9D4; --grad-a: #245C4C; --on-accent: #101917; --grad-b: #142A25; } }
:root[data-palette="sky"] { --ground: #F5F8FD; --ground-2: #E4ECF8; --surface-2: #EEF3FB; --surface-3: #E3EBF6; --line: #DBE4F1; --line-strong: #C3D2E8; --accent: #2F6BD0; --accent-hover: #2557AF; --accent-soft: #E1EBFB; --accent-ink: #1F4A93; --grad-a: #B3CDFA; --grad-b: #E5EEFF; --on-accent: #FFFFFF; }
:root[data-palette="sky"][data-theme="dark"] { --ground: #0F151E; --ground-2: #151E2B; --surface: #161F2D; --surface-2: #1D293A; --surface-3: #263447; --line: #2E3D52; --line-strong: #3E5069; --accent: #8FB4F5; --accent-hover: #A5C3F8; --accent-soft: #1E2E47; --accent-ink: #B9D0FA; --grad-a: #27446F; --on-accent: #0F151E; --grad-b: #141F31; }
@media (prefers-color-scheme: dark) { :root[data-palette="sky"]:not([data-theme="light"]) { --ground: #0F151E; --ground-2: #151E2B; --surface: #161F2D; --surface-2: #1D293A; --surface-3: #263447; --line: #2E3D52; --line-strong: #3E5069; --accent: #8FB4F5; --accent-hover: #A5C3F8; --accent-soft: #1E2E47; --accent-ink: #B9D0FA; --grad-a: #27446F; --on-accent: #0F151E; --grad-b: #141F31; } }
:root[data-palette="peach"] { --ground: #FDF7F3; --ground-2: #F8E7DD; --surface-2: #FBF0EA; --surface-3: #F5E4DA; --line: #F0DDD2; --line-strong: #E3C6B6; --accent: #B84F2C; --accent-hover: #9B4023; --accent-soft: #FCE6DC; --accent-ink: #8E3B1E; --grad-a: #FFC9AC; --grad-b: #FFEBDF; --on-accent: #FFFFFF; }
:root[data-palette="peach"][data-theme="dark"] { --ground: #1B1411; --ground-2: #261B16; --surface: #251A15; --surface-2: #30221C; --surface-3: #3B2B24; --line: #45322A; --line-strong: #5A4338; --accent: #FFA07A; --accent-hover: #FFB393; --accent-soft: #46281D; --accent-ink: #FFC3A8; --grad-a: #7A3E28; --on-accent: #1B1411; --grad-b: #33201A; }
@media (prefers-color-scheme: dark) { :root[data-palette="peach"]:not([data-theme="light"]) { --ground: #1B1411; --ground-2: #261B16; --surface: #251A15; --surface-2: #30221C; --surface-3: #3B2B24; --line: #45322A; --line-strong: #5A4338; --accent: #FFA07A; --accent-hover: #FFB393; --accent-soft: #46281D; --accent-ink: #FFC3A8; --grad-a: #7A3E28; --on-accent: #1B1411; --grad-b: #33201A; } }
:root[data-palette="graphite"] { --ground: #F6F7F9; --ground-2: #E9ECF0; --surface-2: #F1F3F6; --surface-3: #E7EAEF; --line: #E0E4EA; --line-strong: #C9D0D9; --accent: #3E4C5E; --accent-hover: #2F3B4A; --accent-soft: #E6EAF0; --accent-ink: #2B3644; --grad-a: #CBD3DD; --grad-b: #EEF1F5; --on-accent: #FFFFFF; }
:root[data-palette="graphite"][data-theme="dark"] { --ground: #131619; --ground-2: #1A1F25; --surface: #1B2026; --surface-2: #232930; --surface-3: #2C333B; --line: #333B45; --line-strong: #454F5B; --accent: #B4C0D0; --accent-hover: #C5CFDC; --accent-soft: #2A323C; --accent-ink: #D3DBE5; --grad-a: #3C4756; --on-accent: #131619; --grad-b: #1E242B; }
@media (prefers-color-scheme: dark) { :root[data-palette="graphite"]:not([data-theme="light"]) { --ground: #131619; --ground-2: #1A1F25; --surface: #1B2026; --surface-2: #232930; --surface-3: #2C333B; --line: #333B45; --line-strong: #454F5B; --accent: #B4C0D0; --accent-hover: #C5CFDC; --accent-soft: #2A323C; --accent-ink: #D3DBE5; --grad-a: #3C4756; --on-accent: #131619; --grad-b: #1E242B; } }

/* Градиентное оформление: мягкая заливка фона и боковой панели, включается в персонализации */
:root[data-wash="on"] body { background: linear-gradient(165deg, var(--grad-b) 0%, var(--ground) 42%, var(--ground) 100%) fixed; }
:root[data-wash="on"] .sidebar { background: linear-gradient(180deg, color-mix(in srgb, var(--grad-a) 26%, var(--surface)) 0%, var(--surface) 46%); }
:root[data-wash="on"] .stat, :root[data-wash="on"] .card { background: linear-gradient(180deg, color-mix(in srgb, var(--grad-b) 30%, var(--surface)), var(--surface) 60%); }
.brand-mark { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); }
.login-wrap { background: radial-gradient(1200px 600px at 20% 0%, var(--grad-b), var(--ground)); }
/* Карточка персонализации */
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pal { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; color: var(--ink); font: inherit; text-align: left; }
.pal:hover { border-color: var(--accent); }
.pal.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pal .dot { width: 28px; height: 28px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.pal .nm { font-weight: 500; } .pal .sub { display: block; font-size: 11.5px; color: var(--ink-faint); font-weight: 400; }
.pers-row { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.pers-row .ctl { display: flex; justify-content: flex-end; }
@media (max-width: 760px) { .pers-row { grid-template-columns: 1fr; } .pers-row .ctl { justify-content: flex-start; } }

/* Матрица прав: восемнадцать строк на три роли. Плотно, потому что смысл экрана — увидеть расклад
   целиком, а не читать описания: они живут в подсказке к названию.
   Заголовок группы сперва был залит --surface-2 — тем же цветом, каким подсвечивается строка под
   курсором, поэтому секций на экране просто не было видно. Теперь он отбит линией и отступом. */
.perm-grid { width: 100%; font-size: 12.5px; border-collapse: collapse; table-layout: fixed; }
.perm-grid th, .perm-grid td { padding: 3px 12px; text-align: left; }
.perm-grid tbody tr:not(.grp) td { border-bottom: 1px solid var(--line); }
.perm-grid thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  color: var(--ink-faint); font-weight: 500; font-size: 11.5px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong); }
.perm-grid td:first-child { cursor: help; }
.perm-grid th.c, .perm-grid td.c { text-align: center; width: 96px; }
.perm-grid tr.grp td { color: var(--accent-ink); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; cursor: default;
  padding: 14px 12px 4px; border-bottom: 2px solid var(--line-strong); }
.perm-grid tr.grp:first-child td { padding-top: 6px; }
.perm-grid tbody tr:not(.grp):hover td { background: var(--surface-2); }
.perm-grid .yes { color: var(--good); }
.perm-grid .no { color: var(--ink-faint); }
.perm-grid input[type=checkbox] { margin: 0; vertical-align: middle; }

/* Счётчики по площадкам над таблицей роликов: сколько выложено в каждой соцсети за выбранный период.
   Кнопка, а не подпись: по ней же и фильтруют, чтобы не идти за этим в выпадашку. */
.plat-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.plat-count { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 7px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 13px; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.plat-count:hover { border-color: var(--line-strong); }
.plat-count.active { border-color: var(--accent); background: var(--accent-soft); }
.plat-count b { font-weight: 600; }
.plat-count .faint { font-size: 12px; }
.plat-count.total { cursor: default; border-style: dashed; padding-left: 11px; }
.plat-count.total:hover { border-color: var(--line); }

/* На телефоне переключатели не помещаются в строку: у периодов в карточке их четыре, у площадок на
   «Аккаунтах» — пять, а ширина окна около 340 пикселей. Без переноса они уезжали за край.
   Переносим и растягиваем кнопки по ширине, чтобы ряды выглядели ровными. */
/* Телефон: кнопки переключателей тянутся на всю ширину ряда, счётчики площадок компактнее, а
   затемнение отдаёт окну почти весь экран — двадцать пикселей с каждой стороны это его десятая часть. */
@media (max-width: 560px) {
  .plat-counts { gap: 6px; }
  .plat-count { padding: 4px 9px 4px 6px; font-size: 12.5px; }
  .modal-scrim { padding: 10px; }
  .modal-h { padding: 14px 14px 10px; }
  .modal-b { padding: 12px 14px; }
  .modal-f { padding: 10px 14px 14px; }
  .hist th, .hist td { padding: 5px 6px; }
}

/* Hits settings: aligned threshold columns and a compact sentence with a number. */
.hit-threshold-section { gap: 8px; }
.hit-threshold-list { display: grid; gap: 6px; width: 100%; max-width: 520px; }
.hit-threshold-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.hit-threshold-row .input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.hit-threshold-row .btn { width: 32px; padding: 0; }
.hit-threshold-header { font-size: 12px; color: var(--ink-faint); }
.hit-setting-number { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hit-setting-number .input { width: 76px !important; min-width: 0; }
.hit-setting-unit { white-space: nowrap; }

.hit-anomaly-floors {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-width:520px}
.hit-mode-tabs {margin:12px 0;align-self:flex-start}
@media(max-width:480px){.hit-anomaly-floors {grid-template-columns:1fr}}

.combo-check { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid currentColor; border-radius: 3px; display: inline-grid; place-items: center; font-size: 12px; }
.load-error .btn { margin-top: 12px; }
.text-link { text-decoration: underline; text-underline-offset: .15em; }
.sort-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button.expander { background: none; border: 0; padding: 0; min-width: 24px; min-height: 24px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.product-report { display: block; text-align: left; white-space: normal; font-size: 11.5px; }

.top-row a.mono { display: inline-flex; align-items: center; min-height: 24px; }
button[title="Все авторы"] { min-width: 24px; }

/* Catalog: quiet product rows with a separate, aligned code table. */
.catalog-product-name { font-weight: 550; max-width: 420px; white-space: normal; line-height: 1.4; overflow-wrap: anywhere; }
.catalog-product-name .badge { margin-left: 8px; font-weight: 400; }
.catalog-expand { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-radius: 7px; padding: 7px 10px; background: var(--surface-2); color: var(--accent); font: inherit; cursor: pointer; white-space: nowrap; }
.catalog-expand:hover { background: var(--accent-soft); }
.catalog-expand:focus-visible, .catalog-history-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.catalog-chevron { transition: transform .15s; }
.catalog-expand[aria-expanded=true] .catalog-chevron { transform: rotate(180deg); }
.catalog-more { font-size: 22px; width: 36px; min-width: 36px; height: 34px; padding: 0; }
.catalog-products .catalog-product-row.is-expanded > td { border-bottom-color: transparent; background: var(--surface-2); }
.catalog-products .catalog-detail-row > td { padding: 0 18px 18px; background: var(--surface-2); }
.catalog-codes { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.catalog-codes-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.catalog-codes-head strong { font-size: 13px; }
.catalog-codes-head .small { margin-top: 3px; line-height: 1.45; white-space: normal; }
.catalog-codes-head .btn { flex-shrink: 0; }
.catalog-codes-scroll { overflow-x: auto; }
.catalog-codes-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 13px; }
.catalog-codes-table th { background: var(--surface-2); font-size: 11px; font-weight: 500; color: var(--ink-faint); text-align: left; }
.catalog-codes-table th, .catalog-codes-table td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: normal; }
.catalog-codes-table th:first-child { width: 32%; }
.catalog-codes-table th.num { width: 12%; }
.catalog-codes-table th.catalog-actions-heading { width: 52px; }
.catalog-codes-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.catalog-codes-table tr:last-child td { border-bottom: 0; }
.catalog-code-cell { overflow-wrap: anywhere; }
.catalog-actions-cell { text-align: right; padding-right: 10px !important; }
.catalog-code-status { font-size: 12px; color: var(--ink-faint); }
.catalog-code-status.active { color: var(--good); }
.catalog-history-link { border: 0; background: none; padding: 5px 0; color: var(--accent); font: inherit; cursor: pointer; white-space: nowrap; }
.catalog-code-match { background: var(--accent-soft); }
.catalog-no-codes { padding: 20px 16px; font-size: 13px; }
.catalog-card-top { display: grid; grid-template-columns: minmax(0,1fr) 36px; align-items: start; gap: 12px; }
.catalog-card-meta { display: flex; gap: 16px; font-size: 12px; margin: 7px 0 12px; color: var(--ink-faint); }
.catalog-product-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.catalog-product-card > .catalog-expand { width: 100%; }
.catalog-mobile-detail { margin-top: 12px; }
.catalog-wb-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 14px 0; }
.menu button:disabled { opacity: .65; cursor: default; }
.menu button:disabled:hover { background: none; }
@media (max-width: 900px) {
 .catalog-products .rowcards { padding: 0; }
 .catalog-products.table-wrap, .catalog-products .table-wrap { border: 0; background: transparent; box-shadow: none; }
 .catalog-codes-head { padding: 12px; gap: 10px; flex-wrap: wrap; }
 .catalog-codes-head .small { font-size: 11px; }
 .catalog-codes-table th, .catalog-codes-table td { padding: 9px 6px; font-size: 12px; }
 .catalog-codes-table th { font-size: 10px; }
 .catalog-codes-table th:first-child { width: 29%; }
 .catalog-codes-table th.num { width: 13%; }
 .catalog-codes-table th.catalog-actions-heading { width: 36px; }
 .catalog-codes-table .catalog-more { width: 28px; min-width: 28px; }
 .catalog-codes-table .catalog-actions-cell { padding-right: 4px !important; }
 .catalog-code-status { font-size: 10px; }
 .catalog-wb-totals { gap: 6px; }
 .catalog-wb-totals .stat { padding: 10px; }
}
.catalog-products > .table-wrap > .table-scroll > .tbl { width: 100%; table-layout: fixed; }
.catalog-products > .table-wrap > .table-scroll > .tbl > thead > tr > th:first-child { width: 40%; }
.catalog-products > .table-wrap > .table-scroll > .tbl > thead > tr > th:nth-child(2) { width: 18%; }
.catalog-products > .table-wrap > .table-scroll > .tbl > thead > tr > th:nth-child(3) { width: 15%; }
.catalog-products > .table-wrap > .table-scroll > .tbl > thead > tr > th:last-child { width: 52px; }
.catalog-codes-table th { position: static; }
.catalog-codes-table tbody tr { cursor: default; }
.catalog-codes-table td { height: 40px; padding-top: 6px; padding-bottom: 6px; }
.catalog-codes-table th { height: 34px; padding-top: 6px; padding-bottom: 6px; }
.catalog-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
@media (max-width: 900px) {
 .catalog-codes-table td { height: 44px; }
 .catalog-stats .stat { padding: 10px; }
 .catalog-stats .k { font-size: 10px; }
}
.catalog-chevron { display: block; flex: none; }
.catalog-history-heading { margin: 12px 0; }
.catalog-history-heading .small { margin-top: 4px; }

/* ===== Документация: задачи, оглавление и снимки шагов ===== */
.parser-guide{min-width:0}.pg-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:20px}.pg-heading h2{margin:0;font-size:20px}.parser-guide a{color:var(--ink);text-decoration:none}.parser-guide a:hover{text-decoration:underline}.pg-muted{font-size:12px;color:var(--ink-soft)}.pg-layout{display:grid;grid-template-columns:minmax(220px,270px) minmax(0,1fr);gap:20px;align-items:start}.pg-sidebar{padding:18px;position:sticky;top:16px;max-height:calc(100dvh - 32px);overflow:auto}.pg-sidebar label{display:block;font-weight:600;margin-bottom:8px}.pg-sidebar input{width:100%;min-width:0}.pg-sidebar details{margin:12px 0}.pg-sidebar summary{font-weight:600;cursor:pointer;padding:5px 0}.pg-sidebar nav a{display:block;padding:9px 11px;border:1px solid transparent;border-radius:8px;margin:3px 0;color:var(--ink-soft);line-height:1.5}.pg-sidebar nav a[aria-current]{background:var(--surface-2);border-color:var(--line);font-weight:600;color:var(--ink)}
.pg-article{min-width:0;padding:24px;line-height:1.7;overflow-wrap:anywhere}.pg-article h2{font-size:22px;line-height:1.4;margin:12px 0}.pg-breadcrumb{font-size:12px;color:var(--ink-soft)}.pg-breadcrumb a{color:inherit}.pg-lead{font-size:15px;color:var(--ink-soft)}.pg-jumps{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0 24px}.pg-jumps button{max-width:100%;white-space:normal;text-align:left}
.pg-step{border-top:1px solid var(--line);padding:22px 0 4px}.pg-step h3{font-size:15px;display:flex;align-items:baseline;gap:10px;line-height:1.5;scroll-margin-top:20px;margin:0 0 10px}.pg-number{display:inline-flex;flex:0 0 28px;height:28px;align-items:center;justify-content:center;border:1px solid var(--line);background:var(--surface-2);border-radius:7px;color:var(--ink-soft);font-size:12px}.pg-step p,.pg-notes p{max-width:78ch;margin:8px 0 12px}.pg-step figure{margin:14px 0}.pg-shot{display:block;width:100%;border:1px solid var(--line);border-radius:9px;overflow:hidden;padding:0;background:var(--surface);cursor:zoom-in}.pg-shot img{display:block;width:100%;height:auto}.pg-step figcaption{font-size:12px;color:var(--ink-soft);margin-top:8px}.pg-result{padding:11px 13px;background:var(--surface-2);border-radius:8px}.pg-result strong{font-weight:500}.pg-explanation{border-top:1px solid var(--line);margin:20px 0 8px;padding-top:16px}.pg-explanation summary{font-weight:500;cursor:pointer;padding:4px 0}.pg-open{display:inline-block;padding:9px 14px;border:1px solid var(--line);border-radius:9px;font-weight:500}.pg-related{border-top:1px solid var(--line);margin-top:24px;padding-top:12px}.pg-related h3{font-size:14px}.pg-related a{display:block;padding:6px 0}
.pg-image-dialog{width:min(1200px,calc(100% - 24px));max-height:90dvh;overflow:auto;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:16px}.pg-image-dialog::backdrop{background:rgb(0 0 0/.65)}.pg-image-heading{display:flex;justify-content:space-between;align-items:start;gap:12px}.pg-image-heading h2{font-size:15px;margin:0 0 16px}.pg-image-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}.pg-image-tools span{min-width:44px;text-align:center}.pg-image-viewport{width:100%;max-height:65dvh;overflow:auto;border:1px solid var(--line);border-radius:8px}.pg-image-viewport img{display:block;width:100%;max-width:none;height:auto}
@media(max-width:760px){.pg-layout{grid-template-columns:minmax(0,1fr);gap:14px}.pg-sidebar{position:static;max-height:340px}.pg-article{padding:18px}.pg-article h2{font-size:20px}.pg-jumps{display:block}.pg-jumps button{display:block;width:100%;margin-bottom:6px}.pg-step{padding-top:18px}.pg-step figure{margin:12px -6px}}

.topbar-tools{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}.documentation-entry{color:var(--ink);font-size:13px}.documentation-entry[aria-current]{background:var(--surface-2);border-color:var(--line-strong)}.topbar{flex-wrap:wrap}.topbar-right{max-width:100%;flex-wrap:wrap}.topbar-right:empty{display:none}@media(max-width:600px){.topbar-tools{margin-left:auto}.documentation-entry{height:34px;padding:0 10px}.topbar .page-title{min-width:0;overflow-wrap:anywhere}}
/* The help entry keeps text/background contrast during an immediate theme switch. */
.documentation-entry{transition:none}
.beoma-guide-dock{position:fixed;inset:0 0 0 auto;width:var(--beoma-guide-width,440px);z-index:1100;color:var(--ink);font:inherit;font-size:14px;line-height:1.45}.beoma-guide-box{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--surface);border-left:1px solid var(--line);box-shadow:-8px 0 30px #0001}.beoma-guide-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex:none;padding:12px;border-bottom:1px solid var(--line)}.beoma-guide-bar strong{margin-right:auto;font-size:14px}.beoma-guide-bar button,.beoma-guide-bar a{font:inherit;font-size:12px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:7px 9px;text-decoration:none;cursor:pointer}.beoma-guide-box iframe{width:100%;height:100%;flex:1;border:0;min-height:0;background:var(--surface)}.beoma-guide-scrim{position:fixed;inset:0;border:0;background:#0006;z-index:-1}.beoma-guide-bar :focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(min-width:768px){html.beoma-guide-open body{margin-right:var(--beoma-guide-width,440px)}}
@media(max-width:767px){.beoma-guide-dock{width:min(440px,100%)}.beoma-guide-box{box-shadow:-8px 0 30px #0003}}

.parser-guide-embed .sidebar,.parser-guide-embed .topbar,.parser-guide-embed .pg-heading{display:none!important}.parser-guide-embed .app{display:block;min-height:100vh}.parser-guide-embed .content{padding:12px}.parser-guide-embed body{background:var(--surface)}.parser-guide-embed .pg-layout{display:block}.parser-guide-embed .pg-outline{border:1px solid var(--line);border-radius:9px;padding:10px 8px;margin-bottom:12px}.parser-guide-embed .pg-outline>summary{cursor:pointer;font-weight:500}.parser-guide-embed .pg-sidebar{padding:12px 14px;scrollbar-gutter:stable;scroll-padding-block:8px;border-radius:8px;margin:12px 0 0;border:0;box-shadow:none;position:static;max-height:320px}.parser-guide-embed .pg-article{padding:12px 2px;border:0;box-shadow:none}.parser-guide-embed .pg-jumps{display:none}.parser-guide-embed .pg-step figure{margin:12px 0}

.beoma-guide-resizer{position:absolute;inset:0 auto 0 -5px;width:10px;z-index:3;cursor:col-resize;touch-action:none}.beoma-guide-resizer::after{content:"";position:absolute;left:4px;top:calc(50% - 24px);height:48px;width:3px;border-radius:3px;background:var(--line)}.beoma-guide-resizer:hover::after,.beoma-guide-resizer:focus-visible::after{background:var(--accent)}.beoma-guide-resizer:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.beoma-guide-resizing,.beoma-guide-resizing *{cursor:col-resize!important;user-select:none!important}.beoma-guide-resizing iframe{pointer-events:none}@media(max-width:767px){.beoma-guide-resizer{display:none}}

/* Reflow the workspace by available width, including browser zoom and dock resizing. */
html.beoma-guide-narrow .app{grid-template-columns:minmax(0,1fr)}
html.beoma-guide-narrow .sidebar{position:fixed;left:0;top:0;z-index:31;width:min(300px,calc(100vw - var(--beoma-guide-width) - 20px));transform:translateX(-100%);transition:transform .18s}
html.beoma-guide-narrow .sidebar.open{transform:none}
html.beoma-guide-narrow .brand .sidebar-close,html.beoma-guide-narrow .topbar .menu-btn{display:inline-grid}
html.beoma-guide-narrow .topbar{padding:12px 14px 0}
html.beoma-guide-narrow .content{padding:12px 14px 40px}
html.beoma-guide-narrow .page-title{font-size:18px}
html.beoma-guide-narrow .toolbar .flex{flex-wrap:wrap}
html.beoma-guide-open .stat-row{grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr))}
html.beoma-guide-open .stat{min-width:0}
html.beoma-guide-open .stat :is(.v,.k,.s){max-width:100%;white-space:normal;overflow-wrap:anywhere}
html.beoma-guide-open .two-col{grid-template-columns:minmax(0,1fr)}
html.beoma-guide-open .toolbar :is(.search,.input,.select){max-width:100%}
@media(min-width:768px){
 html.beoma-guide-open .modal-scrim{right:var(--beoma-guide-width)}
 html.beoma-guide-open .panel{right:var(--beoma-guide-width);max-width:calc(100vw - var(--beoma-guide-width))}
 html.beoma-guide-open :is(.scrim,.panel-scrim){right:var(--beoma-guide-width)}
 html.beoma-guide-open .setting{grid-template-columns:minmax(0,1fr)}
}

/* Documentation uses a neutral hierarchy independently of the accent palette. */
.parser-guide{--guide-outline-line:light-dark(#e2e7ed,#424953);--guide-current-surface:light-dark(#f4f6f9,#282d35)}
.parser-guide .pg-sidebar,.parser-guide .pg-outline{border-color:var(--guide-outline-line)}
.parser-guide .pg-sidebar nav a[aria-current]{border-color:var(--guide-outline-line);background:var(--guide-current-surface)}
.parser-guide .pg-sidebar nav a:hover{background:var(--guide-current-surface)}
.parser-guide .pg-sidebar :focus-visible{outline-color:var(--ink-soft)}

.pg-related a{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin:7px 0;padding:9px 12px;border:1px solid light-dark(#dbe3ec,#444d59);border-radius:8px;background:light-dark(#f6f8fb,#282e37);color:light-dark(#315f99,#aacbf1);text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.pg-related a::after{content:"→";flex:none;text-decoration:none}
.pg-related a:hover{background:light-dark(#e8eff9,#314158);border-color:light-dark(#b5c9e3,#607f9f)}

/* Reader layout: a resizable contents area, without completion controls. */
.pg-outline-resizer{display:flex;align-items:center;justify-content:center;height:24px;margin:4px 0 -6px;cursor:row-resize;touch-action:none;border-radius:5px}
.pg-outline-resizer::after{content:"";width:44px;height:4px;border-radius:4px;background:var(--line)}
.pg-outline-resizer:hover::after,.pg-outline-resizer:focus-visible::after{background:var(--ink-soft)}
.outline-resizing,.outline-resizing *{user-select:none;cursor:row-resize!important}

/* Groups and their articles form two visibly distinct navigation levels. */
.parser-guide .pg-sidebar nav>details>summary{font-weight:600;line-height:1.5;padding:8px 6px;list-style-position:inside;border-radius:6px}
.parser-guide .pg-sidebar nav>details>summary:hover{background:light-dark(#eef2f7,#2c3038)}
.parser-guide .pg-tree-articles{margin:3px 0 12px 13px;padding:1px 0 1px 12px;border-inline-start:1px solid light-dark(#d6deea,#4c5563)}
.parser-guide .pg-tree-articles>a{min-height:42px;padding:9px 10px;line-height:1.5}
.parser-guide .pg-tree-articles>a[aria-current]{font-weight:600}

.parser-guide .pg-audience{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;padding:3px;border:1px solid var(--line);border-radius:9px;margin-bottom:16px;background:light-dark(#f3f5f8,#242932)}
.parser-guide .pg-audience button{min-width:0;margin:0;padding:8px 5px;border:1px solid transparent;border-radius:6px;font:inherit;font-size:12px;line-height:1.5;color:var(--ink-soft);background:transparent;cursor:pointer;overflow-wrap:anywhere}
.parser-guide .pg-audience button[aria-selected=true]{color:var(--ink);background:light-dark(#e3ecf9,#293b51);border-color:light-dark(#afc3e0,#607f9f);font-weight:600}
.parser-guide .pg-audience button:hover{background:light-dark(#e8edf5,#303b4b)}
.parser-guide .pg-audience-badge{display:block;font-size:11px;line-height:1.4;color:var(--ink-soft);font-weight:400;margin-top:3px}

/* Compact hierarchy keeps clear nesting and larger touch targets. */
.parser-guide .pg-sidebar details{margin:6px 0}
.parser-guide .pg-sidebar nav>details>summary{padding:5px 6px;line-height:1.4}
.parser-guide .pg-tree-articles{margin:2px 0 6px 11px;padding:1px 0 1px 10px}
.parser-guide .pg-tree-articles>a{min-height:36px;margin:2px 0;padding:6px 9px;line-height:1.4}
@media(pointer:coarse){.parser-guide .pg-sidebar nav>details>summary,.parser-guide .pg-tree-articles>a{min-height:44px}}

/* Beosha is intentionally a local, non-modal guide navigator. */
.beosha-float{position:fixed;right:16px;bottom:16px;z-index:80;display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-width:calc(100% - 32px);font:inherit;font-size:13px;color:var(--ink)}
.beosha-float[hidden],.beosha-panel[hidden]{display:none!important}
html.beoma-guide-open .beosha-float{display:none}
.beosha-float .beosha-launch{display:flex;align-items:center;gap:10px;padding:8px 14px 8px 8px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);box-shadow:0 4px 20px #0002;cursor:pointer;font:inherit;max-width:100%}
.beosha-symbol{display:grid;place-items:center;width:40px;height:40px;flex:none;background:var(--accent);color:#fff;border-radius:12px;font-size:22px;font-weight:700}
.beosha-caption{display:flex;flex-direction:column;align-items:flex-start;gap:2px}.beosha-caption>span{color:var(--ink-soft);font-size:11px}
.beosha-panel{display:flex;flex-direction:column;width:380px;max-width:calc(100vw - 32px);height:min(480px,68dvh);min-height:220px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 8px 32px #0003;overflow:hidden}
.beosha-heading{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line);flex:none}.beosha-heading>strong{margin-right:auto}
.beosha-float button:not(.beosha-launch){font:inherit;font-size:12px;line-height:1.4;padding:7px 9px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:8px;cursor:pointer;white-space:normal}
.beosha-log{padding:12px;overflow:auto;min-height:0;flex:1;overscroll-behavior:contain}.beosha-message{margin-bottom:12px;overflow-wrap:anywhere;line-height:1.5}.beosha-message>p{margin:3px 0 8px}.beosha-who{font-size:11px;font-weight:600;color:var(--ink-soft)}.beosha-user{padding:8px 10px;border-radius:10px;background:var(--bg,var(--surface-2));margin-left:20px}
.beosha-topics{display:flex;flex-wrap:wrap;gap:6px}.beosha-results{display:grid;gap:6px}
.beosha-float .beosha-result{display:block;padding:9px 11px;border:1px solid var(--line);border-radius:8px;text-decoration:none;background:var(--surface);color:var(--ink)}
.beosha-result>strong{display:block;text-decoration:underline;text-underline-offset:3px;font-size:13px}.beosha-result>span{display:block;font-size:12px;line-height:1.4;margin-top:4px;color:var(--ink-soft)}.beosha-result:hover{border-color:var(--accent)!important}
.beosha-form{padding:10px 12px 12px;border-top:1px solid var(--line);flex:none}.beosha-form label{display:block;font-size:12px;font-weight:600;margin-bottom:7px}.beosha-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
.beosha-float .beosha-form input{width:100%;min-width:0;margin:0;font:inherit;font-size:13px;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}
.beosha-float :is(a,button,input):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:390px){.beosha-float{right:12px;bottom:12px;max-width:calc(100% - 24px)}.beosha-panel{max-width:calc(100vw - 24px)}.beosha-heading{gap:5px;padding:8px}.beosha-symbol{width:34px;height:34px;font-size:19px}}
@media(pointer:coarse){.beosha-float button,.beosha-result{min-height:44px}}
.beosha-panel{position:relative;display:block;overflow:visible;min-height:0;max-height:calc(100dvh - 100px)}.beosha-panel-inner{display:flex;flex-direction:column;height:100%;min-height:0;border-radius:inherit;overflow:hidden}
.beosha-symbol{background:var(--accent-soft,var(--surface-2));color:var(--ink)}
.beosha-status{margin:0;padding:0 12px 8px;color:var(--ink-soft);font-size:12px;flex:none}.beosha-status[hidden]{display:none}
.beosha-float .beosha-result{display:block;border:1px solid var(--line);padding:10px 11px;border-radius:9px;background:var(--surface)}
.beosha-float .beosha-result-link{color:var(--ink);font-weight:600;text-decoration:underline;text-underline-offset:3px}.beosha-result .beosha-summary{margin:5px 0 8px;color:var(--ink-soft);font-size:12px;line-height:1.45}
.beosha-steps summary{cursor:pointer;font-size:12px;padding:6px 0;font-weight:600}.beosha-steps ol{padding-left:18px;margin:8px 0 0}.beosha-steps li{margin-bottom:16px;font-size:12px;line-height:1.5}.beosha-steps li>p{margin:6px 0}.beosha-step-result{padding:8px;border-radius:6px;background:var(--bg,var(--surface-2))}
.beosha-figure{margin:9px 0}.beosha-figure .beosha-shot{display:block;width:100%;padding:0!important;border-radius:7px;overflow:hidden;cursor:zoom-in!important}.beosha-shot img{display:block;width:100%;height:auto}.beosha-image-status{font-size:11px;color:var(--ink-soft)}.beosha-image-status[hidden]{display:none!important}
.beosha-float .beosha-form textarea{width:100%;min-width:0;max-height:120px;margin:0;resize:vertical;font:inherit;font-size:13px;line-height:1.4;padding:8px 9px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}
.beosha-resizer{position:absolute;z-index:2;touch-action:none}.beosha-resizer-w{left:-5px;top:10px;bottom:10px;width:10px;cursor:col-resize}.beosha-resizer-h{top:-5px;left:10px;right:10px;height:10px;cursor:row-resize}.beosha-resizer-w::after,.beosha-resizer-h::after{content:"";position:absolute;background:var(--line);border-radius:3px}.beosha-resizer-w::after{left:4px;top:calc(50% - 18px);width:3px;height:36px}.beosha-resizer-h::after{top:4px;left:calc(50% - 18px);height:3px;width:36px}.beosha-resizer:hover::after,.beosha-resizer:focus-visible::after{background:var(--accent)}

@media(max-width:600px){.beosha-float .beosha-form textarea{font-size:16px}}

.beosha-shot img[hidden]{display:none!important}


/* Independent chat, persistent on every workspace page. */
.beosha-float{z-index:1101;right:20px;bottom:20px;gap:10px}
.beosha-panel{position:relative;inset:auto;max-width:calc(100vw - 32px);max-height:calc(100dvh - 104px);border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:0 12px 48px #0002,0 2px 8px #0001}
.beosha-heading{padding:14px 16px;min-height:64px;background:var(--accent-soft,var(--surface-2));border-bottom:1px solid var(--line)}
.beosha-heading>strong{display:block;font-size:16px;letter-spacing:-.2px;margin-right:auto}
.beosha-heading .beosha-clear,.beosha-heading .beosha-expand,.beosha-heading .beosha-close{font-size:11px;padding:6px 8px;background:var(--surface)}
.beosha-log{padding:16px}.beosha-message{margin-bottom:16px}.beosha-bot>p{font-size:13px;line-height:1.6}.beosha-user{margin-left:40px;padding:10px 13px;background:var(--accent-soft,var(--surface-2));border-radius:14px 14px 4px 14px}
.beosha-results{gap:9px}.beosha-float .beosha-result{border-radius:12px;padding:12px}.beosha-float .beosha-result-link{color:var(--accent);line-height:1.45}.beosha-form{padding:12px 16px 16px}.beosha-input-row{align-items:end}.beosha-float .beosha-form textarea{border-radius:12px;min-height:64px}.beosha-float .beosha-input-row>button{min-height:40px;border-color:var(--accent);font-weight:600}
.beosha-launch{border-radius:18px!important;box-shadow:0 4px 24px #0002!important}.beosha-symbol{border-radius:13px}
.beosha-image-dialog{width:min(1200px,95vw);max-width:95vw;max-height:94dvh;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink)}.beosha-image-dialog::backdrop{background:#0008}.beosha-image-tools{display:flex;align-items:center;gap:10px;margin:12px 0}.beosha-image-tools a{color:var(--accent);text-decoration:underline}.beosha-image-tools button:last-child{margin-left:auto}.beosha-image-scroll{overflow:auto;max-height:70dvh}.beosha-image-scroll img{display:block;max-width:none;height:auto}
html.beoma-guide-open .beosha-float{display:flex;right:calc(var(--beoma-guide-width,440px) + 16px)}
@media(max-width:767px){.beosha-float{right:12px;bottom:12px;gap:8px}.beosha-panel{border-radius:16px;max-width:calc(100vw - 24px)}.beosha-heading{padding:12px 10px;gap:6px}.beosha-log{padding:12px}.beosha-form{padding:10px 12px 12px}.beosha-user{margin-left:22px}html.beoma-guide-open .beosha-float{display:none}}

/* Round avatar launcher; the final character artwork is pending approval. */
.beosha-float .beosha-launch{padding:4px;width:58px;height:58px;border-radius:50%!important;display:grid;place-items:center;flex:none}
.beosha-launch .beosha-caption{display:none}.beosha-symbol{width:48px;height:48px;border-radius:50%;font-size:24px}
.beosha-heading{display:grid;grid-template-columns:minmax(0,1fr) 32px;align-items:center;min-height:60px;padding:12px 16px;gap:12px}
.beosha-heading>strong{margin:0;line-height:1.4}.beosha-float .beosha-heading .beosha-close{display:grid;place-items:center;padding:0;width:32px;height:32px;min-height:32px;font-size:24px;line-height:1;background:transparent;border-color:transparent;border-radius:8px}
.beosha-float .beosha-heading .beosha-close:hover{background:var(--surface)}
.beosha-input-row{grid-template-columns:minmax(0,1fr) 44px;align-items:stretch;gap:8px}.beosha-float .beosha-form textarea{min-height:56px;resize:none;line-height:1.5;padding:9px 11px}.beosha-float .beosha-input-row>button{align-self:stretch;margin:0;padding:0;border-radius:12px;font-size:24px;line-height:1;display:grid;place-items:center}
.beosha-float .beosha-resizer-corner{position:absolute;left:-5px;top:-5px;width:22px;height:22px;min-height:22px;padding:0;border:0;border-radius:7px;background:var(--surface);z-index:3;cursor:nwse-resize;touch-action:none;box-shadow:0 0 0 1px var(--line)}
.beosha-resizer-corner::before{content:"";position:absolute;inset:6px;border-top:2px solid var(--ink-soft);border-left:2px solid var(--ink-soft);border-radius:2px 0 0 0}
@media(pointer:coarse){.beosha-heading{grid-template-columns:minmax(0,1fr) 44px}.beosha-float .beosha-heading .beosha-close{width:44px;height:44px}.beosha-float .beosha-resizer-corner{width:28px;height:28px}}

.beosha-heading{background:var(--surface);min-height:72px}.beosha-identity{display:flex;align-items:center;gap:10px;min-width:0}.beosha-avatar{width:38px;height:38px;border-radius:50%;background:var(--accent-soft,var(--surface-2));display:grid;place-items:center;font-size:19px;font-weight:600;flex:none;color:var(--ink)}
.beosha-name{display:grid;gap:3px;min-width:0}.beosha-name strong{font-size:15px;line-height:1.25}.beosha-name>span{font-size:11px;line-height:1.3;color:var(--ink-soft)}
.beosha-log{background:var(--bg,var(--surface-2));scrollbar-gutter:stable}.beosha-bot{padding:0 2px}.beosha-who{display:block;font-size:10px;line-height:1.3;letter-spacing:.3px;margin-bottom:5px}.beosha-user .beosha-who{color:var(--ink-soft)}.beosha-user>p{margin:0}.beosha-bot>p{margin:0 0 12px;line-height:1.65}
.beosha-topics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.beosha-float .beosha-topics button{min-height:42px;text-align:left;padding:10px 11px;border-radius:11px;line-height:1.4;background:var(--surface)}
.beosha-float .beosha-topics button:hover{border-color:var(--accent);background:var(--accent-soft,var(--surface-2))}.beosha-float .beosha-result{padding:12px 13px;border-radius:12px;box-shadow:0 1px 3px #00005}.beosha-float .beosha-result-link{display:block;position:relative;padding-right:18px;text-decoration:none;font-size:13px;line-height:1.5}.beosha-result-link::after{content:"→";position:absolute;right:0;top:0}.beosha-result-link:hover{text-decoration:underline}.beosha-result .beosha-summary{margin:7px 0 8px;line-height:1.55}.beosha-steps{border-top:1px solid var(--line);padding-top:3px;margin-top:9px}.beosha-steps summary{padding:8px 0;font-size:11px;color:var(--ink-soft)}
.beosha-form label{margin-bottom:8px;color:var(--ink-soft);font-size:11px;font-weight:500}.beosha-float .beosha-input-row>button{background:var(--accent-soft,var(--surface-2));color:var(--ink);border-color:var(--line)}.beosha-float .beosha-input-row>button:hover{border-color:var(--accent)}.beosha-input-row>button:disabled{opacity:.5;cursor:wait}
.beosha-tour{position:fixed;inset:0;z-index:1300;pointer-events:none}.beosha-tour-spot{position:fixed;border:2px solid var(--accent);border-radius:9px;box-shadow:0 0 0 4px var(--accent-soft);pointer-events:none}
.beosha-tour-bubble{position:fixed;z-index:1302;padding:15px;border:1px solid var(--line);border-radius:17px;background:var(--surface);color:var(--ink);box-shadow:0 8px 32px #0003;box-sizing:border-box;max-width:calc(100vw - 24px);font:13px/1.5 'Golos Text',sans-serif;pointer-events:auto}
.beosha-tour-identity{display:flex;align-items:center;gap:9px}.beosha-tour-progress{margin-left:auto;font-size:11px;color:var(--ink-soft)}.beosha-tour-mascot{display:grid;place-items:center;width:34px;height:34px;background:var(--accent-soft);border-radius:50%;font-size:18px;font-weight:600;transition:transform .3s}
.beosha-tour-mascot[data-action=point]{animation:beosha-nod 1.6s ease-in-out infinite}.beosha-tour-mascot[data-action=type]{transform:rotate(-9deg)}.beosha-tour-mascot[data-action=choose]{transform:rotate(9deg)}.beosha-tour-mascot[data-action=check]{transform:scale(1.08)}
.beosha-tour-text{margin:12px 0;line-height:1.6}.beosha-tour-actions{display:flex;gap:6px;flex-wrap:wrap}.beosha-tour-actions button{font:inherit;font-size:12px;padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);cursor:pointer}.beosha-tour-actions button:nth-child(2){margin-left:auto;background:var(--accent-soft)}.beosha-tour-actions button:disabled{opacity:.5;cursor:default}.beosha-tour-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.beosha-tour-arrow{position:fixed;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.beosha-tour-arrow path{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:5 4;animation:beosha-flow 1s linear infinite}.beosha-float .beosha-tour-start{grid-column:1/-1;border-color:var(--accent);font-weight:600}
@keyframes beosha-nod{50%{transform:translateY(-3px) rotate(7deg)}}@keyframes beosha-flow{to{stroke-dashoffset:-18}}@media(prefers-reduced-motion:reduce){.beosha-tour-mascot,.beosha-tour-arrow path{animation:none!important;transition:none}}

/* Quiet composer and corner grip; avatar artwork is reserved for later. */
.beosha-input-row{grid-template-columns:minmax(0,1fr) 34px;align-items:end;gap:4px;padding:5px;border:1px solid var(--line);border-radius:13px;background:var(--surface)}.beosha-input-row:focus-within{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.beosha-float .beosha-form textarea{min-height:44px;padding:6px 7px;border:0!important;box-shadow:none!important;outline:none!important;background:transparent;border-radius:0;font-size:13px;line-height:1.5}
.beosha-float .beosha-input-row>button{width:34px;height:34px;min-height:34px;align-self:end;border:0;border-radius:50%;padding:8px;background:transparent;box-shadow:none;color:var(--ink-soft)}.beosha-float .beosha-input-row>button:hover{background:var(--accent-soft);color:var(--ink)}.beosha-input-row>button svg{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.beosha-float .beosha-resizer-corner{left:0;top:0;width:22px;height:22px;min-height:22px;border:0;border-radius:0;background:transparent;box-shadow:none;opacity:.35}.beosha-resizer-corner::before{inset:5px;border:0;border-radius:0;background:repeating-linear-gradient(135deg,transparent 0 3px,var(--ink-soft) 3px 4px,transparent 4px 7px);clip-path:polygon(0 0,100% 0,0 100%)}.beosha-resizer-corner:hover,.beosha-resizer-corner:focus-visible{opacity:1}
@media(max-width:600px){.beosha-float .beosha-form textarea{font-size:16px}}

/* One baseline for the initial one-line composer; vertical resizing stays available. */
.beosha-input-row{align-items:center;padding:4px;gap:4px}.beosha-float .beosha-form textarea{height:38px;min-height:38px;max-height:180px;line-height:22px;padding:8px 6px;resize:vertical;overflow-y:auto;box-sizing:border-box}.beosha-float .beosha-input-row>button{align-self:center;width:32px;height:32px;min-height:32px;padding:7px;box-sizing:border-box}

.beosha-float button.beosha-resizer-corner{border:0;border-radius:0;background:transparent;box-shadow:none;padding:0}

/* Geometry comes from the actual control, independently of the bubble/list bounds. */
.beosha-tour-spot{box-sizing:border-box;box-shadow:0 0 0 2px var(--accent-soft)}
.beosha-tour-bubble[popover]{margin:0;inset:auto;position:fixed}

/* Approved Beosha portrait. Same local artwork in both workspaces. */
.beosha-symbol,.beosha-avatar{overflow:hidden;background:var(--accent-soft,var(--surface-2));position:relative}
.beosha-symbol img,.beosha-avatar img{display:block;width:100%;height:100%;object-fit:contain}
.beosha-avatar{width:42px;height:42px;border:1px solid var(--line)}

/* One wardrobe per tour, five poses. Artwork never intercepts form controls. */
.beosha-tour-scene{display:grid;grid-template-columns:90px minmax(0,1fr);gap:12px;align-items:center}
.beosha-tour-mascot{display:block;position:relative;width:90px;height:150px;border-radius:0;background:none;overflow:hidden;animation:none!important;transform:none!important}
.beosha-tour-sprite{display:block;width:450px!important;max-width:none!important;height:150px!important;transition:none}
.beosha-tour-fallback{width:90px;height:150px;object-fit:contain}
.beosha-tour-mascot img[hidden]{display:none!important}
.beosha-tour-identity{gap:6px}.beosha-tour-text{margin:8px 0;line-height:1.55}
.beosha-tour-actions{margin-top:12px}
@media(max-width:390px){.beosha-tour-scene{grid-template-columns:66px minmax(0,1fr);gap:8px}.beosha-tour-mascot{width:66px;height:110px}.beosha-tour-sprite{width:330px!important;height:110px!important}.beosha-tour-fallback{width:66px;height:110px}.beosha-tour-bubble{padding:12px}}

/* The composer grows towards its top grip; no misleading bottom resize corner. */
.beosha-float .beosha-form textarea{resize:none}
.beosha-form{position:relative;padding-top:19px}
.beosha-input-grip{position:absolute;left:20px;right:20px;top:0;height:14px;cursor:ns-resize;touch-action:none;display:grid;place-items:center}
.beosha-input-grip::after{content:'';width:36px;height:3px;border-radius:3px;background:var(--line)}
.beosha-input-grip:hover::after,.beosha-input-grip:focus-visible::after{background:var(--accent)}
.beosha-input-grip:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.beosha-float .beosha-invite{width:254px;max-width:calc(100vw - 32px);padding:12px 15px;border-radius:15px 15px 4px 15px;line-height:1.5;text-align:left;white-space:normal;box-shadow:0 4px 20px #0002;background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.beosha-invite[hidden]{display:none!important}
.beosha-tour-label{grid-column:1/-1;font-size:11px;font-weight:500;color:var(--ink-soft);padding-top:5px}
/* Keep the owner documentation entry reachable on a narrow workspace. */
@media(max-width:600px){
 .topbar{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:8px;position:sticky;top:0;z-index:20;background:var(--bg,var(--surface));padding:10px 12px}
 .topbar .page-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .topbar-tools{grid-column:3;grid-row:1;margin-left:0;gap:5px}
 .topbar-right{grid-column:1/-1;grid-row:2;margin-left:0;min-width:0}
 .topbar .documentation-entry{font-size:12px;padding:0 8px}
}
/* The guide owns a separate workspace area: it never floats over a form. */
html.beosha-tour-side .main{margin-right:380px}
html.beosha-tour-side #modal-root .modal-scrim{right:380px}
html.beosha-tour-bottom .main{padding-bottom:var(--beosha-tour-reserve,220px)}
html.beosha-tour-bottom #modal-root .modal-scrim{top:var(--beosha-tour-top,0px);bottom:auto;height:var(--beosha-tour-space,60dvh);box-sizing:border-box;padding:10px}
html.beosha-tour-bottom #modal-root .modal{max-height:calc(var(--beosha-tour-space,60dvh) - 20px)}
.beosha-tour-bubble{display:flex;flex-direction:column;overflow:hidden}
.beosha-tour-scene{min-height:0;overflow:auto;overscroll-behavior:contain}
.beosha-tour-actions{flex:none}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-scene{grid-template-columns:54px minmax(0,1fr);gap:10px;align-items:start}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-mascot{width:54px;height:90px}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-sprite{width:270px!important;height:90px!important}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-fallback{width:54px;height:90px}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-text{font-size:12px;line-height:1.5;margin:5px 0 0}
.beosha-tour-bubble[data-layout=bottom]{padding:11px 12px}
.beosha-tour-arrow path{stroke-dasharray:none;animation:beosha-pointer 1.5s ease-in-out infinite;stroke-width:2}
@keyframes beosha-pointer{50%{opacity:.55}}
html.beosha-tour-side #modal-root .modal-scrim{top:var(--beosha-tour-top,0px);bottom:auto;height:var(--beosha-tour-space,100dvh);box-sizing:border-box}
html.beosha-tour-side #modal-root .modal{max-height:calc(var(--beosha-tour-space,100dvh) - 24px)}
html.beosha-tour-keyboard #modal-root .modal-h{padding:8px 12px;font-size:14px}
html.beosha-tour-keyboard #modal-root .modal-f{padding:6px 12px}
html.beosha-tour-keyboard #modal-root .modal-b{padding:8px 12px}
html.beosha-tour-side .beosha-float,html.beosha-tour-bottom .beosha-float{visibility:hidden}
/* Desktop guide floats over the unchanged workspace; mobile keeps its bottom area. */
html.beosha-tour-floating .beosha-float{visibility:hidden}
.beosha-tour-bubble[data-layout=floating] .beosha-tour-scene{grid-template-columns:64px minmax(0,1fr);gap:10px}
.beosha-tour-bubble[data-layout=floating] .beosha-tour-mascot{width:64px;height:107px}
.beosha-tour-bubble[data-layout=floating] .beosha-tour-sprite{width:320px!important;height:107px!important}
.beosha-tour-bubble[data-layout=floating] .beosha-tour-fallback{width:64px;height:107px}
.beosha-tour-arrow path{animation:none;opacity:1;stroke-linejoin:round;stroke-linecap:round}
.beosha-tour-arrow path.beosha-arrow-halo{stroke:var(--surface);stroke-width:9;filter:drop-shadow(0 1px 2px #0008)}
.beosha-tour-arrow path.beosha-arrow-line{stroke:var(--accent);stroke-width:4}

/* Excursions are a primary way to get help, above ordinary article topics. */
.beosha-tour-hub{min-width:0;margin:12px 0 16px;padding:12px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:14px;background:linear-gradient(145deg,var(--surface),var(--accent-soft,var(--surface-2)))}
.beosha-tour-kicker{display:block;color:var(--ink-soft);font-size:10px;line-height:1.4;margin-bottom:4px}
.beosha-tour-hub h3{margin:0 0 6px;font-size:16px;line-height:1.3;color:var(--ink)}
.beosha-tour-hub>p{margin:0 0 10px;font-size:12px;line-height:1.5;color:var(--ink-soft)}
.beosha-float button.beosha-tour-featured{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);gap:3px 9px;width:100%;padding:11px;text-align:left;background:var(--accent);color:var(--on-accent,var(--ink));border:1px solid var(--accent);border-radius:10px;min-height:58px}
.beosha-tour-featured>strong{font-size:13px;line-height:1.4;font-weight:600}
.beosha-tour-play{grid-row:1/3;align-self:center;display:grid;place-items:center;width:28px;height:28px;border:1px solid currentColor;border-radius:50%;font-size:10px;padding-left:1px;box-sizing:border-box}
.beosha-tour-cta{font-size:11px;line-height:1.4}
.beosha-float button.beosha-tour-featured:hover{background:var(--accent-hover,var(--accent));border-color:var(--accent-hover,var(--accent))}
.beosha-tour-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:9px}
.beosha-float .beosha-tour-choices button{grid-column:auto;min-width:0;min-height:44px;padding:8px 9px;border-radius:9px;text-align:left;line-height:1.4;font-size:11px;font-weight:500;border-color:var(--line);background:var(--surface);color:var(--ink)}
.beosha-tour-choices strong{font:inherit}.beosha-float .beosha-tour-choices button:hover{border-color:var(--accent);background:var(--accent-soft,var(--surface-2))}
.beosha-search-topics{font-size:11px!important;color:var(--ink-soft);margin:0 0 8px!important}

/* Matched documentation navigation in parser and dashboard. */
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar){font-family:'Golos Text',sans-serif;font-size:13px;line-height:1.35;padding:14px;box-sizing:border-box}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) label{font-size:12px;line-height:1.35;font-weight:600;margin:0 0 6px}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) input[type=search]{appearance:none;box-sizing:border-box;height:36px;min-height:36px;width:100%;min-width:0;margin:0;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font-family:inherit;font-size:13px;line-height:1.35}
:is(.parser-guide,#s-documentation) :is(.pg-muted,#docsSearchStatus)[role=status]{margin:6px 0 10px;font-size:11px;line-height:1.35;color:var(--ink-soft)}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav>details{margin:4px 0}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav>details>summary{box-sizing:border-box;min-height:28px;padding:4px 6px;font-size:13px;line-height:1.35;font-weight:600;list-style-position:inside;border-radius:6px}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav>details>summary:hover{background:light-dark(#eef2f7,#2c3038)}
:is(.parser-guide,#s-documentation) :is(.pg-tree-articles,.docs-tree-articles){margin:2px 0 5px 11px;padding:1px 0 1px 9px;border-inline-start:1px solid light-dark(#d6deea,#4c5563)}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav a{box-sizing:border-box;display:block;min-height:32px;margin:1px 0;padding:5px 8px;border:1px solid transparent;border-radius:7px;font-size:13px;line-height:1.35;font-weight:400;text-decoration:none;color:var(--ink-soft);box-shadow:none}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav a:hover{background:light-dark(#eef2f7,#2c3038);border-color:light-dark(#d5deea,#4c5563);color:var(--ink)}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav a[aria-current]{background:light-dark(#e3ecf9,#293b51);border-color:light-dark(#afc3e0,#607f9f);box-shadow:inset 3px 0 light-dark(#537eb5,#9fc4f0);font-weight:600;color:var(--ink)}
:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav a[aria-current]:hover{background:light-dark(#d6e4f7,#334b68)}
:is(.parser-guide,#s-documentation) :is(.pg-audience,.docs-audience){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;box-sizing:border-box;padding:3px;margin:0 0 12px;border:1px solid var(--line);border-radius:9px;background:light-dark(#f3f5f8,#242932)}
:is(.parser-guide,#s-documentation) :is(.pg-audience,.docs-audience) button{appearance:none;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;height:34px;min-height:34px;margin:0;padding:5px 6px;border:1px solid transparent;border-radius:6px;font-family:inherit;font-size:12px;line-height:1.3;font-weight:500;color:var(--ink-soft);background:transparent;white-space:normal;cursor:pointer}
:is(.parser-guide,#s-documentation) :is(.pg-audience,.docs-audience) button[aria-selected=true]{color:var(--ink);background:light-dark(#e3ecf9,#293b51);border-color:light-dark(#afc3e0,#607f9f);font-weight:600}
:is(.parser-guide,#s-documentation) :is(.pg-audience,.docs-audience) button:hover{background:light-dark(#e8edf5,#303b4b)}
:is(.parser-guide-embed,.guide-embed) :is(.pg-sidebar,.docs-sidebar){padding:10px 12px}
@media(pointer:coarse){:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav a,:is(.parser-guide,#s-documentation) :is(.pg-sidebar,.docs-sidebar) nav>details>summary,:is(.parser-guide,#s-documentation) :is(.pg-audience,.docs-audience) button{min-height:44px}}

/* A quiet cue appears only when the current step allows continuing. */
.beosha-tour-actions .beosha-tour-next{display:inline-flex;align-items:center;justify-content:center;gap:5px}
.beosha-tour-next-cue{display:inline-block;width:14px;font-size:17px;font-weight:500;line-height:1;visibility:hidden}
.beosha-tour-next:not(:disabled) .beosha-tour-next-cue{visibility:visible;animation:beosha-ready-nudge 1.15s ease-in-out 2}
@keyframes beosha-ready-nudge{0%,100%{transform:translateX(-2px)}50%{transform:translateX(1px)}}
@media(prefers-reduced-motion:reduce){.beosha-tour-next:not(:disabled) .beosha-tour-next-cue{animation:none}}

/* Frame offsets are relative to the mascot viewport, never the wide image transform box. */
.beosha-tour-bubble .beosha-tour-mascot>.beosha-tour-sprite{position:absolute;top:0;left:0;width:500%!important;height:100%!important;max-width:none!important;object-fit:fill;transform:none!important;margin:0}

/* A little more character, while keeping the reading surface and controls crisp. */
.beosha-tour-bubble{background:var(--surface)}
.beosha-tour-bubble[data-layout=floating] .beosha-tour-scene{grid-template-columns:76px minmax(0,1fr)}
.beosha-tour-bubble[data-layout=floating] .beosha-tour-mascot,.beosha-tour-bubble[data-layout=floating] .beosha-tour-fallback{width:76px;height:127px}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-scene{grid-template-columns:62px minmax(0,1fr)}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-mascot,.beosha-tour-bubble[data-layout=bottom] .beosha-tour-fallback{width:62px;height:103px}

/* Keep the guide readable over loaded tables and narrow modal margins. */
.beosha-tour-bubble{background:var(--surface)}
.beosha-tour-identity{cursor:grab;touch-action:none;user-select:none;min-height:32px;border-radius:6px}
.beosha-tour-identity.is-dragging{cursor:grabbing}
.beosha-tour-identity:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.beosha-tour-identity::before{content:'⠿';color:var(--ink-soft);font-size:16px}
.beosha-tour-speech{min-width:0}
.beosha-tour-actions{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center}
.beosha-tour-actions button{min-width:0;white-space:nowrap;font-size:12px;padding:7px 9px}
.beosha-tour-actions button:nth-child(2){margin-left:0}

/* Chat actions share one aligned header row, including narrow screens. */
.beosha-heading{grid-template-columns:minmax(0,1fr) auto}
.beosha-heading-actions{display:flex;align-items:center;gap:4px}
.beosha-float .beosha-heading .beosha-clear-chat{display:grid;place-items:center;width:32px;height:32px;min-height:32px;padding:0;border-color:transparent;background:transparent}
.beosha-clear-chat svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.beosha-float .beosha-heading .beosha-clear-chat:hover{background:var(--surface-2,var(--accent-soft))}
@media(pointer:coarse){.beosha-float .beosha-heading .beosha-clear-chat{width:44px;height:44px}}

.beosha-answer{padding-left:22px;margin:8px 0 12px;line-height:1.6}.beosha-answer li+li{margin-top:7px}.beosha-match-reason{font-size:12px;color:var(--ink-soft);margin:7px 0}.beosha-clarification{margin-top:10px}.beosha-float .beosha-inline-tour{border-color:var(--accent);color:var(--accent);margin:5px 0}

/* Opaque welcome card: a quiet branded frame without movement or text overlays. */
.beosha-float .beosha-invite,.beosha-welcome>p:first-of-type{border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line));border-radius:16px;background:linear-gradient(135deg,color-mix(in srgb,var(--surface) 92%,var(--accent)),var(--surface) 80%);box-shadow:0 5px 18px #0000000d;color:var(--ink);padding:13px 15px;line-height:1.6;text-align:left}
.beosha-float .beosha-invite{max-width:280px;position:relative}
.beosha-float .beosha-invite::after{content:'';position:absolute;right:23px;bottom:-5px;width:8px;height:8px;background:var(--surface);border-right:1px solid color-mix(in srgb,var(--accent) 35%,var(--line));border-bottom:1px solid color-mix(in srgb,var(--accent) 35%,var(--line));transform:rotate(45deg)}
.beosha-welcome>p:first-of-type{margin:4px 0 14px;border-left:3px solid var(--accent)}

.beosha-tour-previews{display:grid;gap:7px}.beosha-tour-previews[hidden]{display:none!important}.beosha-tour-previews>.beosha-tour-start:not(.beosha-tour-featured){text-align:left}
.beosha-tour-all{margin-top:10px;border-top:1px solid var(--line);padding-top:5px}.beosha-tour-all>summary{padding:9px 2px;cursor:pointer;color:var(--accent);font-weight:600}.beosha-tour-all>summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.beosha-tour-all>input{box-sizing:border-box;width:100%;min-width:0;margin:5px 0;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);font:inherit}
.beosha-tour-paging{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:10px;font-size:11px}.beosha-tour-paging[hidden]{display:none!important}.beosha-tour-empty{grid-column:1/-1;margin:4px 0;font-size:12px;line-height:1.5}

.beosha-result-options{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}.beosha-result-options .beosha-inline-tour{margin:0}.beosha-read-guide{font-size:12px;text-decoration:underline;text-underline-offset:3px;color:var(--accent);padding:8px 0}.beosha-read-guide:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

/* Compact dock controls stay independent of the workspace header height. */
.beoma-guide-bar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;min-height:56px;box-sizing:border-box;padding:10px 12px}.beoma-guide-bar strong{min-width:0;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.beoma-guide-bar a,.beoma-guide-bar button{min-height:34px;box-sizing:border-box;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
@media(pointer:coarse){.beoma-guide-bar a,.beoma-guide-bar button{min-height:44px}}

/* Image viewing uses the full window, while reading retains the saved dock width. */
.beoma-guide-dock.beoma-guide-image-expanded{width:100vw;max-width:none}.beoma-guide-image-expanded .beoma-guide-bar,.beoma-guide-image-expanded .beoma-guide-resizer{display:none}
:is(.pg-image-dialog,#docsImageDialog,.beosha-image-dialog){width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto;padding:12px}
:is(.pg-image-viewport,.docs-image-viewport,.beosha-image-scroll){max-height:calc(100dvh - 170px)}
:is(.pg-shot,.docs-shot) img{height:auto;max-height:none;object-fit:contain}
:is(.pg-step,.docs-step) figure{margin:14px -12px}
:is(.parser-guide-embed,.guide-embed) :is(.pg-step,.docs-step) figure{margin:12px -8px}

/* Approved garment sprites: a larger upper-body portrait and readable tour character. */
.beosha-float .beosha-launch{width:90px;height:90px;padding:5px}.beosha-launch .beosha-symbol{width:78px;height:78px}.beosha-avatar{width:64px;height:64px}
.beosha-wardrobe{position:relative;overflow:hidden}.beosha-wardrobe img{position:absolute;left:0;top:0;width:500%!important;max-width:none!important;height:auto!important;object-fit:fill}
.beosha-tour-bubble[data-layout=floating] .beosha-tour-scene{grid-template-columns:110px minmax(0,1fr)}.beosha-tour-bubble[data-layout=floating] :is(.beosha-tour-mascot,.beosha-tour-fallback){width:110px;height:183.333px}
.beosha-tour-bubble[data-layout=bottom] .beosha-tour-scene{grid-template-columns:80px minmax(0,1fr)}.beosha-tour-bubble[data-layout=bottom] :is(.beosha-tour-mascot,.beosha-tour-fallback){width:80px;height:133.333px}
.beosha-float .beosha-invite::after{right:39px}
@media(max-width:767px){.beosha-float .beosha-launch{width:80px;height:80px}.beosha-launch .beosha-symbol{width:68px;height:68px}.beosha-tour-bubble[data-layout=floating] .beosha-tour-scene{grid-template-columns:90px minmax(0,1fr)}.beosha-tour-bubble[data-layout=floating] :is(.beosha-tour-mascot,.beosha-tour-fallback){width:90px;height:150px}.beosha-float .beosha-invite::after{right:34px}}
@media(max-height:520px){.beosha-tour-bubble[data-layout=floating] .beosha-tour-scene{grid-template-columns:76px minmax(0,1fr)}.beosha-tour-bubble[data-layout=floating] :is(.beosha-tour-mascot,.beosha-tour-fallback){width:76px;height:126.667px}}
@media(max-height:520px){.beosha-avatar{width:48px;height:48px}.beosha-tour-bubble[data-layout=bottom] .beosha-tour-scene{grid-template-columns:62px minmax(0,1fr)}.beosha-tour-bubble[data-layout=bottom] :is(.beosha-tour-mascot,.beosha-tour-fallback){width:62px;height:103.333px}}

/* Product lifecycle: compact dependency summary, including narrow dialogs. */
.product-removal-dependencies{margin:0;display:grid;gap:5px;font-size:13px}
.product-removal-dependencies>div{display:flex;gap:12px;justify-content:space-between;border-bottom:1px solid var(--line);padding:4px 0}
.product-removal-dependencies dt{min-width:0;overflow-wrap:anywhere}.product-removal-dependencies dd{margin:0;flex:none;font-variant-numeric:tabular-nums}

/* Destructive confirmation stays above the floating chat; active tours retain their own layer. */
#modal-root:has(.product-lifecycle-modal) .modal-scrim{z-index:1200}
