/* AM production admin panel. Light/dark follow the system setting.
   Design 2 (user, 20.11.2026 — «инновационно и дорого, но не режет глаза»): porcelain light / deep-space dark, soft white
   cards with hairlines and layered shadows, one calm indigo accent for actions, the brand amber for small marks only,
   Apple system faces (SF Pro for UI and numbers, New York for display titles; the panel's CSP allows no web fonts).
   The look before it: tools/backup/admin.css.before-redesign-2026-11-20.
   Platform colours are checked for colour blindness (dataviz validator, all pairs, both modes; Telegram berry added 16.11.2026). */
:root {
  color-scheme: light;
  --page: #f2f3f7;
  --glow-1: rgba(110, 96, 255, 0.10);   /* indigo aurora, top left */
  --glow-2: rgba(245, 183, 0, 0.07);    /* brand amber, top right */
  --surface: #fdfdfe;
  --surface-2: #ffffff;                 /* raised: the selected segment of a switcher, menus */
  --track: #e8eaf1;                     /* the groove of segmented switchers */
  --field: #f5f6fa;
  --ink: #111626;
  --ink-2: #3a4155;
  --muted: #646b7e;
  --axis: #868d9f;
  --grid: #eaecf2;
  --baseline: #d0d4df;
  --border: rgba(17, 22, 38, 0.08);
  --border-strong: rgba(17, 22, 38, 0.16);
  --wash: rgba(17, 22, 38, 0.04);
  --shadow: 0 1px 1px rgba(17, 22, 38, 0.03), 0 2px 6px rgba(17, 22, 38, 0.04), 0 14px 34px -12px rgba(17, 22, 38, 0.10);
  --shadow-lift: 0 1px 1px rgba(17, 22, 38, 0.04), 0 6px 14px rgba(17, 22, 38, 0.06), 0 22px 44px -16px rgba(17, 22, 38, 0.16);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --accent: #4f46e5;
  --accent-2: #6d5efc;                  /* the lighter end of the accent gradient */
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.09);
  --link: #4338ca;
  --gold: #b07d12;                      /* brand amber, readable on light */
  --youtube: #cf563c;
  --instagram: #ad72d6;
  --tiktok: #1e957a;
  --facebook: #2a54b0;
  --telegram: #8f0d6a;
  --threads: #784000;
  --bar: #6b63f0;
  --good-text: #1f7a43;
  --bad-text: #b42f2a;
  --good: #2f9a5c;
  --warning: #d49a1e;
  --critical: #d0453e;
  --on-status: #ffffff;
  --stars: 0;
  --radius: 16px;
  --radius-sm: 10px;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, sans-serif;
  --display: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #090b11;
    --glow-1: rgba(110, 96, 255, 0.17);
    --glow-2: rgba(245, 183, 0, 0.05);
    --surface: #11141d;
    --surface-2: #1a1e2a;
    --track: #0b0e15;
    --field: #0d1018;
    --ink: #eceef5;
    --ink-2: #c2c6d3;
    --muted: #8e95a8;
    --axis: #767e92;
    --grid: #1d2130;
    --baseline: #2e3446;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --wash: rgba(255, 255, 255, 0.045);
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 16px 36px -14px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 1px 1px rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.75);
    --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    --accent: #8a83ff;
    --accent-2: #a79fff;
    --accent-ink: #100e2c;
    --accent-soft: rgba(138, 131, 255, 0.14);
    --link: #aaa4ff;
    --gold: #f5b700;
    --youtube: #e06a50;
    --instagram: #b276d6;
    --tiktok: #2ea58c;
    --facebook: #3263c8;
    --telegram: #a33585;
    --threads: #8f5a10;
    --bar: #8a83ff;
    --good-text: #84d29f;
    --bad-text: #f38b86;
    --good: #4fae74;
    --warning: #e0b04a;
    --critical: #e06464;
    --on-status: #090b11;
    --stars: 0.35;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--page);
  background-image:
    radial-gradient(900px 520px at 6% -10%, var(--glow-1), transparent 65%),
    radial-gradient(820px 520px at 100% -6%, var(--glow-2), transparent 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--stars);
  background-image:
    radial-gradient(1px 1px at 23px 41px, rgba(236, 230, 218, 0.55), transparent 60%),
    radial-gradient(1px 1px at 131px 87px, rgba(236, 230, 218, 0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 197px 19px, rgba(221, 184, 115, 0.55), transparent 60%),
    radial-gradient(1px 1px at 71px 163px, rgba(236, 230, 218, 0.30), transparent 60%),
    radial-gradient(1px 1px at 251px 211px, rgba(236, 230, 218, 0.45), transparent 60%),
    radial-gradient(1px 1px at 163px 257px, rgba(236, 230, 218, 0.25), transparent 60%);
  background-size: 280px 280px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
}
h1 { font-family: var(--serif); font-size: 1.6rem; margin: 0; font-weight: 500; letter-spacing: 0.005em; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 650; }
.h3 { font-size: 0.92rem; margin: 22px 0 8px; font-weight: 600; color: var(--ink-2); }
.muted { color: var(--muted); margin: 2px 0 0; font-size: 0.88rem; }
.sub { color: var(--muted); margin: 2px 0 14px; font-size: 0.88rem; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

.top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 22px 16px 6px;
}
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-actions form { margin: 0; }
.top-actions a.btn { text-decoration: none; display: inline-block; }
.top-actions a.btn[aria-current="page"] { background: var(--wash); color: var(--ink); }

/* Header menu: "☰" in the top-right corner, the panel buttons drop down under it (menu.js closes it on outside click / Esc) */
.top { position: relative; }
.top > div:first-child { padding-right: 52px; }
.menu { position: absolute; top: 22px; right: 16px; z-index: 50; }
summary.menu-toggle {
  list-style: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border), var(--shadow);
}
.menu-toggle::-webkit-details-marker { display: none; }
.menu-toggle::marker { content: ""; }
summary.menu-toggle:hover { filter: none; background: var(--wash); }
.menu[open] > summary.menu-toggle { background: var(--wash); }
.menu-toggle svg { width: 20px; height: 20px; display: block; }
.menu-toggle .i-close, .menu[open] .i-open { display: none; }
.menu[open] .i-close { display: block; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: max-content; min-width: 250px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border), var(--shadow);
}
.menu-panel .btn, .menu-panel button.btn { display: block; width: 100%; text-align: left; padding: 10px 12px; }
.menu-panel .btn.btn-ghost { box-shadow: none; }
.menu-panel a.btn { text-decoration: none; }
.menu-panel a.btn[aria-current="page"] { background: var(--wash); color: var(--ink); }
.menu-panel #refresh { text-align: center; margin-bottom: 4px; }
.menu-panel form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }

.btn {
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 8px 14px;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.6; cursor: progress; filter: none; }
.btn-ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--border); }
.btn-ghost:hover { background: var(--wash); }

.app { max-width: 1180px; margin: 0 auto; padding: 8px 16px 48px; }
.app.loading .card, .app.loading .tiles { opacity: 0.55; transition: opacity 0.15s; }

.filters { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border); margin: 8px 0 16px; background: var(--surface); }
.updated { margin: -8px 0 16px; }   /* «Последний сбор» — под переключателем периодов */
.seg { font: inherit; font-size: 0.88rem; border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg:hover { background: var(--wash); }
.seg[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 420px) { .tile { padding: 12px; } .tile-value { font-size: 1.55rem; } }
.tile { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--border), var(--shadow); padding: 14px 16px; min-width: 0; }
.tile-label { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; color: var(--ink-2); }
.tile-value { font-size: 1.9rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 6px; }
.tile-value.empty { color: var(--muted); font-weight: 500; font-size: 1.3rem; }
.tile-delta { font-size: 0.84rem; color: var(--muted); margin-top: 2px; }
.tile-delta .up { color: var(--good-text); font-weight: 600; }
.tile-delta .down { color: var(--bad-text); font-weight: 600; }
.tile-note { font-size: 0.76rem; color: var(--muted); margin-top: 6px; }
.tile-eng { font-size: 0.82rem; color: var(--ink-2); margin-top: 8px; }
.tile-eng strong { color: var(--ink); }
.tile-eng .eng-open, .tile-eng .eng-open strong { color: var(--bad-text); font-weight: 600; }
.tile-eng .eng-done { color: var(--muted); }
/* Tiles in one row share the lines: label, number, change, note — so numbers line up even when a label wraps to 2 lines */
@supports (grid-template-rows: subgrid) {
  .tiles { row-gap: 0; margin-bottom: 4px; }
  .tile { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; margin-bottom: 12px; }
  .tile > * { align-self: start; }
  .tile-label { align-self: start; }
  .tile-note { grid-row: 4; }
}

.key-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.key-line { width: 14px; height: 2px; border-radius: 2px; flex: none; }
/* Brand logos next to platform names; TikTok follows the text colour so it works in dark mode */
.logo { width: 15px; height: 15px; flex: none; fill: currentColor; }
h2 .logo { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.logo-youtube { fill: #ff0000; }
.logo-instagram { fill: #e4405f; }
.logo-facebook { fill: #0866ff; }
.logo-telegram { fill: #26a5e4; }
.logo-tiktok { fill: var(--ink); }
.logo-threads { fill: var(--ink); }
.logo-metrika { fill: #fc3f1d; }
.logo-sheet { fill: #0f9d58; }
.c-youtube { background: var(--youtube); }
.c-instagram { background: var(--instagram); }
.c-tiktok { background: var(--tiktok); }
.c-facebook { background: var(--facebook); }
.c-telegram { background: var(--telegram); }
.c-threads { background: var(--threads); }

.card { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--border), var(--shadow); padding: 18px 18px 14px; margin-bottom: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card { margin-bottom: 16px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; gap: 0; } }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.chart { position: relative; width: 100%; min-height: 40px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--baseline); stroke-width: 1; }
.chart text { fill: var(--axis); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart text.x-date { font-size: 10px; }
.chart .end-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.s-youtube { stroke: var(--youtube); }
.s-instagram { stroke: var(--instagram); }
.s-tiktok { stroke: var(--tiktok); }
.s-facebook { stroke: var(--facebook); }
.s-telegram { stroke: var(--telegram); }
.s-threads { stroke: var(--threads); }
.f-youtube { fill: var(--youtube); }
.f-instagram { fill: var(--instagram); }
.f-tiktok { fill: var(--tiktok); }
.f-facebook { fill: var(--facebook); }
.f-telegram { fill: var(--telegram); }
.f-threads { fill: var(--threads); }
.chart .bar { fill: var(--bar); }
.chart .bar.hover { opacity: 0.75; }
.chart .stack.hover { opacity: 0.75; }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.empty-state { color: var(--muted); font-size: 0.9rem; padding: 26px 0; text-align: center; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 120px;
  background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 0 0 1px var(--border), var(--shadow); font-size: 0.82rem;
}
.tip-date { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tip-row strong { font-variant-numeric: tabular-nums; }
.tip-row .tip-name { color: var(--ink-2); }

.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px; align-items: center; font-size: 0.88rem; }
.hbar-name { color: var(--ink-2); overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 6px; }
.hbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar-fill { height: 14px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--bar); flex: none; }
.hbar-val { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.hbar-val small { color: var(--muted); font-weight: 400; margin-left: 4px; }

details { margin-top: 8px; }
summary { cursor: pointer; color: var(--ink-2); font-size: 0.86rem; }
/* post page: notes about edits already made — folded, open on a click */
.post-edits { margin: 10px 0; border-left: 2px solid var(--grid); padding-left: 10px; }
.post-edits > summary { font-size: 0.84rem; }
.post-edits[open] > summary { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem; margin-top: 8px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.title { min-width: 220px; }

/* Post tables (YouTube, Instagram, TikTok, Facebook): same column widths so numbers line up */
table.posts { table-layout: fixed; min-width: 620px; }
table.posts th:nth-child(2) { width: 120px; }
table.posts th:nth-child(n+3) { width: 110px; }
table.posts td.title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Video factory */
table.factory td { white-space: nowrap; }
.fv-name { display: grid; min-width: 200px; white-space: normal; }
.fv-name small { color: var(--muted); font-size: 0.76rem; }
.fv-name small:empty { display: none; }
.fv-name .dl { color: var(--muted); }
.stage { display: inline-block; font-size: 0.76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--grid); color: var(--ink-2); }
.stage-assembled { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good-text); }
.stage-published { background: var(--good); color: var(--on-status); }
.pub { display: inline-flex; gap: 10px; }
.pub a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; }
.pub a:hover { text-decoration: underline; }

.runs { display: grid; gap: 10px; }
.run { display: grid; grid-template-columns: 20px 180px 1fr auto; gap: 8px; align-items: start; font-size: 0.88rem; }
.run-btn { margin: -3px 0 0; white-space: nowrap; }
.run-msg small.run-saved { color: var(--good-text); }
.run-icon { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--on-status); margin-top: 2px; }
.run-icon.ok { background: var(--good); }
.run-icon.fail { background: var(--critical); }
.run-icon.off { background: var(--axis); }
.run-name { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.run-msg { color: var(--ink-2); overflow-wrap: anywhere; }
.run-msg small { color: var(--muted); display: block; }
.connect { margin: 16px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.88rem; }
.connect .btn { text-decoration: none; }
/* Connect form under a source row (admin.js accFormEl) */
.acc-form { display: grid; gap: 12px; margin: 2px 0 8px 28px; padding: 14px 16px; border-radius: 10px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); font-size: 0.88rem; }
.acc-own { display: grid; gap: 12px; }
.acc-own[hidden] { display: none; }
.acc-field { display: grid; gap: 4px; max-width: 640px; }
.acc-field input[type="text"], .acc-field input[type="password"] {
  width: 100%; font: inherit; font-size: 0.92rem; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--field); color: var(--ink);
}
.acc-field .muted { font-size: 0.8rem; }
.acc-check { grid-template-columns: auto 1fr; align-items: start; gap: 8px; }
.acc-check input { margin-top: 3px; }
.acc-note { margin: 0; font-size: 0.8rem; max-width: 640px; }
.acc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-actions .btn-sm { margin-left: 0; }
.acc-status { font-size: 0.85rem; color: var(--ink-2); }
.acc-status.bad { color: var(--bad-text); }
@media (max-width: 560px) {
  .run { grid-template-columns: 20px 1fr; } .run-msg, .run-btn { grid-column: 2; } .run-btn { justify-self: start; margin-top: 0; }
  .acc-form { margin-left: 0; }
}

/* Login page */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 340px; background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--border), var(--shadow); padding: 26px 22px; }
.login h1 { margin-bottom: 18px; }
.login form { display: grid; gap: 10px; }
.login label { font-size: 0.88rem; color: var(--ink-2); }
.login input { font: inherit; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--field); color: var(--ink); }
.login button { font: inherit; font-weight: 600; padding: 10px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.login-error { color: var(--bad-text); margin: 0; font-size: 0.88rem; }

/* ---------- navigation between panel pages ---------- */
.nav { display: flex; gap: 4px; margin-top: 8px; }
.nav a { font-size: 0.9rem; color: var(--ink-2); text-decoration: none; padding: 4px 10px; border-radius: 7px; }
.nav a:hover { background: var(--wash); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- documents page ---------- */
.docs-app { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-list { position: sticky; top: 12px; }
.doc-group { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 4px 0 6px; font-weight: 600; }
.doc-group ~ .doc-group { margin-top: 16px; }
.doc-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.doc-links a { display: block; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 6px 8px 0; border-radius: 7px 7px 0 0; }
.doc-links small { display: block; color: var(--muted); font-size: 0.75rem; padding: 0 8px 6px; }
.doc-links li { border-radius: 7px; }
.doc-links li:hover { background: var(--wash); }
.doc-links li:has(a[aria-current]) { background: var(--wash); box-shadow: inset 3px 0 0 var(--accent); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.doc-head > div:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.doc-head .doc-actions { flex: 0 0 auto; }
@media (max-width: 560px) { .doc-head { flex-wrap: wrap; } }
.doc-head h2 { font-size: 1.25rem; }
.doc-actions { display: flex; gap: 8px; }
.btn-sm { font-size: 0.8rem; padding: 5px 10px; margin-left: 6px; }
.doc-notice { border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 0.9rem; background: var(--wash); }
.doc-notice.ok { box-shadow: inset 3px 0 0 var(--good); }
.doc-notice.bad { box-shadow: inset 3px 0 0 var(--bad-text); }
.doc-notice.info { box-shadow: inset 3px 0 0 var(--accent); }

.toc { margin: 0 0 14px; font-size: 0.9rem; }
.toc summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2 260px; }
.toc li { break-inside: avoid; margin: 2px 0; }
.toc .toc-sub { list-style: none; margin-left: 14px; font-size: 0.85rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--link); text-decoration: underline; }

.md { font-size: 0.95rem; line-height: 1.6; max-width: 900px; overflow-wrap: anywhere; }
.md h1 { font-size: 1.5rem; margin: 6px 0 12px; }
.md h2 { font-size: 1.2rem; margin: 30px 0 10px; padding-top: 14px; border-top: 1px solid var(--grid); }
.md h3 { font-size: 1.02rem; margin: 22px 0 8px; }
.md h4, .md h5, .md h6 { font-size: 0.95rem; margin: 16px 0 6px; }
.md h1, .md h2, .md h3 { scroll-margin-top: 12px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md li > ul, .md li > ol { margin: 4px 0; }
.md hr { border: 0; border-top: 1px solid var(--grid); margin: 22px 0; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--wash); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--wash); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 0 0 12px; }
.md pre code { background: none; padding: 0; font-size: 0.82rem; white-space: pre-wrap; }
.md blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--border); color: var(--ink-2); }
.md-table { overflow-x: auto; margin: 0 0 14px; }
.md table { font-size: 0.86rem; margin: 0; width: auto; min-width: 50%; }
.md th, .md td { overflow-wrap: normal; min-width: 70px; }
.md th.c-num, .md td.c-num { min-width: 0; width: 40px; white-space: nowrap; }
/* Script table: «Мимика» narrow, «Реплика» takes the freed space (просьба пользователя 07.11.2026) */
.md table.script { width: 100%; min-width: 720px; table-layout: fixed; }
.md table.script th, .md table.script td { width: 84px; }
.md table.script .c-num { width: 40px; }
.md table.script .c-len { width: 58px; white-space: nowrap; }
.md table.script .c-act { width: 20%; }
.md table.script .c-line { width: auto; }
.md table.script .c-about { width: 22%; }
.md table.script .c-over { width: 19%; }
.md table.script:has(.c-over) { min-width: 980px; }
.md table.script:has(.c-about) .c-act { width: 11%; }
.script-foot { margin-top: 12px; }
/* desktop: «Спросить ИИ» sits in the bottom right corner of its block (user, 11.11.2026) */
@media (min-width: 761px) { .script-foot { justify-content: flex-end; } }
#pack-card .script-foot { margin-top: 10px; }
.script-foot:has(> [hidden]:only-child) { display: none; }
.post-facts .post-models { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
/* «Спросить ИИ» in the script card (post.js → renderAsk) */
.script-ai:not(:empty) { margin: 6px 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--wash); }
.script-ai .gen-answer { margin-bottom: 8px; }
.script-ai .editor-actions { flex-wrap: wrap; }
.script-ai .ask-quote { margin: 0 0 8px; font-size: 0.9rem; overflow-wrap: anywhere; }
.script-ai .ask-note { margin: 8px 0 0; font-size: 0.84rem; }
.script-ai .gen-log { background: none; padding: 0; }

.editor textarea {
  display: block; width: 100%; box-sizing: border-box; min-height: 65vh; margin: 10px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; line-height: 1.55;
  color: var(--ink); background: var(--field); border: 1px solid var(--border); border-radius: 8px; padding: 12px; resize: vertical;
}
.editor code { font-size: 0.82rem; background: var(--wash); padding: 1px 4px; border-radius: 4px; }
.editor-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.history-table td:last-child { text-align: right; }

@media (max-width: 820px) {
  .docs-app { grid-template-columns: 1fr; }
  .doc-list { position: static; }
}

/* photos, voice and video inside documents */
.gallery { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 16px; align-items: flex-start; }
.gallery figure { margin: 0; max-width: 100%; }
.gallery img { display: block; height: 340px; width: auto; max-width: 100%; object-fit: contain; border-radius: 8px; background: var(--wash); }
.gallery-1 figure { width: 100%; }
.gallery-1 img { width: 100%; height: auto; }
.gallery video { display: block; height: 420px; max-width: 100%; border-radius: 8px; background: #000; }
.gallery audio { display: block; width: 360px; max-width: 100%; }
.gallery figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 6px; max-width: 260px; }
.gallery .media-dl { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
@media (max-width: 560px) { .gallery img { height: 220px; } .gallery video { height: 320px; } }

/* publication packages */
.fv-pack { font-size: 0.8rem; font-weight: 600; text-decoration: none; margin-top: 2px; }
.fv-pack:hover { text-decoration: underline; }
.md pre { position: relative; }
.md pre .copy { position: absolute; top: 8px; right: 8px; margin: 0; background: var(--surface); }
.md pre code { display: block; padding-right: 96px; }

/* "Анализ рынка" page: same layout as documents, one hint line under the menu */
/* Подсказка под шапкой — отдельной строкой на всю ширину */
.market-hint { flex: 1 0 100%; margin: -4px 0 0; font-size: 0.85rem; }

/* ---------- schedule page ---------- */
.tg p { margin: 8px 0 0; }
.tg-list { display: grid; gap: 0; }
.tg-item { padding: 14px 0; }
.tg-item + .tg-item { border-top: 1px solid var(--border); }
.tg-item:last-child { padding-bottom: 0; }
.tg-char { margin: 0; }
.sched-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.sched-form .wide, .sched-form .when { grid-column: 1 / -1; }
.sched-form label { display: grid; gap: 4px; font-size: 0.86rem; color: var(--ink-2); }
.sched-form input, .sched-form select {
  font: inherit; font-size: 0.92rem; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--field); color: var(--ink); min-width: 0;
}
.sched-form .when { margin: 0; min-height: 1.3em; }
.sched-day { margin-top: 18px; }
.sched-day::first-letter { text-transform: uppercase; }
.sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sched-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 8px; border-radius: 8px; }
.sched-item:hover { background: var(--wash); }
.sched-item.is-past { opacity: 0.6; }
/* today's posts not yet out everywhere — framed (schedule.js, user 11.11.2026); a passed one stays framed and fully visible */
.sched-item.is-today { box-shadow: inset 0 0 0 2px var(--accent); margin: 4px 0; }
.sched-item.is-today.is-past { opacity: 1; }
.sched-time { display: grid; font-variant-numeric: tabular-nums; }
.sched-time strong { font-size: 1.05rem; }
.sched-time small { color: var(--muted); font-size: 0.76rem; }
.sched-main { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sched-kind { margin-right: 4px; vertical-align: middle; }
.sched-nets { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: -2px; }
.sched-nets .logo.is-delayed { fill: var(--accent); opacity: 0.9; }
.sched-delayed { margin: 4px 0 2px; font-size: 0.9rem; color: var(--ink-2, inherit); }
.sched-delayed-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-status); font-size: 0.78rem; font-weight: 600; }
.sched-nets .logo.is-pending { fill: var(--muted); opacity: 0.35; }
.ready-mark { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-right: 8px;
  width: 18px; height: 18px; border-radius: 50%; flex: none; color: var(--on-status); }
.ready-mark::before { content: ""; display: block; }
.ready-ok { background: var(--good); }
.ready-ok::before { width: 4px; height: 8px; margin-top: -2px; border: solid var(--on-status); border-width: 0 2px 2px 0;
  transform: rotate(45deg); }
.ready-started { background: var(--warning); }
.ready-started::before { display: none; }
.ready-none { background: var(--critical); }
.ready-none::before { width: 8px; height: 2px; border-radius: 1px; background: var(--on-status); }
.ready-published::before { display: none; }
.ready-published { width: auto; height: auto; border-radius: 4px; padding: 2px 7px;
  background: color-mix(in srgb, var(--muted) 22%, transparent); color: var(--ink-2); font-size: 0.74rem; font-weight: 600; }
.sched-warn { font-size: 0.82rem; color: var(--bad-text); }
.sched-acts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.sched-acts .btn-sm { margin-left: 0; }
@media (max-width: 640px) {
  .sched-item { grid-template-columns: 56px minmax(0, 1fr); }
  .sched-acts { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 560px) { .nav { flex-wrap: wrap; } }

/* Social network logos in documents (":instagram:" etc.) */
.si { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; color: var(--ink); flex: none; }
.md td .si { margin-right: 2px; }

/* Platform name on a follower tile: link to the platform's publishing studio */
.tile-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: 6px; }
.tile-link:hover { color: var(--link); text-decoration: underline; }
.tile-link:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.tile-link-arrow { font-size: 0.8em; color: var(--muted); margin-left: -3px; }
.tile-link:hover .tile-link-arrow { color: var(--link); }
.tile-label.has-link { flex-wrap: wrap; column-gap: 5px; row-gap: 0; }

/* Schedule rows open the post page */
.sched-item.is-link { cursor: pointer; }
.sched-title { color: var(--ink); font-weight: 650; text-decoration: none; }
.sched-item.is-link:hover .sched-title, .sched-title:focus-visible { color: var(--link); text-decoration: underline; }

/* ---------- post page (/admin/post) ---------- */
.back-link { display: inline-block; margin: 4px 0 12px; font-size: 0.9rem; color: var(--ink-2); text-decoration: none; }
.back-link:hover { color: var(--link); text-decoration: underline; }
.post-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.post-head-main { min-width: 0; flex: 1 1 360px; }
.post-title { font-size: 1.3rem; line-height: 1.35; overflow-wrap: anywhere; }
.post-title .sched-kind { vertical-align: 3px; }
.post-when { margin: 8px 0 0; }
.post-status { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 6px; }
.post-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.post-dot.is-done { background: var(--good); }
.post-dot.is-skipped { background: var(--axis); }
.post-note { margin: 8px 0 0; font-size: 0.92rem; }
.post-app .sched-form { border-top: 1px solid var(--grid); padding-top: 14px; margin-top: 16px; }
.post-facts { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 0.92rem; }
.post-facts dt { color: var(--muted); }
.post-facts dd { margin: 0; overflow-wrap: anywhere; }
.post-hook { font-style: italic; }
.post-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.post-links .btn { text-decoration: none; margin-left: 0; }
.post-app .doc-head { margin-bottom: 4px; }
.post-app .md { max-width: none; }
.post-app .editor textarea { min-height: 45vh; }
.post-app .editor textarea.brief-text { min-height: 220px; font-family: var(--sans); font-size: 0.95rem; }
.post-app .editor textarea.pack-text { min-height: 60vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.pack-actions { margin: 0 0 10px; }
@media (max-width: 560px) { .post-facts { grid-template-columns: 1fr; gap: 0 0; } .post-facts dd { margin-bottom: 8px; } }
.post-app .doc-actions .btn-sm { margin-left: 0; }

/* Generation card on the post page */
.gen-steps { margin: 0 0 12px; padding-left: 20px; font-size: 0.92rem; color: var(--ink-2); }
.gen-steps li { margin: 4px 0; }
.gen-big { margin: 0 0 8px; font-size: 1rem; }
.gen-progress { margin: 0 0 8px; font-weight: 600; }
/* «Идёт работа» (user, 13.11.2026: «показывай анимацию, чтобы было видно, что система не зависла»): строка шага задачи
   с крутящимся кружком слева и бегущей полоской снизу. Ставится, только пока Mac шлёт вести (не дольше 15 минут тишины).
   Движение не гасится и при «Уменьшить движение» — пользователь просил именно анимацию. */
.gen-progress.is-live { position: relative; display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.gen-progress.is-live::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-right-color: var(--accent);
  animation: work-spin 0.85s linear infinite; }
.gen-progress.is-live::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat,
    color-mix(in srgb, var(--accent) 14%, transparent);
  background-size: 35% 100%, 100% 100%; animation: work-bar 1.8s ease-in-out infinite; }
@keyframes work-spin { to { transform: rotate(360deg); } }
@keyframes work-bar { from { background-position: -60% 0, 0 0; } to { background-position: 160% 0, 0 0; } }
/* Film strip + live step (user, 16.11.2026: «показывай гифку и транслируй текст, что делается»). The strip runs while a
   job is queued or running; «Уменьшить движение» is on on the owner's Mac — then the frames blink instead of travelling. */
.gen-live { margin: 4px 0 6px; }
.gen-anim { max-width: 360px; margin: 6px 0 10px; }
.gen-film { display: block; width: 100%; height: auto; }
.gen-film-band { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
.gen-film-hole { fill: color-mix(in srgb, var(--ink) 22%, transparent); }
.gen-film-frame { fill: color-mix(in srgb, var(--accent) 24%, transparent); stroke: color-mix(in srgb, var(--accent) 70%, transparent); stroke-width: 1.2;
  animation: film-glow 2.4s ease-in-out infinite; }
.gen-film-star { fill: var(--accent); opacity: 0.35; animation: film-star 2.4s ease-in-out infinite; }
.gen-f1 { animation-delay: 0.4s; } .gen-f2 { animation-delay: 0.8s; } .gen-f3 { animation-delay: 1.2s; }
.gen-f4 { animation-delay: 1.6s; } .gen-f5 { animation-delay: 2s; }
.gen-film-run { animation: film-run 3s linear infinite; }
.gen-anim.is-waiting .gen-film-run { animation-duration: 9s; }
.gen-anim.is-waiting, .gen-anim.is-paused { opacity: 0.55; }
.gen-anim.is-paused .gen-film-run, .gen-anim.is-paused .gen-film-frame, .gen-anim.is-paused .gen-film-star { animation: none; }
@keyframes film-run { to { transform: translateX(-360px); } }
@keyframes film-glow { 50% { fill: color-mix(in srgb, var(--accent) 50%, transparent); } }
@keyframes film-star { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .gen-film-run { animation: none; }
  .gen-film-frame { animation-name: film-glow; animation-duration: 1.6s; }
  .gen-film-star { animation-duration: 1.6s; }
}
.gen-now { display: flex; align-items: baseline; gap: 9px; margin: 0 0 4px; font-weight: 600; font-size: 1.02rem; }
.gen-now-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); transform: translateY(-1px); }
.gen-now-dot.is-live { background: var(--accent); animation: nc-fade 1.2s ease-in-out infinite; }
.gen-stage { margin: 0 0 6px; font-size: 0.88rem; }
.gen-feed { list-style: none; margin: 6px 0 0; padding: 0 0 0 18px; font-size: 0.86rem; display: grid; gap: 2px; }
.gen-feed li { overflow-wrap: anywhere; }
.gen-feed-0 { opacity: 0.85; } .gen-feed-1 { opacity: 0.72; } .gen-feed-2 { opacity: 0.6; } .gen-feed-3 { opacity: 0.48; } .gen-feed-4 { opacity: 0.38; }
.gen-log { list-style: none; margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--wash); font-size: 0.85rem; display: grid; gap: 3px; }
.gen-log li { overflow-wrap: anywhere; }
.gen-more { margin-top: 12px; }
.gen-more > .md, .gen-more > .table-wrap, .gen-more > .gen-log { margin-top: 8px; }
.gen-question { margin: 8px 0 10px; }
.gen-question p:last-child { margin-bottom: 0; }
.gen-answer { display: block; width: 100%; font: inherit; font-size: 0.95rem; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--field); color: var(--ink); margin-bottom: 10px; resize: vertical; }
.gen-history td { white-space: nowrap; }
.gen-estimate .md, .gen-finished .md { margin-bottom: 8px; }
.gen-done { border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; background: color-mix(in srgb, var(--good) 14%, transparent); box-shadow: inset 3px 0 0 var(--good); }
.gen-done .gen-big strong { color: var(--good-text); }
ul.sched-warn { margin: 0 0 10px; padding-left: 18px; }

/* Publishing to social networks (admin/publish.js) */
.pub-file { margin: 0 0 12px; font-size: 0.92rem; overflow-wrap: anywhere; }
.pub-logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; flex: none; }
.pub-logo svg { width: 18px; height: 18px; }
.pub-logo-instagram { background: var(--instagram); }
.pub-logo-facebook { background: var(--facebook); }
.pub-logo-telegram { background: var(--telegram); }
.pub-logo-youtube { background: var(--youtube); }
.pub-logo-tiktok { background: var(--tiktok); }
.pub-accounts { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.pub-accounts legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.pub-acc { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 10px 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.pub-acc:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.pub-acc.is-off { cursor: default; }
.pub-acc.is-off .pub-logo { opacity: 0.55; }
.pub-acc input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.pub-acc-main { display: grid; min-width: 0; }
.pub-acc-handle { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.pub-acc-note { font-size: 0.82rem; color: var(--muted); }
.pub-acc-note.ok { color: var(--good-text); }
.pub-acc-note.bad { color: var(--bad-text); }
.pub-acc-note.warn { color: var(--ink-2); }
.pub-acc-note.ready { color: var(--warning); }   /* «готово к публикации» — ещё не вышло */
.pub-acc-fix .btn-sm { margin-left: 0; text-decoration: none; }
.pub-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.pub-field select { width: 100%; font: inherit; font-size: 0.95rem; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--field); color: var(--ink); }
.pub-field select:disabled { opacity: 0.7; }
.pub-locked { margin: 0; }
.pub-acc-fix { margin: -2px 0 4px 12px; font-size: 0.82rem; }
.pub-refresh { justify-self: start; margin-left: 0; }
.pub-source { font-size: 0.86rem; margin: 4px 0 10px; }
.pub-form { border-top: 1px solid var(--grid); padding-top: 14px; margin-top: 14px; }
.pub-form-head { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; margin: 0 0 12px; flex-wrap: wrap; }
.pub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 18px; }
.pub-grid.one { grid-template-columns: minmax(0, 1fr); }
.pub-fields { display: grid; gap: 12px; align-content: start; min-width: 0; }
.pub-field { display: grid; gap: 5px; }
.pub-label { font-size: 0.86rem; color: var(--ink-2); font-weight: 600; }
.pub-field textarea, .pub-field input[type="text"], .pub-field input[type="number"] {
  width: 100%; font: inherit; font-size: 0.95rem; line-height: 1.5; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--field); color: var(--ink); resize: vertical;
}
.pub-field input.pub-num { width: 120px; }
.pub-count { font-size: 0.8rem; color: var(--muted); }
.pub-count.bad { color: var(--bad-text); font-weight: 600; }
.pub-cover-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.pub-cover-choice legend { padding: 0; margin-bottom: 4px; }
.pub-check { display: flex; gap: 9px; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.pub-check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.pub-hint { font-size: 0.82rem; margin: 0; }
.pub-count-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pub-tt { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.pub-steps { margin: 6px 0 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 0.92rem; }
.pub-steps a { font-weight: 600; }
.pub-ai { display: grid; gap: 4px; }
.pub-ai .sched-warn { margin: 0 0 0 26px; }
.pub-side { min-width: 0; }
.pub-cover { display: block; width: 100%; max-width: 180px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow); background: var(--wash); }
.pub-cover.is-45 { aspect-ratio: 4 / 5; }
.pub-frame-fig { margin: 0; display: grid; gap: 6px; max-width: 180px; }
.pub-frame-fig figcaption { font-size: 12px; line-height: 1.35; }
.pub-frame { background: #000; }
.pub-rec-sec { margin-left: 4px; }
/* carousel slides on the post page */
.car-strip { list-style: none; margin: 14px 0 6px; padding: 2px 2px 10px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.car-strip li { flex: none; scroll-snap-align: start; }
.car-strip a { position: relative; display: block; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.car-strip img { display: block; width: 156px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--wash); }
.car-num { position: absolute; left: 6px; top: 6px; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: rgba(10, 17, 32, 0.78); color: #f3ecde; font-size: 0.75rem; text-align: center; }
.car-strip a { cursor: zoom-in; }
/* Slide viewer (post.js → openViewer): full screen, dark in both themes */
.lb { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6, 10, 20, 0.97); color: #f3ecde; outline: none; }
.lb[open] { display: flex; flex-direction: column; }
.lb[hidden] { display: none !important; }   /* закрытый просмотр слайдов — точно не виден (post.js → shut, 13.11.2026) */
.lb::backdrop { background: rgba(6, 10, 20, 0.6); }
html:has(.lb[open]) { overflow: hidden; }
.lb-bar { flex: none; display: flex; align-items: center; gap: 16px; padding: 10px 16px; font-size: 0.92rem; }
.lb-count { font-variant-numeric: tabular-nums; }
.lb-orig { color: #c9a86a; margin-left: auto; }
.lb-close { background: none; border: 0; color: inherit; font-size: 1.9rem; line-height: 1; padding: 0 4px; cursor: pointer; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px 16px; }
.lb-frame { position: relative; display: flex; max-width: 100%; max-height: 100%; }
.lb-img { display: block; max-width: calc(100vw - 32px); max-height: calc(100dvh - 72px); width: auto; height: auto; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); user-select: none; -webkit-user-drag: none; }
.lb-stage { gap: 20px; }
.lb.has-text .lb-img { max-width: calc(100vw - 32px - 340px); }
.lb-text { flex: none; width: 320px; max-height: calc(100dvh - 72px); overflow-y: auto; align-self: center; padding: 14px 16px; border-radius: 10px; background: rgba(243, 236, 222, 0.06); }
.lb-text[hidden] { display: none; }
.lb-text-head { margin: 0 0 8px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #c9a86a; }
.lb-line { margin: 0 0 4px; font-size: 1rem; line-height: 1.4; color: #f3ecde; }
.lb-text .tr { margin: 0 0 12px; color: rgba(243, 236, 222, 0.72); border-left-color: rgba(201, 168, 106, 0.6); font-size: 0.92rem; }
.lb-text .tr::before { color: #c9a86a; }
@media (max-width: 760px) {
  .lb.has-text .lb-stage { flex-direction: column; justify-content: flex-start; overflow-y: auto; padding-top: 4px; }
  .lb.has-text .lb-img { max-width: calc(100vw - 32px); max-height: 62dvh; }
  .lb-text { width: auto; max-height: none; align-self: stretch; }
}
.lb-half { position: absolute; top: 0; bottom: 0; width: 50%; background: none; border: 0; padding: 0; color: #fff; display: flex; align-items: center; -webkit-tap-highlight-color: transparent; }
.lb-half[hidden] { display: none; }
.lb-prev { left: 0; justify-content: flex-start; cursor: w-resize; }
.lb-next { right: 0; justify-content: flex-end; cursor: e-resize; }
.lb-chev { margin: 0 10px; width: 40px; height: 40px; border-radius: 50%; background: rgba(6, 10, 20, 0.55); font-size: 1.8rem; line-height: 38px; text-align: center; opacity: 0; transition: opacity 0.15s; }
.lb-half:hover .lb-chev, .lb-half:focus-visible .lb-chev { opacity: 1; }
.lb-half:focus-visible { outline: none; }
@media (hover: none) { .lb-chev { opacity: 0.7; } }
.car-caption { white-space: pre-wrap; font-family: var(--sans); font-size: 0.9rem; margin: 8px 0 0; padding: 10px 12px; background: var(--field); border-radius: 8px; }
.cap-net { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.cap-net-name { font-size: 0.98rem; margin: 0; }
.cap-net-label { margin: 10px 0 0; }
.cap-net-copy { margin-top: 8px; }
.cap-net-copy .btn { margin-left: 0; }
.pub-slide-links { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.pub-slide-links a { display: inline-block; min-width: 26px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 6px; text-align: center; }
.car-strip.is-story img { width: 128px; aspect-ratio: 9 / 16; }
.pub-cover.is-916 { aspect-ratio: 9 / 16; }
.pub-cover.is-169 { aspect-ratio: 16 / 9; max-width: 320px; }
.pub-sticker { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0; display: grid; gap: 6px; }
@media (max-width: 560px) { .car-strip img { width: 128px; } .car-strip.is-story img { width: 104px; } }
.pub-actions { border-top: 1px solid var(--grid); margin-top: 16px; padding-top: 14px; }
.pub-actions .editor-actions { margin-top: 12px; }
/* "Отложенная публикация" (publish.js → delayView, countdown) */
.pub-delay { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--grid); display: grid; gap: 6px; }
.pub-delay-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pub-delay-at { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--field); color: inherit; min-height: 38px; }
.pub-delay-et { font-size: 0.88rem; }
.pub-countdown { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.pub-badge.is-scheduled { background: var(--accent); color: var(--on-status, #fff); }
.pub-run.is-scheduled { box-shadow: inset 3px 0 0 var(--accent); }
.pub-video { display: block; max-width: 100%; width: 260px; aspect-ratio: 9 / 16; border-radius: 10px; background: #000; margin-top: 8px; }
.pub-runs { margin: 0 0 16px; display: grid; gap: 10px; scroll-margin-top: 12px; }
.pub-runs-head { font-size: 1rem; margin: 0; }
.pub-runs-old { margin: 6px 0 0; font-size: 0.86rem; }
.pub-run { padding: 12px 14px; border-radius: 10px; background: var(--wash); box-shadow: inset 3px 0 0 var(--accent); }
.pub-run.is-done { box-shadow: inset 3px 0 0 var(--good); }
.pub-run.is-warn { box-shadow: inset 3px 0 0 var(--warning); }
.pub-run.is-failed { box-shadow: inset 3px 0 0 var(--critical); }
.pub-run-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pub-badge { font-size: 0.76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--wash); color: var(--ink-2); }
.pub-badge.is-done { background: var(--good); color: var(--on-status); }
.pub-badge.is-warn { background: var(--warning); color: #1a1408; }
.pub-badge.is-failed { background: var(--critical); color: var(--on-status); }
.pub-open { margin-left: auto; font-size: 0.9rem; }
.pub-step { margin: 8px 0 0; font-weight: 600; font-size: 0.92rem; }
.pub-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: pub-spin 0.9s linear infinite; }
@keyframes pub-spin { to { transform: rotate(360deg); } }
.pub-checks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; font-size: 0.9rem; }
.pub-checks li { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.pub-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; flex: none; margin-top: 1px; }
.pub-checks .ok .pub-mark { background: var(--good); color: var(--on-status); }
.pub-checks .bad .pub-mark { background: var(--warning); color: #1a1408; }
.pub-checks .info .pub-mark { background: var(--wash); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--border); font-style: italic; }
.pub-run-acts { display: flex; gap: 8px; margin-top: 10px; }
.pub-run-acts .btn-sm { margin-left: 0; }
.pub-browser { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--wash); display: grid; gap: 8px; }
.pub-browser .pub-step, .pub-browser .pub-run-acts, .pub-browser .gen-log { margin-top: 0; }
.pub-browser .gen-log { padding: 0; background: none; }
.pub-br-question { margin: 0; white-space: pre-wrap; }
.pub-br-answer { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 0.95rem; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--field); color: var(--ink); resize: vertical; }
@media (max-width: 640px) {
  .pub-acc { grid-template-columns: auto auto minmax(0, 1fr); }
  .pub-acc-note { grid-column: 1 / -1; }
  .pub-grid { grid-template-columns: minmax(0, 1fr); }
  .pub-cover { max-width: 140px; }
  .pub-open { margin-left: 0; }
}
.sched-add { margin: 0 0 14px; }

/* «Тренды»: разделы выпуска — вкладки */
.section-tabs { display: flex; flex-wrap: wrap; margin: 4px 0 6px; }
.md .tab-panel > h2.tab-heading:first-child { margin-top: 14px; padding-top: 0; border-top: 0; }
@media (max-width: 600px) { .section-tabs .seg { padding: 6px 9px; } }

/* Character switcher in the header, centred: "Celeste  Roxy" (admin/char.js sets links and the current one) */
/* centred over the whole header: the left block takes the full width, and the h1 also takes back the room kept for "☰" */
.top > div:first-child { flex: 1 1 100%; min-width: 0; }
h1.chars { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 4px 33px; margin-right: -52px; margin-bottom: 10px; } /* room between the underline and the section tabs (user, 09.11.2026) */
h1.chars .char {
  color: var(--muted); text-decoration: none; position: relative; padding-bottom: 2px;
  transition: color 0.15s ease;
}
h1.chars .char:hover { color: var(--ink); }
/* a thin vertical line between the characters, in the middle of the gap (user, 09.11.2026) */
h1.chars .char + .char::before {
  content: ""; position: absolute; left: -17px; top: 18%; bottom: 14%; width: 1px; background: var(--border-strong, var(--muted)); opacity: 0.6;
}
h1.chars .char[aria-current] { color: var(--ink); }
h1.chars .char[aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 2px; border-radius: 2px; background: var(--accent);
}

/* AM production logo (variant 4, «Завод») in the top-left corner on a transparent background; on narrow screens only the factory mark stays.
   It comes after the switcher block in the HTML so `.top > div:first-child` keeps centring «Celeste  Roxy». */
.brand {
  position: absolute; top: 22px; left: 16px; z-index: 40; display: flex; align-items: flex-end; gap: 2px;
  height: 40px; color: var(--ink); text-decoration: none;
}
.brand:hover { opacity: 0.85; }
/* The logo in a frame, like «☰» in the other corner and the section tabs under it (user, 20.11.2026): the same surface,
   hairline and shadow; the factory gets a bit smaller to sit inside the 40px box. On narrow screens only the mark stays
   and the frame becomes a 40×40 square, the twin of «☰». */
.brand {
  box-sizing: border-box; align-items: center; gap: 4px; padding: 4px 12px 4px 4px; border-radius: 10px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), var(--shadow); transition: box-shadow 0.15s ease;
}
.brand:hover { opacity: 1; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow); }
.brand .brand-mark { width: 32px; height: 32px; }
.brand .brand-text { padding-bottom: 0; margin-top: 2px; }
@media (max-width: 760px) { .brand { padding: 4px; } }
/* «☰» on the same line as the framed logo: the general `details { margin-top: 8px }` pushed it 8px lower */
.top > .menu { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .brand { transition: none; } }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { display: grid; line-height: 1.05; padding-bottom: 4px; } /* bottom of the text = bottom of the factory (y 41 of 48 in the mark) */
.brand-text b { color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.brand-text small { color: var(--brand-amber); font-size: 8.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
@media (max-width: 760px) { .brand-text { display: none; } }

:root { --brand-amber: #8a6400; }
@media (prefers-color-scheme: dark) { :root { --brand-amber: #F5B700; } }

/* Shared dashboard of all characters (/admin/overview, the click on the logo) */
/* the logo is never underlined, the dashboard included (user, 11.11.2026) */
.brand, .brand:hover, .brand:focus, .brand[aria-current] .brand-text b { text-decoration: none; }
.ov-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.ov-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.ov-table { min-width: 980px; }
.ov-table th.num, .ov-table td.num { white-space: nowrap; }
.ov-th-logo { display: inline-flex; align-items: center; gap: 5px; }
.ov-name { color: var(--ink); white-space: nowrap; }
.ov-name a { color: var(--ink); font-weight: 650; font-size: 0.95rem; text-decoration: none; }
.ov-name a:hover { color: var(--link); text-decoration: underline; }
.ov-name small { display: block; color: var(--muted); font-weight: 500; font-size: 0.74rem; }
.ov-cell { display: inline-grid; justify-items: end; line-height: 1.25; }
.ov-cell small { font-size: 0.74rem; font-weight: 600; }
.ov-cell small.up { color: var(--good-text); }
.ov-cell small.down { color: var(--bad-text); }
.ov-strong { font-weight: 650; }
.ov-total th, .ov-total td { border-top: 1px solid var(--border); border-bottom: 0; font-weight: 650; color: var(--ink); }
.ov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.upcoming-card { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.upcoming-card:hover, .upcoming-card:focus-visible { border-color: var(--link); }
.upcoming-card:hover .upcoming-title, .upcoming-card:focus-visible .upcoming-title { color: var(--link); }
.upcoming-card .ov-when { font-size: .8rem; }
.upcoming-title { font-size: .98rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.upcoming-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 2px; color: var(--ink-2); font-size: .8rem; }
.ov-when { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.ov-char { font-weight: 600; }
.ov-post { color: var(--ink); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-post:hover { color: var(--link); text-decoration: underline; }
@media (max-width: 520px) {
  .ov-post { grid-column: 1 / -1; white-space: normal; }
}

/* Russian translation under foreign texts (admin/translate.js) */
.tr { margin: 4px 0 12px; padding: 3px 0 3px 10px; border-left: 2px solid var(--baseline); color: var(--muted);
  font-family: var(--sans); font-size: 0.9em; font-style: normal; font-weight: 400; line-height: 1.45; white-space: pre-line; text-transform: none; letter-spacing: normal; }
.tr::before { content: "RU"; margin-right: 6px; font-size: 0.72em; font-weight: 650; letter-spacing: 0.06em; color: var(--axis); }
td > .tr, th > .tr, li > .tr, .fv-name > .tr { margin: 4px 0 2px; }
.pub-field > .tr { margin: 2px 0 0; }
.tr-off .tr { display: none; }

/* On every screen: section tabs and the period switcher span the whole row; items stretch to fill each row (wrapping on narrow phones) */
.nav { flex-wrap: wrap; margin-right: -52px; } /* the header keeps 52px on the right for "☰"; the tabs sit below it, so take that room back */
/* The section tabs are one bar (user, 20.11.2026): a surface strip with a hairline border, like the period switcher
   under it, and tabs of equal width inside it — they no longer float on the page background. */
.nav {
  gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow);
}
.nav a { flex: 1 1 0; min-width: max-content; text-align: center; padding: 8px 12px; border-radius: 8px; font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"], .nav a[aria-current="page"]:hover { color: var(--accent-ink); box-shadow: 0 1px 2px rgba(60, 45, 20, 0.18); }
@media (prefers-reduced-motion: reduce) { .nav a { transition: none; } }
.filters { display: flex; width: 100%; box-sizing: border-box; flex-wrap: wrap; }
.filters .seg { flex: 1 1 auto; padding: 8px 12px; }

/* «Что публикуем» on the post page: the video, covers and the original — always in view */
.pub-content { margin: 12px 0 18px; }
.pub-content-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.pub-content figure { margin: 0; display: grid; gap: 6px; }
.pub-content-video .pub-video { aspect-ratio: auto; width: auto; max-width: min(100%, 520px); max-height: 460px; margin-top: 0; }
.pub-content-cover img { display: block; max-width: 220px; max-height: 240px; border-radius: 10px; box-shadow: var(--shadow); }
.pub-content figcaption { font-size: 0.82rem; }
.pub-content-dl { margin: 10px 0 0; }
@media (max-width: 600px) { .pub-content-video .pub-video { max-width: 100%; } .pub-content-cover img { max-width: 140px; } }

/* «Версии ролика» under «Что публикуем»: every upload of the video, newest first (17.11.2026) */
.pub-versions { margin: 16px 0 0; }
.pub-versions > summary { cursor: pointer; margin: 0 0 8px; }
.pub-versions-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pub-ver { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--wash); }
.pub-ver.is-current { border-color: var(--accent); }
.pub-ver p { margin: 0; }
.pub-ver-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.pub-ver-badge { margin-left: auto; font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-status); }
.pub-ver-note { margin-top: 4px !important; font-size: 0.88rem; }
.pub-ver-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; align-items: center; }
.pub-ver-video { display: block; width: auto; max-width: min(100%, 360px); max-height: 420px; margin-top: 10px; border-radius: 10px; }

/* under a yellow remark: what differs and what to do about it */
.pub-check-diff, .pub-check-fix { display: block; margin-top: 2px; font-size: 0.86rem; }
.pub-check-fix { color: var(--warning); }
.pub-check-expected { display: grid; gap: 6px; justify-items: start; margin-top: 6px; }
.pub-check-expected pre { margin: 0; white-space: pre-wrap; max-width: 100%; }

/* followers line over the daily views columns (right scale) */
.chart .followers-line { stroke: var(--accent); stroke-width: 2.5; }
.chart .followers-dot { fill: var(--accent); }
.chart .axis-right { fill: var(--accent); }
.key-followers { background: var(--accent); }

/* views today vs the same weekday a week ago, inside a platform tile */
.tile-views { color: var(--ink-2); font-size: 0.82rem; margin-bottom: 4px; }
.tile-views strong { font-size: 0.95rem; color: var(--ink); }
.tile-views-cmp { color: var(--muted); }
.tile-views-cmp .up { color: var(--good-text); font-weight: 600; }
.tile-views-cmp .down { color: var(--bad-text); font-weight: 600; }

/* «Сохранить все кадры на телефон» — one tap, then the system share sheet (09.11.2026) */
.pub-save { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.pub-save-all { min-height: 40px; margin-left: 0; }
.pub-save-hint { font-size: 12px; }
.car-save { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.car-save .btn { min-height: 40px; }
.car-save .muted { font-size: 12px; }

/* Расписание: опубликованное — под кнопкой «История» (09.11.2026) */
.sched-history { margin: 0 0 18px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Сортировка таблицы роликов по клику на заголовок (09.11.2026) */
.th-sort { all: unset; cursor: pointer; color: inherit; font: inherit; white-space: nowrap; border-radius: 4px; }
.th-sort:hover, .th-sort.is-on { color: var(--ink); }
.th-sort:focus-visible { outline: 2px solid var(--accent, #d4a95a); outline-offset: 2px; }
.th-arrow { font-size: 0.7rem; }

/* Расписание: стрелки ↑ ↓ — поменять соседние публикации местами (10.11.2026) */
.sched-move { display: inline-flex; gap: 4px; margin-right: 6px; }
.sched-move .btn-sm { margin-left: 0; min-width: 32px; padding: 5px 8px; font-size: 0.95rem; line-height: 1; }

/* День и время публикации — правка на месте (10.11.2026) */
.sched-when-btn { all: unset; display: grid; align-content: start; font-variant-numeric: tabular-nums; box-sizing: border-box; cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: -2px -6px; }
.sched-when-btn:hover, .sched-when-btn:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sched-when-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sched-when-pen { display: block; font-size: 0.68rem; color: var(--accent); opacity: 0; transition: opacity .15s; }
.sched-when-btn:hover .sched-when-pen, .sched-when-btn:focus-visible .sched-when-pen { opacity: 1; }
@media (hover: none) { .sched-when-pen { opacity: 1; } }
.when-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 4px 0 10px; padding: 10px 12px;
  border-radius: 10px; background: var(--surface-2, rgba(255,255,255,.04)); box-shadow: inset 0 0 0 1px var(--border); }
.when-edit label { display: grid; gap: 4px; font-size: 0.78rem; color: var(--muted); }
.when-edit input { font: inherit; font-size: 0.95rem; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); min-height: 38px; }
.when-edit-acts { display: inline-flex; gap: 6px; }
.when-edit-acts .btn-sm { margin-left: 0; min-height: 38px; }
.when-edit-hint { flex-basis: 100%; font-size: 0.8rem; }
.post-when-edit { vertical-align: middle; }

/* Пакет публикации — сворачиваемый блок на странице поста (10.11.2026) */
#pack-details > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#pack-details > summary::-webkit-details-marker { display: none; }
#pack-details > summary::before { content: "▸"; color: var(--muted); font-size: 0.9rem; }
#pack-details[open] > summary::before { content: "▾"; }
#pack-details > summary h2 { display: inline; margin: 0; }
#pack-details[open] > summary { margin-bottom: 8px; }

/* Likes in detail (/admin/likes): the dashboard's "Лайки" tile opens it */
a.tile-click { color: inherit; text-decoration: none; cursor: pointer; transition: box-shadow 0.15s; }
a.tile-click:hover { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow); }
a.tile-click:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.tile-more { margin-left: auto; color: var(--muted); font-weight: 600; }
a.tile-click:hover .tile-more { color: var(--link); }
.lk-back { display: inline-block; margin-top: 4px; color: var(--link); text-decoration: none; font-size: 0.88rem; }
.lk-back:hover { text-decoration: underline; }
.lk-chars { margin-top: -8px; }
.lk-pl { display: flex; align-items: center; gap: 8px; font-size: 1.5rem; }
.lk-pl .logo { width: 22px; height: 22px; }
.lk-top { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow: hidden; color: var(--ink-2); }
.lk-table { min-width: 720px; }
.lk-what { min-width: 900px; }
.lk-pub { min-width: 240px; max-width: 380px; }
.lk-pub .lk-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; font-weight: 600; }
.lk-pub small { display: block; color: var(--muted); font-size: 0.74rem; margin-top: 2px; }
.lk-num { color: var(--ink); text-decoration: underline dotted var(--axis); text-underline-offset: 3px; }
.lk-num:hover { color: var(--link); text-decoration-style: solid; }
.lk-zero td, .lk-zero .lk-title { color: var(--muted); }
.lk-share { display: inline-flex; align-items: center; gap: 8px; }
.lk-bar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.lk-bar-fill { display: block; height: 100%; border-radius: 3px; }
.lk-foot { font-size: 0.8rem; margin: 8px 0 0; }

/* ---------- New character: "+" in the header, the description window and the wizard /admin/new (admin/char.js, admin/new.js) ---------- */
h1.chars .char-add { font-weight: 400; min-width: 1ch; text-align: center; }
h1.chars .char-add:hover { color: var(--accent); }
.nc-dialog {
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 14px;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--border), 0 24px 60px rgba(0, 0, 0, 0.35);
}
.nc-dialog::backdrop { background: rgba(8, 12, 22, 0.55); }
.nc-dialog[hidden] { display: none !important; }   /* закрытое окно «Новый персонаж» — точно не видно (char.js → shutDialog) */
.nc-form { padding: 20px 22px 18px; display: grid; gap: 12px; }
.nc-form p { margin: 0; }
.nc-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nc-dialog-head h2 { margin: 0; }
.nc-close { padding: 4px 10px; }
.nc-idea, .nc-app textarea, .nc-app input[type="text"], .nc-app input[type="password"] {
  width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--field); color: var(--ink); resize: vertical;
}
.nc-idea { min-height: 220px; line-height: 1.45; }
.nc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0 4px; }
.nc-mac { font-size: 0.86rem; }
.nc-drafts { border-top: 1px solid var(--border); padding-top: 10px; }
.nc-drafts h3 { margin: 0 0 6px; font-size: 0.95rem; }
.nc-drafts ul, .nc-drafts-list { margin: 0; padding-left: 18px; }
.nc-drafts li, .nc-drafts-list li { margin: 4px 0; }
.nc-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.nc-list-head h2 { margin: 0; }
.nc-idea-short { margin: 2px 0 8px; font-size: 0.86rem; }

.nc-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; }
.nc-head h2 { margin: 0 0 2px; }
.nc-head p { margin: 0; }
.nc-idea-box { margin-top: 10px; }
.nc-idea-box summary { cursor: pointer; color: var(--ink-2); }
.nc-idea-text { white-space: pre-wrap; margin: 8px 0 0; line-height: 1.45; }
.nc-grid { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .nc-grid { grid-template-columns: minmax(0, 1fr); } }
.nc-side { padding: 10px 8px; position: sticky; top: 12px; }
@media (max-width: 860px) { .nc-side { position: static; } }
.nc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nc-step {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: transparent; border: 0; border-radius: 9px; padding: 8px 10px; cursor: pointer;
}
.nc-step:hover:not(:disabled) { background: var(--wash); }
.nc-step:disabled { cursor: default; color: var(--muted); }
.nc-steps .is-sel .nc-step { background: var(--wash); box-shadow: inset 3px 0 0 var(--accent); }
.nc-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--border); color: var(--muted);
}
.nc-steps .is-done .nc-num { background: var(--good); color: var(--on-status, #fff); box-shadow: none; }
.nc-steps .is-cur .nc-num { background: var(--accent); color: var(--surface); box-shadow: none; }
.nc-steps .is-bad .nc-num { background: var(--bad-text); }
.nc-step-text { display: grid; gap: 1px; min-width: 0; }
.nc-step-text b { font-weight: 600; font-size: 0.93rem; line-height: 1.25; }
.nc-step-text small { color: var(--muted); font-size: 0.8rem; }
.nc-steps .is-you .nc-step-text small { color: var(--accent); font-weight: 600; }
.nc-steps .is-bad .nc-step-text small { color: var(--bad-text); font-weight: 600; }

.nc-main { min-width: 0; }
.nc-step-head h2 { margin: 2px 0 4px; }
.nc-step-head p { margin: 0 0 12px; }
.nc-kicker { color: var(--accent); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }
.nc-big { font-size: 1.02rem; margin: 6px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nc-progress { margin: 0 0 8px; color: var(--ink-2); }
.nc-warn { margin: 8px 0; padding: 9px 12px; border-radius: 9px; background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--ink); }
.nc-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: nc-spin 0.9s linear infinite; animation-delay: var(--nc-sync, 0s); }
@keyframes nc-spin { to { transform: rotate(360deg); } }
/* "Claude is working": bouncing dots, a running stripe and a live timer, so the wait reads as work in progress. */
.nc-dots { display: inline-flex; gap: 3px; align-items: flex-end; margin-left: -2px; }
.nc-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: nc-dot 1.2s ease-in-out infinite; animation-delay: var(--nc-sync, 0s); }
.nc-dots i:nth-child(2) { animation-delay: calc(var(--nc-sync, 0s) + 0.15s); }
.nc-dots i:nth-child(3) { animation-delay: calc(var(--nc-sync, 0s) + 0.3s); }
@keyframes nc-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-4px); opacity: 1; } }
.nc-elapsed { font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.nc-bar { position: relative; height: 3px; margin: 0 0 10px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.nc-bar::before { content: ""; position: absolute; inset: 0; width: 35%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: nc-bar 2s ease-in-out infinite; animation-delay: var(--nc-sync, 0s); }
@keyframes nc-bar { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.nc-progress.is-live { animation: nc-breathe 2s ease-in-out infinite; animation-delay: var(--nc-sync, 0s); }
@keyframes nc-breathe { 50% { opacity: 0.6; } }
/* "Reduce motion" is on on the owner's Mac: a work indicator must still move there, so only the travelling parts calm down to fades. */
@keyframes nc-fade { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .nc-dots i { animation-name: nc-fade; }
  .nc-bar::before { width: 100%; animation-name: nc-fade; }
}
.nc-more { margin: 12px 0 0; }
.nc-more summary { cursor: pointer; color: var(--ink-2); }
.nc-log { list-style: none; padding: 0; margin: 6px 0 0; font-size: 0.86rem; display: grid; gap: 3px; }
.nc-log time { color: var(--muted); font-variant-numeric: tabular-nums; }

.nc-intro { margin-bottom: 8px; }
.nc-questions { display: grid; gap: 4px; }
.nc-q { border: 0; margin: 0; padding: 12px 0; border-top: 1px solid var(--border); display: grid; gap: 6px; min-width: 0; }
.nc-q-text { font-weight: 600; padding: 0; line-height: 1.35; }
.nc-why { margin: 0; font-size: 0.86rem; }
.nc-general { display: grid; gap: 6px; }
.nc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nc-chip {
  font: inherit; font-size: 0.9rem; text-align: left; padding: 6px 11px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--field); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border);
}
.nc-chip:hover { background: var(--wash); }
.nc-chip[aria-pressed="true"], .nc-media-opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--field)); }
.nc-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 6px 0; }
.nc-media-opt {
  margin: 0; padding: 6px; border-radius: 10px; background: var(--field); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer;
  display: grid; gap: 6px; align-content: start; min-width: 0;
}
figure.nc-media-opt { cursor: default; }
.nc-media-opt img, .nc-media-opt video { width: 100%; height: auto; border-radius: 7px; display: block; background: var(--wash); }
.nc-media-opt audio { width: 100%; }
.nc-media-label, .nc-media-opt figcaption { font-size: 0.86rem; color: var(--ink-2); }
.nc-img-link { display: block; }
.nc-spend { margin-top: 10px; padding: 12px 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.nc-spend p { margin: 0 0 6px; }
.nc-texts { margin: 14px 0; padding: 12px 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border); }
.nc-texts > p { margin: 0 0 6px; }
.nc-texts-ok { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-weight: 600; cursor: pointer; }
.nc-texts-ok input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

.nc-result .md { margin-bottom: 8px; }
.nc-docs-box { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--wash); }
.nc-docs-box h3 { margin: 0 0 6px; font-size: 0.98rem; }
.nc-docs-box p { margin: 6px 0 0; font-size: 0.86rem; }
.nc-docs { margin: 0; padding-left: 18px; }
.nc-docs li { margin: 3px 0; }
.nc-approve { margin-top: 16px; }
.nc-revise { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.nc-revise h3 { margin: 0 0 6px; font-size: 0.98rem; }
.nc-reopen textarea { margin-top: 6px; }

.nc-accounts { display: grid; gap: 10px; margin: 12px 0; }
.nc-acc { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.nc-acc .nc-why { grid-column: 1 / -1; }
.nc-acc-done, .nc-acc-skip { display: flex; align-items: center; gap: 7px; }
@media (max-width: 600px) { .nc-acc { grid-template-columns: minmax(0, 1fr) auto; } .nc-acc input[type="text"] { grid-column: 1 / -1; grid-row: 2; } }
.nc-plain { padding-left: 20px; margin: 8px 0; }
.nc-plain li { margin: 4px 0; }
.nc-phrase { white-space: pre-wrap; word-break: break-word; padding: 12px 14px; border-radius: 10px; background: var(--field); box-shadow: inset 0 0 0 1px var(--border); font-size: 0.9rem; }

/* Voice input «Наговорить» (admin/char.js → window.ADMIN_DICTATE) */
.nc-mic-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nc-mic { display: inline-flex; align-items: center; gap: 7px; }
.nc-mic svg { flex: none; }
.nc-mic.is-rec { color: var(--bad-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad-text) 60%, transparent); }
.nc-mic.is-rec svg { animation: nc-pulse 1.1s ease-in-out infinite; }
@keyframes nc-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .nc-mic.is-rec svg { animation: none; } }
.nc-mic-label { font-variant-numeric: tabular-nums; }
.nc-mic-msg { font-size: 0.86rem; }
.nc-field { display: grid; gap: 6px; justify-items: start; }
.nc-field > textarea { justify-self: stretch; }
.nc-field .nc-mic { padding: 5px 11px; font-size: 0.88rem; }
/* «Прикрепить файлы»: photos and other files for Claude next to a text field (admin/char.js attachBox) */
.nc-attach { display: grid; gap: 8px; justify-self: stretch; border-radius: 10px; }
.nc-attach.is-drop { outline: 2px dashed var(--ink-2); outline-offset: 4px; }
.nc-attach-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nc-attach-btn { display: inline-flex; align-items: center; gap: 7px; }
.nc-attach-btn svg { flex: none; }
.nc-field .nc-attach-btn { padding: 5px 11px; font-size: 0.88rem; }
.nc-attach-msg { font-size: 0.86rem; }
.nc-attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nc-attach-list[hidden] { display: none; }
.nc-attach-item { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 6px 4px 8px; border-radius: 8px; font-size: 0.86rem;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-2) 35%, transparent); }
.nc-attach-item img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; flex: none; }
.nc-attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.nc-attach-item.is-up .nc-attach-name::after { content: " ✓"; }
.nc-attach-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 0.86rem; line-height: 1; }
.nc-attach-x:hover, .nc-attach-x:focus-visible { background: color-mix(in srgb, var(--ink-2) 18%, transparent); }
.nc-dialog .nc-attach { margin-top: 10px; }
.nc-ufiles { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.nc-ufiles li { display: grid; gap: 4px; min-width: 0; }
.nc-ufiles a { display: grid; gap: 6px; color: inherit; text-decoration: none; min-width: 0; }
.nc-ufiles img, .nc-ufile-ext { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.nc-ufile-ext { display: grid; place-items: center; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-2) 35%, transparent); }
.nc-ufile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; text-decoration: underline; }

/* Tabs of characters being created ("Celeste | Roxy | Новый персонаж | +", admin/char.js) */
h1.chars .char-draft { white-space: nowrap; }
.nav a[aria-disabled="true"] { opacity: 0.45; cursor: default; }
/* Dashboard and its detailed pages: all the names in one rectangle — the data is for all characters (admin/char.js, 11.11.2026) */
h1.chars .char-group {
  display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: inherit;
  padding: 2px 22px 4px; border: 1.5px solid var(--accent); border-radius: 12px;
}
/* Phones: with the drafts' tabs the row of names gets long — keep it clear of the logo (left) and "☰" (right) */
@media (max-width: 760px) {
  h1.chars { padding: 0 52px 0 46px; column-gap: 22px; font-size: 1.35rem; }
  h1.chars .char + .char::before { left: -11px; }
  h1.chars .char-group { padding: 1px 10px 3px; column-gap: 12px; }
  h1.chars .char-group .char + .char::before { left: -6px; }
}

/* Detailed pages behind the dashboard tiles (admin/insights.js, 11.11.2026) */
.c-bar { background: var(--bar); }
.f-bar { fill: var(--bar); }
.s-bar { stroke: var(--bar); }
.key-ref { background: var(--critical); }
.chart .ref { stroke: var(--critical); stroke-width: 1.5; stroke-dasharray: 5 4; }
.lk-table.in-small { min-width: 0; }
.lk-table .in-sub td:first-child { color: var(--muted); padding-left: 18px; }
.in-days { min-width: 640px; }
.in-posts { display: grid; gap: 2px; min-width: 0; max-width: 460px; }
.in-posts .ov-post { font-size: 0.86rem; }
.in-spend { min-width: 760px; }
.in-work { color: var(--ink-2); font-size: 0.84rem; max-width: 300px; }
.in-bad { color: var(--bad-text); font-weight: 600; }
.in-funnel { display: grid; gap: 12px; }
.in-step { display: grid; grid-template-columns: minmax(150px, 220px) 1fr minmax(150px, auto); gap: 6px 14px; align-items: center; }
.in-step-name { font-size: 0.9rem; color: var(--ink); font-weight: 600; }
.in-step-bar { height: 14px; border-radius: 7px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.in-step-fill { display: block; height: 100%; border-radius: 7px; background: var(--bar); }
.in-step-num { display: grid; justify-items: end; font-variant-numeric: tabular-nums; line-height: 1.25; }
.in-step-num strong { font-size: 1.05rem; }
.in-step-num small { color: var(--muted); font-size: 0.74rem; }
@media (max-width: 640px) {
  .in-step { grid-template-columns: 1fr auto; }
  .in-step-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* Цель блога (admin/goal.js, 11.11.2026) */
.goal-card { border-left: 4px solid var(--accent, #F5B700); }
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-head .goal-title { margin: 0; }
.goal-text { margin: 8px 0 4px; font-size: 1.02rem; line-height: 1.45; white-space: pre-line; }
.goal-note { font-size: 0.8rem; }
.goal-form { margin: 8px 0 6px; }
.post-app .editor.goal-form textarea.brief-text, .goal-form textarea { min-height: 90px; }

/* История текстов поста (admin/post.js, 11.11.2026) */
.texts-versions details { border-top: 1px solid var(--border); padding: 6px 0; }
.texts-versions summary { cursor: pointer; font-size: 0.88rem; }
.texts-version { white-space: pre-wrap; font-size: 0.8rem; background: var(--wash); padding: 10px; border-radius: 8px; max-height: 50vh; overflow: auto; }

/* «Пересобрать» on the schedule page: the goal or the rules changed (schedule.js → renderPlan) */
.plan-card { border-left: 3px solid var(--warn-text, #d8a53c); }
.plan-card.is-note { border-left-color: var(--good-text, #6fbf8f); }
.plan-card h2 { margin: 0 0 4px; }
.plan-card .editor-actions { margin: 12px 0 0; flex-wrap: wrap; }
.plan-why { margin-top: 12px; }
.plan-why > summary { cursor: pointer; font-weight: 600; }
.plan-why h3 { font-size: 0.95rem; margin: 14px 0 6px; }
.plan-diff { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: 0.9rem; }
.plan-diff li { padding: 3px 8px; border-radius: 6px; background: var(--wash); overflow-wrap: anywhere; }
.plan-diff .was { text-decoration: line-through; color: var(--muted); }
.plan-diff .now::before { content: "+ "; color: var(--good-text, #6fbf8f); font-weight: 700; }
.plan-diff .was::before { content: "− "; text-decoration: none; display: inline-block; }

/* «Анализ результатов» on the shared dashboard (analysis.js) */
/* the head row: title and «Последний сбор» on the left, «Анализ результатов» on the right, centred on one line;
   the space under it keeps the button off the tiles (user, 11.11.2026) */
.ov-head:has(.ov-analysis) { align-items: center; row-gap: 8px; margin-bottom: 14px; }
.ov-head .ov-title { margin: 0; }
.ov-head #updated { margin: 0; }
.ov-head .ov-analysis { margin-left: auto; flex: 0 0 auto; }
@media (max-width: 640px) { .ov-head .ov-analysis { margin-left: 0; width: 100%; } }
.analysis-card h2 { margin: 0 0 4px; }
.analysis-card .analysis-body { max-width: 900px; margin-top: 10px; }
.analysis-card .editor-actions { margin-top: 10px; }

/* «Прочитать вслух» над текстом Claude в мастере нового персонажа (admin/new.js speakBtn) */
.nc-speak-row { margin: 0 0 8px; }
.nc-speak-row .btn-sm { margin-left: 0; }
.nc-speak[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); }

/* Просмотр картинок поверх страницы (admin/new.js openViewer): листать ← →, половины картинки, свайп; увеличение. */
html.lb-lock { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(12, 14, 20, 0.97); color: #f3efe6; display: flex; flex-direction: column; }
.lb-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 12px 64px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.lb-stage.is-zoomed { cursor: grab; }
.lb-stage.is-zoomed:active { cursor: grabbing; }
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transform-origin: center; border-radius: 4px; pointer-events: none; }
.lb-btn { border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 999px; cursor: pointer; font: inherit; line-height: 1; }
.lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb-btn:focus-visible, .lb-pick:focus-visible { outline: 2px solid #f5d27a; outline-offset: 2px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 2rem; padding-bottom: 4px; }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; font-size: 1.15rem; }
.lb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px 14px; font-size: 0.92rem; }
.lb-count { color: rgba(243, 239, 230, 0.7); font-variant-numeric: tabular-nums; }
.lb-cap { flex: 1; min-width: 120px; }
.lb-pick[aria-pressed="true"] { background: #2f7d4f; }
.lb-zoom { display: inline-flex; align-items: center; gap: 6px; }
.lb-zoom .lb-btn { width: 34px; height: 34px; font-size: 1.15rem; }
.lb-zoom-txt { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; color: rgba(243, 239, 230, 0.8); }
.nc-lb img { cursor: zoom-in; }
/* Просмотр слайдов на странице поста (dialog.lb, admin/post.js) — свой крестик: правило .lb-close выше (для new.js)
   ставило его в угол поверх ссылки «Оригинал». Здесь он в строке, крупнее, со своим отступом от ссылки (13.11.2026). */
dialog.lb .lb-close { position: static; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0 0 4px; margin-left: 20px; border-radius: 999px; font-size: 2.4rem; line-height: 1; }
dialog.lb .lb-close:hover { background: rgba(255, 255, 255, 0.12); }
dialog.lb .lb-close:focus-visible { outline: 2px solid #f5d27a; outline-offset: 2px; }
@media (max-width: 640px) {
  .lb-stage { padding: 8px; }
  .lb-prev, .lb-next { width: 40px; height: 40px; background: rgba(0, 0, 0, 0.35); }
}

/* Вариант-текст среди вариантов-картинок и картинка, которой нет в панели (admin/new.js questionField, mediaEl) */
.nc-media-opt.nc-media-text { padding: 12px 14px; align-content: center; min-height: 64px; }
.nc-media-opt.nc-media-text .nc-media-label { font-size: 0.95rem; color: var(--ink); }
.nc-media-missing { display: block; padding: 18px 10px; border-radius: 7px; background: var(--wash); color: var(--ink-2); font-size: 0.84rem; text-align: center; }

/* Step 7 «Подключение к панели»: the form for the Mac and the platforms of the new panel (13.11.2026) */
.nc-connect { display: grid; gap: 12px; margin: 12px 0; }
.nc-cf { display: grid; gap: 5px; }
.nc-cf-check { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; }
.nc-cf-check input { margin-top: 4px; }
.nc-pf-box { margin: 12px 0 16px; padding: 12px 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border); }
.nc-pf-box .nc-big { margin-top: 0; }
.nc-platforms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nc-platforms li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nc-pf-mark { width: 1.2em; text-align: center; color: var(--ink-2); }
.nc-platforms li.is-ok .nc-pf-mark { color: var(--good-text); font-weight: 700; }
.nc-pf-text { flex: 1 1 260px; min-width: 0; }
.nc-platforms .btn-sm { margin-left: 0; }
.nc-platforms a.btn, .nc-pf-box a.btn { text-decoration: none; }
.nc-later { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--wash); }
.nc-link { padding: 4px 8px; border-radius: 6px; background: var(--field); word-break: break-all; font-size: 0.86rem; }

/* «Показать ещё» under the publication tables (5 at a time) */
.show-more-row { display: flex; align-items: baseline; gap: 12px; padding: 12px 8px 2px; }
.show-more { background: none; border: 0; padding: 0; font: inherit; font-size: 0.9rem; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.show-more:hover { text-decoration-thickness: 2px; }
.show-more:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.show-more-row .muted { font-size: 0.8rem; }

/* «Внести правки в расписание с ИИ» on the schedule page (schedule.js → chat, 16.11.2026) */
.chat-card { border-left: 3px solid var(--accent); }
.chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.chat-head h2 { margin: 0; }
.chat-head-acts { margin-left: auto; display: flex; gap: 8px; }
.chat-card > .sub { margin: 4px 0 12px; }
#chat .chat-head-acts { flex-wrap: wrap; }
#chat .chat-head-acts button { margin: 0; min-height: 40px; }
.chat-log:empty, #chat .chat-log[hidden] { display: none; }
@media (max-width: 640px) {
  #chat .chat-head-acts { width: 100%; }
  #chat .chat-head-acts button { min-height: 44px; }
}
.chat-log { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 2px 2px 4px; margin-bottom: 10px; overscroll-behavior: contain; }
.chat-msg { max-width: min(760px, 92%); padding: 9px 12px; border-radius: 10px; background: var(--wash); overflow-wrap: anywhere; }
.chat-msg.is-user { justify-self: end; background: var(--field); box-shadow: inset 0 0 0 1px var(--border); }
.chat-msg.is-ai { justify-self: start; box-shadow: inset 3px 0 0 var(--accent); }
.chat-msg.is-question { box-shadow: inset 3px 0 0 var(--warn-text, #d8a53c); }
.chat-msg.is-failed { box-shadow: inset 3px 0 0 var(--bad-text); }
.chat-spend { margin-top: 10px; padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.chat-spend.is-over { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn-text, #d8a53c) 60%, transparent); }
.chat-spend p { margin: 0 0 6px; }
.chat-spend .editor-actions { margin-top: 8px; }
.chat-who { font-size: 0.78rem; color: var(--muted); margin-bottom: 3px; }
.chat-text { white-space: pre-wrap; }
.chat-msg .md > :first-child { margin-top: 0; }
.chat-msg .md > :last-child, .chat-msg p:last-child { margin-bottom: 0; }
.chat-empty { margin: 0; }
.chat-status:empty { display: none; }
.chat-status .gen-progress, .chat-status .sched-warn { margin: 0 0 10px; }
.topic-picks { display: grid; gap: 6px; margin: 8px 0; }
.topic-pick { width: 100%; }
.topic-more { margin-bottom: 10px; }
.publication-guide { min-width: 0; margin: 0 0 12px; padding: 0; border: 0; }
.publication-guide .guide-question { margin: 4px 0 10px; font-weight: 650; }
.publication-guide form { max-width: 36rem; margin-top: 10px; }
.publication-guide label { display: block; color: var(--muted); }
.publication-guide input { margin-top: 4px; }
.publication-guide .guide-nav { margin-top: 12px; }
.chat-acts { flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) { .chat-msg { max-width: 100%; } .chat-head-acts { margin-left: 0; } }
/* «Внести правки в ролик с ИИ» inside «Публикация в соцсети» (publish.js → chatView, 16.11.2026) */
.pub-chat-wrap { margin: 4px 0 18px; }
.pub-chat-bar { margin: 0 0 10px; }
.pub-chat { padding: 12px 14px; border-radius: 10px; background: var(--wash); }
.pub-chat h2 { font-size: 1.05rem; }
/* «Публикации» и кнопка чата с ИИ — в одну строку, кнопка справа (16.11.2026) */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.list-head h2 { margin: 0; }
.schedule-list-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.list-head + .sched-add:not(:has(:not([hidden]):not(:empty))) { display: none; }
/* the post page: «← Все публикации» on the left, «Внести правки с ИИ» on the right, one line (16.11.2026) */
.post-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 4px 0 12px; }
.post-top .back-link { margin: 0; }

/* «Нужен ваш ответ»: Claude waits for the user (char.js askBox, 17.11.2026) */
.ask-box { margin: 10px 0 12px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.ask-alert { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin: 0 0 8px; font-size: 1.02rem; }
.ask-alert strong { color: var(--accent); font-size: 1.08rem; }
.ask-alert-sub { color: var(--ink-2); font-size: 0.92rem; }
.ask-dot { flex: none; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: nc-fade 1.2s ease-in-out infinite; }
.ask-question { margin: 0 0 10px; }
.ask-question p:last-child { margin-bottom: 0; }
.ask-picks { display: grid; gap: 10px; margin: 4px 0 10px; }
.ask-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.ask-group-q { padding: 0; margin: 0 0 6px; font-weight: 600; font-size: 0.92rem; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chip { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; text-align: left; font: inherit; font-size: 0.93rem; line-height: 1.35;
  padding: 8px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--field); color: var(--ink); cursor: pointer; }
.ask-chip:hover { border-color: var(--accent); }
.ask-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.ask-chip-n { flex: none; display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; border-radius: 50%; font-size: 0.78rem; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; }
.ask-chip[aria-pressed="true"] .ask-chip-n { background: color-mix(in srgb, var(--accent-ink) 25%, transparent); }
.ask-chip:disabled { opacity: 0.6; cursor: default; }
.ask-hint { margin: 4px 0 0; font-size: 0.82rem; }
.ask-text { margin-bottom: 10px; }
.ask-actions { align-items: center; flex-wrap: wrap; }
.ask-actions .btn.is-ready { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.chat-msg.is-question .ask-box { margin: 6px 0 0; }

/* «Новый срез» над списком срезов на странице «Анализ рынка» (admin/market.js, 20.11.2026) */
.market-new { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.market-new .market-new-btn { width: 100%; }
.market-new .gen-progress, .market-new .sched-warn, .market-new .market-new-note { margin: 0; font-size: 0.85rem; }
.market-new .gen-log { margin: 0; font-size: 0.8rem; }
.market-new > .btn-sm { justify-self: start; }

/* «Поиск новых звёзд» on «Идеи для персонажей» (admin/stars.js, 20.11.2026) */
.ideas-app .doc-list { grid-row: 1 / span 2; }
.ideas-app .stars-panel, .ideas-app .doc-main { grid-column: 2; }
.ideas-app .stars-panel { margin-bottom: 0; }
.stars-form { display: grid; gap: 8px; margin: 0; }
.stars-form .muted { margin: 0; font-size: 0.8rem; }
.stars-form input[type="text"], .stars-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 0.88rem; padding: 7px 9px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--field); color: var(--ink); resize: vertical; }
.stars-seg { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--wash); }
.stars-seg .seg { flex: 1; padding: 6px 4px; }
.stars-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.stars-acts .btn-sm { margin-left: 0; }
.market-new .linkish, .linkish { font: inherit; font-size: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.stars-job { display: grid; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--border); }
.stars-job-name { margin: 0; font-weight: 600; font-size: 0.88rem; }
.stars-job .gen-progress, .stars-job .sched-warn { margin: 0; font-size: 0.85rem; }
.stars-job .gen-log { margin: 0; font-size: 0.8rem; }
.stars-job > .btn-sm { justify-self: start; margin-left: 0; }
.stars-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.stars-head h2 { margin: 0; }
.stars-head .muted { margin-top: 4px; }
.stars-grid { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.star-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); min-width: 0; }
.star-top { display: flex; align-items: baseline; gap: 8px; }
.star-top h3 { margin: 0; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.star-top h3 a { color: var(--ink); }
.star-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.star-sub { margin: 0; font-size: 0.8rem; overflow-wrap: anywhere; }
.star-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 2px 0 0; font-size: 0.85rem; }
.star-facts dt { color: var(--muted); }
.star-facts dd { margin: 0; overflow-wrap: anywhere; }
.star-growth { font-weight: 700; color: var(--good-text); }
.star-why { margin: 0; font-size: 0.86rem; }
.star-src { margin: 0; font-size: 0.76rem; overflow-wrap: anywhere; }
.star-act { margin-top: auto; padding-top: 6px; }
.star-act .btn-sm { margin-left: 0; }
.star-act .gen-progress { margin: 0; font-size: 0.85rem; }
@media (max-width: 820px) {
  .ideas-app .doc-list { grid-row: auto; }
  .ideas-app .stars-panel, .ideas-app .doc-main { grid-column: auto; }
}
@media (max-width: 560px) { .stars-head { flex-wrap: wrap; } .stars-grid { grid-template-columns: 1fr; } }
/* Competitors on «Анализ рынка» (admin/rivals.js, 20.11.2026): best posts of a period, «Сделать такой же», ×/+ in «Конкуренты» */
.rivals-app .doc-list { grid-row: 1 / span 2; }
.rivals-app .rivals-panel, .rivals-app .doc-main { grid-column: 2; }
.rivals-app .rivals-panel { margin-bottom: 0; }
@media (max-width: 820px) {
  .rivals-app .doc-list { grid-row: auto; }
  .rivals-app .rivals-panel, .rivals-app .doc-main { grid-column: auto; }
}
.rivals-form select, .rivals-form input[type="date"], .rival-date input, .rv-add-form input, .rv-add-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 0.88rem;
  padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface, transparent); color: var(--ink); }
.rivals-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rivals-dates label, .rival-date { display: grid; gap: 3px; font-size: 0.8rem; color: var(--muted); }
.rival-pic { aspect-ratio: 4 / 5; }
.rival-pic img { object-position: center; }
.rival-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
.rival-metrics div { padding: 4px 8px; border-radius: 8px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); }
.rival-metrics dt { font-size: 0.7rem; color: var(--muted); }
.rival-metrics dd { margin: 0; font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.rival-text summary { font-size: 0.85rem; }
.rival-pre { white-space: pre-wrap; margin: 6px 0 0; font-size: 0.84rem; overflow-wrap: anywhere; }
.md td.rv-act, .md th.rv-act { width: 1%; white-space: nowrap; text-align: right; }
.rv-acts { display: inline-flex; gap: 4px; }
.rv-acts .btn-sm { margin-left: 0; padding: 3px 9px; }
.rv-del { color: var(--bad-text); }
.rv-add { margin: 8px 0 18px; }
.rv-add > .btn-sm { margin-left: 0; }
.rv-add-form { max-width: 520px; padding: 12px; border-radius: 10px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); }
.rv-add-form label { display: grid; gap: 3px; font-size: 0.8rem; color: var(--muted); }
.star-pic { position: relative; display: block; margin: -12px -14px 4px; border-radius: 10px 10px 0 0; overflow: hidden; background: var(--wash); aspect-ratio: 4 / 3; }
.star-pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.star-pic-tag { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; background: rgba(0, 0, 0, 0.55); color: #fff; }
/* «Редактировать с ИИ» on the «Документы» pages (20.11.2026): the conversation opens under the document's buttons */
.doc-actions { flex-wrap: wrap; justify-content: flex-end; }
.doc-chat { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; }
.doc-chat .chat-head h2 { font-size: 1.05rem; }
.doc-chat > .sub { margin: 4px 0 12px; }

/* Buttons next to a document's title (user, 20.11.2026): all plain outlines until pressed; the pressed one is filled —
   «Редактировать с ИИ» while its chat is open, «История» while the history or an old version is shown. */
#btn-ai[aria-expanded="true"], #btn-history[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink); box-shadow: none;
}
#btn-ai[aria-expanded="true"]:hover, #btn-history[aria-pressed="true"]:hover { background: var(--accent); filter: brightness(1.07); }

/* =====================================================================================================================
   Design 2 — components (user, 20.11.2026). Comes last on purpose: it refines the rules above without touching layout.
   ===================================================================================================================== */

body { font-size: 14.5px; letter-spacing: -0.003em; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
body {
  background-image:
    radial-gradient(1100px 600px at 0% -12%, var(--glow-1), transparent 62%),
    radial-gradient(900px 520px at 100% -10%, var(--glow-2), transparent 60%);
}
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 75%, transparent); outline-offset: 2px; border-radius: 6px; }
h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-family: var(--display); font-size: 1.02rem; font-weight: 640; letter-spacing: -0.012em; }
.h3 { font-family: var(--display); font-weight: 620; letter-spacing: -0.005em; }
.sub, .muted { line-height: 1.5; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- surfaces ---------- */
.card, .tile, .login {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--highlight), 0 0 0 1px var(--border), var(--shadow);
}
.card { padding: 20px 22px 16px; margin-bottom: 18px; }
.grid2 { gap: 18px; }
.grid2 .card { margin-bottom: 18px; }
.tiles { gap: 14px; }
.tile { padding: 16px 18px; }
@supports (grid-template-rows: subgrid) { .tile { margin-bottom: 14px; } }
.tile-label { font-size: 0.8rem; font-weight: 500; color: var(--muted); letter-spacing: 0.005em; }
.tile-value { font-family: var(--display); font-size: 2.05rem; font-weight: 640; letter-spacing: -0.035em; margin-top: 8px; color: var(--ink); }
.tile-value.empty { font-size: 1.15rem; font-weight: 520; letter-spacing: -0.01em; color: var(--axis); }
.tile-delta { font-size: 0.8rem; }
.tile-delta .up, .tile-delta .down { font-variant-numeric: tabular-nums; }
.tile-note { font-size: 0.74rem; line-height: 1.45; }
/* clickable tiles lift a little and show a hairline of the accent */
a.tile-click { transition: box-shadow 0.18s ease, transform 0.18s ease; }
a.tile-click:hover { transform: translateY(-1px); box-shadow: var(--highlight), 0 0 0 1px color-mix(in srgb, var(--accent) 40%, var(--border)), var(--shadow-lift); }
.tile-more { color: var(--axis); transition: color 0.18s ease, transform 0.18s ease; }
a.tile-click:hover .tile-more { color: var(--accent); transform: translateX(2px); }

/* ---------- buttons ---------- */
.btn {
  border-radius: var(--radius-sm); padding: 8px 15px; font-weight: 600; letter-spacing: -0.005em;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(17, 22, 38, 0.12), 0 4px 12px -4px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: filter 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(0.97); }
.btn-ghost {
  background: var(--surface); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 1px rgba(17, 22, 38, 0.03);
}
.btn-ghost:hover { background: var(--field); color: var(--ink); filter: none; }
.btn-sm { border-radius: 8px; }
.menu-panel .btn.btn-ghost { background: transparent; }
.menu-panel .btn.btn-ghost:hover { background: var(--wash); }
#btn-ai[aria-expanded="true"], #btn-history[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px -4px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ---------- segmented switchers: section tabs and periods — a groove with a raised white segment ---------- */
.nav, .filters {
  background: var(--track); box-shadow: inset 0 1px 2px rgba(17, 22, 38, 0.06), inset 0 0 0 1px var(--border);
  border-radius: 13px; padding: 4px;
}
.nav a, .seg { color: var(--ink-2); font-weight: 520; border-radius: 9px; }
.nav a:hover, .seg:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); color: var(--ink); }
.nav a[aria-current="page"], .nav a[aria-current="page"]:hover, .seg[aria-pressed="true"] {
  background: var(--surface-2); color: var(--ink); font-weight: 620;
  box-shadow: 0 1px 2px rgba(17, 22, 38, 0.10), 0 3px 10px -3px rgba(17, 22, 38, 0.14), 0 0 0 1px var(--border);
}
@media (prefers-color-scheme: dark) {
  .nav, .filters { box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px var(--border); }
  .nav a[aria-current="page"], .nav a[aria-current="page"]:hover, .seg[aria-pressed="true"] {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px -2px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
  }
}

/* ---------- header ---------- */
h1.chars { font-size: 1.75rem; }
h1.chars .char { letter-spacing: -0.015em; }
h1.chars .char[aria-current]::after { height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
h1.chars .char-group { border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 70%, transparent); box-shadow: var(--shadow); }
.brand { border-radius: 12px; box-shadow: var(--highlight), 0 0 0 1px var(--border), var(--shadow); }
.brand-text small { color: var(--gold); }
summary.menu-toggle { border-radius: 12px; box-shadow: var(--highlight), 0 0 0 1px var(--border), var(--shadow); }
.menu-panel { background: var(--surface-2); border-radius: 14px; box-shadow: 0 0 0 1px var(--border), var(--shadow-lift); }
.ov-title { font-size: 1.55rem; letter-spacing: -0.015em; }

/* ---------- tables ---------- */
table { font-size: 0.85rem; }
thead th { font-size: 0.7rem; font-weight: 620; text-transform: uppercase; letter-spacing: 0.06em; color: var(--axis); padding-top: 9px; padding-bottom: 9px; vertical-align: bottom; }
th, td { border-bottom-color: var(--grid); }
td { padding-top: 10px; padding-bottom: 10px; }
tbody tr { transition: background-color 0.12s ease; }
tbody tr:hover { background: var(--wash); }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.table-wrap { scrollbar-width: thin; scrollbar-color: var(--baseline) transparent; }
/* the dashboard's wide tables: headers may wrap onto two lines, so the last columns are no longer cut off */
.ov-table { min-width: 860px; }
#factory-models table { min-width: 0; }
#factory-models tbody tr > :first-child { white-space: normal; overflow-wrap: anywhere; }
.ov-table thead th { white-space: normal; line-height: 1.25; }
.ov-total th, .ov-total td { border-top: 1px solid var(--border-strong); }
.ov-name a { font-weight: 620; }

/* ---------- small parts ---------- */
.stage { background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); font-weight: 600; }
.chat-card { border-left: 0; box-shadow: var(--highlight), 0 0 0 1px var(--border), inset 3px 0 0 var(--accent), var(--shadow); }
.doc-chat { border: 0; border-radius: 14px; background: var(--field); box-shadow: inset 0 0 0 1px var(--border), inset 3px 0 0 var(--accent); }
.chat-msg.is-user { background: var(--accent-soft); box-shadow: none; }
.doc-links li:has(a[aria-current]) { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.doc-group { color: var(--axis); letter-spacing: 0.07em; font-size: 0.7rem; }
.run-icon.off { background: var(--baseline); color: var(--ink-2); }
.show-more { color: var(--link); }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], input[type="time"], textarea, select {
  border-radius: var(--radius-sm);
}
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 0 1px var(--accent); }
.tip { border-radius: 12px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--border), var(--shadow-lift); }

@media (prefers-reduced-motion: reduce) {
  a.tile-click, a.tile-click:hover, .tile-more, .btn, tbody tr { transition: none; transform: none; }
}

/* «Обновить данные» on a character's «Метрики» too (user, 20.11.2026): «Последний сбор» on the left, the button on the right */
.metrics-head { margin: 2px 0 14px; }
.metrics-head .updated { margin: 0; }

/* The wordmark beside the factory (user, 20.11.2026): «production» and «CONTENT FACTORY» set to one exact width (SVG
   textLength — the caps line is letter-spaced out to the edge of «production»), with air between the lines. */
.brand { gap: 7px; padding-right: 13px; }
.brand-word { display: block; flex: none; overflow: visible; }
.brand-word text { font-family: var(--display); }
.brand-word .bw-1 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; fill: var(--ink); }
.brand-word .bw-2 { font-size: 7px; font-weight: 650; fill: var(--gold); }
.brand .brand-word { margin: 0; padding: 0; }
@media (max-width: 760px) { .brand { padding-right: 4px; } .brand .brand-word { display: none; } }

/* ---------- phones: the sections as a tab bar pinned to the bottom, «☰ Ещё» in its right corner (user, 20.11.2026) ----------
   admin/menu.js adds the icons, the «Ещё» label and the block of sections that do not fit (.menu-extra). */
.nav-ic, .menu-label, .menu-extra { display: none; }
.menu-extra { gap: 2px; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-extra .nav-ic { display: block; width: 18px; height: 18px; }
.menu-extra a.btn { display: flex; align-items: center; gap: 10px; }
.menu-extra a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); }
.nav-ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 760px) {
  .top .nav {
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; margin: 0;
    display: flex; flex-wrap: nowrap; gap: 2px;
    padding: 6px 76px calc(6px + env(safe-area-inset-bottom, 0px)) 6px;
    border-radius: 0; background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: 0 -1px 0 var(--border), 0 -10px 30px -18px rgba(17, 22, 38, 0.35);
  }
  .top .nav a, summary.menu-toggle {
    flex: 1 1 0; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 5px 2px 4px; border-radius: 12px; background: none; box-shadow: none;
    font-size: 0.66rem; font-weight: 560; letter-spacing: 0; line-height: 1.15; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s ease, background-color 0.15s ease;
  }
  .top .nav a:hover, summary.menu-toggle:hover { background: var(--wash); color: var(--ink); box-shadow: none; }
  .top .nav a[aria-current="page"], .top .nav a[aria-current="page"]:hover { color: var(--accent); background: var(--accent-soft); box-shadow: none; font-weight: 650; }
  .top .nav a.nav-overflow { display: none; }
  .top .nav .nav-ic { display: block; width: 23px; height: 23px; }
  .menu { position: fixed; z-index: 61; top: auto; right: 0; bottom: 0; width: 76px; margin: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
  summary.menu-toggle { width: 100%; height: auto; }
  summary.menu-toggle svg { width: 23px; height: 23px; }
  .menu-label { display: block; }
  .menu[open] > summary.menu-toggle { background: var(--accent-soft); color: var(--accent); }
  .menu-panel { top: auto; bottom: calc(100% + 6px); right: 8px; min-width: 240px; max-height: calc(100vh - 140px); overflow-y: auto; }
  .menu-extra:not([hidden]) { display: grid; }
  .top > div:first-child { padding-right: 0; }
  /* «☰» left the header for the bar: the names get its room, so «+» stays on their line */
  h1.chars { margin-right: 0; padding: 0 0 0 50px; column-gap: 20px; font-size: 1.3rem; }
  h1.chars .char + .char::before { left: -10px; }
  .app { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  .top .nav { box-shadow: 0 -1px 0 var(--border), 0 -12px 30px -16px rgba(0, 0, 0, 0.8); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .top .nav a, summary.menu-toggle { transition: none; } }
@media (max-width: 360px) {   /* the narrowest phones: smaller captions so «Анализ рынка» still fits */
  .top .nav { padding-right: 64px; padding-left: 4px; gap: 0; }
  .menu { width: 64px; padding-left: 2px; padding-right: 4px; }
  .top .nav a, summary.menu-toggle { font-size: 0.6rem; padding-left: 1px; padding-right: 1px; white-space: normal; text-align: center; line-height: 1.1; }
  h1.chars { font-size: 1.15rem; column-gap: 16px; padding-left: 46px; }
  h1.chars .char + .char::before { left: -8px; }
}

/* ---------- the bottom bar, round 2 (user, 20.11.2026) ----------
   five equal cells (four sections + «Ещё»), so the spaces between them are the same; «Расписание» in the middle is
   raised under an arc of the bar; «Анализ рынка» is «Анализ» in the bar; even spacing inside «Ещё». */
.nav-short { display: none; }
@media (max-width: 760px) {
  :root { --tab-w: calc((100vw - 12px) / 5); }
  .top .nav { gap: 0; padding-left: 6px; padding-right: calc(var(--tab-w) + 6px); overflow: visible; }
  .menu { width: calc(var(--tab-w) + 6px); padding-left: 0; padding-right: 6px; }
  .top .nav a, summary.menu-toggle { flex: 1 1 0; width: auto; }
  .top .nav .nav-full:has(+ .nav-short) { display: none; }
  .top .nav .nav-short { display: inline; }

  /* the arc: a disc of the bar's own glass behind «Расписание», only its top shows above the bar's edge */
  .top .nav a.nav-main { position: relative; overflow: visible; isolation: isolate; color: var(--ink-2); }
  .top .nav a.nav-main::before {
    content: ""; position: absolute; z-index: -1; left: 50%; top: -22px; width: 76px; height: 76px; margin-left: -38px;
    border-radius: 50%; background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: 0 0 0 1px var(--border), 0 -8px 18px -10px rgba(17, 22, 38, 0.3);
    clip-path: inset(-12px -12px calc(100% - 17px) -12px);
  }
  .top .nav a.nav-main .nav-ic {
    width: 42px; height: 42px; padding: 9px; margin-top: -20px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .top .nav a.nav-main, .top .nav a.nav-main:hover, .top .nav a.nav-main[aria-current="page"] { background: none; }
  .top .nav a.nav-main:hover .nav-ic { background: color-mix(in srgb, var(--accent) 18%, transparent); }
  .top .nav a.nav-main[aria-current="page"] { color: var(--accent); }
  .top .nav a.nav-main[aria-current="page"] .nav-ic {
    background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  }

  /* «Ещё»: the same height for every row and the same space around each divider; it opens above the arc */
  .menu-panel { gap: 2px; padding: 6px; bottom: calc(100% + 22px); }
  .menu-panel .menu-extra a.btn[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .menu-panel .btn, .menu-panel button.btn { min-height: 42px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
  .menu-panel #refresh { justify-content: center; margin: 0 0 6px; }
  .menu-extra { margin: 0 0 6px; padding: 0 0 6px; }
  .menu-panel form { margin: 4px 0 0; padding-top: 6px; }
  .menu-panel form .btn { width: 100%; }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  .top .nav a.nav-main::before { box-shadow: 0 0 0 1px var(--border), 0 -10px 20px -10px rgba(0, 0, 0, 0.8); }
}
@media (max-width: 360px) {
  .top .nav { padding-left: 4px; padding-right: calc(var(--tab-w) + 4px); }
  .menu { width: calc(var(--tab-w) + 4px); padding-right: 4px; }
  .top .nav a.nav-main .nav-ic { width: 38px; height: 38px; padding: 8px; }
}

/* ---------- the bottom bar, round 3 (user, 20.11.2026, on an iPhone) ----------
   It floats: a rounded glass bar lifted off the bottom edge and away from the screen's rounded corners, above the home
   indicator (the pages have viewport-fit=cover, so env(safe-area-inset-*) is known). «Расписание» keeps its arc and
   raised icon but has no colour until it is the open page. */
@media (max-width: 760px) {
  :root {
    --bar-side: max(12px, env(safe-area-inset-left, 0px));
    --bar-bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) - 8px));
    --tab-w: calc((100vw - 2 * var(--bar-side) - 12px) / 5);
  }
  .top .nav {
    left: var(--bar-side); right: var(--bar-side); bottom: var(--bar-bottom);
    padding: 6px calc(var(--tab-w) + 6px) 6px 6px;
    border-radius: 26px;
    box-shadow: 0 0 0 1px var(--border), 0 12px 32px -10px rgba(17, 22, 38, 0.30), 0 2px 6px rgba(17, 22, 38, 0.08);
  }
  .menu { right: var(--bar-side); bottom: var(--bar-bottom); width: calc(var(--tab-w) + 6px); padding: 6px 6px 6px 0; }
  .top .nav a, summary.menu-toggle { border-radius: 20px; }
  .menu-panel { right: 0; }
  .app { padding-bottom: calc(var(--bar-bottom) + 100px); }
  /* the content and the header keep clear of a notch in landscape */
  .app, .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

  /* «Расписание» not open: the same quiet colours as the other tabs */
  .top .nav a.nav-main:not([aria-current="page"]) { color: var(--muted); }
  .top .nav a.nav-main:not([aria-current="page"]) .nav-ic { background: var(--surface-2); color: var(--muted); box-shadow: 0 0 0 1px var(--border), 0 2px 6px -2px rgba(17, 22, 38, 0.12); }
  .top .nav a.nav-main:not([aria-current="page"]):hover .nav-ic { background: var(--field); color: var(--ink); }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  .top .nav { box-shadow: 0 0 0 1px var(--border), 0 14px 34px -10px rgba(0, 0, 0, 0.75); }
  .top .nav a.nav-main:not([aria-current="page"]) .nav-ic { box-shadow: 0 0 0 1px var(--border); }
}
@media (max-width: 360px) {
  :root { --bar-side: max(8px, env(safe-area-inset-left, 0px)); --tab-w: calc((100vw - 2 * var(--bar-side) - 8px) / 5); }
  .top .nav { padding: 5px calc(var(--tab-w) + 4px) 5px 4px; }
  .menu { width: calc(var(--tab-w) + 4px); padding: 5px 4px 5px 0; }
}

/* ---------- the bottom bar, round 4 (user, 20.11.2026): no gap under it ----------
   The bar reaches the very bottom of the screen again (rounded on top only); its buttons stay where round 3 put them:
   above the home indicator (padding = safe-area inset) and clear of the screen's rounded corners (inner side padding). */
@media (max-width: 760px) {
  :root {
    --bar-side: max(14px, env(safe-area-inset-left, 0px));
    --bar-pb: max(10px, env(safe-area-inset-bottom, 0px));
    --tab-w: calc((100vw - 2 * var(--bar-side)) / 5);
  }
  .top .nav {
    left: 0; right: 0; bottom: 0;
    padding: 7px calc(var(--tab-w) + var(--bar-side)) var(--bar-pb) var(--bar-side);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -1px 0 var(--border), 0 -12px 32px -14px rgba(17, 22, 38, 0.28);
  }
  .menu { right: 0; bottom: 0; width: calc(var(--tab-w) + var(--bar-side)); padding: 7px var(--bar-side) var(--bar-pb) 0; }
  .menu-panel { right: var(--bar-side); }
  .app { padding-bottom: calc(var(--bar-pb) + 96px); }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  .top .nav { box-shadow: 0 -1px 0 var(--border), 0 -14px 34px -14px rgba(0, 0, 0, 0.75); }
}
@media (max-width: 360px) {
  :root { --bar-side: max(8px, env(safe-area-inset-left, 0px)); --tab-w: calc((100vw - 2 * var(--bar-side)) / 5); }
  .top .nav { padding: 6px calc(var(--tab-w) + var(--bar-side)) var(--bar-pb) var(--bar-side); }
  .menu { width: calc(var(--tab-w) + var(--bar-side)); padding: 6px var(--bar-side) var(--bar-pb) 0; }
}

/* ---------- phones: the header (logo + characters) stays on screen while the page scrolls (user, 20.11.2026) ----------
   No blur or transform on .top itself: that would make it the box of the fixed bottom bar inside it; the glass is its
   ::before. scroll-padding keeps «scroll to this block» targets clear of it. */
@media (max-width: 760px) {
  :root { --head-h: 64px; }
  html { scroll-padding-top: calc(var(--head-h) + env(safe-area-inset-top, 0px) + 8px); }
  .top {
    position: sticky; top: 0; z-index: 55; max-width: none; margin: 0;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: 10px;
  }
  .top::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: color-mix(in srgb, var(--page) 80%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: 0 1px 0 var(--border), 0 8px 24px -16px rgba(17, 22, 38, 0.25);
  }
  .brand { top: calc(12px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); }
  h1.chars { margin-bottom: 0; min-height: 40px; align-items: center; }
  .app { padding-top: 14px; }
  .nc-side { top: calc(var(--head-h) + env(safe-area-inset-top, 0px) + 8px); }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  .top::before { box-shadow: 0 1px 0 var(--border), 0 10px 26px -16px rgba(0, 0, 0, 0.8); }
}

/* ---------- «Расписание» vanished while scrolling (user, 20.11.2026, iPhone; reproduced in Chrome too) ----------
   The arc used to be a pseudo-element under the tab itself (negative z-index in an isolated link, with its own blur):
   once the page scrolled under the bar the browsers painted it over the icon and the caption. Now the arc is drawn by
   the bar (.nav::before, behind all the tabs) above the middle cell, without blur, in the bar's colour. */
@media (max-width: 760px) {
  .top .nav { background: color-mix(in srgb, var(--surface) 96%, transparent); }
  .top .nav a.nav-main { isolation: auto; }
  .top .nav a.nav-main::before { content: none; display: none; }
  .top .nav::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    left: calc(var(--bar-side) + 2.5 * var(--tab-w) - 38px); top: -16px; width: 76px; height: 76px;
    border-radius: 50%; background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 0 0 1px var(--border), 0 -8px 18px -10px rgba(17, 22, 38, 0.3);
    clip-path: inset(-12px -12px calc(100% - 17px) -12px);
  }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  .top .nav::before { box-shadow: 0 0 0 1px var(--border), 0 -10px 20px -10px rgba(0, 0, 0, 0.8); }
}

/* ---------- «Ещё» on phones: a bottom sheet (user, 20.11.2026) ----------
   Dimmed page, a sheet from the bottom with a handle, «Ещё» and «✕» (menu.js .sheet-head); tiles with icons for the
   places (Форматы, Идеи, Тренды, Инструкция, Настройки) and «Обновить»; then «Выйти».
   The order and the icons come from CSS only: translate.js and char.js keep adding their items as before. */
.sheet-head { display: none; }
@media (max-width: 760px) {
  html.sheet-open { overflow: hidden; }
  .menu[open]::before {
    content: ""; position: fixed; inset: 0; background: rgba(9, 11, 17, 0.45);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: sheet-fade 0.2s ease;
  }
  .top .menu .menu-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; min-width: 0; max-width: none;
    max-height: min(86vh, 640px); overflow-y: auto; overscroll-behavior: contain;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start;
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    border-radius: 26px 26px 0 0; background: var(--field);
    box-shadow: 0 -1px 0 var(--border), 0 -20px 50px -20px rgba(9, 11, 17, 0.5);
    animation: sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .top .menu .menu-panel > * { order: 10; }
  .top .menu .menu-panel > .sheet-head { order: 0; grid-column: 1 / -1; display: flex; align-items: center; position: relative; padding: 18px 0 4px; }
  .sheet-head::before { content: ""; position: absolute; top: 2px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--baseline); }
  .sheet-title { font-family: var(--display); font-size: 1.15rem; font-weight: 680; letter-spacing: -0.015em; color: var(--ink); }
  .sheet-close {
    margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--wash); color: var(--ink-2); font: inherit; font-size: 0.9rem; line-height: 1;
  }
  .sheet-close:hover { background: var(--border-strong); color: var(--ink); }

  /* tiles */
  .top .menu .menu-panel .menu-extra:not([hidden]) { display: contents; }
  .top .menu .menu-panel .menu-extra a { order: 1; }
  .top .menu .menu-panel a[href*="/ideas"] { order: 2; }
  .top .menu .menu-panel a[href*="/trends"] { order: 3; }
  .top .menu .menu-panel a[href*="/blogs"] { order: 4; }
  .top .menu .menu-panel a[href*="/settings"] { order: 5; }
  .top .menu .menu-panel #refresh { order: 6; }
  .top .menu .menu-panel .menu-extra a, .top .menu .menu-panel > a.btn, .top .menu .menu-panel #refresh {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px;
    min-height: 92px; margin: 0; padding: 14px; border-radius: 18px; text-align: left; white-space: normal;
    background: var(--surface-2); color: var(--ink); font-size: 0.86rem; font-weight: 600; line-height: 1.25;
    box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(17, 22, 38, 0.04); filter: none;
  }
  .top .menu .menu-panel .menu-extra a:hover, .top .menu .menu-panel > a.btn:hover { background: var(--surface-2); color: var(--ink); box-shadow: 0 0 0 1px var(--border-strong), 0 4px 14px -6px rgba(17, 22, 38, 0.2); }
  .top .menu .menu-panel .menu-extra a[aria-current="page"], .top .menu .menu-panel > a.btn[aria-current="page"] {
    background: var(--surface-2); color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent);
  }
  /* the icon in a soft square at the top of each tile: Форматы has its own <svg>, the others are masks */
  .top .menu .menu-panel .menu-extra a .nav-ic {
    display: block; width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  }
  .top .menu .menu-panel > a.btn::before, .top .menu .menu-panel #refresh::before, .top .menu .menu-panel form .btn::before {
    content: ""; display: block; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft);
  }
  .top .menu .menu-panel form .btn { position: relative; }
  .top .menu .menu-panel > a.btn::after, .top .menu .menu-panel #refresh::after, .top .menu .menu-panel form .btn::after {
    content: ""; position: absolute; width: 20px; height: 20px; background: var(--accent);
    -webkit-mask: var(--ic) no-repeat center / contain; mask: var(--ic) no-repeat center / contain;
  }
  .top .menu .menu-panel > a.btn::after, .top .menu .menu-panel #refresh::after { left: 23px; top: 23px; }
  .top .menu .menu-panel a[href*="/ideas"] { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.6 10.8c.6.5 1.1 1.3 1.1 2.2h5c0-.9.5-1.7 1.1-2.2A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
  .top .menu .menu-panel a[href*="/trends"] { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8M15 7h6v6'/%3E%3C/svg%3E"); }
  .top .menu .menu-panel a[href*="/blogs"] { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h12v16H6a2 2 0 0 0-2 2zM4 19V5M8 7h6'/%3E%3C/svg%3E"); }
  .top .menu .menu-panel a[href*="/settings"] { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
  .top .menu .menu-panel #refresh { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 0 0-14.7-4.3M4 5v4h4M4 13a8 8 0 0 0 14.7 4.3M20 19v-4h-4'/%3E%3C/svg%3E"); }
  .top .menu .menu-panel form .btn { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4h3a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-3M10 8l-4 4 4 4M6 12h10'/%3E%3C/svg%3E"); }
  /* «Обновить» — the one accent tile */
  .top .menu .menu-panel #refresh, .top .menu .menu-panel #refresh:hover {
    background: linear-gradient(160deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
    box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 80%, transparent);
  }
  .top .menu .menu-panel #refresh:hover { filter: brightness(1.05); }
  .top .menu .menu-panel #refresh::before { background: rgba(255, 255, 255, 0.2); }
  .top .menu .menu-panel #refresh::after { background: var(--accent-ink); }
  .top .menu .menu-panel #refresh:disabled { opacity: 0.75; }

  /* the row: «Выйти» (the translation switch moved to «Настройки», 20.11.2026) */
  .top .menu .menu-panel form { order: 8; grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
  .top .menu .menu-panel form .btn {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: 9px 14px 9px 9px;
    border-radius: 16px; background-color: var(--surface-2); color: var(--ink); text-align: left; font-size: 0.9rem; font-weight: 600;
    box-shadow: 0 0 0 1px var(--border); filter: none;
  }
  .top .menu .menu-panel form .btn::after { left: 18px; top: 18px; }
  .top .menu .menu-panel form .btn:hover { background-color: var(--surface-2); box-shadow: 0 0 0 1px var(--border-strong); }
  .top .menu .menu-panel form .btn { color: var(--bad-text); }
  .top .menu .menu-panel form .btn::before { background: color-mix(in srgb, var(--bad-text) 12%, transparent); }
  .top .menu .menu-panel form .btn::after { background: var(--bad-text); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .top .menu .menu-panel, .menu[open]::before { animation: none; } }

/* =====================================================================================================================
   Phones — audit of every block (user, 20.11.2026). admin/mobile.js labels table cells and folds the list of documents.
   ===================================================================================================================== */
.doc-toggle { display: none; }
@media (max-width: 760px) {
  /* roomier cards, but less side padding: the screen is narrow */
  .card { padding: 16px 16px 14px; margin-bottom: 14px; border-radius: 18px; }
  .grid2 .card { margin-bottom: 14px; }
  .sub { font-size: 0.86rem; }

  /* touch targets and no iOS zoom on focus (a field under 16px makes Safari zoom the page in) */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; padding: 7px 12px; }
  input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"], input[type="url"],
  input[type="date"], input[type="time"], input[type="datetime-local"], textarea, select { font-size: 16px !important; }

  /* ---------- tables of 4+ columns become cards (mobile.js marks them .m-cards and gives each cell data-label) ---------- */
  .table-wrap:has(> table.m-cards) { overflow: visible; }
  table.m-cards { display: block; min-width: 0 !important; width: 100%; table-layout: auto; margin-top: 10px; }
  table.m-cards thead { display: none; }
  table.m-cards tbody, table.m-cards tfoot { display: grid; gap: 10px; }
  table.m-cards tfoot { margin-top: 10px; }
  table.m-cards tr {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px 10px;
    padding: 12px 14px; border-radius: 14px; background: var(--field); box-shadow: inset 0 0 0 1px var(--border);
  }
  #factory-models table.m-cards tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.m-cards tbody tr:hover { background: var(--field); }
  table.m-cards td, table.m-cards th {
    display: block; padding: 0; border: 0; min-width: 0 !important; width: auto !important; max-width: none;
    text-align: left !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
    font-size: 0.88rem; overflow-wrap: anywhere;
  }
  table.m-cards td::before, table.m-cards th::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: 0.72rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); line-height: 1.25;
    white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none;
  }
  table.m-cards td[data-label=""]::before, table.m-cards th[data-label=""]::before { display: none; }
  /* the first cell is the card's title: the whole width, larger, no label */
  table.m-cards tr > :first-child { grid-column: 1 / -1; font-size: 0.95rem; font-weight: 620; color: var(--ink); padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  table.m-cards tr > :first-child::before { display: none; }
  table.m-cards tr > :first-child a { font-weight: 620; }
  table.m-cards .ov-total, table.m-cards tr.ov-total { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
  table.m-cards .ov-total th, table.m-cards .ov-total td { border-top: 0; }
  table.m-cards .ov-cell { justify-items: start; }

  /* ---------- «Источники данных» and «Сбор данных»: name and button on one line, the message under them ---------- */
  .run { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); }
  .runs .run:last-child { border-bottom: 0; }
  .run-name { grid-column: 2; min-width: 0; }
  .run-btn { grid-column: 3; grid-row: 1; justify-self: end; margin: 0; min-height: 32px; padding: 5px 11px; font-size: 0.78rem; }
  .run-msg { grid-column: 2 / -1; grid-row: 2; font-size: 0.84rem; }
  .run-msg:empty { display: none; }
  .runs { gap: 0; }
  .acc-form { margin: 4px 0 10px; }

  /* ---------- «Расписание»: each post a card; the time on the left, the buttons in one even row under it ---------- */
  .sched-item { grid-template-columns: 52px minmax(0, 1fr); gap: 8px 12px; padding: 12px; margin: 0 0 8px; border-radius: 14px; background: var(--field); box-shadow: inset 0 0 0 1px var(--border); }
  .sched-item:hover { background: var(--field); }
  .sched-item.is-today { box-shadow: inset 0 0 0 2px var(--accent); margin: 0 0 8px; }
  .sched-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: stretch; padding-top: 8px; border-top: 1px solid var(--border); }
  .sched-acts > .btn, .sched-acts > .btn-sm { flex: 1 1 auto; }
  .sched-move { margin-right: 0; }
  .sched-move .btn-sm { min-width: 40px; }

  /* ---------- the list of documents: one line «Документ: … ▾», the list opens under it ---------- */
  .doc-list { padding: 6px; }
  .doc-toggle {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "s m" "t m"; align-items: center; column-gap: 10px;
    width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  }
  .doc-toggle small { grid-area: s; font-size: 0.68rem; font-weight: 620; letter-spacing: 0.06em; text-transform: uppercase; color: var(--axis); }
  .doc-toggle span { grid-area: t; font-weight: 640; font-size: 0.98rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .doc-toggle em { grid-area: m; font-style: normal; font-size: 0.8rem; font-weight: 600; color: var(--accent); padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); }
  .doc-toggle em::after { content: " ▾"; }
  #doc-list.is-open .doc-toggle em::after { content: " ▴"; }
  /* only the list itself folds: on «Анализ рынка» and «Идеи» the card also holds «Новый срез» / «Поиск новых звёзд» above it */
  #doc-list:not(.is-open) > :not(.doc-toggle) { display: none; }
  #doc-list.is-open > .doc-toggle { margin-bottom: 6px; border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
  #doc-list.is-open { padding-bottom: 10px; }
  .doc-links a { padding-top: 9px; }
  .doc-links small { padding-bottom: 9px; }

  /* ---------- tiles: a name instead of a number («Быстрее всего растёт: Instagram») fits the tile ---------- */
  .tile-value.lk-pl { font-size: 1.25rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }
  .tile-value.lk-pl .logo { width: 20px; height: 20px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 1.75rem; }

  /* ---------- long words and links never push the page sideways ---------- */
  .md, .card { overflow-wrap: anywhere; }
  .md pre { white-space: pre-wrap; }
  .md table:not(.m-cards) { display: block; overflow-x: auto; }
}
@media (max-width: 760px) {
  /* «Ещё» sits in the sticky header's fixed bar; browsers sometimes skipped painting it — its own layer keeps it drawn
     (the transform is on the button only: on .menu it would trap the fixed sheet and backdrop inside it) */
  summary.menu-toggle { -webkit-transform: translateZ(0); transform: translateZ(0); }
}

/* ---------- «Видео-завод» cards on phones (user, 20.11.2026) ----------
   «Этап» broke into «Опублико / ван» on a dark chip with dark text, and the views per platform fell apart digit by digit.
   Chips and numbers never break inside; the publications take the card's whole width; the stage colours are restored
   (the «Design 2» chip rule had overridden the backgrounds but not the text colours). */
.stage-assembled { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good-text); box-shadow: none; }
.stage-published { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good-text); box-shadow: none; }
.pub a, .pub > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  table.m-cards td, table.m-cards th { overflow-wrap: break-word; }
  table.m-cards .stage { white-space: nowrap; padding: 3px 9px; }
  table.m-cards td:has(.pub) { grid-column: 1 / -1; }
  table.m-cards .pub { display: flex; flex-wrap: wrap; gap: 6px 16px; }
  table.m-cards .pub a, table.m-cards .pub > span { overflow-wrap: normal; font-weight: 600; color: var(--ink); }
  table.m-cards .pub .logo { width: 17px; height: 17px; }
}
@media (max-width: 760px) {
  /* «Этап» (user, 20.11.2026, iPhone Pro Max): with four narrow columns the chip «Опубликован» ran over «Опубликован 8–9 ноя».
     The stage gets two columns' room; a chip never grows wider than its cell. */
  table.m-cards td:has(.stage) { grid-column: span 2; }
  table.m-cards .stage { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* «Ролики» of the video factory on phones: 3 latest, «Показать ещё» +5 (admin.js renderFactory; user, 20.11.2026) */
.fv-more { display: none; }
@media (max-width: 760px) {
  #factory-videos tr.fv-hide { display: none !important; }
  .fv-more { display: flex; flex-wrap: wrap; padding: 4px 2px 2px; }
}

/* The chats' «Внести правки … с ИИ» and «Пересобрать» are plain outlines until pressed (user, 20.11.2026); a chat's
   button is filled while its chat is open — like «Редактировать с ИИ» of a document. */
#chat-open[aria-expanded="true"], #pub-chat-open[aria-expanded="true"], .market-new-btn[aria-expanded="true"] {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px -4px color-mix(in srgb, var(--accent) 55%, transparent);
}
#chat-open[aria-expanded="true"]:hover, #pub-chat-open[aria-expanded="true"]:hover, .market-new-btn[aria-expanded="true"]:hover { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); filter: brightness(1.06); }

/* Connection bar (admin/net.js, audit of 20.11.2026): a saved copy is on the screen, or the server does not answer.
   At the bottom, clear of the header; on phones above the bottom sections bar. */
.net-bar {
  position: fixed; z-index: 70; bottom: 18px; left: 0; right: 0; margin: 0 auto; width: fit-content;   /* centred, not squeezed */
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); box-sizing: border-box;
  padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lift); font-size: 0.85rem; line-height: 1.3;
}
.net-bar[hidden] { display: none; }
.net-bar.is-down { color: var(--bad-text); padding-right: 6px; }
.net-bar-btn {
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; flex: none;
  background: transparent; color: var(--ink-2); border: 0; border-radius: 999px; padding: 4px 12px;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.net-bar-btn:hover { background: var(--wash); }
@media (max-width: 760px) {
  .net-bar { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }   /* just above the sections bar */
}

/* ---------- «Ещё» keeps the bottom bar (user, 20.11.2026) ----------
   The bar stays on top of the dimmed page and can be used while «Ещё» is open; the sheet becomes a card floating just
   above the bar (and above the arc of «Расписание»). «Ещё» itself shows ✕ and closes it. */
@media (max-width: 760px) {
  :root { --bar-h: calc(59px + var(--bar-pb, 10px)); }
  /* the dim is under the header and the bar (they are in .top, z-index 55), so both stay usable; a tap on it closes
     «Ещё» (menu.js: a click outside the menu) */
  .menu[open]::before { content: none; display: none; }
  html.sheet-open body::after {
    content: ""; position: fixed; inset: 0; z-index: 50; background: rgba(9, 11, 17, 0.45);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: sheet-fade 0.2s ease;
  }
  .top .menu .menu-panel {
    left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--bar-h) + 24px);
    max-height: calc(100vh - var(--bar-h) - 110px);
    padding: 6px 14px 14px; border-radius: 24px;
    box-shadow: 0 0 0 1px var(--border), 0 24px 60px -18px rgba(9, 11, 17, 0.55);
    animation: sheet-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: 90% 100%;
  }
  .top .menu .menu-panel > .sheet-head { padding-top: 14px; }
  .top .menu .menu-panel > .sheet-head::before { display: none; }
}
@keyframes sheet-pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .top .menu .menu-panel { animation: none; } }

/* Charts on touch screens: a sideways drag belongs to the chart (the numbers follow the finger — admin/mobile.js),
   up and down still scroll the page; no text selection or iOS magnifier on a long press (user, 20.11.2026). */
.chart { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (hover: none), (max-width: 760px) {
  .chart, .chart svg { touch-action: pan-y; }
  .chart .hit { cursor: default; }
  .tip { pointer-events: none; transition: left 0.05s linear, top 0.05s linear; }
}
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

/* ---------- ☰ → «Настройки» (user, 20.11.2026): notifications, the Telegram bot, the translation ---------- */
.settings { max-width: 860px; }
.set-head, .set-row { display: flex; align-items: flex-start; gap: 14px; }
.set-row { align-items: center; }
.set-head h2, .set-row h2 { margin: 0; }
.set-head .sub, .set-row .sub { margin: 4px 0 0; }
.set-row-text { flex: 1 1 auto; min-width: 0; }
.set-ic {
  flex: none; position: relative; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft);
}
.set-ic::after {
  content: ""; position: absolute; inset: 10px; background: var(--accent);
  -webkit-mask: var(--ic) no-repeat center / contain; mask: var(--ic) no-repeat center / contain;
}
.set-ic-bell { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.9 1.9 0 0 0 3.4 0'/%3E%3C/svg%3E"); }
.set-ic-tg { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 4L3 11l6 2.5M21 4l-3.5 16L9 13.5M21 4L9 13.5v5.5l3-3'/%3E%3C/svg%3E"); }
.set-ic-tr { --ic: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h9M8.5 3v2M6 5c.5 3 2.5 5.5 5.5 7M11 5c-.5 3-2.5 6-6.5 8M13 21l4-10 4 10M14.5 17.5h5'/%3E%3C/svg%3E"); }
.set-body { margin-top: 14px; padding-left: 54px; }
.set-body > p:first-child { margin-top: 0; }
.set-state { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; color: var(--ink); }
.set-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--baseline); }
.set-dot.on { background: var(--good); }
.set-dot.bad { background: var(--bad-text); }
.set-body .connect { margin-top: 12px; }
.set-msg { margin: 10px 0 0 54px; min-height: 0; }
.set-msg:empty { display: none; }
.settings .tg-item:first-child { padding-top: 0; }
/* the switch (role="switch"): on — green, off — grey */
.switch {
  flex: none; position: relative; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--baseline); transition: background-color 0.18s ease;
}
.switch[aria-checked="true"] { background: var(--good); }
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(9, 11, 17, 0.3); transition: transform 0.18s ease;
}
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch-knob { transition: none; } }
@media (max-width: 760px) {
  .set-body { padding-left: 0; }
  .set-msg { margin-left: 0; }
}

.schedule-publications .list-head { margin-bottom: 8px; }
.schedule-archive-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.schedule-archive-actions .btn { margin: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.schedule-archive-actions .btn[aria-expanded="true"] { background: var(--wash); }
.schedule-publications .schedule-list-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px;
}
.schedule-list-actions .btn { margin: 0; min-height: 44px; padding: 8px 14px; line-height: 1.3; text-wrap: balance; }
.schedule-publications #add-msg:empty, .history-short { display: none; }
@media (max-width: 760px) {
  .schedule-archive-actions { width: 100%; }
  .schedule-archive-actions .btn { padding-inline: 4px; }
  .schedule-publications .history-full { display: none; }
  .schedule-publications .history-short { display: inline; }
  .schedule-publications .schedule-list-actions { max-width: none; gap: 8px; margin-bottom: 12px; }
  .schedule-list-actions .btn { min-width: 0; min-height: 48px; padding: 6px 4px; white-space: normal; overflow-wrap: anywhere; }
}

.doc-fold-row, .doc-fold-content { display: contents; }
.doc-fold-button, .doc-fold-extra { display: none; }
@media (max-width: 760px) {
  .md .doc-fold-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--grid); padding: 4px 0; }
  .md .doc-fold-row > :first-child { margin: 0; padding: 0; border: 0; font-size: 1rem; font-weight: 650; }
  .doc-fold-button { display: block; flex: none; min-height: 44px; border: 0; background: transparent; color: var(--link); font: inherit; font-size: .85rem; cursor: pointer; }
  .doc-fold-row:not(.expanded) + .doc-fold-content { display: none; }
}

@media (max-width: 760px) {
  .star-card:not(.card-expanded) > :not(.star-top):not(.card-fold) { display: none; }
  .star-card .card-fold { align-self: flex-start; }
}
