/* Розовый минимализм: румяный фон, белые карточки, ярко-розовые кнопки-«таблетки», сливовый текст. */
/* Минимализм с пастельно-розовыми акцентами: спокойный светлый фон, белые карточки, нежные розовые кнопки. */
:root {
  color-scheme: light;
  --font-display: "Unbounded", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f6f4f2; --surface: #ffffff; --surface-2: #f8eef2; --line: #ece4e7;
  --ivory: #fffdf8; /* карточки Легенды — слоновая кость */
  --text: #1c1a1b; --text-2: #5c5257; --muted: #7d7277;
  --accent: #b0466f; --link: #0b6b4f; --accent-2: #f6c9d9; --accent-ink: #1c1a1b; --accent-soft: #fbe7ef; --btn-from: #f9d5e2; --btn-to: #f3bcd0;
  --bar: #eeaac4; --bar-unk: #f6dbe5; --ma: #1c1a1b; --ma3: #8a6fc9;
  --band: rgba(238, 170, 196, .18); --price: #8a5a00;
  --good: #1e7a4c; --bad: #b3263e; --warn: #9a5b00;
  --ev-chapter: #1baf7a; --ev-discount: #eb6834; --ev-start: #4a3aa7; --ev-promo: #eda100; --ev-contest: #2a78d6; --ev-note: #7d7277; --ev-outage: #c4506a;
  --shadow: 0 2px 10px rgba(60, 30, 45, .05);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #161515; --surface: #201f1f; --surface-2: #2c2427; --line: #353032; --ivory: #201f1f;
    --text: #f7f3f4; --text-2: #cfc4c8; --muted: #a2969b;
    --accent: #f2b3ca; --link: #6fd0aa; --accent-2: #f2b3ca; --accent-ink: #1c1a1b; --accent-soft: #3a2a30; --btn-from: #f6c6d7; --btn-to: #eeaac4;
    --bar: #e79ab8; --bar-unk: #5a3a46; --ma: #f7f3f4; --ma3: #b79bff;
    --band: rgba(242, 179, 202, .12); --price: #e0b45a;
    --good: #5fd39b; --bad: #ff8fa0; --warn: #f0b85a;
    --ev-chapter: #199e70; --ev-discount: #d95926; --ev-start: #9085e9; --ev-promo: #c98500; --ev-contest: #3987e5; --ev-note: #a2969b; --ev-outage: #e07a90;
    --shadow: 0 2px 10px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161515; --surface: #201f1f; --surface-2: #2c2427; --line: #353032; --ivory: #201f1f;
  --text: #f7f3f4; --text-2: #cfc4c8; --muted: #a2969b;
  --accent: #f2b3ca; --link: #6fd0aa; --accent-2: #f2b3ca; --accent-ink: #1c1a1b; --accent-soft: #3a2a30; --btn-from: #f6c6d7; --btn-to: #eeaac4;
  --bar: #e79ab8; --bar-unk: #5a3a46; --ma: #f7f3f4; --ma3: #b79bff;
  --band: rgba(242, 179, 202, .12); --price: #e0b45a;
  --good: #5fd39b; --bad: #ff8fa0; --warn: #f0b85a;
  --ev-chapter: #199e70; --ev-discount: #d95926; --ev-start: #9085e9; --ev-promo: #c98500; --ev-contest: #3987e5; --ev-note: #a2969b; --ev-outage: #e07a90;
  --shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font-body); padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
main { max-width: 860px; margin: 0 auto; padding: 12px 16px 24px; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 20px; margin: 0; color: var(--text); } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 14px 0 6px; font-weight: 800; }
.top { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 16px 0; max-width: 860px; margin: 0 auto; }
.top small { color: var(--muted); display: block; font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 14px; margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 12px; min-width: 0; }
.stat .k { font-size: 12px; color: var(--text-2); } .stat .v { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.up { color: var(--good); } .down { color: var(--bad); } .warnc { color: var(--warn); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 6px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { text-align: left; } th { font-weight: 600; color: var(--text-2); font-size: 12px; }
tr.total td { font-weight: 650; border-top: 2px solid var(--line); }
.scroll { overflow-x: auto; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 9px 18px; min-height: 42px; cursor: pointer; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.primary, .btn.primary { background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); border-color: var(--btn-to); color: var(--accent-ink); font-weight: 800; box-shadow: none; }
button:not(.primary):not(.link):not(.chip) { border-color: var(--btn-to); color: var(--text); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
button.danger, button.danger:not(.primary) { color: var(--bad); border-color: var(--bad); } button.link { border: 0; background: none; padding: 4px 6px; min-height: 0; color: var(--link); }
button:disabled { opacity: .5; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .row.between { justify-content: space-between; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; min-height: 34px; font-size: 14px; }
.chip { font-weight: 700; color: var(--text-2); }
.chip.on { background: var(--btn-from); color: var(--accent-ink); border-color: var(--btn-to); }
label { display: block; font-size: 13px; color: var(--text-2); margin: 10px 0 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 10px; min-height: 42px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); }
input[type=checkbox] { width: auto; min-height: 0; margin-right: 8px; }
textarea { min-height: 80px; } .f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabs a { flex: 1; text-align: center; padding: 8px 2px 7px; font-size: 11px; color: var(--muted); text-decoration: none; min-height: 56px; }
nav.tabs a b { display: block; font-size: 20px; line-height: 1.2; font-weight: normal; }
nav.tabs a.on { color: var(--text); font-weight: 800; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); }
.badge.good { color: var(--good); border-color: var(--good); } .badge.bad { color: var(--bad); border-color: var(--bad); } .badge.warn { color: var(--warn); border-color: var(--warn); }
.list a.item, .list .item { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.list .item:last-child { border-bottom: 0; }
.bar-share { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 5px; } .bar-share i { display: block; height: 100%; background: var(--bar); border-radius: 3px; }
.progress { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin: 8px 0; } .progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--btn-from), var(--btn-to)); border-radius: 5px; }
.alert { border: 1px solid var(--warn); border-radius: 10px; padding: 10px 12px; margin: 8px 0; color: var(--text); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.alert.ok { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.alert.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.chart { position: relative; touch-action: pan-y; } .chart svg { display: block; }
.grid { stroke: var(--line); stroke-width: 1; } .axis { fill: var(--muted); font-size: 10px; }
.bar { fill: var(--bar); } .bar.unk { fill: var(--bar-unk); }
.ma { stroke: var(--ma); stroke-width: 2; stroke-linejoin: round; } .ma3 { stroke: var(--ma3); stroke-width: 2; stroke-dasharray: 5 4; }
.band { fill: var(--band); } .price { stroke: var(--price); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ev { stroke: var(--surface); stroke-width: 2; } .evn { font-size: 8px; fill: #fff; pointer-events: none; }
.line1 { stroke: var(--bar); stroke-width: 2; } .dot1 { fill: var(--bar); stroke: var(--surface); stroke-width: 2; }
.cursor { stroke: var(--muted); stroke-width: 1; }
.tip { position: absolute; top: 20px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.18); pointer-events: none; max-width: 240px; z-index: 3; }
.tip b { font-size: 13px; } .tev { display: flex; align-items: center; gap: 6px; margin-top: 3px; } .tev i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; } .legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; } .legend i.dot { width: 9px; height: 9px; border-radius: 50%; }
.legend i.ln { height: 0; border-top: 2px solid var(--ma); border-radius: 0; } .legend i.ln3 { height: 0; border-top: 2px dashed var(--ma3); border-radius: 0; } .legend i.pr { height: 0; border-top: 2px dashed var(--price); border-radius: 0; }
dialog { border: 1px solid var(--line); border-radius: 26px; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 20px)); max-height: 92vh; padding: 16px; }
dialog::backdrop { background: rgba(0,0,0,.45); }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 20; max-width: 90vw; font-size: 14px; }
#toast .toast-undo { margin-left: 10px; min-height: 0; padding: 2px 10px; font-size: 14px; background: transparent; color: var(--bg); border: 1px solid currentColor; border-radius: 999px; }
.auth { max-width: 380px; margin: 8vh auto; padding: 0 16px; } .boot { padding: 24px; color: var(--muted); }
.demo { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-bottom: 1px solid var(--warn); font-size: 12px; padding: 6px 16px; text-align: center; }
.dl dt { color: var(--text-2); font-size: 13px; margin-top: 8px; } .dl dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill-ev { display: inline-flex; align-items: center; gap: 6px; } .pill-ev i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
@media (min-width: 700px) { .grid4 { grid-template-columns: repeat(4, 1fr) !important; } }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

/* ---------- Мастерская: обложки, метки, галерея ---------- */
.big { font-family: var(--font-display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.covers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .covers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cover-tile { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cover { aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); max-width: 100%; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-ph { width: 100%; height: 100%; display: flex; align-items: flex-end; padding: 14px; background: linear-gradient(160deg, var(--surface-2), var(--btn-from) 55%, var(--btn-to)); }
.cover-ph span { font-family: var(--font-display); color: #1c1a1b; font-size: 14px; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.ct-title { font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-num { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); text-decoration: none; }
.tag.on { background: var(--accent-soft); color: var(--accent); }
.book-head { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 480px) { .book-head { grid-template-columns: 1fr; } .book-head .cover.big { max-width: 200px; } }
.cover.big { display: flex; flex-direction: column; gap: 8px; aspect-ratio: auto; background: none; box-shadow: none; overflow: visible; }
.cover.big > img, .cover.big > .cover-ph { aspect-ratio: 2 / 3; border-radius: 18px; box-shadow: var(--shadow); height: auto; }
.small-btn { font-size: 13px; min-height: 34px; padding: 6px 12px; cursor: pointer; }
.book-info { min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
label.check { display: inline-flex; align-items: center; gap: 4px; margin: 6px 0; color: var(--text); font-size: 14px; }
.idea-text { white-space: pre-wrap; margin: 8px 0; }
.comments { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; display: grid; gap: 8px; }
.comment { background: var(--surface-2); border-radius: 14px; padding: 8px 10px; }
.faded { opacity: .6; }
.alert-card { border-color: var(--bad); }
button.wide { width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.g-item { position: relative; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); min-height: 0; box-shadow: var(--shadow); }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-item .tag { position: absolute; left: 6px; bottom: 6px; }
details summary { cursor: pointer; font-weight: 700; color: var(--link); }
.top .row { flex-wrap: nowrap; }
/* компактная шапка на телефоне */
.top { flex-wrap: wrap; row-gap: 6px; }
.top > div:first-child { min-width: 0; }
.top .row { gap: 6px; }
.top .btn, .top button { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.top button[aria-label] { width: 34px; padding: 0; }
/* нижнее меню не отрывается от низа экрана при прокрутке до конца (эффект «резинки» на телефоне) */
html, body { overscroll-behavior-y: none; }
nav.tabs { transform: translateZ(0); }
nav.tabs::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: var(--surface); }
.tax-sum { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.unpaid { margin-top: 12px; padding: 10px 12px; border-radius: 16px; background: var(--accent-soft); }

/* окна целиком помещаются в экран телефона (с учётом панели браузера) и прокручиваются внутри */
dialog { margin: auto; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
dialog h2 { outline: none; padding-right: 8px; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.shot { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: 96px; height: 96px; min-height: 0; background: var(--surface-2); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* иконки: тонкие линии, цвет — от текста */
.ic { flex: none; display: inline-block; vertical-align: -0.2em; }
nav.tabs a b { display: flex; justify-content: center; height: 26px; align-items: center; }
nav.tabs a .ic { width: 22px; height: 22px; }
nav.tabs a.on { color: var(--text); }
nav.tabs a.on .ic { color: var(--link); stroke-width: 2; }
.top .ic, button .ic, .btn .ic { width: 18px; height: 18px; }
.tag .ic, .small .ic, td .ic, .item .ic, p .ic, b .ic { width: 1.05em; height: 1.05em; }
nav.tabs a { color: var(--text-2); }
nav.tabs a .ic { color: var(--text); }
nav.tabs a.on .ic { color: var(--link); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 6px; }
.tiles > div { background: var(--surface-2); border-radius: 16px; padding: 10px 12px; min-width: 0; }
.tiles .k { font-size: 12px; color: var(--text-2); } .tiles .v { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-top: 2px; } .tiles .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar-row { margin-top: 8px; }
.progress.ok i { background: linear-gradient(90deg, #bfe8cf, #7fd3a2); }
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; }
.day-nav button { width: 44px; padding: 0; font-size: 18px; }
.day-title { flex: 1; text-align: center; min-width: 0; }
.day-title input { text-align: center; font-weight: 800; border: 0; background: transparent; min-height: 36px; }
.day-sum { font-family: var(--font-display); font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip-stat { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
/* ссылки — аккуратно, без подчёркивания; «назад» — маленькая кнопка */
main a:not(.btn):not(.item):not(.tag):not(.cover-tile):not(.tap) { color: var(--link); text-decoration: none; font-weight: 700; }
.btn.back { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.btn.small-btn { min-height: 34px; padding: 6px 14px; font-size: 14px; }
tr.sel td { background: var(--accent-soft); }
/* кнопки в заголовках карточек — одного размера и вида, как «Отчёт» */
.card > .row.between:first-child > :is(button, .btn):not(.link),
.card > .row.between:first-child > .row > :is(button, .btn):not(.link) { min-height: 34px; padding: 6px 14px; font-size: 14px; font-weight: 700; background: var(--surface); border-color: var(--btn-to); color: var(--text); }
/* все кнопки — на страницах и в окнах — одного аккуратного размера, как «Отчёт» */
:is(main, dialog) :is(button, .btn):not(.link):not(.chip):not(.wide) { min-height: 34px; padding: 6px 14px; font-size: 14px; }
/* выбор месяца внизу «Рекламы»: одна тихая строка */
.archive { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; max-width: 860px; margin: 6px auto 0; padding: 4px 4px 0; font-size: 14px; color: var(--muted); }
.archive label { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.archive select { width: auto; min-height: 30px; padding: 2px 6px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); font-weight: 700; cursor: pointer; }
.archive button.link { margin-left: auto; font-size: 14px; }
/* окна: скругление не ломается полосой прокрутки — прокручивается содержимое внутри, кнопки всегда видны внизу */
dialog { padding: 0; overflow: hidden; }
#sheetForm { max-height: calc(100vh - 34px); max-height: calc(100dvh - 34px); overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#sheetForm::-webkit-scrollbar { width: 6px; }
#sheetForm::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
#sheetForm::-webkit-scrollbar-track { background: transparent; margin: 18px 0; }
.sheet-actions { position: sticky; bottom: 0; margin: 16px -18px 0; padding: 12px 18px 16px; background: var(--surface); border-top: 1px solid var(--line); }
/* широкие таблицы с цифрами — компактнее, листаются вбок */
table.tight { font-size: 13px; }
table.tight th { white-space: nowrap; font-size: 12px; }
table.tight td { white-space: nowrap; vertical-align: top; }
.sub { color: var(--muted); font-size: 12px; font-weight: 400; display: block; }
/* пары полей: поля выровнены по низу, длинные подписи не сдвигают их; ничего не вылезает за колонку */
.f2 > * { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.f2 input, .f2 select { min-width: 0; max-width: 100%; }
/* настройки на телефоне — по одному полю в строке */
@media (max-width: 560px) {
  .settings-form .f2 { grid-template-columns: 1fr; gap: 0; }
  .settings-form .f2 > * { display: block; }
  .settings-form .f2 label { margin-top: 12px; }
  .settings-form .f2:first-child > :first-child label { margin-top: 0; }
}
.settings-form label.first { margin-top: 0; }
/* текст кнопок и ссылок-кнопок рядом — одного размера и насыщенности */
:is(main, dialog) :is(button, .btn):not(.chip), :is(main, dialog) button.link { font-size: 14px; font-weight: 700; }
:is(main, dialog) button.link { line-height: 1.3; }
/* поля дат на телефонах (особенно iPhone) не вылезают за рамку: своя ширина у системного поля отключена */
input[type="date"], input[type="month"], input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0;
  line-height: 1.3; text-align: left;
}
input[type="date"]::-webkit-date-and-time-value, input[type="month"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.3em; }
input[type="date"]::-webkit-datetime-edit, input[type="month"]::-webkit-datetime-edit { padding: 0; }
.f2 > * { min-width: 0; }
/* узкий телефон: пары полей — в один столбец, чтобы даты и суммы помещались целиком */
@media (max-width: 440px) {
  .f2 { grid-template-columns: 1fr; gap: 0; }
  .f2 > * { display: block; }
}
/* дата в шапке «Дня» — по центру */
.day-title input[type="date"] { text-align: center; }
.day-title input[type="date"]::-webkit-date-and-time-value { text-align: center; }
.day-title input[type="date"]::-webkit-datetime-edit { display: inline-flex; justify-content: center; width: 100%; }
.list .item.sel { background: var(--accent-soft); border-radius: 14px; }
/* строки «название — сумма»: длинное название переносится, сумма всегда справа в своей колонке */
.item.row.between, .item > .row.between:first-child { flex-wrap: nowrap; align-items: flex-start; }
.item.row.between > :first-child, .item > .row.between:first-child > :first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.item.row.between > :last-child:not(:first-child), .item > .row.between:first-child > :last-child:not(:first-child) { flex: 0 0 auto; text-align: right; white-space: nowrap; }
/* мини-график дохода книги по дням */
.spark { display: block; width: 100%; height: 28px; margin: 6px 0 4px; fill: var(--bar); }
/* выбор из списка: название слева, кнопка отдельно справа, по центру строки */
.item.row.between.pick { align-items: center; gap: 14px; padding: 10px 0; }
.item.row.between.pick > :first-child { display: flex; align-items: center; gap: 6px; }
.list .item.row { display: flex; }
/* пары «показатель — значение» в аналитике */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.kv > div { background: var(--surface-2); border-radius: 14px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.kv span { font-size: 12px; color: var(--muted); }
.kv b { font-size: 15px; }
/* доход по дням недели — 7 столбиков */
.wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 110px; }
.wd > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.wd i { display: block; width: 70%; max-width: 34px; background: var(--bar); border-radius: 4px 4px 0 0; }
.wd span { font-size: 12px; font-weight: 700; }
.wd small { font-size: 11px; color: var(--muted); white-space: nowrap; }
/* история продаж по годам */
details.year { border-top: 1px solid var(--line); padding: 8px 0; }
details.year > summary { display: flex; justify-content: space-between; gap: 10px; color: var(--text); }
details.year > summary span { color: var(--link); }
details.year > summary span::before { content: '▸ '; }
details.year[open] > summary span::before { content: '▾ '; }
a.item.book-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
/* выбор месяца внизу: без рамки фокуса, только подчёркивание темнее */
.archive select:focus, .archive select:focus-visible { outline: none; box-shadow: none; border-bottom-color: var(--text-2); }
/* строка выбора месяца на телефоне: месяц сверху, ссылка на отчёт под ним, всё по левому краю */
@media (max-width: 560px) {
  .archive { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; padding: 4px 6px 0; }
  .archive select { justify-self: start; max-width: 100%; }
  .archive button.link { grid-column: 1 / -1; margin-left: 0; justify-self: start; padding: 6px 0; text-align: left; }
}
/* «Налог к уплате» на главной: текст слева, кнопка всегда справа */
.taxline { flex-wrap: nowrap; }
.taxline > span { flex: 1 1 auto; min-width: 0; }
.taxline > :last-child { flex: 0 0 auto; }
.taxline { align-items: center; gap: 12px; }
.taxline .tl { display: flex; flex-direction: column; gap: 1px; }
.taxline .tl-k { font-size: 13px; color: var(--muted); }
.taxline .tl-v { font-size: 20px; font-weight: 800; line-height: 1.2; }
.taxline .tl-s { font-size: 13px; color: var(--muted); }
/* ссылка внизу карточки */
.card-foot { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; text-align: center; }
/* приложение с ярлыка заходит под часы и «островок» iPhone: шапку опускаем ниже них */
.top { padding-top: calc(12px + env(safe-area-inset-top)); }
.demo { padding-top: calc(6px + env(safe-area-inset-top)); }
.demo + .top { padding-top: 12px; }
/* окна и экран входа — не под часами */
dialog { max-height: calc(100dvh - 32px - 2 * env(safe-area-inset-top)); }
#sheetForm { max-height: calc(100dvh - 34px - 2 * env(safe-area-inset-top)); }
.auth { padding-top: calc(24px + env(safe-area-inset-top)); }
/* кликабельные карточки и строки на «Дне» */
main a.card.tap { display: block; color: inherit; font-weight: inherit; text-decoration: none; cursor: pointer; transition: box-shadow .15s; }
main a.card.tap:hover { box-shadow: 0 2px 14px rgba(60, 30, 45, .1); }
.tap-ev { cursor: pointer; }
.tap-ev:hover span { text-decoration: underline; text-decoration-color: var(--line); }
/* ---------- единая типографика ----------
   заголовки — Unbounded; важные числа — Unbounded: 20 px в плитках, 28 px — главное число экрана;
   текст — Nunito 15 px, подписи 13 px, мелкие метки 12 px; жирность — 700 (без 650/800) */
.stat .v, .tiles .v, .taxline .tl-v { font-family: var(--font-display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tax-sum, .day-sum { font-size: 28px; }
.kv b { font-family: var(--font-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
h3 { font-weight: 700; }
.sub-h { font-weight: 700; margin-bottom: 6px; }
tr.total td { font-weight: 700; }
.card p.muted, .card > p:not(.small):not(.hint) { font-size: 15px; }
.list .item, .list a.item { font-size: 15px; }
.list .item b { font-weight: 700; }
td, th { font-variant-numeric: tabular-nums; }
.stat .s, .tiles .s, .kv span, .tl-k, .tl-s { line-height: 1.35; }
.card { font-size: 15px; }
details > summary { font-size: 15px; }
/* поля ввода — 16 px: иначе iPhone увеличивает страницу при нажатии */
input, select, textarea, .archive select { font-size: 16px; }
/* пункты выпадающих списков — читаемы в любой теме (у прозрачного списка браузер рисует белый фон) */
select option { background-color: var(--surface); color: var(--text); }
/* идеи: фильтры и группы по книгам */
.idea-filter input[type="search"] { margin-bottom: 8px; }
.idea-filter .f2 { margin-bottom: 4px; }
details.idea-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
details.idea-group > summary span:first-child { display: flex; align-items: center; gap: 6px; }
details.idea-group[open] > summary { margin-bottom: 4px; }
.item.idea .idea-head { color: inherit; font-weight: 400; text-decoration: none; align-items: baseline; }
.item.idea .idea-snip { margin-top: 2px; }
.item.idea.open { background: var(--surface-2); border-radius: 14px; padding: 12px; margin: 4px -4px; }
.item.idea .idea-head { cursor: pointer; }
details.idea-group > summary::-webkit-details-marker { display: none; }
details.idea-group > summary { list-style: none; cursor: pointer; }
details.idea-group > summary > span:first-child::before { content: '▸'; color: var(--link); font-size: 13px; margin-right: 2px; }
details.idea-group[open] > summary > span:first-child::before { content: '▾'; }
/* маркетинг: список книг с обложками */
.mk-row { display: flex; align-items: center; gap: 12px; }
.mk-cover { flex: 0 0 auto; width: 44px; height: 62px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); color: var(--muted); }
.mk-cover img { width: 100%; height: 100%; object-fit: cover; }
.mk-cover.big { width: 60px; height: 84px; }
.mk-info { display: flex; flex-direction: column; min-width: 0; }
.list a.item.mk-row { display: flex; }
/* Мастерская, главная: карточки книг в работе */
main a.card.wcard { display: flex; gap: 14px; align-items: flex-start; color: inherit; font-weight: inherit; text-decoration: none; }
.wcard-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.wbar .progress { margin: 10px 0 8px; }
.alert.alert-thin { margin-top: 8px; padding: 6px 12px; font-size: 14px; line-height: 1.35; }
/* кнопки и ссылки-кнопки всегда основным шрифтом и в одну строку — как в «Доходах» */
button, .btn { font-family: var(--font-body); white-space: nowrap; }
label.btn { cursor: pointer; }
/* выкладка глав по площадкам */
table.pub-t td, table.pub-t th { white-space: nowrap; }
table.pub-t td:first-child { white-space: normal; }
table.pub-t td, table.pub-t th { padding-left: 4px; padding-right: 4px; }
table.pub-t th { font-size: 12px; }
table.pub-t .r { text-align: right; }
.pc { text-align: center; }
button.pill { min-height: 0; padding: 2px 7px; font-size: 12px; border-radius: 999px; background: transparent; border: 1px solid var(--line); color: var(--text-2); font-variant-numeric: tabular-nums; }
button.pill.done { border-color: var(--link); color: var(--link); background: color-mix(in srgb, var(--link) 8%, var(--surface)); }
button.pill.wait { border-color: var(--warn); color: var(--text); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.pick-list { max-height: 38vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; }
.pick-list label.check { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
@media (max-width: 420px) { table.pub-t.many .r { display: none; } }
label.inline-num { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 6px; color: var(--text); font-size: 14px; }
label.inline-num input { width: 84px; text-align: center; margin: 0; }
.checks.dow { gap: 4px 10px; }
.wbar + .wbar { margin-top: 16px; }
/* маленькая иконка-кнопка (урна у идеи) */
button.icon-btn { min-height: 0; width: 30px; height: 30px; padding: 0; margin-left: 6px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; background: transparent; border: 0; border-radius: 50%; color: var(--muted); box-shadow: none; }
button.icon-btn .ic { width: 17px; height: 17px; }
button.icon-btn:hover, button.icon-btn:active { color: var(--bad); background: var(--surface-2); }
.trash-link { text-align: center; margin: 18px 0 6px; }
.trash-link .link { color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.trash-link .ic { width: 15px; height: 15px; }
.idea-head > span:last-child { display: inline-flex; align-items: center; white-space: nowrap; }
button.icon-btn { opacity: .55; } button.icon-btn:hover, button.icon-btn:active { opacity: 1; }
#toast:has(.toast-undo) { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
#toast[hidden] { display: none !important; }
/* ---------- Планер ---------- */
.week { padding: 10px 10px 12px; }
.wk-head { padding: 0 4px 6px; }
.wk-head > .link { font-size: 22px; line-height: 1; padding: 0 8px; min-height: 0; }
.wstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wstrip button.wday { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; padding: 6px 0 5px; border-radius: 14px; border: 1px solid transparent; background: transparent; box-shadow: none; color: var(--text); font-weight: 600; }
button.wday .wk-d { font-size: 11px; color: var(--muted); font-weight: 600; }
button.wday .wk-n { font-size: 16px; }
.wstrip button.wday.today { border-color: var(--line); }
button.wday.today .wk-n { color: var(--link); }
.wstrip button.wday.on { background: var(--accent-soft); border-color: var(--accent-2); }
.wk-dots { display: flex; gap: 3px; height: 6px; }
.wk-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.plist { display: flex; flex-direction: column; }
.pitem { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.plist .pitem:first-child { border-top: 0; }
.pitem .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pi-t { font-size: 15px; font-weight: 600; }
.pi-s { font-size: 13px; color: var(--muted); }
.pi-btns { display: flex; gap: 6px; flex: none; }
.pi-btns button { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.pday + .pday { margin-top: 8px; }
.pday-h { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 6px 0 0; }
.k-pub { background: var(--link); } .k-wait { background: var(--warn); } .k-done { background: var(--line); }
.k-contest { background: var(--accent); } .k-book { background: #9a8ad6; } .k-queue { background: var(--text-2); }
.k-waitans { background: var(--bad); } .k-money { background: #c9a227; }
.psec-h { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 8px; }
.psec-h h2 { margin: 0; font-size: 18px; }
.psec-h h2 .muted { font-weight: 600; font-size: 15px; margin-left: 4px; }
.psec-h .small-btn { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.pbook + .pbook { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.pbook-t { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; margin-bottom: 6px; }
.wstrip button.wday { padding: 6px 0 5px; border-radius: 14px; }
.week .wstrip button.wday { border-color: transparent; }
.week .wstrip button.wday.today { border-color: var(--line); }
.week .wstrip button.wday.on { border-color: var(--accent-2); background: var(--accent-soft); }
/* Google Диск: точка-маркер и аккуратная кнопка «Обновить» на Главной */
.ddot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; flex: none; }
.ddot.on { background: var(--link); } .ddot.off { background: var(--bad); }
h2 .ddot { margin-left: 6px; position: relative; top: -2px; }
button.drive-chip { min-height: 32px; padding: 4px 12px 4px 10px; font-size: 13px; font-weight: 600; gap: 6px; color: var(--text-2); }
button.drive-chip .ic { width: 15px; height: 15px; }
.home-h { margin: 0 0 10px; gap: 10px; }
.home-h button.drive-chip { min-height: 32px; padding: 4px 12px 4px 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.drow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); } .drow > span { flex: 1; min-width: 0; } .drow .icon-btn { margin-left: 0; }
/* корзина идей: строка разворачивается, кнопки справа */
.trash-item summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.trash-item summary::-webkit-details-marker { display: none; }
.trash-item .ti-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trash-item .ti-btns { display: flex; align-items: center; gap: 2px; flex: none; }
.trash-item .ti-btns button:not(.icon-btn) { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.trash-item .ti-body { padding: 6px 0 2px; }
.trash-item[open] .ti-main b::after { content: ''; }
.trash-item[hidden] { display: none !important; }
details.trash-item > summary, details.trash-item > summary b { color: var(--text); }
details.trash-item > summary .sub { color: var(--muted); }
/* цели и графики Мастерской */
.target { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.bar.hit { fill: var(--link); opacity: .85; }
.goal-dot { fill: var(--accent); }
.goals .goal + .goal { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.goal .goal-t { color: var(--text); text-decoration: none; }
.goal .progress { margin: 8px 0 6px; }
.goal.ok .small:first-of-type { color: var(--good); }
.k-goal { background: var(--accent); }
.chart-cap { margin-top: 6px; }
.cursor[hidden] { display: none; }
/* «Дальше» в Планере: компактная лента */
.agenda .arow { display: flex; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); align-items: baseline; }
.agenda .arow:first-child { border-top: 0; }
.agenda .ad { flex: none; width: 44px; font-size: 13px; font-weight: 700; color: var(--muted); }
.agenda .ai { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.agenda .aitem { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.agenda .aitem i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.agenda .aitem .muted { font-size: 13px; }
/* «Спросить ИИ про этот день» — тихая ссылка под суммой дня */
.ai-day { margin: -4px 0 12px; text-align: right; }
.ai-day .link { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.ai-day .link .ic { width: 14px; height: 14px; }
.ai-day .link:hover { color: var(--link); }
.f3 { display: grid; grid-template-columns: 1fr 1fr 0.9fr; gap: 0 10px; } .f3 > div { min-width: 0; }
/* редактор главы */
.ed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ed-tools { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 6px; padding: 6px 0; background: var(--bg); }
.ed-tools button { min-height: 34px; width: 40px; padding: 0; font-size: 15px; }
.ed-tools #edvol { margin-left: auto; }
.editor { min-height: 60vh; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 40px; font-family: Georgia, 'PT Serif', 'Times New Roman', serif; font-size: 18px; line-height: 1.65; color: var(--text); outline: none; overflow-wrap: anywhere; }
.editor:focus { border-color: var(--accent-2); }
.editor p { margin: 0 0 .7em; text-indent: 1.4em; }
.ed-foot { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.ed-draft .link { padding: 0 4px; }
a.ch-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.editor p { text-indent: 1.2em; }
/* приоритетные показы */
.wg .tiles { margin: 6px 0 4px; }
.wg-bar { margin-top: 12px; }
.wg-status { margin-top: 12px; font-size: 14px; color: var(--muted); }
.wg-status.ok { color: var(--good); }
.wg-apply { margin-top: 12px; }
.wg-how { margin-top: 10px; }
.wg-how summary { font-size: 14px; }
.wg-how p { margin: 6px 0 0; color: var(--text-2); }
.wg .wg-bonus { padding: 0 !important; min-height: 0; font-size: 13px; margin-top: 4px; }
.wbar > .small.muted { line-height: 1.45; }
.k-mk { background: #e59ac0; }
/* следующая выкладка и кнопки в карточке книги — с воздухом */
.next-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.pbook-actions { margin-top: 16px; }
.wbar > .small.muted { margin-top: 2px; }

/* ---------- широкий экран (компьютер): меню слева, страница по центру, колонка «Сегодня» справа ---------- */
aside.side { display: none; }
.side-h { margin-bottom: 14px; }
.side-k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side-date { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 700; margin-top: 2px; }
.side-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin-top: 12px; color: var(--text); text-decoration: none; }
a.side-card:hover { border-color: var(--accent-2); }
.side-big { font-size: 24px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.side-big .small { font-weight: 600; }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.side-stats span { font-size: 12px; color: var(--muted); }
.side-stats b { font-size: 17px; }
.side-agenda { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 6px 16px; }
.side .pitem { padding: 8px 0; }
.side .pi-t { font-size: 14px; }
.side .pi-btns button { min-height: 32px; padding: 3px 10px; font-size: 13px; }
.side-more { display: block; margin: 14px 0 0; font-size: 14px; }
.side-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.side-actions button, .side-actions .btn { min-height: 36px; padding: 6px 14px; font-size: 14px; }

@media (min-width: 1180px) {
  body { padding-bottom: 0; }
  #app { padding: 0 372px 0 236px; }
  .demo { margin: 0 -372px 0 -236px; }
  main, .top { max-width: 920px; }
  main { padding-bottom: 48px; }
  nav.tabs { top: 0; bottom: 0; left: 0; right: auto; width: 220px; flex-direction: column; gap: 4px; padding: 28px 14px; border-top: 0; border-right: 1px solid var(--line); transform: none; overflow-y: auto; }
  nav.tabs::after { display: none; }
  nav.tabs a { flex: none; display: flex; flex-direction: row; align-items: center; gap: 12px; text-align: left; min-height: 0; padding: 11px 14px; border-radius: 14px; font-size: 15px; font-weight: 600; color: var(--text-2); }
  nav.tabs a b { height: auto; display: flex; }
  nav.tabs a:hover { background: var(--surface-2); }
  nav.tabs a.on { background: var(--accent-soft); color: var(--text); font-weight: 800; }
  aside.side { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: 356px; overflow-y: auto; padding: 28px 22px 32px; border-left: 1px solid var(--line); background: var(--bg); }
  #toast { left: calc(50% - 68px); bottom: 24px; }
  .ed-foot { bottom: 0; }
}

/* ---------- ритм карточек книг: заголовок → шкалы → следующая выкладка → итог месяца ---------- */
.wcard-body { gap: 0; }
.wcard-title { font-weight: 800; font-size: 16px; line-height: 1.3; margin-bottom: 14px; }
.wbar { display: block; }
.wbar + .wbar, .wbar + .small, .small + .wbar { margin-top: 18px; }
.wbar > .row.small { font-size: 14px; align-items: baseline; }
.wbar .progress { height: 8px; margin: 9px 0 7px; }
.wbar > .small.muted { font-size: 13px; line-height: 1.45; margin-top: 0; }
.next-line { margin-top: 18px; }
.wcard-body > .small, .pbook > .small { display: block; margin-top: 14px; line-height: 1.45; }
.wcard-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.wcard-foot .wf-k { width: 100%; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pbook-t { margin-bottom: 16px; }
.pbook-actions { margin-top: 18px; }
@media (max-width: 520px) { main a.card.wcard { flex-direction: column; } main a.card.wcard .mk-cover.big { width: 64px; height: 92px; } }
.prog { display: block; }
.prog > * + * { margin-top: 18px !important; }
.prog > .small { line-height: 1.45; }
.wcard-body > .prog, .pbook > .prog { margin-top: 0; }

/* меню слева: сворачивается до иконок */
.nav-toggle { display: none; }
@media (min-width: 1180px) {
  #app { transition: padding-left .25s ease; }
  nav.tabs { transition: width .25s ease, padding .25s ease; overflow-x: hidden; }
  nav.tabs a .nl { white-space: nowrap; transition: opacity .18s ease; }
  nav.tabs a b { flex: none; width: 22px; justify-content: center; }
  .nav-toggle { display: inline-flex; margin-top: auto; align-self: flex-end; width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; border: 1px solid var(--line) !important; color: var(--muted) !important; transition: transform .25s ease, align-self .25s; }
  .nav-toggle:hover { color: var(--text) !important; background: var(--surface-2); }
  .nav-toggle .ic { width: 18px; height: 18px; }
  html.nav-mini #app { padding-left: 96px; }
  html.nav-mini .demo { margin-left: -96px; }
  html.nav-mini nav.tabs { width: 76px; padding-left: 12px; padding-right: 12px; }
  html.nav-mini nav.tabs a { justify-content: center; padding: 11px 0; gap: 0; }
  html.nav-mini nav.tabs a .nl { opacity: 0; width: 0; overflow: hidden; }
  html.nav-mini .nav-toggle { align-self: center; transform: rotate(180deg); }
  html.nav-mini #toast { left: 50%; }
}

/* ---------- Мастерская на компьютере: без правой колонки — шире страница и баннер «Сегодня важно» ---------- */
@media (min-width: 1180px) {
  html.app-writer #app { padding-right: 40px; }
  html.app-writer .demo { margin-right: -40px; }
  html.app-writer main, html.app-writer .top { max-width: 1120px; }
  html.app-writer .covers { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.today-banner { position: relative; margin: 4px 0 22px; padding: 20px 22px 18px; border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 85%, var(--surface)) 0%, var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--accent-2) 55%, var(--line)); }
.tb-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.tb-k { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tb-date { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 700; }
.tb-stats { margin-left: auto; display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.tb-stats b { color: var(--text); font-weight: 700; }
.tb-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.tb-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, transform .15s; }
.tb-item:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.tb-t { font-size: 15px; font-weight: 700; line-height: 1.3; }
.tb-s { font-size: 13px; color: var(--muted); line-height: 1.4; }
.tb-item > .small-btn, .tb-btns { margin-top: auto; padding-top: 10px; }
.tb-item > .small-btn { align-self: flex-start; }
.tb-btns { display: flex; gap: 6px; }
.tb-btns .small-btn, .tb-item > .small-btn { min-height: 32px; padding: 4px 14px; font-size: 13px; }
.tb-more { margin-top: 12px; padding: 0; font-size: 14px; }
.tb-empty { margin-top: 10px; font-size: 15px; color: var(--good); }
.today-banner.calm { padding-bottom: 16px; }

/* ---------- Мастерская: дела на сегодня — в левом меню, под разделами ---------- */
.nav-today, .nav-soon { display: none; }
@media (min-width: 1180px) {
  html.app-writer nav.tabs { width: 272px; }
  html.app-writer #app { padding-left: 292px; }
  html.app-writer .demo { margin-left: -292px; }
  html.app-writer.nav-mini #app { padding-left: 96px; }
  html.app-writer.nav-mini .demo { margin-left: -96px; }
  html.app-writer.nav-mini nav.tabs { width: 76px; }
  .nav-today { display: block; margin: 22px 2px 12px; padding: 16px 14px 12px; border-radius: 18px; background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
  html.nav-mini .nav-today, html.nav-mini .nav-soon { display: none; }
  /* «Скоро» — отдельный блок, нежнее и бледнее, чем «сегодня» */
  .nav-soon { display: block; margin: 0 2px 12px; padding: 12px 14px 10px; border-radius: 18px; background: color-mix(in srgb, var(--accent-soft) 32%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-2) 22%, var(--line)); }
  .nav-soon .nt-k { margin-top: 0; }
  .nt-date { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
  .nt-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); cursor: pointer; }
  .nt-date + .nt-item { border-top: 0; }
  .nt-item > i { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 7px; }
  .nt-body { min-width: 0; flex: 1; }
  .nt-t { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text); }
  .nt-s { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
  .nt-btns { display: flex; gap: 6px; margin-top: 8px; }
  button.nt-btn { min-height: 28px; padding: 2px 12px; font-size: 13px; margin-top: 8px; }
  .nt-btns button.nt-btn { margin-top: 0; }
  .nt-btns button.nt-btn:first-child { background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); border-color: var(--btn-to); color: var(--accent-ink); }
  .nt-more { padding: 6px 0 0; font-size: 13px; }
  .nt-empty { font-size: 13px; color: var(--good); }
}

/* ---------- редактор главы ---------- */
.ed-bar { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 8px 0 10px; margin: -4px 0 12px; border-bottom: 1px solid var(--line); }
.ed-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ed-nav .btn.back { min-height: 34px; padding: 4px 14px; font-size: 14px; }
.ed-chapter { display: flex; align-items: center; gap: 4px; }
.ed-chapter select { width: auto; max-width: 260px; min-height: 34px; padding: 4px 30px 4px 12px; font-weight: 700; }
.ed-status { font-size: 13px; color: var(--muted); margin-left: auto; }
.ed-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin: 0; }
.ed-nav > button.primary { min-height: 34px; padding: 4px 16px; font-size: 14px; }
.ed-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 10px; position: static; padding: 0; background: none; }
.ed-tools .ed-style { width: auto; min-height: 34px; padding: 4px 30px 4px 12px; font-size: 14px; }
button.ed-ic { min-width: 34px; width: auto; min-height: 34px; padding: 0 9px; border-radius: 10px; font-size: 15px; background: transparent; border: 1px solid transparent !important; color: var(--text) !important; font-weight: 600; }
button.ed-ic:hover { background: var(--surface-2); }
button.ed-ic .ic { width: 18px; height: 18px; }
.ed-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.ed-find { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ed-find input { width: 200px; min-height: 34px; }
.ed-find[hidden] { display: none; }
.ed-paper { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 48px 56px 64px; }
.editor { --ed-zoom: 1; min-height: 70vh; border: 0; border-radius: 0; background: transparent; padding: 0; max-width: 760px; margin: 0 auto;
  font-family: Georgia, 'Times New Roman', serif; font-size: calc(18px * var(--ed-zoom)); line-height: 1.6; color: var(--text); outline: none; overflow-wrap: anywhere; caret-color: var(--accent); }
.editor p { margin: 0; text-indent: 0; }
.editor h1, .editor h2, .editor h3, .editor h4, .editor h5, .editor h6 { font-family: inherit; margin: .9em 0 .5em; line-height: 1.3; }
.editor h1 { font-size: 1.8em; } .editor h2 { font-size: 1.45em; } .editor h3 { font-size: 1.2em; } .editor h4 { font-size: 1.08em; } .editor h5 { font-size: 1em; }
.editor h6 { font-size: 1.1em; font-weight: 400; color: var(--text-2); }
.ed-stats { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 10px 0; font-size: 13px; color: var(--muted); background: linear-gradient(transparent, var(--bg) 35%); }
.ed-stats b { color: var(--text); }
@media (max-width: 700px) { .ed-paper { padding: 20px 16px 40px; border-radius: 14px; } .ed-status { width: 100%; order: 9; margin-left: 0; } }
@media (min-width: 1180px) { .ed-stats { bottom: 0; } }
/* режим фокуса: только текст */
/* свёрнутое меню: иконки — посередине по высоте, кнопка разворота — внизу */
@media (min-width: 1180px) {
  html.nav-mini nav.tabs { justify-content: center; }
  html.nav-mini .nav-toggle { position: absolute; bottom: 24px; left: 50%; margin: 0; transform: translateX(-50%) rotate(180deg); }
}
/* гармоничные отступы: шапка ↔ плитки, внутри плиток */
main { padding-top: 20px; }
.stat { padding: 14px 16px 15px; }
.stat .v { margin-top: 6px; }
.stat .s { margin-top: 6px; line-height: 1.4; }
.grid4 { gap: 12px; margin-bottom: 16px; }
.home-h { margin-bottom: 14px; }

/* шторка правой колонки «Сегодня» (Доходы) */
.side-grip { display: none; }
@media (min-width: 1180px) {
  aside.side { transition: transform .3s ease; }
  #app { transition: padding .3s ease; }
  .side-grip { display: flex; position: fixed; top: 50%; right: 356px; z-index: 7; width: 18px; height: 64px; min-height: 0; padding: 0; margin: -32px -9px 0 0;
    align-items: center; justify-content: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line) !important; cursor: grab; touch-action: none; transition: right .3s ease, background .15s; }
  .side-grip span { width: 3px; height: 26px; border-radius: 2px; background: var(--line); box-shadow: 5px 0 0 -0px transparent; }
  .side-grip:hover { background: var(--surface-2); }
  .side-grip:hover span { background: var(--muted); }
  html.side-drag, html.side-drag * { cursor: grabbing !important; user-select: none; }
  html.side-drag aside.side, html.side-drag .side-grip { transition: none; }
  html.side-off aside.side { transform: translateX(100%); }
  html.side-off .side-grip { right: 0; margin-right: 0; border-radius: 10px 0 0 10px; border-right: 0 !important; width: 22px; }
  html.side-off:not(.app-writer) #app { padding-right: 56px; }
  html.side-off:not(.app-writer) .demo { margin-right: -56px; }
  html.side-off:not(.app-writer) main, html.side-off:not(.app-writer) .top { max-width: 1120px; }
}
/* свёрнутое меню — гармонично: иконки сверху, как в развёрнутом, ровно по центру полоски, одинаковые квадраты */
@media (min-width: 1180px) {
  html.nav-mini nav.tabs { justify-content: flex-start; align-items: center; width: 77px !important; padding: 28px 0; }
  html.nav-mini nav.tabs a { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 14px; }
  html.nav-mini nav.tabs a b { width: 22px; }
}
@media (min-width: 1180px) {
  .nt-done { font-size: 13px; color: var(--good); padding: 6px 0 0; cursor: pointer; line-height: 1.35; }
  .nt-stat { font-size: 12px; color: var(--muted); padding-top: 10px; margin-top: 10px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
  .nt-stat b { color: var(--text); }
  .nt-k { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
  .nt-soon { display: flex; gap: 10px; font-size: 13px; line-height: 1.35; padding: 4px 0; color: var(--text-2); }
  .nt-d { flex: none; width: 48px; white-space: nowrap; color: var(--muted); font-weight: 700; }
}
/* поиск в редакторе: все совпадения и текущее */
::highlight(ed-find) { background-color: color-mix(in srgb, var(--warn) 35%, transparent); }
::highlight(ed-find-cur) { background-color: var(--accent-2); color: var(--accent-ink); }
.ed-find { padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ed-find input { width: 190px; min-height: 32px; padding: 4px 10px; }
.ed-found { min-width: 70px; }
/* переключатель глав: аккуратные стрелки и «+» */
.ed-chapter .ed-ic { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.ed-chapter .ed-ic .ic { width: 18px; height: 18px; stroke-width: 2; }
.ed-chapter .flip { display: inline-flex; transform: scaleX(-1); }
.ed-ic-gap { width: 34px; height: 34px; flex: none; }
.ed-chapter .ed-add { font-size: 20px; font-weight: 400; line-height: 1; }
/* цели книги: узкий блок, мини-график без осей */
.goals-card .plist { margin-top: 6px; }
.goals-card .mini-chart { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.goals-card .mini-chart .row { margin-bottom: 4px; }
/* шторка закрыта: колонка ровно по центру между меню и краем окна — одинаковые поля слева и справа, спокойная ширина */
@media (min-width: 1180px) {
  html.side-off:not(.app-writer) #app { padding-left: calc(220px + 48px); padding-right: 48px; }
  html.side-off.nav-mini:not(.app-writer) #app { padding-left: calc(77px + 48px); }
  html.side-off:not(.app-writer) .demo { margin-left: calc(-220px - 48px); margin-right: -48px; }
  html.side-off.nav-mini:not(.app-writer) .demo { margin-left: calc(-77px - 48px); }
  html.side-off:not(.app-writer) main, html.side-off:not(.app-writer) .top { max-width: 1040px; }
  /* меню слева — без полосы прокрутки (прокручивается колёсиком и пальцем) */
  nav.tabs { scrollbar-width: none; -ms-overflow-style: none; }
  nav.tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
}
.next-line .nl-k { margin-left: auto; }
/* аннотация, синопсис, рукопись: строка — название с подписью слева, аккуратные кнопки справа */
.svc-card h2 { margin-bottom: 6px; }
.svc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.svc-card h2 + .svc-row { border-top: 0; }
.svc-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: inherit; text-decoration: none; }
.svc-name b { font-weight: 700; }
.svc-name .sub { font-size: 13px; color: var(--muted); }
.svc-btns { display: flex; gap: 4px; flex: none; }
.svc-btns .ed-ic { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.svc-btns .ed-ic .ic { width: 18px; height: 18px; }
.svc-btns .small-btn { min-height: 32px; padding: 4px 14px; font-size: 13px; }
.svc-text { max-height: 60vh; overflow-y: auto; font-family: 'Times New Roman', Times, serif; font-size: 16px; line-height: 1.55; padding: 4px 2px; }
.svc-text p { margin: 0 0 .35em; text-indent: 1.5em; }
.svc-text p.center { text-indent: 0; text-align: center; } .svc-text p.right { text-indent: 0; text-align: right; }
.svc-card > p.small { font-size: 13px; line-height: 1.45; }
/* маленькая линейная иконка в строке текста (часы «запланировано») */
.icx { display: inline-flex; vertical-align: -0.16em; }
.icx .ic { width: 1.05em; height: 1.05em; stroke-width: 1.8; }
/* выделение цветом в редакторе: тёмно-изумрудный (в тёмной теме — светлее, чтобы читалось) */
.editor [data-c="#0b6b4f"] { color: var(--link) !important; }
button.ed-ic.ed-color span { font-weight: 800; color: var(--link); border-bottom: 3px solid var(--link); line-height: 1; padding: 0 1px 1px; }
/* цвета из Документа (кроме своей изумрудной пометки) в редакторе не показываем — обычный цвет текста темы; в Документе они сохраняются */
.editor [data-c]:not([data-c="#0b6b4f"]) { color: inherit !important; }
/* два поля рядом — подписи и поля на одной линии, одинаковой высоты */
.f2.f2-top { align-items: start; }
.f2.f2-top > * { justify-content: flex-start; }
.f2.f2-top select, .f2.f2-top input { height: 46px; min-height: 46px; box-sizing: border-box; }
.f2-note { margin-top: 6px; }
/* главы и выкладка: всё по одной линии, площадки — ровными колонками по центру, отметки — мягкие плашки без обводки */
table.pub-t { width: 100%; border-collapse: collapse; }
table.pub-t th { font-weight: 600; color: var(--muted); padding-top: 4px; padding-bottom: 10px; }
table.pub-t td { vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
table.pub-t td.r, table.pub-t th.r { width: 64px; color: var(--text-2); font-variant-numeric: tabular-nums; }
table.pub-t th.pc, table.pub-t td.pc { width: 112px; text-align: center; }
table.pub-t tr.total td { font-weight: 700; color: var(--text); }
table.pub-t .ch-link { text-decoration: none; color: var(--text); }
table.pub-t .ch-link:hover { color: var(--link); }
main table.pub-t button.pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 64px; min-height: 28px; height: 28px; padding: 0 10px;
  border: 0 !important; border-radius: 8px; background: transparent; box-shadow: none; color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
main table.pub-t button.pill:hover { background: var(--surface-2); }
main table.pub-t button.pill.done { background: color-mix(in srgb, var(--link) 13%, transparent); color: var(--link); }
main table.pub-t button.pill.wait { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--text); }
main table.pub-t button.pill.done:hover, main table.pub-t button.pill.wait:hover { filter: brightness(.97); }
main table.pub-t button.pill { width: 92px; min-width: 92px; color: var(--muted) !important; font-weight: 600; }
main table.pub-t button.pill.done { color: var(--link) !important; }
main table.pub-t button.pill.wait { color: var(--text) !important; }
/* отметки выкладки: без плашек — линейная галочка, часы и дата текстом; значки ровно в одну вертикаль */
table.pub-t th.pc, table.pub-t td.pc { width: 96px; text-align: left; padding-left: 14px; }
main table.pub-t button.pill, main table.pub-t button.pill.done, main table.pub-t button.pill.wait { width: auto; min-width: 0; height: 28px; min-height: 28px; padding: 0 6px; margin-left: -6px;
  justify-content: flex-start; gap: 7px; background: transparent !important; color: var(--text) !important; font-weight: 500; font-size: 14px; filter: none; }
main table.pub-t button.pill:hover { background: var(--surface-2) !important; }
main table.pub-t button.pill .icx .ic { width: 18px; height: 18px; stroke-width: 1.8; }
main table.pub-t button.pill .icx { vertical-align: 0; }
main table.pub-t .pl-none { color: var(--muted); display: inline-block; width: 18px; text-align: center; }
table.pub-t tr.total td.pc { padding-left: 14px; }
table.pub-t td.r, table.pub-t th.r { padding-right: 22px; }
/* главы: компактные строки, на широком экране — две колонки; выложенные свёрнуты */
.ch-sum { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.ch-sum b { color: var(--text); font-weight: 700; }
.ch-cols { columns: 2 300px; column-gap: 32px; }
.chr { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 8px; margin: 0 -8px; border-radius: 10px; break-inside: avoid; }
.chr:hover { background: var(--surface-2); }
.chr-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.chr-n .ch-link { color: var(--text); text-decoration: none; }
.chr-n .ch-link:hover { color: var(--link); }
.chr-v { flex: none; width: 40px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chr-m { flex: none; display: flex; gap: 2px; }
main .chr button.pm { display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; width: 74px; min-width: 0; height: 30px; min-height: 30px; padding: 0 8px;
  border: 0 !important; border-radius: 8px; background: transparent !important; box-shadow: none; color: var(--text) !important; font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
main .chr button.pm:hover { background: var(--surface) !important; }
main .chr button.pm .icx .ic { width: 17px; height: 17px; stroke-width: 1.8; }
main .chr button.pm .icx { vertical-align: 0; }
main .chr .pl-none { color: var(--muted); display: inline-block; width: 17px; text-align: center; }
details.ch-done { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
details.ch-done > summary { list-style: none; cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--text-2); }
details.ch-done > summary::-webkit-details-marker { display: none; }
details.ch-done > summary::before { content: '›'; display: inline-block; width: 14px; transition: transform .15s; color: var(--muted); }
details.ch-done[open] > summary::before { transform: rotate(90deg); }
details.ch-done > summary .muted { font-weight: 400; }
/* шапка книги: обложка слева, справа — название, цифры плитками, аннотация и синопсис */
.book-head2 { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: start; }
.bh-cover { position: relative; display: block; cursor: pointer; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 2 / 3; background: var(--surface-2); }
.bh-cover img, .bh-cover .cover-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.bh-cover-edit { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 9px; text-align: center; font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); opacity: 0; transition: opacity .15s; }
.bh-cover:hover .bh-cover-edit, .bh-cover:focus-within .bh-cover-edit { opacity: 1; }
.bh-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bh-title h2 { margin: 0 0 8px; }
.bh-title .tags { margin: 0; }
.bh-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.bh-acts .btn.small-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 14px; font-size: 13.5px; }
.bh-acts .btn .ic, .bh-acts .ed-ic .ic { width: 17px; height: 17px; }
.bh-acts .ed-ic { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.bh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.bh-tile { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; border-radius: 14px; background: var(--surface-2); }
.bh-tile .bh-k { font-size: 12px; color: var(--muted); }
.bh-tile b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; }
.bh-tile .bh-sub { font-size: 12px; color: var(--muted); }
.bh-texts { display: grid; gap: 14px; }
.bh-text { border-top: 1px solid var(--line); padding-top: 12px; }
.bh-h { display: flex; align-items: center; gap: 8px; }
.bh-h b { font-size: 14px; }
.bh-ics { margin-left: auto; display: flex; gap: 2px; }
.bh-ics .ed-ic { width: 32px; height: 32px; min-height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.bh-ics .ed-ic .ic { width: 17px; height: 17px; }
.bh-ann { margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); cursor: pointer; max-height: calc(1.55em * 4); overflow: hidden; position: relative; }
.bh-ann::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.6em; background: linear-gradient(transparent, var(--surface)); }
.bh-ann.open { max-height: none; } .bh-ann.open::after { display: none; }
.bh-ann p { margin: 0 0 .5em; }
.bh-syn { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-foot { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .book-head2 { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; }
  .bh-main { display: contents; }
  .bh-top { flex-direction: column; gap: 10px; }
  .bh-tiles, .bh-texts, .bh-foot { grid-column: 1 / -1; }
  .bh-tiles { grid-template-columns: 1fr 1fr; }
  .bh-tile b { font-size: 18px; }
  .bh-cover-edit { opacity: 1; padding: 10px 4px 6px; font-size: 11px; }
}
/* таблица глав: всё содержание по порядку, строки компактные, отметки — простые значки */
table.pub-t td { padding-top: 7px; padding-bottom: 7px; }
table.pub-t .ch-link { color: var(--text) !important; font-weight: 400; text-decoration: none; }
table.pub-t .ch-link:hover { color: var(--link) !important; }
main table.pub-t button.pm { display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; width: auto; min-width: 0; height: 28px; min-height: 28px; padding: 0 6px; margin-left: -6px;
  border: 0 !important; border-radius: 8px; background: transparent !important; box-shadow: none; color: var(--text) !important; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
main table.pub-t button.pm:hover { background: var(--surface-2) !important; }
main table.pub-t button.pm .icx .ic { width: 17px; height: 17px; stroke-width: 1.8; }
main table.pub-t button.pm .icx { vertical-align: 0; }
main table.pub-t .pl-none { color: var(--muted); display: inline-block; width: 17px; text-align: center; }
/* содержание книги: название главы + её первая строка, полоска длины, объём, отметки */
table.pub-t2 { table-layout: fixed; }
table.pub-t2 col.c-v { width: 120px; } table.pub-t2 col.c-al { width: 64px; } table.pub-t2 col.c-pf { width: 104px; }
table.pub-t2 td:first-child { white-space: nowrap; }
.ch-cell { display: flex; align-items: baseline; gap: 14px; min-width: 0; overflow: hidden; }
.ch-cell .ch-link, .ch-cell .ch-t { flex: none; }
.ch-lead { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13.5px; font-style: italic; }
table.pub-t2 th.bar-h { font-weight: 600; color: var(--muted); text-align: left; padding-left: 16px; }
table.pub-t2 td.bar-c { padding-left: 16px; padding-right: 0; }
.ch-bar { display: block; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.ch-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent-2); }
table.pub-t2 td.r { padding-right: 14px; }
@media (max-width: 640px) {
  table.pub-t2 col.c-v, table.pub-t2 th.bar-h, table.pub-t2 td.bar-c { display: none; }
  table.pub-t2 col.c-v { width: 0; }
  .ch-lead { display: none; }
}
.ch-cell .ch-link, .ch-cell .ch-t { min-width: 5.4em; }
.bh-ann { cursor: default; }
.bh-more { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--link); padding: 0; min-height: 0; }
table.pub-t2 col.c-al { width: 92px; }
.bh-ann.bh-tog { cursor: pointer; }
/* редактор — бережно к глазам: тёплая «бумага» вместо чисто-белого и мягкий графитовый текст вместо чёрного;
   в тёмной теме — не чисто-белые буквы, а приглушённые */
:root { --paper: #fbf8f3; --ink: #3a3532; --paper-line: #ece5dc; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --paper: #1e1c1b; --ink: #d8d0c9; --paper-line: #302c2a; } }
:root[data-theme="dark"] { --paper: #1e1c1b; --ink: #d8d0c9; --paper-line: #302c2a; }
.ed-paper { background: var(--paper); border-color: var(--paper-line); }
.editor { color: var(--ink); caret-color: var(--link); }
.editor ::selection { background: color-mix(in srgb, var(--link) 22%, transparent); }
/* крупные числа никогда не разрываются: если плитка узкая — число чуть уменьшается, но остаётся одной строкой */
.stat, .bh-tile, .tiles > *, .side-card { container-type: inline-size; }
.stat .v, .tiles .v, .bh-tile b, .side-big, .big, .tl-v { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.stat .v, .tiles .v { font-size: clamp(14px, 12.5cqi, 20px); }
.bh-tile b { font-size: clamp(14px, 15cqi, 20px); }
.side-big { font-size: clamp(16px, 11cqi, 26px); }
table td, table th { overflow-wrap: normal; word-break: normal; }
/* название на обложке-заглушке: переносы по слогам, а не посреди слова */
.cover-ph span { overflow-wrap: normal; word-break: normal; hyphens: auto; }
@media (max-width: 640px) { .bh-cover .cover-ph span { font-size: 12px; } }
/* редактор главы на телефоне и планшете: нижнего меню нет — весь экран под текст (назад — «← К книге») */
@media (max-width: 1179px) {
  html.on-ed nav.tabs { display: none; }
  html.on-ed body { padding-bottom: env(safe-area-inset-bottom); }
  html.on-ed .ed-stats { bottom: env(safe-area-inset-bottom); }
}
/* строка главы целиком открывает редактор; цветом не выделяется */
table.pub-t tr.ch-row { cursor: pointer; }
table.pub-t tr.ch-row:hover td { background: transparent; }
.ch-cell .ch-t { color: var(--text); font-weight: 600; }
/* редактор на телефоне: строка «слова · знаки · а.л.» прижата к самому низу экрана */
@media (max-width: 1179px) {
  html.on-ed .ed-stats { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0; gap: 14px;
    padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  html.on-ed main { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  html.on-ed #toast { bottom: calc(56px + env(safe-area-inset-bottom)); }
}
/* цифры главы на компьютере — не под текстом, а тихой колонкой сбоку */
.ed-stats i { font-style: normal; }
.ed-paper { position: relative; }
@media (min-width: 1180px) {
  .ed-paper .ed-stats { position: absolute; top: 18px; right: 22px; bottom: auto; left: auto; padding: 0; background: none; gap: 14px; font-size: 12px; opacity: .7; transition: opacity .2s; }
  .ed-paper .ed-stats:hover { opacity: 1; }
  .ed-paper .ed-stats b { font-weight: 600; }
}
@media (min-width: 1380px) {
  .ed-paper .ed-stats { position: fixed; top: 50%; right: 28px; transform: translateY(-50%); flex-direction: column; flex-wrap: nowrap; align-items: flex-end; gap: 16px; text-align: right; opacity: .55; }
  .ed-paper .ed-stats span { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.2; }
  .ed-paper .ed-stats b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
  .ed-paper .ed-stats b.up { color: var(--good); } .ed-paper .ed-stats b.down { color: var(--bad); }
  .ed-paper .ed-stats i { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
  .ed-paper .ed-stats .es-sess { padding-top: 14px; border-top: 1px solid var(--line); }
}
/* колонка цифр сбоку: чуть мельче и чуть заметнее */
@media (min-width: 1380px) {
  .ed-paper .ed-stats { opacity: .8; gap: 13px; }
  .ed-paper .ed-stats b { font-size: 14px; }
  .ed-paper .ed-stats i { font-size: 10.5px; color: var(--text-2); }
  .ed-paper .ed-stats .es-sess { padding-top: 12px; }
}
@media (min-width: 1180px) and (max-width: 1379px) { .ed-paper .ed-stats { opacity: .85; font-size: 11.5px; } }
/* лимит НПД */
.npd { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.npd .progress { margin: 8px 0 6px; }
.npd-bar.warn i { background: var(--warn); } .npd-bar.bad i { background: var(--bad); }
a.card.npd-alert { display: block; color: var(--text); text-decoration: none; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
a.card.npd-alert.over { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
a.card.npd-alert .small { margin-top: 4px; color: var(--text-2); }
/* следующая выкладка: листок календаря + что сделать + когда */
.next-line { display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 14px; padding: 10px 14px; }
.nl-date { flex: none; width: 46px; height: 50px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.nl-date b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.nl-date i { font-style: normal; font-size: 11px; color: var(--muted); margin-top: 3px; text-transform: lowercase; }
.nl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nl-t { font-weight: 700; font-size: 14.5px; }
.nl-s { font-size: 12.5px; color: var(--muted); }
.nl-when { flex: none; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.nl-when.soon { color: var(--warn); font-weight: 600; } .nl-when.late { color: var(--bad); font-weight: 600; }
.nl-when-m { display: none; }
@media (max-width: 520px) { .nl-when { display: none; } .nl-when-m { display: inline; color: var(--text-2); font-weight: 600; } .next-line { gap: 12px; } }
/* выполненное сегодня: вместо точки — тонкая галочка, текст спокойнее; без лишних «✓» в тексте */
.pi-ok { flex: none; width: 10px; display: inline-flex; justify-content: center; margin-top: 3px; color: var(--good); }
.pi-ok .icx .ic { width: 15px; height: 15px; stroke-width: 2; }
.pitem.done-today .pi-t { color: var(--text-2); }
/* свои задачи из Todoist: кнопка «сделано» — тонкая галочка в кружке */
button.td-ok { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line) !important; color: var(--muted) !important; }
button.td-ok:hover { border-color: var(--good) !important; color: var(--good) !important; }
button.td-ok .ic, button.td-ok .icx .ic { width: 16px; height: 16px; stroke-width: 2; }
.k-td { background: var(--accent-2); }
.td-card .pitem { padding: 8px 0; }
.td-how { margin-top: 8px; color: var(--text-2); }
.td-how p { margin: 0 0 6px; line-height: 1.45; }
/* конкурс: блок «вставьте условия» сверху */
.c-fill { padding: 12px 14px; margin-bottom: 4px; border-radius: 14px; background: var(--surface-2); }
.c-fill textarea, .c-fill input { background: var(--surface); }
.c-filled { margin-top: 6px; color: var(--good); }
/* идеи: подсказка про Todoist и выбор книги у идеи «Без книги» */
.idea-hint { margin: -2px 0 10px; line-height: 1.45; }
.idea-pick { margin-top: 6px; }
.idea-pick select { width: auto; min-height: 30px; padding: 2px 28px 2px 10px; font-size: 13px; color: var(--text-2); }
/* конкурс: шапка, факты сеткой, книги с проверкой и кнопками, действия; полный текст — свёрнут */
.ct .ct-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ct h3 { margin: 0; font-size: 18px; }
.ct-sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; margin-top: 4px; }
select.ct-st { width: auto; min-height: 26px; padding: 0 24px 0 8px; font-size: 13px; border-radius: 8px; color: var(--text-2); background-color: transparent; }
.ct-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.ct-f { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ct-f > span { font-size: 11.5px; color: var(--muted); }
.ct-f > b { font-size: 14px; font-weight: 700; }
.ct-f > b i { display: block; font-style: normal; font-weight: 500; font-size: 12px; color: var(--muted); }
.ct-mails { margin-top: 8px; padding: 0 2px; }
.ct-mail { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; font-weight: 600; font-size: 14px; }
.ct-mail .link { padding: 0 2px; min-height: 0; } .ct-mail .ic { width: 15px; height: 15px; }
.ct-delivery { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; min-width: 0; }
.ct-delivery .ct-mail { margin-right: 0; }
.ct-email-unit { display: inline-flex; align-items: center; flex-wrap: wrap; column-gap: 6px; row-gap: 1px; }
.ct-send-what { font-size: 13px; color: var(--text-2); }
.ct-submit-link { color: var(--link); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (hover: hover) { .ct-submit-link:hover { text-decoration: underline; } }
.ct-books { margin-top: 8px; }
.ct-book { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ct-book.is-sent .ct-bt b { color: var(--text-2); }
.ct-fn .ic { width: 13px; height: 13px; flex: none; }
.ct-sent { color: var(--good) !important; font-size: 13px !important; display: inline-flex; align-items: center; gap: 3px; padding: 0 4px !important; }
.ct-sent .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.ct-url { color: var(--link); text-decoration: none; font-weight: 600; margin-left: 4px; }
.ct-bt { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ct-bt .sub { display: block; font-size: 13px; color: var(--muted); }
.ct-ok { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; margin-top: 1px; background: var(--surface-2); color: var(--muted); }
.ct-ok.yes { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); } .ct-ok.no { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.ct-ok .icx .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.ct-bb { display: flex; gap: 6px; align-items: center; }
.ct-bb .small-btn { min-height: 30px; padding: 3px 12px; font-size: 13px; }
.ct-x .ic { width: 16px; height: 16px; } .ct-x { color: var(--muted) !important; padding: 0 4px; }
.ct-add { margin-top: 10px; } .ct-add select, select.ct-join { width: auto; min-height: 32px; padding: 2px 28px 2px 12px; font-size: 13.5px; }
.ct-acts { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ct-acts select.ct-addb { width: auto; min-height: 30px; padding: 2px 28px 2px 12px; font-size: 13px; }
.ct-acts .small-btn { min-height: 32px; padding: 4px 14px; font-size: 13.5px; }
.ct-full { margin-top: 8px; } .ct-full summary { font-size: 13.5px; color: var(--muted); cursor: pointer; }
.ct-wrap .ct { margin-bottom: 12px; }
/* идеи: маленькая обложка книги у группы */
.idea-group summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ig-h { display: inline-flex; align-items: center; gap: 12px; min-width: 0; font-weight: 700; }
.ig-cover { flex: none; width: 30px; height: 44px; border-radius: 6px; object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.14); }
.ig-ph, .ig-none { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent-soft), var(--accent-2)); color: var(--accent-ink); font-weight: 800; font-size: 14px; box-shadow: none; }
.ig-none { background: var(--surface-2); color: var(--muted); }
/* идеи: группа — обложка книги крупнее, название и счётчик, шеврон справа; строки идей спокойнее */
details.idea-group > summary > span:first-child::before { content: none; }
.idea-group > summary { list-style: none; cursor: pointer; padding: 2px 0; }
.idea-group > summary::-webkit-details-marker { display: none; }
.ig-h { gap: 14px; font-weight: 400; }
.ig-cover { width: 44px; height: 64px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.16); }
.ig-ph { font-size: 18px; }
.ig-none .ic { width: 22px; height: 22px; color: var(--muted); }
.ig-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ig-t b { font-size: 16px; font-weight: 800; }
.ig-n { font-size: 12.5px; color: var(--muted); }
.ig-chev { flex: none; color: var(--muted); display: inline-flex; transform: rotate(-90deg); transition: transform .2s; }
.idea-group[open] .ig-chev { transform: rotate(90deg); }
.ig-chev .ic { width: 18px; height: 18px; }
.idea-group[open] > summary { padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.idea-snip { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idea-pick { margin-top: 8px; }
.idea-pick select { width: auto; min-height: 28px; padding: 1px 26px 1px 12px; font-size: 12.5px; border-radius: 999px; color: var(--text-2); border: 1px dashed color-mix(in srgb, var(--text-2) 45%, var(--line)) !important; background-color: transparent; }
details.idea-group[open] > summary > span:first-child::before { content: none; }
.ig-chev { transform: rotate(180deg); } .idea-group[open] .ig-chev { transform: rotate(-90deg); }
.ig-h .ig-cover { margin-right: 4px; }
/* задача из Todoist — вся строка открывает её */
.pi-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.pi-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* большая цель */
.bg-target { margin-top: 6px; font-size: 15px; }
.bg-target b { font-size: 22px; letter-spacing: -.01em; }
.bg-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.bg-facts > div { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bg-facts span { font-size: 12px; color: var(--text-2); }
.bg-facts b { font-size: 18px; white-space: nowrap; }
.bg-facts i { font-style: normal; font-size: 12px; color: var(--text-2); }
.bg-miles { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.bg-miles::-webkit-scrollbar { display: none; }
.bg-miles > div { flex: 1 0 auto; border-top: 2px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; font-size: 12px; color: var(--text-2); }
.bg-miles > div:last-child { border-color: var(--accent); }
.bg-miles b { color: var(--text); font-size: 14px; white-space: nowrap; }
.bg-line { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; }
.card > .bg-line:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.bg-line .muted { font-size: 12.5px; }
@media (max-width: 560px) { .bg-facts { grid-template-columns: 1fr; } .bg-facts > div { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px; } .bg-facts span { flex: 1 0 100%; } }
.bg-now { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 10px; }
.bg-now > span:last-child { flex: none; }
@media (max-width: 560px) {
  .bg-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .bg-facts > div { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 1px; padding: 8px 9px; }
  .bg-facts span { flex: none; font-size: 11px; }
  .bg-facts b { font-size: 16px; }
  .bg-facts i { font-size: 11px; }
  .bg-miles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; overflow: visible; }
  .bg-target b { font-size: 20px; }
}
a.td-ext { text-decoration: none; font-weight: 700; font-size: 14px; }
a.td-ext { color: var(--link); }
/* перетаскивание дел и целей на другой день */
[data-drag] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[data-drag] a { -webkit-user-drag: none; }
@media (hover: hover) { .wstrip ~ * [data-drag], body:has(.wstrip) [data-drag] { cursor: grab; } }
.pitem.dragging { opacity: .35; }
html.is-dragging, html.is-dragging * { cursor: grabbing !important; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; padding: 9px 14px; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--accent-2); }
.wstrip button.wday.drop, .week .wstrip button.wday.drop { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); transform: translateY(-2px); transition: transform .12s; }
.ct-fn { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.ct-fnh { font-size: 11.5px; }
.ct-fnc { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.ct-fnc i { font-style: normal; flex: none; width: 64px; padding-top: 1px; white-space: nowrap; }
.ct-fnc code { font-family: inherit; font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; min-width: 0; }
.ct-fnc .link { padding: 0 3px !important; min-height: 0; color: var(--muted) !important; }
.ct-fnc .ic { width: 13px; height: 13px; }
/* календарь конкурсов */
.cc-grid { margin-top: 12px; }
.cc-row { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 14px; align-items: center; padding: 7px 0; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.cc-row.cc-head { border-top: 0; padding: 0 0 4px; }
.cc-name { display: flex; flex-direction: column; min-width: 0; }
.cc-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-name span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-track { position: relative; height: 22px; }
.cc-track > i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.cc-months { height: 28px; }
.cc-months .cc-yr { position: absolute; top: 0; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--text-2); padding-left: 4px; }
.cc-months span { position: absolute; top: 13px; font-size: 11px; color: var(--muted); padding-left: 4px; }
.cc-now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--link); border-radius: 2px; opacity: .6; }
.cc-bar { position: absolute; top: 6px; height: 10px; border-radius: 6px; }
.cc-plan, .cc-legend i.cc-plan { background: var(--accent-2); }
.cc-in, .cc-legend i.cc-in { background: var(--accent); }
.cc-sent, .cc-legend i.cc-sent { background: var(--good); }
.cc-approx { background: repeating-linear-gradient(90deg, var(--accent-2) 0 6px, transparent 6px 9px); }
.cc-res { position: absolute; top: 7px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text-2); }
.cc-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cc-legend i { display: inline-block; width: 14px; height: 7px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
.cc-legend i.cc-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--text-2); background: transparent; }
.cc-pick { align-items: flex-start; } .cc-pick .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 640px) {
  .cc-row { grid-template-columns: 1fr; gap: 4px; }
  .cc-row.cc-head .cc-name { display: none; }
  .cc-months span { font-size: 9.5px; padding-left: 2px; }
}
.ct-src { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }

.ct-bb { flex-wrap: wrap; }
@media (max-width: 560px) { .ct-book { align-items: stretch; } .ct-bb { width: 100%; } .ct-bb .small-btn { padding: 3px 10px; font-size: 12.5px; } .ct-bb .ct-x { margin-left: auto; } }
.bg-pace { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--text); }
/* строка о книге: тихо, тёмно-серым; акцент — точка статуса и конкурс */
.bmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.bmeta > b { color: var(--muted); font-weight: 400; opacity: .6; }
.bm-st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.bm-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.bm-progress i { background: var(--accent); } .bm-done i { background: var(--good); } .bm-idea i { background: var(--muted); }
.bmeta-ct { margin-top: 3px; }
.bm-ct { color: var(--accent); font-weight: 600; }
.bm-ct em { font-style: normal; font-weight: 500; color: var(--text-2); }
.bh-title .bmeta { font-size: 13.5px; }
.cover-tile .bmeta { margin-top: 3px; }
/* круглые выпадающие списки-«пилюли»: своя аккуратная стрелка, на одном расстоянии от края */
.idea-pick select, select.ct-addb, select.ct-join, .ct-add select {
  -webkit-appearance: none; appearance: none; padding-right: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c5257' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 10px 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.idea-pick select, select.ct-addb, select.ct-join, .ct-add select) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23c9bfc4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] :is(.idea-pick select, select.ct-addb, select.ct-join, .ct-add select) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23c9bfc4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* книга на конкурсе: скачать — тихими ссылками, «отправлена» — меткой у названия, корзина — при наведении */
.ct-bb { gap: 4px; }
:is(main, dialog) button.dl.dl:not(.chip):not(.link):not(.wide) { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 10px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--text-2); font-size: 13px; font-weight: 600; }
:is(main, dialog) button.dl.dl:not(.chip):not(.link):not(.wide):hover { background: var(--surface-2); color: var(--text); }
.dl .ic { width: 15px; height: 15px; opacity: .8; flex: none; }
/* единый вид действий с файлами: тихая ссылка с иконкой; только иконка — квадратная */
:is(main, dialog) button.dl.dl-i:not(.chip):not(.link):not(.wide) { width: 34px; padding: 0; justify-content: center; }
.dl.dl-i .ic { width: 17px; height: 17px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; margin-left: -10px; }
.svc-btns { gap: 2px; }
.ct-send { margin-left: 4px; }
:is(main, dialog) button.ct-pill.ct-pill:not(.chip):not(.link):not(.wide) { display: inline-flex; align-items: center; gap: 4px; vertical-align: 2px; margin-left: 8px; min-height: 0; padding: 2px 9px 2px 7px; border: 0; border-radius: 999px; box-shadow: none; background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); font-size: 11.5px; font-weight: 700; cursor: pointer; }
:is(main, dialog) button.ct-pill.ct-pill:not(.chip):not(.link):not(.wide):hover { background: color-mix(in srgb, var(--good) 20%, transparent); }
.ct-pill .icx .ic, .ct-pill .ic { width: 12px; height: 12px; stroke-width: 2.6; }
@media (hover: hover) { .ct-book .ct-x { opacity: 0; transition: opacity .15s; } .ct-book:hover .ct-x, .ct-book .ct-x:focus-visible { opacity: 1; } }

/* название книги в «Книгах в работе» — чёрное, как заголовок; цвет — только в акцентах */
main a.pbook-t, main a.pbook-t b { color: var(--text) !important; }
/* имена файлов по условиям — тихо, без плашек */
.ct-fnc code { background: transparent; padding: 0; color: var(--text-2); }
/* день со сбоем «не от меня» */
.outage-card { border-left: 3px solid var(--ev-outage); }
.outage-card > b { display: block; margin-bottom: 2px; }
/* описание и условия конкурса — как аккуратная статья */
.ct-cond { margin-top: 10px; max-width: 720px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.ct-cond dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.ct-cond dt { font-size: 11.5px; color: var(--muted); }
.ct-cond dd { margin: 0; font-weight: 600; color: var(--text); }
.ct-cond p { margin: 0 0 10px; }
.ct-cond h4 { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.ct-cond ul { margin: 0 0 12px; padding-left: 18px; }
.ct-cond li { margin: 3px 0; }
.ct-cond li::marker { color: var(--accent); }
/* выбор цвета акцентов — круглые пастельные образцы */
.acc-pick { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 6px; }
:is(main, dialog) button.acc-sw.acc-sw:not(.chip):not(.link):not(.wide) { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; min-height: 0; padding: 4px 2px; border: 0; background: transparent; box-shadow: none; font-size: 12px; font-weight: 600; color: var(--text-2); }
.acc-sw i { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); transition: transform .15s; }
.acc-sw:hover i { transform: scale(1.06); }
.acc-sw.on i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.acc-sw.on span { color: var(--text); }

/* ---------- «Директ» ---------- */
.d-st { font-size: 13px; color: var(--muted); white-space: nowrap; }
.d-st.good { color: var(--good); } .d-st.warn { color: var(--warn); }
.d-q { min-height: 0; padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.d-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .d-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.d-t td, .d-t th { white-space: nowrap; } .d-t td:first-child { white-space: normal; min-width: 160px; }
.d-group { margin: 12px 0 16px; }
.d-ad-t { color: var(--link); font-weight: 700; margin-top: 6px; }
.d-ad-u { color: var(--good); }
.d-x { min-height: 0; padding: 0 2px; color: var(--muted); }
.item.d-pick { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; } .d-pick input { margin-top: 4px; }
.d-pick .sub { display: block; }
.d-link { align-items: center; gap: 8px; margin-top: 10px; } .d-link select { flex: 1; min-width: 0; }
.d-code { display: inline-block; word-break: break-all; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; margin: 4px 0; }
.d-learn details { border-top: 1px solid var(--line); padding: 10px 0; } .d-learn details p { margin: 8px 0; }
.d-addminus { margin-top: 12px; }
.d-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--text); margin: 14px 0 6px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.d-banner:hover { background: var(--accent-soft); } .d-banner .d-b-go { color: var(--link); white-space: nowrap; }
.d-banner .d-b-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); display: grid; place-items: center; }
.d-banner .d-b-ic svg { width: 22px; height: 22px; stroke: var(--accent-ink); }
.d-banner .d-b-t { flex: 1; min-width: 0; } .d-banner .d-b-t b { color: var(--text); } .d-banner .d-b-t .sub { display: block; }
.l-tabs { margin: 0 0 12px; }
.an-tabs { margin: 0 0 14px; }
.l-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-left: 2px; }
.l-stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.l-stage { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.l-stage.past { color: var(--good); } .l-stage.on { background: var(--btn-from); color: var(--accent-ink); font-weight: 800; }
.l-todo { padding-left: 18px; } .l-todo li { margin: 4px 0; } .l-todo li::marker { color: var(--accent); }
.l-live { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--link) 8%, var(--surface)); }
.l-live .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--link); }
.l-quiz { margin: 12px 0; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.l-opt { display: block; width: 100%; text-align: left; margin: 6px 0; font-weight: 600; }
.l-opt.ok { border-color: var(--good); color: var(--good); } .l-opt.no { border-color: var(--warn); color: var(--warn); }
.l-task .ic { width: 14px; height: 14px; color: var(--link); vertical-align: -2px; }
.st-step { border-top: 1px solid var(--line); padding: 10px 0; }
.st-step summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.st-step summary::-webkit-details-marker { display: none; }
.st-n, .d-learn summary .st-n { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.st-step.done .st-n, .d-learn .st-n:has(.ic) { background: color-mix(in srgb, var(--good) 15%, var(--surface)); color: var(--good); }
.st-n .ic { width: 14px; height: 14px; }
.st-how { padding-left: 18px; } .st-how li { margin: 6px 0; } .st-how .dl { display: inline-flex; min-height: 0; padding: 2px 6px; }
.st-form { gap: 8px; flex-wrap: nowrap; } .st-form input { flex: 1; min-width: 0; }
.d-learn summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; } .d-learn summary::-webkit-details-marker { display: none; }
.st-step summary, .d-learn summary { color: var(--text); } .st-step summary b, .d-learn summary b { color: var(--text); }
/* «От автора» — отдельным небольшим блоком под главами */
.ch-author { margin-top: 6px; padding-top: 4px; border-top: 1px dashed var(--line); }
.ch-au-h { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ch-au-h .muted { font-weight: 500; }
/* Настройки «Директа»: воздух между полями, галочкой, раскрывашкой и кнопкой */
.app-direct .d-check { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-weight: 600; cursor: pointer; }
.app-direct .d-check input { width: 18px; height: 18px; margin: 0; flex: none; }
.app-direct .d-more { margin: 16px 0 0; } .app-direct .d-more[open] summary { margin-bottom: 8px; }
.app-direct .d-save { margin-top: 22px; }
.app-direct .st-form { margin-top: 12px; }
.app-direct .card details > form { margin-top: 10px; }
/* «От автора» и подписи под таблицей глав — один ровный размер, без скачков */
.ch-author .ch-au-h { font-size: 14px; font-weight: 700; line-height: 1.4; }
.ch-author .ch-au-h .muted { font-size: 13px; font-weight: 500; }
.ch-author p.small, .ch-author > p { font-size: 13px !important; line-height: 1.5; color: var(--muted); margin: 4px 0 0; }
.ch-author + .hint, .ch-author ~ .small, .ch-author ~ p { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.mk-orig { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin: 12px 0 4px; }
/* «Легенда» книги: переключатель Книга | Легенда, вкладки Идея / Каркас / Персонажи, карточки */
.bk-top, .lg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.lg-book { margin: 0; font-size: 20px; color: var(--text); }
.bk-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.bk-seg > * { padding: 5px 14px; border-radius: 999px; color: var(--text-2); text-decoration: none; }
.bk-seg .on { background: var(--accent-soft); color: var(--text); }
.bk-seg > a, .bk-seg > a:visited { color: var(--text-2); }
.bk-seg > a:hover { color: var(--text); }
.lg-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 10px; }
.lg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex: 1 1 auto; }
main .lg-tabs button { background: none; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0; min-height: 36px; padding: 6px 10px; font-weight: 700; color: var(--muted) !important; box-shadow: none; white-space: nowrap; }
main .lg-tabs button.on { color: var(--text) !important; border-bottom-color: var(--accent-2) !important; }
.lg-acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lg-acts .primary { min-height: 34px; padding: 6px 14px; display: inline-flex; align-items: center; gap: 6px; }
.lg-acts .primary .ic { width: 16px; height: 16px; }
.lg-sync { margin: 0 0 10px; }
.lg-conf { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 10px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.lg-conf .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lg-l { display: block; margin: 14px 0 4px; font-weight: 700; font-size: 14px; color: var(--text); }
.lg-idea .lg-l:first-child { margin-top: 0; }
textarea.lg-ta { width: 100%; resize: none; overflow: hidden; min-height: 40px; line-height: 1.45; font: inherit; font-size: 15px; }
.lg-ch { padding: 12px 14px; margin-bottom: 10px; }
.lg-ch textarea.lg-ta { margin-top: 6px; }
.lg-ch-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--text); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
input.lg-t { flex: 1 1 160px; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 4px 2px; font-weight: 700; font-size: 16px; color: var(--text); }
input.lg-t:focus { outline: none; border-bottom: 1px solid var(--accent-2) !important; }
.lg-st { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lg-st.ok { color: var(--good); }
.lg-st.ok::before { content: "● "; font-size: 9px; vertical-align: 1px; }
.lg-mv { display: inline-flex; gap: 2px; margin-left: auto; }
main button.lg-ib { min-width: 30px; width: 30px; min-height: 30px; padding: 0; border-radius: 8px; background: transparent; border: 0 !important; box-shadow: none; color: var(--muted) !important; font-size: 15px; font-weight: 700; }
main button.lg-ib:hover:not(:disabled) { background: var(--surface-2); color: var(--text) !important; }
main button.lg-ib:disabled { opacity: .3; }
.lg-ib .ic { width: 16px; height: 16px; }
.lg-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.lg-pov { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.lg-pov select { min-height: 30px; padding: 2px 26px 2px 8px; font-size: 13px; width: auto; }
.lg-chips { display: flex; gap: 4px; flex-wrap: wrap; }
main button.lg-chip { min-height: 28px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: transparent; border: 1px solid var(--line) !important; color: var(--muted) !important; box-shadow: none; }
main button.lg-chip.on { background: var(--accent-soft); border-color: var(--accent-2) !important; color: var(--text) !important; }
.lg-add { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.lg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lg-cards .lg-card.lg-card { display: flex; flex-direction: row; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0; color: var(--text); text-decoration: none; min-height: 76px; }
.lg-cb { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-role { font-size: 13px; color: var(--muted); }
.lg-sn { font-size: 13px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lg-in { font-size: 12px; color: var(--muted); }
main .lg-cards button.lg-new { justify-content: center; align-items: center; border: 1px dashed var(--line) !important; background: transparent; color: var(--muted) !important; font-weight: 700; box-shadow: none; }
.lg-av { flex: 0 0 auto; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #1c1a1b; font-weight: 800; font-size: 15px; }
.lg-ch-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.lg-photo { cursor: pointer; font-weight: 700; }
.lg-ch-top button.lg-photo-open { padding: 0; min-height: 0; border: 0 !important; border-radius: 50%; background: none; line-height: 0; cursor: zoom-in; box-shadow: none; }
.lg-ch-top button.lg-photo-open:hover { opacity: .82; }
.lg-photo-new-note { font-size: 12px; color: var(--text-2); }
.lg-photo-viewer .lg-photo-hint { color: #fff; font-size: 12px; line-height: 1.45; text-align: center; max-width: 520px; margin: 10px auto 0; }
dialog.lg-photo-viewer { width: max-content; max-width: 94vw; max-height: 94dvh; padding: 0; border: 0; border-radius: 16px; background: transparent; overflow: visible; }
dialog.lg-photo-viewer::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(3px); }
.lg-photo-viewer img { display: block; width: min(78vw, 520px); max-height: 84dvh; height: auto; object-fit: contain; border-radius: 14px; background: var(--surface); box-shadow: 0 18px 50px rgba(0,0,0,.3); }
dialog.lg-photo-viewer button.lg-photo-close { position: absolute; z-index: 1; top: 8px; right: 8px; width: 38px; height: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 25px; line-height: 1; box-shadow: 0 3px 16px rgba(0,0,0,.2); }
textarea.lg-ai { width: 100%; font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; margin-top: 10px; resize: vertical; }
.lg-peek { display: grid; gap: 10px; margin-top: 12px; }
.lg-pk { display: flex; gap: 10px; align-items: flex-start; }
.lg-pk .lg-av { font-size: 12px; }
@media (max-width: 640px) { input.lg-t { flex-basis: calc(100% - 40px); } .lg-st { flex: 1 1 auto; padding-left: 34px; } .lg-acts { width: 100%; } .lg-cards { grid-template-columns: 1fr; } }
/* «Легенда» в панели редактора: значок + слово, ширина по содержимому */
.ed-chapter button.ed-ic.ed-leg { width: auto; gap: 6px; padding: 0 10px; margin-left: 6px; }
.ed-chapter .ed-leg .ed-lbl { font-size: 13px; font-weight: 700; }
@media (max-width: 640px) { .ed-chapter button.ed-ic.ed-leg { width: 34px; padding: 0; margin-left: 2px; } .ed-chapter .ed-leg .ed-lbl { display: none; } }
/* «Архив книг» */
.arc .arc-st { margin: 10px 0 6px; display: flex; align-items: center; gap: 8px; }
.arc .arc-st.warn { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); }
.arc .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: 0 0 auto; }
.arc .arc-name { color: var(--text); }
.arc-err { color: var(--bad); }
.arc .dl-row, .arc-copies .dl-row { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 8px; }
:is(main, dialog) a.dl.dl, :is(main, dialog) a.dl.dl:visited { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
:is(main, dialog) a.dl:hover { background: var(--surface-2); color: var(--text); }
a.dl .ic { width: 15px; height: 15px; }
.arc-copies .good { color: var(--good); font-weight: 700; }
.arc-steps { padding-left: 20px; margin: 0; display: grid; gap: 10px; line-height: 1.45; }
.arc-steps .dl-row { margin-top: 8px; }
.arc-gh { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.arc-gh summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
main a.card.arc-warn, main a.card.arc-warn:visited { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--accent-soft); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
a.card.arc-warn .ic { width: 18px; height: 18px; flex: 0 0 auto; }
.arc-steps a, .arc-steps a:visited { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.arc-gh summary { color: var(--text); }
.arc .arc-upd { flex-wrap: wrap; justify-content: space-between; }
.arc .arc-upd .small-btn { display: inline-flex; align-items: center; gap: 6px; }
.arc .arc-upd .small-btn .ic { width: 15px; height: 15px; }
/* Директ: покупки по целям Метрики */
.d-goalrow { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 2px; color: var(--text-2); }
.d-goalrow b { color: var(--text); white-space: nowrap; }
.item.d-good b::before { content: "● "; color: var(--good); font-size: 11px; vertical-align: 2px; }
.alert.d-outage { background: var(--accent-soft); }
.mk-pick { margin-top: 12px; }
.mk-goals { display: grid; gap: 2px; margin-top: 6px; }
.mk-goal { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.mk-goal .d-check { margin: 0; }
.mk-star { display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.mk-star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mk-star span { font-size: 24px; color: var(--muted); opacity: .35; line-height: 1; padding: 2px 6px; transition: opacity .15s, color .15s; }
.mk-star:hover span { opacity: .7; }
.mk-star input:checked + span { color: var(--accent); opacity: 1; }
.mk-star input:focus-visible + span { outline: 2px solid var(--link); border-radius: 6px; }
.l-camp { border-top: 1px solid var(--line); padding: 10px 0; } .l-camp summary { cursor: pointer; list-style: none; } .l-camp summary::-webkit-details-marker { display: none; }
.l-camp summary b { color: var(--text); } .l-check { margin: 10px 0; } .l-check .d-check { margin: 8px 0 0; font-weight: 400; align-items: flex-start; } .l-check .d-check input { margin-top: 2px; }
.l-ai-tasks { flex-wrap: wrap; gap: 8px; } .l-calc { margin: 10px 0; }
.l-why { white-space: normal; text-align: left; padding-left: 0; }
.ai-tasks { margin: 10px 0 4px; }
.l-hl { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); border-radius: 12px; padding: 10px 12px !important; } .l-step { color: var(--accent); font-weight: 700; }
@media (max-width: 560px) { .app-direct .grid2 { grid-template-columns: 1fr; } }
/* Аналитика: формулы — моноширинно и спокойно */
.f-formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); margin: 2px 0; word-break: break-word; }

/* Идеи и заметки: Открытые | Готово, книги кнопками, галочка «Готово» */
.idea-seg { display: flex; padding: 3px; border-radius: 999px; background: var(--surface-2); margin: 0 0 10px; }
:is(main, dialog) .idea-seg > button { flex: 1; min-height: 32px; padding: 4px 10px; border: 0 !important; border-radius: 999px; background: transparent; box-shadow: none; color: var(--text-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
:is(main, dialog) .idea-seg > button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.idea-books { flex-wrap: nowrap; overflow-x: auto; margin: 0 -4px; padding: 0 4px 2px; scrollbar-width: none; }
.idea-books::-webkit-scrollbar { display: none; }
.idea-books .chip { flex: none; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.idea-books .chip .muted { font-weight: 600; margin-left: 2px; }
.idea-filter { padding-bottom: 10px; }
.ig-head { padding: 2px 0 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.item.idea { display: block; }
.item.idea .idea-head { display: flex; align-items: flex-start; gap: 12px; }
:is(main, dialog) button.idea-ok { flex: none; width: 26px; height: 26px; min-height: 26px; margin-top: 1px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1.5px solid color-mix(in srgb, var(--text-2) 40%, var(--line)) !important; color: transparent; box-shadow: none; }
:is(main, dialog) button.idea-ok .ic { width: 14px; height: 14px; stroke-width: 2.4; }
:is(main, dialog) button.idea-ok:hover { border-color: var(--good) !important; color: var(--good); }
:is(main, dialog) button.idea-ok.on { background: var(--good); border-color: var(--good) !important; color: #fff; }
.idea-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; outline: none; }
.idea-main b { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.idea-main b.idea-done { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.idea-sub { font-size: 12.5px; color: var(--muted); }
.item.idea .idea-snip, .item.idea .idea-pick { margin-left: 38px; }
.item.idea.open > :not(.idea-head) { margin-left: 38px; }
.item.idea .idea-snip { margin-top: 3px; }
.idea-acts { gap: 6px 14px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
.idea-acts select { width: auto; min-height: 30px; padding: 2px 28px 2px 10px; font-size: 13px; }
.trash-link { text-align: center; margin: 14px 0 4px; }
.trash-link .link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.trash-link .ic { width: 15px; height: 15px; }
.item.idea .idea-head > span.idea-main { display: flex; white-space: normal; }
.idea-main, .item.idea .idea-snip, .item.idea.open > * { text-align: left; }
.idea-books .chip { display: inline-block; text-align: left; line-height: 20px; }
:is(main, dialog) button.idea-ok:not(.on) { color: transparent !important; }
:is(main, dialog) button.idea-ok:not(.on):hover { color: var(--good) !important; }
:is(main, dialog) button.idea-ok.on { color: #fff !important; }
.item.idea .idea-head > span.idea-main { align-items: flex-start; text-align: left; }
:is(main, dialog) button.idea-ok.idea-ok.idea-ok { width: 26px; height: 26px; min-width: 26px; min-height: 26px !important; padding: 0 !important; border-width: 1.5px !important; }

/* Идеи: книги — колонкой слева на компьютере, окном с поиском на телефоне; вкладки и вид — в одной карточке */
.ideas-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; align-items: start; }
.ideas-side { display: none; }
@media (min-width: 1000px) {
  .ideas-wrap { grid-template-columns: 250px minmax(0, 1fr); }
  .ideas-side { display: block; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding: 10px; }
  .ideas-bookbtn { display: none !important; }
}
.ib-q { margin-bottom: 6px; }
.ib-list { display: flex; flex-direction: column; gap: 1px; }
:is(main, dialog) button.ib-item.ib-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; padding: 7px 10px; border: 0 !important; border-radius: 10px; background: transparent; box-shadow: none; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; }
:is(main, dialog) button.ib-item.ib-item:hover { background: var(--surface-2); }
:is(main, dialog) button.ib-item.ib-item.on { background: var(--accent-soft); }
.ib-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-n { flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ideas-sheet .ib-list { max-height: 60vh; overflow: auto; }
.ideas-sheet .ib-q { position: sticky; top: 0; }
:is(main, dialog) .idea-seg > button span { color: var(--muted); font-weight: 600; margin-left: 3px; }
.idea-pickers { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
:is(main, dialog) .idea-pk.idea-pk { display: inline-flex; align-items: center; gap: 6px; width: auto; max-width: 100%; min-height: 34px; padding: 4px 12px; border: 1px solid var(--line) !important; border-radius: 999px; background-color: var(--surface); box-shadow: none; color: var(--text); font-size: 14px; font-weight: 600; }
select.idea-pk.idea-pk { padding-right: 30px; }
.ideas-bookbtn { min-width: 0; flex: 1 1 auto; }
.ideas-bookbtn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ideas-bookbtn .ic { flex: none; width: 16px; height: 16px; color: var(--muted); }
.ideas-bookbtn .ic:last-child { transform: rotate(90deg); width: 14px; height: 14px; }
.idea-reset { font-size: 13px; }
.idea-list { padding-top: 6px; padding-bottom: 6px; }
.idea-main b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.idea.open .idea-main b { -webkit-line-clamp: unset; display: block; }
.idea-more { text-align: center; padding: 10px 0 4px; }
.idea-trash .idea-head { align-items: center; }
.idea-trash .idea-snip { margin-left: 0 !important; }
.idea-trash .ti-btns { flex: none; display: inline-flex; gap: 6px; align-items: center; }
.ideas-bookbtn .ic:last-child { transform: rotate(-90deg); }
:is(main, dialog) .idea-seg > button { min-width: 0; }
@media (max-width: 480px) { :is(main, dialog) .idea-seg > button { padding: 4px 6px; font-size: 13px; } :is(main, dialog) .idea-seg > button span { margin-left: 1px; } }
:is(main, dialog) button.ib-item[hidden] { display: none !important; }

/* Конкурсы: Идут | Итоги | Архив; чем закончилось */
.ct-tabs { margin: 0 0 12px; }
.ct-dot { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--accent-2); vertical-align: 2px; }
.ct-arch { padding-top: 4px; padding-bottom: 4px; }
.ct-arow { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text); text-decoration: none; }
.ct-arow > span { min-width: 0; }
.ct-arow .sub { display: block; }
.ct-arow > .ic { flex: none; width: 16px; height: 16px; color: var(--muted); transform: rotate(180deg); }
.ct-medal { font-size: 12px; font-weight: 700; color: var(--good); margin-left: 6px; }
.ct-arch-open > .card { box-shadow: none; border: 0; padding: 4px 0; margin: 0; background: transparent; }
.ct-out { display: inline-flex; gap: 4px; flex-wrap: wrap; }
:is(main, dialog) button.ct-oc.ct-oc { min-height: 28px; padding: 3px 10px; border: 1px solid var(--line) !important; border-radius: 999px; background: transparent; box-shadow: none; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
:is(main, dialog) button.ct-oc.ct-oc:hover { color: var(--text); }
:is(main, dialog) button.ct-oc.ct-oc.on { color: var(--text); background: var(--surface-2); border-color: var(--text-2) !important; }
:is(main, dialog) button.ct-oc.ct-oc.on.win, :is(main, dialog) button.ct-oc.ct-oc.on.short { color: var(--good); border-color: var(--good) !important; background: color-mix(in srgb, var(--good) 10%, transparent); }
.ct-fail { color: var(--text-2); }
.ct-arch .item.ct-arow { display: flex !important; }

/* Стрелки «назад / вперёд» (неделя в Планере, день в «Доходах»): просто линейная стрелка, без кружков и обводки */
:is(main, dialog) button.nav-arr.nav-arr { flex: none; width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0 !important; border-radius: 8px; background: transparent; box-shadow: none; color: var(--text-2); }
:is(main, dialog) button.nav-arr.nav-arr:hover { color: var(--text); }
.nav-arr .ic { width: 24px; height: 24px; stroke-width: 1.8; }
.nav-arr.next .ic { transform: rotate(180deg); }
.wk-head { align-items: center; }

/* Маркетинг → Реклама: переходы в «Директ» и в рекламу «Доходов» */
.mk-go { padding-top: 4px; padding-bottom: 4px; }
.mk-go .item { display: flex !important; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.mk-go-ic { flex: none; display: inline-flex; color: var(--text-2); }
.mk-go-ic .ic { width: 22px; height: 22px; }
.mk-go-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mk-go-t .sub { font-size: 13px; color: var(--muted); }
.mk-go .item > .ic:last-child { flex: none; width: 18px; height: 18px; color: var(--muted); transform: rotate(180deg); }
.mk-go .item:hover > .ic:last-child { color: var(--text); }
:is(main, dialog) button.stat.stat-btn { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
:is(main, dialog) button.stat.stat-btn .s { color: var(--link); }
:is(main, dialog) button.stat.stat-btn.stat-btn { border: 1px solid var(--line) !important; background: var(--surface); box-shadow: var(--shadow); padding: 14px 16px 15px !important; min-height: 0; border-radius: 22px; font-weight: inherit; }
.how-row { flex-wrap: nowrap; gap: 12px; align-items: baseline; }
.how-row > span { flex: 1 1 45%; min-width: 0; }
.how-row > b { flex: 1 1 55%; text-align: right; }
.plan-dayh { margin-bottom: 8px; gap: 10px; }
.plan-dayh { flex-wrap: nowrap; align-items: center; }
.plan-dayh h2 { min-width: 0; }
.plan-dayh .small-btn { flex: none; }
/* «+» — просто плюс, без рамки и кружка (как стрелки nav-arr) */
:is(main, dialog) button.plus-btn.plus-btn { flex: none; width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0 !important; border-radius: 8px; background: transparent; box-shadow: none; color: var(--text-2); }
:is(main, dialog) button.plus-btn.plus-btn:hover { color: var(--text); }
.plus-btn .ic { width: 24px; height: 24px; stroke-width: 1.8; }

/* Легенда: статус решения (точкой и словом), открытые вопросы, режимы «Для нейросети», версии */
.lg-ps { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.lg-ps .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.lg-ps.ps-ok .dot { background: var(--good); }
.lg-ps.ps-talk .dot { background: var(--warn); }
.lg-ps.ps-no .dot { background: var(--muted); }
.lg-ps select { width: auto; min-height: 0; padding: 0 16px 0 0; border: 0 !important; background-color: transparent; box-shadow: none; font-size: 12.5px; color: var(--text-2); background-position: right 0 center; }
.lg-ch.lg-no { opacity: .55; }
.lg-ch.lg-no .lg-t { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.lg-qs > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 4px; }
.lg-qs > summary::-webkit-details-marker { display: none; }
.lg-qs > summary b { font-size: 16px; }
.lg-q { padding: 14px 0; border-top: 1px solid var(--line); }
.lg-q:first-of-type { margin-top: 8px; }
.lg-q-h { display: flex; align-items: center; gap: 6px; }
.lg-q-f { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.lg-q.ok .lg-t { color: var(--text-2); }
.lg-mode { margin-bottom: 10px; }
/* Экспорт Легенды: прямой выбор вкладки вместо списка глав */
#sheetForm .lg-mode-h { margin: -3px 0 16px; line-height: 1.5; }
#sheetForm .lg-export-label { margin: 0 0 9px; font: 700 13px/1.4 var(--font-body); color: var(--text); }
#sheetForm .lg-export-sections { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
#sheetForm button.lg-export-choice {
  min-height: 36px; padding: 7px 12px;
  border-radius: 10px; border: 1px solid var(--line) !important;
  background: var(--surface); color: var(--text-2);
  box-shadow: none; font: 700 13px/1.35 var(--font-body);
}
#sheetForm button.lg-export-choice.on {
  background: var(--accent-soft); border-color: var(--accent-2) !important; color: var(--text);
}
#sheetForm button.lg-export-choice:hover { border-color: var(--accent) !important; color: var(--text); }
#sheetForm .lg-export-sections + .lg-ai { margin-top: 16px; }

.lg-vform { display: flex; gap: 8px; align-items: center; }
.lg-vform input { flex: 1; min-width: 0; }
.lg-vform .primary { flex: none; }
.lg-vfoot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; }
.lg-vfoot label.dl { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 4px 10px; }
.lg-vfoot .ic { width: 16px; height: 16px; }
.lg-qs > summary b { color: var(--text); }
.lg-q-h .lg-ta { flex: 1; min-width: 0; font-weight: 700; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 4px 2px; resize: none; }
.lg-vform { flex-wrap: wrap; }
.lg-vform input { flex: 1 1 220px; }
@media (max-width: 480px) { .lg-vform .primary { width: 100%; } }
.lg-tfix { flex: 1 1 160px; padding: 4px 2px; font-weight: 700; font-size: 16px; color: var(--text); }
.lg-ghost { border-style: dashed; box-shadow: none; }
.lg-ghost .lg-n { opacity: .6; }
/* Легенда: «Шаблон для нейросети» и «Загрузить ответ» — тихо, справа внизу вкладки */
.lg-tpl { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 4px; }
.lg-file { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 4px 10px; }
.lg-file .ic { width: 16px; height: 16px; }
@media (max-width: 480px) { .lg-tpl { gap: 2px; } :is(main, dialog) .lg-tpl button.dl.dl:not(.chip):not(.link):not(.wide) { padding: 4px 5px; font-size: 12.5px; gap: 4px; } }
/* Легенда → Синопсис */
.lg-syn-h { flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.lg-syn-acts { display: inline-flex; flex-wrap: wrap; gap: 2px 6px; }
.lg-syn-files { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }

/* Легенда: внешние карточки остаются штатного светлого цвета.
   Тонкая СЕРАЯ РАМКА — у текстового содержимого; при наведении/фокусе
   внутренняя область становится пастельно-розовой. */
.app-writer {
  --lg-content-bg: color-mix(in srgb, var(--surface) 96%, var(--text));
  --lg-content-border: color-mix(in srgb, var(--surface) 81%, var(--text));
}
.lg-f { padding: 16px 18px; margin: 0 0 12px; }
.lg-f .lg-l { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--text); }
.lg-sl { display: block; margin: 15px 0 7px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.lg-ch-h + .lg-sl { margin-top: 12px; }
:is(.lg-f, .lg-ch, .lg-qs, .lg-syn, .lg-cards .lg-card:not(.lg-new)) {
  background: var(--ivory);
}
/* Рамка видна постоянно, цветная заливка появляется ТОЛЬКО при наведении/редактировании. */
.app-writer :is(.lg-f, .lg-ch, .lg-q) > textarea.lg-ta,
.app-writer .lg-q-h textarea.lg-ta,
.app-writer dialog textarea.lg-ta {
  display: block;
  width: 100%;
  margin: 4px 0 10px;
  padding: 12px 14px;
  min-height: 48px;
  border: 1px solid var(--lg-content-border) !important;
  border-radius: 12px;
  background: var(--lg-content-bg) !important;
  box-shadow: none !important;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: break-word;
  transition: border-color .15s, background-color .15s;
}
.app-writer :is(.lg-f, .lg-ch, .lg-q) > textarea.lg-ta:hover,
.app-writer .lg-q-h textarea.lg-ta:hover,
.app-writer dialog textarea.lg-ta:hover {
  border-color: var(--accent-2) !important;
  background: var(--accent-soft) !important;
}
.app-writer :is(.lg-f, .lg-ch, .lg-q) > textarea.lg-ta:focus,
.app-writer .lg-q-h textarea.lg-ta:focus,
.app-writer dialog textarea.lg-ta:focus {
  outline: 1px solid var(--accent-2);
  outline-offset: 0;
  border-color: var(--accent-2) !important;
  background: var(--surface-2) !important;
}
.app-writer :is(.lg-f, .lg-ch, .lg-q) > textarea.lg-ta::placeholder,
.app-writer .lg-q-h textarea.lg-ta::placeholder,
.app-writer dialog textarea.lg-ta::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: .85;
}
.lg-ch { padding: 16px 18px 14px; }
.app-writer .lg-ch textarea.lg-ta { margin: 3px 0 8px; }
.lg-ch .lg-row { margin-top: 10px; }
.lg-q { padding: 15px 0; }
.app-writer .lg-q-h { align-items: flex-start; }
.app-writer .lg-q-h textarea.lg-ta { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 700; line-height: 1.5; }
.app-writer .lg-q > textarea.lg-ta { margin: 9px 0 6px; }
.lg-q-f { margin-top: 10px; }
/* Синопсис и описания персонажей — та же рамка, цвет при наведении на текст. */
.lg-syn { padding: 16px 18px; }
.app-writer .lg-syn-text {
  margin-top: 13px;
  padding: 15px 17px;
  border: 1px solid var(--lg-content-border);
  border-radius: 12px;
  background: var(--lg-content-bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  overflow-wrap: anywhere;
  transition: background-color .15s, border-color .15s;
}
.app-writer .lg-syn-text:hover {
  background: var(--accent-soft);
  border-color: var(--accent-2);
}
.app-writer .lg-syn-text p { margin: 0 0 .75em; }
.app-writer .lg-syn-text p:last-child { margin-bottom: 0; }
.app-writer .lg-char-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  margin-top: 7px;
  min-width: 0;
  border: 1px solid var(--lg-content-border);
  border-radius: 11px;
  background: var(--lg-content-bg);
  transition: background-color .15s, border-color .15s;
}
.app-writer .lg-char-details:hover {
  background: var(--accent-soft);
  border-color: var(--accent-2);
}
.app-writer .lg-char-details .lg-sn {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: 400 14px/1.5 var(--font-body);
  color: var(--text);
}
.app-writer .lg-char-details .lg-in { font: 400 12px/1.45 var(--font-body); color: var(--muted); }
.lg-cb b { font-size: 16px; }
.lg-tabs { overflow-x: auto; scrollbar-width: none; }
.lg-tabs::-webkit-scrollbar { display: none; }
:is(main, dialog) .lg-tabs button:not(.link):not(.chip):not(.wide) { padding: 6px 10px; }
@media (max-width: 480px) {
  :is(main, dialog) .lg-tabs button:not(.link):not(.chip):not(.wide) { padding: 6px 7px; }
  .lg-cnt { display: none; }
  .lg-f, .lg-ch, .lg-syn { padding: 14px 15px; }
  .app-writer :is(.lg-f, .lg-ch, .lg-q) > textarea.lg-ta,
  .app-writer .lg-q-h textarea.lg-ta,
  .app-writer dialog textarea.lg-ta { padding: 11px 12px; font-size: 16px; }
  .app-writer .lg-syn-text { padding: 12px 14px; }
}

/* Маркетинг → книга: тихая ссылка «Справка об авторстве» внизу справа */
.mk-auth { display: flex; justify-content: flex-end; margin: 4px 0 8px; }


/* «Директ» → «Мой первый запуск»: ясная и спокойная вертикальная иерархия. */
.app-direct main .fl-panel {
  padding: clamp(20px, 3.5vw, 30px);
  margin-bottom: 18px;
  border-radius: 20px;
}
.app-direct main .fl-panel .fl-heading {
  align-items: flex-start;
  gap: 10px 20px;
  margin-bottom: 18px;
}
.app-direct main .fl-panel .fl-heading h2 {
  font-size: clamp(16px, 2.5vw, 19px);
  line-height: 1.4;
  flex: 1 1 240px;
  min-width: 0;
}
.app-direct main .fl-panel .fl-heading .d-st {
  flex: none;
  margin-top: 3px;
}
.app-direct main .fl-panel p {
  line-height: 1.65;
  max-width: 72ch;
  margin: 0 0 17px;
}
.app-direct main .fl-panel p.small {
  line-height: 1.65;
}
.app-direct main .fl-panel p.muted,
.app-direct main .fl-panel p.small.muted {
  color: var(--muted);
  font-size: 13px;
}
.app-direct main .fl-panel p:last-child { margin-bottom: 0; }
.app-direct main .fl-panel .fl-tiles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.app-direct main .fl-panel .fl-tiles > div {
  padding: 15px 16px;
  border-radius: 14px;
}
.app-direct main .fl-panel .fl-tiles .k { line-height: 1.5; margin-bottom: 8px; }
.app-direct main .fl-panel .fl-tiles .v { font-size: clamp(15px, 2.5vw, 20px); line-height: 1.35; white-space: normal; overflow-wrap: normal; }
.app-direct main .fl-panel .fl-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}
.app-direct main .fl-panel .fl-form .f2 { gap: 14px; align-items: end; }
.app-direct main .fl-panel .fl-form .f2 > div { justify-content: flex-start; }
.app-direct main .fl-panel .fl-form label { margin: 0 0 7px; line-height: 1.5; font-size: 13px; }
.app-direct main .fl-panel .fl-form :is(input, select, textarea) { margin: 0; }
.app-direct main .fl-panel .fl-form .d-save { margin: 5px 0 0; }
.app-direct main .fl-panel .d-check {
  align-items: flex-start;
  gap: 11px;
  line-height: 1.55;
  margin: 16px 0;
}
.app-direct main .fl-panel .d-check input { margin-top: 3px; }
.app-direct main .fl-panel .fl-checklist {
  display: grid;
  gap: 10px;
  margin: 18px 0 22px;
}
.app-direct main .fl-panel .fl-check-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  line-height: 1.55;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
}
.app-direct main .fl-panel .fl-check-item.fl-check-done { color: var(--text); }
.app-direct main .fl-panel .fl-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  height: 20px;
  font-weight: 800;
  color: var(--muted);
}
.app-direct main .fl-panel .fl-check-done .fl-check-icon { color: var(--good); }
.app-direct main .fl-panel > .row:not(.fl-heading) { margin: 12px 0 18px; }
.app-direct main .fl-panel > label:not(.d-check) { margin: 16px 0 7px; }
.app-direct main .fl-panel > select { margin: 0 0 12px; }
.app-direct main .fl-panel > .small:has(> a) { line-height: 1.8; }
.app-direct main .fl-panel.fl-hero { background: var(--surface); }
@media (max-width: 560px) {
  .app-direct main .fl-panel { padding: 19px 17px; margin-bottom: 14px; }
  .app-direct main .fl-panel .fl-heading { margin-bottom: 15px; }
  .app-direct main .fl-panel .fl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-direct main .fl-panel .fl-tiles > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .app-direct main .fl-panel .fl-form { gap: 13px; }
  .app-direct main .fl-panel .fl-form .f2 { grid-template-columns: 1fr; gap: 13px; }
}


/* Новый конструктор: отделен от карточки и показывает этапы крупными читаемыми блоками. */
.app-direct main .fl-builder {
  padding: 22px;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-2);
}
.app-direct main .fl-builder > h3 { font: 700 16px/1.4 var(--font-body); margin: 0 0 10px; }
.app-direct main .fl-builder > p { max-width: 68ch; margin-bottom: 18px; }
.app-direct main .fl-builder > .row { margin: 16px 0; }
.app-direct main .fl-builder .fl-form { margin: 17px 0; }
.app-direct main .fl-builder .fl-form > label { font-weight: 700; }
.app-direct main .fl-builder .fl-form :is(input,select,textarea) { background: var(--surface); }
.app-direct main .fl-builder .fl-builder-alert {
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  margin: 15px 0;
  line-height: 1.55;
}
.app-direct main .fl-builder .fl-builder-alert p { margin: 9px 0 13px; }
.app-direct main .fl-builder .fl-builder-alert .row { margin-top: 12px; }
.app-direct main .fl-builder .fl-made {
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--good);
  margin: 18px 0 10px;
}
@media (max-width: 560px) {
  .app-direct main .fl-builder { padding: 17px 14px; margin: 18px 0; }
  .app-direct main .fl-builder .row > button { max-width: 100%; white-space: normal; }
}


/* Отзывы: компактные строки в карточке книги, фотографии отдельно от текста. */
.rev-card .rev-summary { margin: 9px 0 6px; }
.rev-brief { display: grid; gap: 8px; margin-top: 10px; }
.rev-entry { min-width: 0; }
.rev-entry + .rev-entry { padding-top: 9px; border-top: 1px solid var(--line); }
.rev-brief .rev-body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.rev-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; margin-top: 4px; }
.rev-actions { gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.rev-actions .dl { display: inline-flex; align-items: center; gap: 5px; }
.rev-actions .dl .ic, .rev-gallery .ic { width: 17px; height: 17px; }
.rev-list { margin-top: 14px; }
.rev-item { display: block; }
.rev-item .rev-body { max-height: 210px; overflow: auto; }
.rev-gallery { margin-top: 12px; }
.rev-gallery .g-item img { object-fit: cover; }
@media(max-width: 480px) {
  .rev-actions { align-items: flex-start; }
  .rev-actions .primary { width: auto; }
  .rev-gallery { gap: 8px; }
}

/* Отзывы: вторичные кнопки должны читаться и при пустом архиве. */
main .rev-actions button.dl.dl:not(.chip):not(.link):not(.wide) {
  color: var(--text);
  font-weight: 700;
}
main .rev-actions button.dl.dl:not(.chip):not(.link):not(.wide):hover:not(:disabled),
main .rev-actions button.dl.dl:not(.chip):not(.link):not(.wide):focus-visible {
  background: var(--surface-2);
  color: var(--text);
}
main .rev-actions button.dl:disabled {
  opacity: .78;
  color: var(--text-2);
  cursor: not-allowed;
}
main .rev-actions button.dl .ic { opacity: 1; }


/* Контроль качества трафика — спокойные акценты и разделение блоков. */
.app-direct .tq { padding: clamp(18px, 3vw, 26px); margin-bottom: 16px; }
.app-direct .tq h2 { font-size: clamp(16px, 2vw, 19px); line-height: 1.35; margin-bottom: 14px; }
.app-direct .tq p { line-height: 1.6; margin: 0 0 14px; }
.app-direct .tq .muted { color: var(--muted); }
.app-direct .tq select { margin: 7px 0 18px; }
.app-direct .tq .tq-tiles { margin: 17px 0 18px; }
.app-direct .tq .tq-tiles .v { font-size: clamp(16px, 2.3vw, 20px); }
.app-direct .tq .tq-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.app-direct .tq .tq-types > div { min-width: 0; padding: 16px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 7px; line-height: 1.5; }
.app-direct .tq .tq-types span { font-size: 13px; color: var(--text-2); }
.app-direct .tq .tq-flags { display: grid; gap: 12px; margin: 16px 0 21px; }
.app-direct .tq .tq-flag { background: var(--surface-2); border-radius: 12px; padding: 13px 15px; display: grid; gap: 6px; }
.app-direct .tq .tq-flag span { font-size: 13px; color: var(--text-2); }
.app-direct .tq .tq-flag p { margin: 0; }
.app-direct .tq details { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 15px; }
.app-direct .tq details summary { cursor: pointer; font-weight: 700; }
.app-direct .tq .tq-table { margin-top: 15px; font-size: 12px; }
.app-direct .tq .tq-table td:first-child { max-width: 260px; overflow-wrap: anywhere; }
.app-direct .tq .tq-table th, .app-direct .tq .tq-table td { text-align: left; }
.app-direct .tq .list .item { line-height: 1.7; }
@media (max-width: 520px) {
  .app-direct .tq { padding: 18px 16px; }
  .app-direct .tq .tq-types { grid-template-columns: 1fr; gap: 9px; }
  .app-direct .tq .tq-table { min-width: 620px; }
}


/* Эксперименты в собственном Директе: понятная последовательность решения → наблюдения. */
.app-direct main .ex-panel { padding: clamp(19px, 3.2vw, 27px); margin-bottom: 16px; }
.app-direct main .ex-panel h2 { font-size: clamp(16px, 2.5vw, 19px); line-height: 1.4; margin: 0 0 16px; }
.app-direct main .ex-panel p { line-height: 1.6; margin: 0 0 13px; }
.app-direct main .ex-panel .ex-form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.app-direct main .ex-panel .ex-form label { font-weight: 650; line-height: 1.5; margin: 0 0 4px; }
.app-direct main .ex-panel .ex-form :is(input, select, textarea) { margin: 0; }
.app-direct main .ex-panel .ex-form .d-save { margin: 5px 0 0; }
.app-direct main .ex-panel .ex-list { display: grid; gap: 18px; }
.app-direct main .ex-panel .ex-item { padding: 18px; background: var(--surface-2); border-radius: 15px; min-width: 0; }
.app-direct main .ex-panel .ex-item > .row:first-child { align-items: flex-start; gap: 8px 15px; margin-bottom: 13px; }
.app-direct main .ex-panel .ex-item > .row:first-child b { flex: 1 1 180px; }
.app-direct main .ex-panel .ex-item .ex-results { border-top: 1px solid var(--line); padding-top: 15px; margin: 14px 0; }
.app-direct main .ex-panel .ex-item .ex-results table { min-width: 470px; background: var(--surface); border-radius: 10px; }
.app-direct main .ex-panel .ex-item .ex-results th, .app-direct main .ex-panel .ex-item .ex-results td { text-align: right; padding: 11px 9px; }
.app-direct main .ex-panel .ex-item .ex-results th:first-child, .app-direct main .ex-panel .ex-item .ex-results td:first-child { text-align: left; }
.app-direct main .ex-panel .ex-item .ex-form { padding-top: 8px; }
@media (max-width: 560px) {
  .app-direct main .ex-panel { padding: 18px 15px; }
  .app-direct main .ex-panel .ex-item { padding: 15px 12px; }
  .app-direct main .ex-panel .ex-item .ex-results table { min-width: 440px; }
}


/* Маркетинг и UTM: используем общую типографику Мастерской:
   Unbounded 16/600 — заголовок; Nunito 15/700 — основное;
   Nunito 13/400 — подписи, 13/700 — небольшие действия. */
.app-writer .utm-panel {
  margin: 16px 0;
  padding: 20px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
.app-writer .utm-panel > .row.between {
  gap: 12px;
  margin: 0 0 12px;
  align-items: center;
}
.app-writer .utm-panel > .row.between h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.app-writer .utm-panel :is(.small-btn, button.link) {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.app-writer .utm-list {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}
.app-writer .utm-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  min-width: 0;
}
.app-writer .utm-item .row.between {
  align-items: flex-start;
  gap: 10px 16px;
  margin-bottom: 10px;
}
.app-writer .utm-item .utm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.app-writer .utm-item .utm-main > b {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.app-writer .utm-item :is(.utm-urlrow, .utm-token, .utm-meta) {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.app-writer .utm-item .utm-urlrow { min-width: 0; }
.app-writer .utm-panel .utm-url {
  overflow-wrap: anywhere;
  word-break: break-word;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.app-writer .utm-item .utm-token { margin-top: 8px; overflow-wrap: anywhere; }
.app-writer .utm-item .utm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
  margin-top: 14px;
}
.app-writer .utm-item .utm-meta span:first-child { font-weight: 700; }
.app-writer .utm-item code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .app-writer .utm-panel { padding: 16px; }
  .app-writer .utm-item { padding: 12px; }
  .app-writer .utm-item .utm-meta { flex-direction: column; gap: 5px; }
}

/* Маркетинг: компактные карточки, тот же Nunito 15/13, что и в остальных разделах. */
.app-writer .mk-book-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 20px;
}
.app-writer .mk-book-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 84px;
  margin: 0;
  padding: 11px 16px;
  border-radius: 17px;
  font-family: var(--font-body);
  font-size: 15px;
}
.app-writer .mk-book-card > a.mk-row {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 13px;
  min-width: 0;
  padding: 0;
  color: var(--text);
  text-decoration: none;
}
.app-writer .mk-book-card > a.mk-row:focus-visible,
.app-writer .mk-book-card .mk-utm-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.app-writer .mk-book-card .mk-cover {
  flex: 0 0 44px;
  width: 44px;
  height: 62px;
}
.app-writer .mk-book-card .mk-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 5px;
}
.app-writer .mk-book-card .mk-info > b {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.app-writer .mk-book-card .mk-info > .sub {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}
.app-writer .mk-book-card .mk-book-utm {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
}
.app-writer .mk-book-card .mk-utm-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: none;
}
.app-writer .mk-book-card .mk-utm-action:hover {
  color: var(--text);
  border-color: var(--accent);
}
.app-writer .mk-book-card .mk-utm-ready span {
  font-weight: 400;
  color: var(--muted);
}
.app-writer .mk-book-card .mk-utm-ready.is-expired,
.app-writer .mk-book-card .mk-utm-ready.is-expired span {
  color: var(--bad);
}
.app-writer .utm-panel.utm-panel-compact {
  margin: 15px 0 0;
  padding: 15px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  box-shadow: none;
  background: transparent;
  border-radius: 0;
}
.app-writer .utm-panel.utm-panel-compact > .row.between h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.app-writer .utm-panel.utm-panel-compact .utm-item { background: var(--surface-2); }
@media (max-width: 600px) {
  .app-writer .mk-book-card {
    padding: 11px 12px;
    min-height: 78px;
    gap: 8px;
  }
  .app-writer .mk-book-card > a.mk-row { gap: 10px; }
  .app-writer .mk-book-card .mk-cover {
    width: 40px;
    height: 56px;
    flex-basis: 40px;
  }
  .app-writer .mk-book-card .mk-utm-action {
    padding: 7px 9px;
    min-height: 34px;
  }
  .app-writer .mk-book-card .mk-utm-ready span { display: none; }
}


/* Директ: «Мой Литнет» — компактные карточки без декоративных пустых блоков. */
.app-direct .ln-head { padding: clamp(17px, 3vw, 23px); }
.app-direct .ln-head > .row.between { gap: 10px; }
.app-direct .ln-head h2,
.app-direct .ln-guide h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.app-direct .ln-head p { margin: 11px 0 0; line-height: 1.5; }
.app-direct .ln-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0 0; }
.app-direct .ln-stats > div { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.app-direct .ln-stats b { font: 600 20px/1.3 var(--font-display); font-variant-numeric: tabular-nums; }
.app-direct .ln-stats span { font: 400 13px/1.45 var(--font-body); color: var(--muted); }
.app-direct .ln-list { display: grid; gap: 11px; }
.app-direct .ln-item { padding: clamp(16px, 2.7vw, 20px); margin: 0; }
.app-direct .ln-item-head { align-items: flex-start; gap: 8px 12px; margin-bottom: 16px; }
.app-direct .ln-title { display: flex; flex-direction: column; gap: 5px; flex: 1 1 180px; min-width: 0; }
.app-direct .ln-title b { font: 700 15px/1.4 var(--font-body); }
.app-direct .ln-title > span { font: 400 13px/1.45 var(--font-body); }
.app-direct .ln-status { font: 700 12px/1.4 var(--font-body); color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; }
.app-direct .ln-status.soon, .app-direct .ln-status.today { color: var(--warn); border-color: var(--warn); }
.app-direct .ln-status.expired { color: var(--bad); border-color: var(--bad); }
.app-direct .ln-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-block: 1px solid var(--line); gap: 12px; padding: 13px 0; }
.app-direct .ln-fields > div { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.app-direct .ln-label { font: 400 13px/1.4 var(--font-body); color: var(--muted); }
.app-direct .ln-fields strong { font: 700 15px/1.4 var(--font-body); font-variant-numeric: tabular-nums; }
.app-direct .ln-tagline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 15px 0 9px; }
.app-direct .ln-tag { display: inline-flex; font: 400 13px/1.45 var(--font-body); background: var(--surface-2); border-radius: 8px; padding: 9px 12px; overflow-wrap: anywhere; flex: 1 1 220px; }
.app-direct .ln-tagline button { font: 700 13px/1.4 var(--font-body); }
.app-direct .ln-actions { flex-wrap: wrap; gap: 10px; align-items: center; }
.app-direct .ln-actions button.link { font: 700 13px/1.4 var(--font-body); padding: 5px 0; }
.app-direct .ln-item .ln-note { margin: 10px 0 0; }
.app-direct .ln-guide { margin-top: 15px; padding: clamp(16px,2.7vw,20px); }
.app-direct .ln-guide h2 { margin: 0 0 13px; }
.app-direct .ln-steps { display: grid; gap: 9px; margin-bottom: 13px; font-size: 15px; }
.app-direct .ln-steps span { line-height: 1.4; }
.app-direct .ln-guide > p { line-height: 1.5; margin: 0 0 13px; }
.app-direct .ln-guide > .row a { font: 700 13px/1.4 var(--font-body); }
.app-direct .ln-summary { padding: 17px 19px; }
.app-direct .ln-summary > .row { margin-bottom: 7px; }
.app-direct .ln-summary .small { margin: 0; }
@media (max-width: 600px) {
  .app-direct .ln-stats { gap: 6px; }
  .app-direct .ln-stats > div { padding: 10px 8px; }
  .app-direct .ln-fields { gap: 9px; }
  .app-direct .ln-item-head { gap: 10px; }
  .app-direct .ln-status { white-space: normal; text-align: center; }
}


/* Директ · Ключевые слова. Общая типографика Nunito / Unbounded — без особых шрифтов. */
.app-direct .kw-head, .app-direct .kw-input, .app-direct .kw-results, .app-direct .kw-foot {
  padding: clamp(16px, 3vw, 22px); margin-bottom: 14px;
}
.app-direct .kw-head .row.between, .app-direct .kw-results-top { gap: 12px; align-items: center; flex-wrap: wrap; }
.app-direct .kw-head a { color: var(--link); font-size: 13px; font-weight: 700; text-decoration: none; }
.app-direct .kw-head label { margin-top: 16px; }
.app-direct .kw-stat-row { display: flex; gap: 12px 23px; flex-wrap: wrap; margin-top: 14px; color: var(--text-2); font-size: 13px; }
.app-direct .kw-stat-row b { font-weight: 700; color: var(--text); }
.app-direct .kw-input h2 { margin-bottom: 13px; }
.app-direct .kw-input textarea { width: 100%; min-height: 84px; resize: vertical; line-height: 1.55; }
.app-direct .kw-input form > .row { margin-top: 12px; gap: 9px; flex-wrap: wrap; }
.app-direct .kw-import { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 13px; }
.app-direct .kw-import > label { display: block; margin-bottom: 10px; }
.app-direct .kw-upload {
  display: inline-flex; align-items: center; position: relative; cursor: pointer;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font: 700 13px/1.4 var(--font-body);
  background: var(--surface); overflow: hidden;
}
.app-direct .kw-upload:hover { border-color: var(--accent); }
.app-direct .kw-upload input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%; padding: 0; margin: 0;
}
.app-direct .kw-results-top .row { flex-wrap: wrap; gap: 8px; }
.app-direct .kw-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 12px; }
.app-direct .kw-filters button {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 7px 10px;
  font: 700 13px/1.45 var(--font-body); color: var(--text-2);
}
.app-direct .kw-filters button.on {
  color: var(--text); background: var(--accent-soft); border-color: var(--accent-2);
}
.app-direct .kw-list { display: grid; }
.app-direct .kw-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 9px 14px; padding: 12px 0; border-top: 1px solid var(--line);
}
.app-direct .kw-main { flex: 1 1 260px; min-width: 0; }
.app-direct .kw-main > b { font: 700 15px/1.4 var(--font-body); overflow-wrap: anywhere; }
.app-direct .kw-main > .small { margin-top: 5px; line-height: 1.45; }
.app-direct .kw-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 12px; }
.app-direct .kw-buttons .link { font: 700 13px/1.4 var(--font-body); white-space: nowrap; }
.app-direct .kw-buttons .kw-selected { color: var(--good); }
.app-direct .kw-foot p { margin: 0; line-height: 1.55; }
@media(max-width: 600px) {
  .app-direct .kw-item { flex-direction: column; }
  .app-direct .kw-buttons { justify-content: flex-start; gap: 9px 13px; }
}


/* Директ: бесплатный тематический поиск похожих книг в открытых подборках. */
.app-direct .cmp-find {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.app-direct .cmp-find > label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}
.app-direct .cmp-find > input {
  width: 100%;
  font-size: 15px;
  font-family: var(--font-body);
}
.app-direct .cmp-find > .row { margin: 10px 0 0; }
.app-direct .cmp-find > p { margin: 10px 0 0; line-height: 1.5; }
.app-direct .cmp-found { margin-top: 12px; }
.app-direct .cmp-found > .row { margin-bottom: 8px; }
.app-direct .cmp-found > .row > h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.app-direct .cmp-suggestion {
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}
.app-direct .cmp-suggest-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 15px;
}
.app-direct .cmp-suggest-content > b { font-weight: 700; line-height: 1.4; }
.app-direct .cmp-suggest-content > span.small {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.app-direct .cmp-suggest-content details { margin-top: 4px; font-size: 13px; }
.app-direct .cmp-suggest-content details p { margin: 8px 0 2px; line-height: 1.55; }
.app-direct .cmp-suggest-content > a { font-size: 13px; font-weight: 700; }
.app-direct .cmp-suggestion > button { flex: 0 0 auto; font-size: 13px; }
@media(max-width: 560px) {
  .app-direct .cmp-suggestion { align-items: flex-start; flex-direction: column; }
}


/* Мастерская: жанры и теги всегда видны прямо под названием книги, без отдельной карточки. */
.app-writer .book-head2 .bh-taxonomy {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 0 0 2px;
}
.app-writer .book-head2 .bh-tax-lines { display: grid; gap: 7px; flex: 1; min-width: 0; }
.app-writer .book-head2 .bh-tax-row { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.app-writer .book-head2 .bh-tax-label {
  flex: 0 0 48px; color: var(--text-2);
  font: 700 12px/1.6 var(--font-body);
}
.app-writer .book-head2 .bh-tax-values {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px;
  min-width: 0; overflow-wrap: anywhere;
}
.app-writer .book-head2 .bh-tax-chip {
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 3px 8px; border-radius: 7px;
  color: var(--text); font: 600 12px/1.45 var(--font-body);
  overflow-wrap: anywhere;
}
.app-writer .book-head2 .bh-tax-genre { background: var(--surface-2); }
.app-writer .book-head2 .bh-tax-tag { border: 1px solid var(--line); color: var(--text-2); }
.app-writer .book-head2 .bh-tax-empty { color: var(--muted); font: 500 12px/1.6 var(--font-body); }
.app-writer .book-head2 .bh-tax-edit {
  display: inline-flex; justify-content: center; align-items: center;
  flex: 0 0 28px; width: 28px; height: 28px; min-width: 0; min-height: 0;
  padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2); box-shadow: none;
}
.app-writer .book-head2 .bh-tax-edit:hover,
.app-writer .book-head2 .bh-tax-edit:focus-visible { color: var(--text); background: var(--surface-2); }
.app-writer .book-head2 .bh-tax-edit .ic { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .app-writer .book-head2 .bh-taxonomy { grid-column: 1 / -1; }
  .app-writer .book-head2 .bh-tax-row { gap: 9px; }
}
/* «О книге»: минималистичные жанры и редактируемые теги, без длинного списка флажков. */
.app-writer .book-taxonomy-edit {
  margin: 22px 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.app-writer .bm-tax-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 14px; margin: 0 0 18px; }
.app-writer .bm-tax-head strong { font: 700 15px/1.4 var(--font-body); color: var(--text); }
.app-writer .bm-tax-head > span { font: 500 12px/1.45 var(--font-body); color: var(--text-2); }
.app-writer .bm-genre-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.app-writer .book-taxonomy-edit .bm-field { min-width: 0; }
.app-writer .book-taxonomy-edit label { display: block; margin: 0 0 7px; font: 700 13px/1.4 var(--font-body); color: var(--text); }
.app-writer .book-taxonomy-edit select,
.app-writer .book-taxonomy-edit input[name="tags"] {
  width: 100%; max-width: 100%; min-height: 44px; margin: 0;
  padding: 10px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  font: 500 14px/1.5 var(--font-body);
}
.app-writer .book-taxonomy-edit :is(select,input[name="tags"]):focus {
  outline: 2px solid var(--accent-2); outline-offset: 1px;
  border-color: var(--accent);
}
.app-writer .bm-optional { color: var(--text-2); font-size: 12px; font-weight: 500; }
.app-writer .bm-tag-field { margin-top: 18px; }
.app-writer .bm-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.app-writer .bm-label-row .bm-overlimit { color: var(--bad); font-weight: 700; }
.app-writer .bm-tag-preview { display: flex; flex-wrap: wrap; gap: 7px; min-height: 0; margin: 10px 0 0; }
.app-writer .bm-edit-tag {
  display: inline-flex; align-items: center; max-width: 100%;
  gap: 8px; min-height: 31px; padding: 5px 9px 5px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); background: var(--surface);
  font: 600 12px/1.4 var(--font-body);
  overflow-wrap: anywhere;
}
.app-writer .bm-edit-tag:hover,
.app-writer .bm-edit-tag:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.app-writer .bm-edit-tag-cross { font-size: 16px; font-weight: 400; line-height: 1; color: var(--text-2); }
.app-writer .bm-hint { display: block; margin: 9px 0 0; color: var(--text-2); font: 500 12px/1.45 var(--font-body); }
.app-writer .bm-tax-save-row { display:flex; align-items:center; flex-wrap:wrap; gap: 8px 15px; margin-top: 16px; }
.app-writer .bm-tax-save-row button { margin:0; border-radius: 10px; }
.app-writer .bm-tax-save-row > span { font:500 12px/1.5 var(--font-body); color:var(--text-2); }
@media (max-width: 560px) {
  .app-writer .book-taxonomy-edit { padding: 14px; }
  .app-writer .bm-genre-grid { grid-template-columns: 1fr; gap: 12px; }
}
.app-direct .cmp-find .kw-terms { display:flex;flex-wrap:wrap;gap:6px;margin:11px 0; }
.app-direct .cmp-find .kw-terms .tag { max-width:100%; }
.app-direct .cmp-optional { margin: 8px 0 10px; }
.app-direct .cmp-optional summary { cursor:pointer; font-size:13px; color:var(--text-2); }
.app-direct .cmp-optional input { width:100%;margin-top:9px; }


/* Директ: единые отступы действий и редактирование метаданных без нагромождений. */
.app-direct main .d-actions { display:flex; align-items:center; flex-wrap:wrap; gap: 10px 14px; margin-top: 16px; }
.app-direct main .d-actions > button { margin:0; flex: 0 1 auto; max-width:100%; }
.app-direct main .d-actions > button.link { padding-left: 2px; padding-right: 2px; }
.app-direct main .d-actions > .small { flex:1 1 180px; line-height:1.5; }
.app-direct main .kw-input .row.between,
.app-direct main .cmp-card > .row.between,
.app-direct main .card > .row.between { column-gap:16px; row-gap:12px; flex-wrap:wrap; }
.app-direct main .cmp-card > .row.between > .d-actions { margin-top:0; }
.app-direct main .d-book-meta { display:grid; gap:0; min-width:0; padding:15px 0 5px; border-top:1px solid var(--line); }
.app-direct main .d-meta-top { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:4px 15px; margin-bottom:13px; }
.app-direct main .d-meta-top strong { font:700 14px/1.4 var(--font-body); color:var(--text); }
.app-direct main .d-meta-top span { color:var(--text-2); font:500 12px/1.5 var(--font-body); }
.app-direct main .d-meta-label { color:var(--text-2); font:700 12px/1.4 var(--font-body); }
.app-direct main .d-meta-values { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin:7px 0 8px; }
.app-direct main .d-meta-chip { display:inline-flex; max-width:100%; padding:4px 9px; border-radius:8px; color:var(--text); background:var(--surface-2); font:600 12px/1.45 var(--font-body); overflow-wrap:anywhere; }
.app-direct main .d-meta-none { color:var(--muted); font:500 12px/1.5 var(--font-body); }
.app-direct main .d-meta-genres { margin:0 0 12px; }
.app-direct main .d-meta-genres summary { width:fit-content; color:var(--link); font:700 12px/1.5 var(--font-body); cursor:pointer; padding:3px 0; }
.app-direct main .d-meta-genres > form { padding:12px 0 3px; }
.app-direct main .d-meta-selects { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.app-direct main .d-meta-selects > div { min-width:0; }
.app-direct main .d-meta-selects label { margin:0 0 6px; color:var(--text-2); }
.app-direct main .d-meta-selects select { min-width:0; width:100%; max-width:100%; background:var(--surface); }
.app-direct main .d-meta-tag-form { border-top:1px solid var(--line); padding-top:13px; }
.app-direct main .d-meta-tag-form > label { display:flex; align-items:center; gap:8px; margin:0 0 7px; font:700 13px/1.4 var(--font-body); color:var(--text); }
.app-direct main .d-meta-count { font:500 12px/1.5 var(--font-body); color:var(--text-2); }
.app-direct main .d-meta-tag-form input { border-radius:10px; min-width:0; }
.app-direct main .d-meta-actions { margin-top:10px; }
.app-direct main .d-meta-seed { margin-top:16px; border-top:1px solid var(--line); padding-top:14px; }
.app-direct main .cmp-find .d-book-meta { margin:0 0 14px; padding-top:0; border-top:0; }
.app-direct main .cmp-optional { border-top:1px solid var(--line); padding-top:11px; margin-top:14px; }
.app-direct main .cmp-optional p { margin:8px 0 0; }
.app-direct main .cmp-errors { margin-top:15px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; }
.app-direct main .cmp-errors b { font-size:13px; color:var(--text); }
.app-direct main .cmp-errors p { margin:5px 0 0; font-size:12px; color:var(--text-2); line-height:1.55; overflow-wrap:anywhere; }
@media (max-width:560px) {
  .app-direct main .d-meta-selects { grid-template-columns:1fr; }
  .app-direct main .d-actions { gap:10px; }
  .app-direct main .d-actions > button { white-space:normal; text-align:center; }
}

/* Внешние таргетологи: тихие поля, компактные записи и связанные задачи */
.app-writer .target-config[hidden] { display: none !important; }
.app-writer .target-config {
  margin: 16px 0;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.app-writer .target-config-title { font: 800 14px/1.45 var(--font-body); margin-bottom: 12px; }
.app-writer .target-book-list, .app-writer .target-sync-opts {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin: 8px 0 15px;
}
.app-writer .target-book-list > .check, .app-writer .target-sync-opts > .check {
  margin: 0; font: 600 13px/1.45 var(--font-body);
}
.app-writer .target-details { margin-top: 12px; display: grid; gap: 5px; }
.app-writer .link-log-form { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.app-writer .link-log-form > input[type="date"] { flex: 0 0 auto; width: auto; }
.app-writer .link-log-form > select { flex: 0 0 140px; min-width: 120px; }
.app-writer .link-log-form > input[name="text"] { flex: 1 1 250px; min-width: 180px; }
.app-writer .link-log-form > button { margin: 0; }
.app-writer .target-log-kind {
  display: inline-block; padding: 2px 7px; margin: 0 7px 0 0;
  border-radius: 7px; font: 700 11px/1.5 var(--font-body);
  color: var(--text-2); background: var(--surface-2);
}
.target-linked-item { display: block; text-decoration: none; }
.target-linked-item > b { display: block; color: var(--text); }
.target-linked-item > .sub, .target-linked-item > .small { display: block; margin-top: 3px; }
@media (max-width: 580px) {
  .app-writer .target-config { padding: 13px; }
  .app-writer .link-log-form > select, .app-writer .link-log-form > input[type="date"] { flex: 1 1 130px; min-width: 0; }
  .app-writer .link-log-form > button { flex: 1 1 100%; }
}

/* Внешний таргетолог: одна рабочая карточка вместо запросов/напоминаний/переписки. */
.app-writer .target-work-heading { display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.app-writer .target-work-heading > h2 { margin:0; }
.app-writer .target-work-card { padding:16px 18px; }
.app-writer .target-quickform { display:grid; gap:10px; }
.app-writer .target-quick-grid { display:grid; grid-template-columns: minmax(110px,.55fr) minmax(140px,.75fr) minmax(220px,1.8fr); gap:9px; }
.app-writer .target-quick-grid > :is(input,select) { width:100%; min-width:0; margin:0; border-radius:11px; }
.app-writer .target-quick-grid.target-log-mode > select[name="section"] { visibility:hidden; }
.app-writer .target-quick-input { display:flex; align-items:stretch; gap:9px; min-width:0; }
.app-writer .target-quick-input > input { flex:1 1 250px; min-width:0; border-radius:11px; margin:0; }
.app-writer .target-quick-input > button { flex:0 0 auto; min-width:112px; margin:0; border-radius:11px; }
.app-writer .target-details-toggle { padding:0; margin:0; }
.app-writer .target-details-toggle summary { cursor:pointer; width:fit-content; color:var(--text-2); font:600 12px/1.5 var(--font-body); }
.app-writer .target-details-toggle textarea { margin:8px 0 0; min-height:72px; width:100%; border-radius:11px; }
.app-writer .target-timeline { border-top:1px solid var(--line); margin-top:16px; padding-top:5px; }
.app-writer .target-entry { display:flex; gap:12px; align-items:flex-start; justify-content:space-between; padding:13px 0; border-bottom:1px solid var(--line); }
.app-writer .target-entry:last-child { border-bottom:0; padding-bottom:0; }
.app-writer .target-entry-main { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; }
.app-writer .target-entry-date, .app-writer .target-entry-type { font:600 11px/1.5 var(--font-body); color:var(--text-2); }
.app-writer .target-entry-type { margin-left:8px; }
.app-writer .target-entry-text { white-space:pre-wrap; font:500 14px/1.55 var(--font-body); color:var(--text); margin-top:4px; }
.app-writer .target-entry-detail { font:500 12px/1.55 var(--font-body); color:var(--text-2); margin:4px 0 0; }
.app-writer .target-entry-actions { flex:0 0 auto; display:flex; gap:8px; align-items:center; }
.app-writer .target-entry-actions > button { margin:0; }
.app-writer .target-entry-done .target-entry-text { opacity:.55; }
.app-writer .target-empty { margin:16px 0 0; }
.app-writer .target-requests { display:grid; gap:4px; padding:11px 0 0; border-top:1px solid var(--line); margin-top:5px; }
.app-writer .target-request { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13px; }
.app-writer .target-request button { flex:0 0 auto; margin:0; }
@media (max-width:650px) {
  .app-writer .target-work-card { padding:13px; }
  .app-writer .target-quick-grid { grid-template-columns:1fr 1fr; }
  .app-writer .target-quick-grid > select[name="section"] { grid-column:1 / -1; }
  .app-writer .target-quick-grid.target-log-mode > select[name="section"] { display:none; }
}
@media (max-width:420px) {
  .app-writer .target-quick-input { flex-wrap:wrap; }
  .app-writer .target-quick-input > button { flex:1 1 100%; }
  .app-writer .target-entry { gap:6px; }
  .app-writer .target-entry-actions { gap:4px; flex-direction:column; }
}

/* Планер: единственный контакт не требует выпадающего списка. */
.app-writer .plan-contact-one {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 12px 0 0; padding: 6px 0;
  color: var(--text-2); font: 600 13px/1.5 var(--font-body);
  cursor: pointer;
}
.app-writer .plan-contact-one input[type="checkbox"] {
  margin: 0; width: 16px; height: 16px; flex: 0 0 16px;
  accent-color: var(--accent);
}

/* Шрифтовая иерархия Мастерской · Связи.
   Заголовок страницы > секции > название записи; Unbounded только для заголовков. */
.app-writer .links-page .links-title > h2 {
  font: 600 22px/1.4 var(--font-display);
  letter-spacing: -.015em;
}
.app-writer .links-page .psec-h h2 {
  font: 600 17px/1.45 var(--font-display);
  letter-spacing: -.012em;
  margin: 0;
}
.app-writer .links-page .psec-h h2 .muted {
  font: 600 13px/1.4 var(--font-body);
  color: var(--text-2);
}
.app-writer .links-page .item b {
  font: 750 14px/1.5 var(--font-body);
  color: var(--text);
}
.app-writer .links-page .sub, .app-writer .links-page .item .small {
  font: 500 12px/1.5 var(--font-body);
}
.app-writer .links-page .psec-h .small-btn {
  font: 700 13px/1.4 var(--font-body);
  min-height: 36px;
  padding: 7px 13px;
}
.app-writer .links-page .card p { line-height: 1.5; }

/* Блог Литнет: компактная библиотека записей */
.app-writer .blog-list-section .psec-h { margin-top: 16px; }
.app-writer .blog-list-card { padding: 7px 16px; }
.app-writer .blog-row {
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--line); padding: 11px 0;
}
.app-writer .blog-row:first-child { border-top: none; }
.app-writer .blog-row-main {
  flex: 1 1 auto; min-width: 0; display: grid; gap: 3px;
  color: var(--text); text-decoration: none;
}
.app-writer .blog-row-main b { font: 750 14px/1.5 var(--font-body); overflow-wrap: anywhere; }
.app-writer .blog-row-main span { color: var(--text-2); font: 500 12px/1.5 var(--font-body); }
.app-writer .blog-row > button {
  flex: 0 0 auto; margin: 0; min-height: 34px;
  font: 700 12px/1.3 var(--font-body); padding: 6px 12px;
}
.app-writer .blog-empty { margin: 10px 0; }

/* Редактор блога: тот же принцип чистого листа, что в редакторе глав. */
.app-writer .blog-editor { max-width: 920px; margin: 0 auto; }
.app-writer .blog-editor-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin-bottom: 13px;
}
.app-writer .blog-editor-top > #blogSaveState { flex: 1 1 auto; text-align: right; }
.app-writer .blog-editor-top > button { margin: 0; }
.app-writer .blog-page {
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 20px;
  padding: clamp(17px, 3vw, 28px);
}
.app-writer .blog-page > label, .app-writer .blog-meta label, .app-writer .blog-posting label {
  display: block; margin: 0 0 7px;
  color: var(--text-2); font: 650 12px/1.5 var(--font-body);
}
.app-writer .blog-page :is(input,select) {
  width: 100%; margin: 0; border-radius: 10px;
  font: 500 14px/1.5 var(--font-body); background: var(--surface);
}
.app-writer .blog-page #blogTitle {
  font: 650 18px/1.5 var(--font-body); margin-bottom: 17px;
}
.app-writer .blog-meta {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(160px,1fr);
  gap: 13px; margin-bottom: 22px;
}
.app-writer .blog-meta > div { min-width: 0; }
.app-writer .blog-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  background: var(--surface-2); padding: 7px;
  border: 1px solid var(--line); border-radius: 11px 11px 0 0;
}
.app-writer .blog-toolbar > button {
  min-height: 34px; border: 0; border-radius: 8px;
  padding: 5px 9px; font: 700 13px/1.35 var(--font-body);
  background: transparent; box-shadow: none;
}
.app-writer .blog-toolbar > button:hover { background: var(--surface); }
.app-writer .blog-toolbar-spacer { flex: 1 1 12px; }
.app-writer .blog-page .blog-body.editor {
  display: block; width: 100%; margin: 0; padding: 25px clamp(12px,4vw,36px);
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 11px 11px;
  min-height: 350px; max-height: none; outline: none;
  background: var(--surface); color: var(--text);
  font: 400 16px/1.75 Georgia, 'Times New Roman', serif;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.app-writer .blog-body:focus { box-shadow: inset 0 0 0 1px var(--accent-2); }
.app-writer .blog-body:empty:before { content: attr(data-placeholder); color: var(--muted); }
.app-writer .blog-body h2 { margin: 18px 0 10px; font: 700 19px/1.5 Georgia, serif; }
.app-writer .blog-body h3 { margin: 16px 0 8px; font: 700 17px/1.5 Georgia, serif; }
.app-writer .blog-body p { margin: 0 0 .8em; }
.app-writer .blog-bottom {
  display: flex; gap: 8px 20px; justify-content: space-between;
  flex-wrap: wrap; margin-top: 9px;
}
.app-writer .blog-posting {
  display: grid; gap: 12px; padding-top: 20px;
  border-top: 1px solid var(--line); margin-top: 24px;
}
.app-writer .blog-post-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.app-writer .blog-post-actions > * { margin: 0; }
.app-writer .blog-danger { margin-top: 25px; text-align: right; }
.app-writer .blog-restore {
  display:flex; align-items: center; flex-wrap: wrap; gap: 9px;
  padding: 9px 12px; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  font: 500 12px/1.5 var(--font-body);
}
.app-writer .blog-restore > span { flex: 1 1 auto; }
@media (max-width: 560px) {
  .app-writer .blog-meta { grid-template-columns: 1fr; }
  .app-writer .blog-page { padding: 14px; }
  .app-writer .blog-editor-top > #blogSaveState { order: 3; flex-basis: 100%; text-align: left; }
  .app-writer .blog-row { gap: 7px; }
}

/* ТИПОГРАФИКА МАСТЕРСКОЙ: один размер для каждой роли, а не отдельные
   размеры в баннерах. Шапка > страница > секция > карточка > подпись. */
.app-writer {
  --w-top-heading: 26px;
  --w-page-heading: 24px;
  --w-section-heading: 17px;
  --w-card-heading: 15px;
  --w-item-heading: 14px;
  --w-meta: 12px;
}
.app-writer .top h1 {
  font: 600 var(--w-top-heading)/1.4 var(--font-display);
  letter-spacing: -.015em;
}
.app-writer main .links-page .links-title > h2 {
  font: 600 var(--w-page-heading)/1.4 var(--font-display);
  letter-spacing: -.012em;
}
.app-writer main .psec-h > h2,
.app-writer main .links-page .psec-h > h2 {
  font: 600 var(--w-section-heading)/1.4 var(--font-display);
  letter-spacing: -.01em;
  margin: 0;
}
.app-writer main .psec-h > h2 .muted {
  font: 600 12px/1.4 var(--font-body);
  margin-left: 5px;
}
.app-writer main .card > h2,
.app-writer main .card > .row.between > h2,
.app-writer main .card > .row > h2,
.app-writer main .target-work-heading > h2 {
  font: 600 var(--w-card-heading)/1.45 var(--font-display);
  margin-top: 0;
  letter-spacing: -.01em;
}
.app-writer main .links-page .item b,
.app-writer main .links-page .blog-row-main > b {
  font: 700 var(--w-item-heading)/1.5 var(--font-body);
}
.app-writer main .links-page :is(.item .sub,.item .small,.blog-row-main > span) {
  font: 500 var(--w-meta)/1.5 var(--font-body);
}
.app-writer .links-page .card p,
.app-writer .links-page .blog-list-card p {
  font-size: 14px;
  line-height: 1.55;
}
.app-writer .links-page .psec-h .small-btn {
  font: 700 13px/1.4 var(--font-body);
}
@media (max-width:560px) {
  .app-writer { --w-top-heading: 23px; --w-page-heading: 22px; --w-section-heading: 17px; }
}

/* Блог использует настоящий интерфейс редактора глав: ed-bar, ed-tools,
   ed-find, ed-paper, editor и ed-stats. Только метаданные отдельные. */
.app-writer .blog-editor { max-width: 1120px; margin: 0 auto; }
.app-writer .blog-meta-card {
  display: grid; gap: 0; background: transparent;
  border: 0; border-radius: 0; padding: 6px 0 14px;
}
.app-writer .blog-meta-card > label,
.app-writer .blog-meta-card .blog-meta label,
.app-writer .blog-posting label {
  display:block; margin:0 0 7px; font: 650 12px/1.5 var(--font-body); color:var(--text-2);
}
.app-writer .blog-meta-card input,
.app-writer .blog-meta-card select,
.app-writer .blog-posting input {
  width:100%; min-width:0; border-radius:10px; font:500 14px/1.5 var(--font-body);
  background:var(--surface);
}
.app-writer .blog-meta-card #blogTitle {
  font:650 18px/1.5 var(--font-body);
  margin-bottom:14px;
}
.app-writer .blog-meta-card .blog-meta { margin:0; }
.app-writer .blog-writer-surface .blog-ed-bar {
  border-top:1px solid var(--line); padding-top:7px; margin:0 0 10px;
  background:var(--bg);
}
.app-writer .blog-writer-surface .ed-tools { margin-top:0; }
.app-writer .blog-writer-surface .ed-paper {
  background:var(--paper); border:1px solid var(--paper-line);
  border-radius:18px; padding:48px 56px 64px;
}
.app-writer .blog-writer-surface .editor {
  min-height:55vh; max-width:760px; width:100%; margin:0 auto;
  border:0; border-radius:0; background:transparent; padding:0;
  color:var(--ink); font:400 calc(18px * var(--ed-zoom,1))/1.6 Georgia,'Times New Roman',serif;
  white-space:pre-wrap; overflow-wrap:anywhere;
}
.app-writer .blog-writer-surface .editor:empty::before {
  content:attr(data-placeholder); color:var(--muted);
}
.app-writer .blog-writer-surface .editor p { margin:0 0 .65em; text-indent:0; }
.app-writer .blog-writer-surface .ed-stats { position:absolute; top:18px; right:20px; bottom:auto; left:auto;
  opacity:.72; background:none; padding:0; gap:12px;
}
.app-writer .blog-bottom { justify-content:flex-end; margin:10px 0 0; }
.app-writer .blog-posting { margin-top:24px; }
@media (max-width:700px){
  .app-writer .blog-writer-surface .ed-paper {padding:20px 16px 40px;border-radius:14px}
  .app-writer .blog-writer-surface .ed-stats {
    position:static;transform:none;flex-direction:row;justify-content:flex-end;
    margin-bottom:14px;gap:12px;
  }
}

/* Легенда — одна шкала шрифтов: заголовок карточки 16 px жирный, текст полей 16 px,
   всё служебное (статус, «написана», «Утвердить решение», счётчики) — 13 px; значки-кнопки одного серого цвета */
.app-writer .lg-qs > summary b { font-weight: 700; }
.app-writer .lg-q-h textarea.lg-ta { font-weight: 600; }
.app-writer main .lg-ps, .app-writer main .lg-ps select, .app-writer main .lg-st, .app-writer main .lg-q-f .link { font: 400 13px/1.4 var(--font-body) !important; }
.app-writer main .lg-q-f .link { font-weight: 600 !important; }
.app-writer main .lg-ps select { color: var(--text-2) !important; }
.app-writer main .lg-st.ok { color: var(--good) !important; }
.app-writer main button.lg-ib, .app-writer main button.lg-ib:disabled { color: var(--muted) !important; }
.app-writer main button.lg-ib:disabled { opacity: .35; }
/* вопрос: поле вопроса и поле решения одной ширины; статус, «Утвердить решение» и корзина — одной строкой под ними */
.app-writer .lg-q-h { display: block; }
.app-writer .lg-q-h textarea.lg-ta { width: 100%; margin: 0 0 8px; }
.app-writer .lg-q > textarea.lg-ta { margin: 0 0 4px; }
.app-writer .lg-q-f { display: flex; align-items: center; gap: 14px; margin-top: 6px; min-height: 30px; }
.app-writer main .lg-q-f button.lg-q-del { margin: 0 0 0 auto !important; }
/* Блог Литнет в списках (Связи, страница книги): название записи чёрное, как названия книг; под ним — серая строка 13 px */
.app-writer main .blog-row-main, .app-writer main .blog-row-main > b { color: var(--text) !important; }
.app-writer main .blog-row-main > b { font: 600 15px/1.45 var(--font-body) !important; }
.app-writer main .blog-row-main > span { font: 400 13px/1.45 var(--font-body) !important; color: var(--text-2) !important; }
.app-writer main .blog-row-main:hover > b { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
/* шапка главы каркаса: кружок — только у статуса решения; «написана · N зн.» — серым текстом без второго кружка */
.app-writer main .lg-st.ok { color: var(--text-2) !important; }
.app-writer main .lg-st.ok::before { content: none; }
.app-writer main .lg-ps select { padding-right: 14px !important; }
/* под главой каркаса: «Глазами» и «от какого лица» — два тихих выпадающих списка в строку, без кружков с именами */
.app-writer main .lg-ch .lg-row { gap: 6px 18px; }
.app-writer main .lg-pov { font: 400 13px/1.4 var(--font-body); color: var(--text-2); gap: 6px; }
.app-writer main .lg-pov select { width: auto; min-height: 30px; padding: 2px 22px 2px 8px; border: 0 !important; border-radius: 8px; background-color: transparent; box-shadow: none; font: 600 13px/1.4 var(--font-body) !important; color: var(--text); background-position: right 4px center; }
.app-writer main .lg-pov select:hover, .app-writer main .lg-pov select:focus { background-color: var(--surface-2); outline: none; }
@media (max-width: 640px) {
  .app-writer main .lg-ch-h .lg-ps { margin-left: 34px; }
  .app-writer main .lg-ch-h .lg-st { flex: 1 1 auto; padding-left: 0; }
}
/* Каркас: акт — тонкая строка-разделитель над его первой главой: «Акт 1  Завязка ———— 🗑» */
.app-writer .lg-act { display: flex; align-items: center; gap: 10px; margin: 22px 4px 10px; }
.app-writer .lg-act-n { font: 700 15px/1.4 var(--font-body); color: var(--text); white-space: nowrap; }
.app-writer main input.lg-act-t { flex: 0 1 260px; min-width: 60px; min-height: 30px; padding: 2px 8px; border: 0 !important; border-radius: 8px; background: transparent !important; box-shadow: none !important; font: 400 15px/1.4 var(--font-body); color: var(--text-2); }
.app-writer main input.lg-act-t:hover, .app-writer main input.lg-act-t:focus { background: var(--surface-2) !important; outline: none; }
.app-writer .lg-act-line { flex: 1 1 auto; border-top: 1px solid var(--line); min-width: 20px; }
.app-writer main .lg-act .lg-ib { opacity: .6; }
.app-writer main .lg-act:hover .lg-ib { opacity: 1; }
.app-writer .lg-add .link { font: 600 13px/1.4 var(--font-body); color: var(--text-2); }
@media (max-width: 640px) { .app-writer main input.lg-act-t { flex: 1 1 auto; } .app-writer .lg-act-line { display: none; } }
/* Редактор блога: заголовок — крупной строкой без рамки, как название документа; книга и дата — одной тихой строкой под ним,
   поля по ширине содержимого (никаких длинных пустых полей) */
.app-writer .blog-head { margin: 4px 0 14px; }
.app-writer main .blog-title-in { display: block; resize: none; overflow: hidden; min-height: 0; padding: 6px 10px; margin: 0 -10px; width: calc(100% + 20px); border: 0 !important; border-radius: 10px; background: transparent !important; box-shadow: none !important; font: 700 22px/1.35 var(--font-body); color: var(--text); }
.app-writer main .blog-title-in::placeholder { color: var(--muted); font-weight: 600; }
.app-writer main .blog-title-in:hover, .app-writer main .blog-title-in:focus { background: var(--surface-2) !important; outline: none; }
.app-writer .blog-meta-line { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 6px; }
.app-writer .blog-pick { display: inline-flex; align-items: center; gap: 6px; margin: 0; font: 400 13px/1.4 var(--font-body); color: var(--text-2); }
.app-writer main .blog-pick :is(select, input) { width: auto; max-width: 62vw; min-height: 30px; padding: 2px 8px; border: 0 !important; border-radius: 8px; background-color: transparent !important; box-shadow: none !important; font: 600 13px/1.4 var(--font-body); color: var(--text); }
.app-writer main .blog-pick select { padding-right: 22px; background-position: right 4px center; }
.app-writer main .blog-pick :is(select, input):hover, .app-writer main .blog-pick :is(select, input):focus { background-color: var(--surface-2) !important; outline: none; }
@media (max-width: 640px) { .app-writer main .blog-title-in { font-size: 19px; } }
/* «Новое дело»: куда попадёт в Todoist — одной тихой строкой; раздел «Мастерской» меняется прямо в строке */
#sheetForm .pd-where { margin: 14px 0 0; font: 400 13px/1.5 var(--font-body); color: var(--text-2); }
#sheetForm .pd-where #pdproj, #sheetForm .pd-where #pdbsec { color: var(--text); font-weight: 600; }
#sheetForm .pd-where select { display: inline-block; width: auto; min-height: 0; margin: 0; padding: 1px 22px 1px 6px; border: 0 !important; border-radius: 6px; background-color: transparent; box-shadow: none; font: 600 13px/1.5 var(--font-body); color: var(--text); background-position: right 4px center; }
#sheetForm .pd-where select:hover, #sheetForm .pd-where select:focus { background-color: var(--surface-2); outline: none; }
#sheetForm .pd-where [hidden] { display: none !important; }
#sheetForm .pd-where select { width: auto !important; max-width: max-content; field-sizing: content; }
/* Блог: счётчик слов и знаков — всегда в правом верхнем углу листа одной строкой (у глав на широком экране он уходит на поля справа,
   в блоге там нет места — столбик наезжал на панель) */
@media (min-width: 1180px) {
  .app-writer .blog-ed-paper .ed-stats { position: absolute !important; top: 14px; right: 20px; bottom: auto; left: auto; transform: none; flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: 14px; padding: 0; background: none; font-size: 12px; opacity: .7; text-align: left; }
  .app-writer .blog-ed-paper .ed-stats span { display: inline; }
  .app-writer .blog-ed-paper .ed-stats b { font-size: 12px; font-weight: 600; }
  .app-writer .blog-ed-paper .ed-stats i { font-size: 12px; }
}
/* «Книга» и «Выложить» — по ширине содержимого, без пустого хвоста */
.app-writer main .blog-pick select { field-sizing: content; max-width: min(320px, 62vw); }
#sheetForm #pdcwrap[hidden] { display: none; }
.app-writer .target-entry-text.tap { cursor: pointer; border-radius: 8px; } .app-writer .target-entry-text.tap:hover { background: var(--surface-2); box-shadow: 0 0 0 6px var(--surface-2); }
.app-writer .td-warn { margin: 2px 0 10px; font: 400 13px/1.5 var(--font-body); color: var(--text-2); } .app-writer .td-warn::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-right: 7px; vertical-align: 1px; } .app-writer .td-warn .link { font-size: 13px; padding: 0; }
/* Директ: шкала фаз запуска — три шага тонкой линией, текущий — точкой акцента */
.fl-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 14px 0 6px; border-top: 1px solid var(--line); }
.fl-ph { position: relative; padding: 12px 8px 0 0; display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.fl-ph b { font-weight: 600; font-size: 14px; color: var(--text-2); }
.fl-ph .fl-dot { position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.fl-ph.past .fl-dot { background: var(--good); }
.fl-ph.on .fl-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fl-ph.on b { color: var(--text); }
.fl-now { font: 700 16px/1.4 var(--font-body); margin: 18px 0 6px; }
.fl-check-item input[type=checkbox] { margin: 3px 0 0; flex: none; }
.fl-check-item .sub { display: block; color: var(--muted); font-size: 13px; }
.fl-how .item b { display: block; margin-bottom: 2px; }
/* Планер, прошедший день: сделанное — зелёная галочка и серый текст; несделанное — «→ перенесено на …» */
.app-writer .pitem.pi-hist { align-items: flex-start; }
.app-writer .pi-hist .ph-mark { flex: none; width: 18px; display: inline-flex; justify-content: center; margin-top: 2px; color: var(--good); font-size: 14px; line-height: 1.3; }
.app-writer .pi-hist .ph-mark .ic { width: 15px; height: 15px; }
.app-writer .pi-hist .pi-t { color: var(--text-2); }
.app-writer .pi-hist.moved .ph-mark { color: var(--muted); }
/* Директ: «Ближайшее» в левой колонке — только на широком экране и в развёрнутом меню */
.nav-side { display: none; }
@media (min-width: 1180px) {
  html:not(.nav-mini) .nav-side { display: flex; flex-direction: column; gap: 2px; margin: 22px 4px 0; padding-top: 16px; border-top: 1px solid var(--line); }
  .nav-side-h { font-size: 12px; color: var(--muted); margin: 0 10px 6px; }
  nav.tabs a.nav-side-i { display: block; padding: 6px 10px; min-height: 0; font-size: 13px; line-height: 1.4; color: var(--text-2); font-weight: 400; text-align: left; white-space: normal; border-radius: 10px; }
  nav.tabs a.nav-side-i:hover { background: var(--surface-2); }
  .nav-side-i span { display: block; font-size: 12px; }
}

/* =====================================================================================================
   «Бумага и графит» — новый вид всех трёх приложений, в стиле сайта lanafreitag.ru (владелица утвердила 01.11.2026).
   Только внешний вид: переменные, шрифты, кнопки, вкладки, меню. Блок стоит в конце и перекрывает прежние правила;
   убрать его — вернётся прежний розовый вид. Шрифты сайта: Oranienbaum (заголовки, крупные цифры, заглавными),
   Cormorant курсив (акцент), Golos Text (текст). Углы прямые, теней нет, разделы — тонкими линиями.
   ===================================================================================================== */
:root {
  --font-display: "Oranienbaum", "Times New Roman", serif;
  --font-italic: "Cormorant", Georgia, serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f6f6f4; --surface: #f6f6f4; --paper-2: #ecece8; --line: rgba(20, 21, 23, .12); --line-2: rgba(20, 21, 23, .28);
  --ivory: #fbfbf9;
  --text: #141517; --text-2: #5c6167; --muted: #6b7076;
  --link: #141517; --good: #2f6b53; --bad: #a3343f; --warn: #9a5b23;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #111214; --surface: #111214; --paper-2: #1a1b1e; --line: rgba(238, 238, 236, .13); --line-2: rgba(238, 238, 236, .3);
    --ivory: #16171a; --text: #eeeeec; --text-2: #a3a7ac; --muted: #8e9297;
    --link: #eeeeec; --good: #6fc39b; --bad: #ff8f9a; --warn: #e3a866;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --surface: #111214; --paper-2: #1a1b1e; --line: rgba(238, 238, 236, .13); --line-2: rgba(238, 238, 236, .3);
  --ivory: #16171a; --text: #eeeeec; --text-2: #a3a7ac; --muted: #8e9297;
  --link: #eeeeec; --good: #6fc39b; --bad: #ff8f9a; --warn: #e3a866;
}
:root body { font: 400 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }

/* заголовки — как на обложке */
:root h1, :root h2 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
:root h1 { font-size: 26px; }
:root h2 { font-size: 21px; margin-bottom: 14px; }
:root h3 { font-weight: 600; }
:root .top { padding-top: 18px; }
:root .top h1 { display: flex; align-items: center; gap: 12px; font-size: 28px; }
:root .top h1::before { content: ""; flex: none; width: 38px; height: 38px; border-radius: 50%; background: url("bear.jpg") center / cover; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .top h1::before { mix-blend-mode: normal; opacity: .85; } }
:root[data-theme="dark"] .top h1::before { mix-blend-mode: normal; opacity: .85; }
:root .top small { font-size: 13px; color: var(--text-2); }

/* разделы вместо карточек: на бумаге, тонкая линия сверху */
:root .card { background: transparent; border: 0; border-top: 1px solid var(--line); box-shadow: none; padding: 22px 0 26px; margin: 0; }
:root .card .card { border-top: 1px solid var(--line); padding: 16px 0; }
:root .item { }

/* цифры-плитки — подпись разрядкой, цифра шрифтом обложки, графитовая линия сверху */
:root .stat, :root .tiles > div { background: transparent; border: 0; border-top: 1px solid var(--text); box-shadow: none; padding: 12px 0 4px; }
:root .stat .k, :root .tiles .k { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
:root .stat .v, :root .tiles .v, :root .big, :root .day-sum, :root .tax-sum { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.1; letter-spacing: .01em; }
:root .stat .s, :root .tiles .s { font-size: 13px; color: var(--text-2); }
:root .grid4, :root .tiles { gap: 22px; }

/* кнопки: прямые, подпись заглавными с разрядкой; главная — графит */
:root button, :root .btn { box-shadow: none; }
:root :is(main, dialog, .top) :is(button, .btn):not(.link):not(.chip):not(.dl):not(.wide):not([aria-label]),
:root button.primary, :root .btn.primary {
  font: 500 11px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; min-height: 44px; padding: 0 20px;
  background: transparent; color: var(--text); border: 1px solid var(--line-2);
}
:root button.primary, :root .btn.primary, :root :is(main, dialog) button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
:root button.primary:hover, :root .btn.primary:hover { background: transparent; color: var(--text); }
:root :is(main, dialog) :is(button, .btn):not(.primary):not(.link):not(.chip):not(.dl):hover { border-color: var(--text); }
:root button:not(.primary):not(.link):not(.chip) { border-color: var(--line-2); }
:root .small-btn { font-size: 10px !important; min-height: 34px !important; padding: 0 12px !important; }
:root button.link, :root a.link { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:root button.dl, :root .dl { color: var(--text-2); }
:root button.danger, :root button.danger:not(.primary) { color: var(--bad); border-color: var(--bad); }
:root .top button[aria-label] { border-radius: 50%; border: 1px solid var(--line); background: transparent; }
:root button:focus-visible, :root a:focus-visible, :root input:focus-visible, :root select:focus-visible, :root textarea:focus-visible { outline: 1.5px solid var(--text); outline-offset: 3px; }

/* «пилюли» → тихие вкладки с тонкой линией */
:root .chip { border: 0; border-bottom: 1px solid transparent; background: transparent; padding: 6px 2px; margin-right: 12px; min-height: 34px;
  font: 500 11px/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
:root .chip.on { background: transparent; color: var(--text); border-bottom-color: var(--text); }
:root .lg-tabs button { font: 500 11px/1.2 var(--font-body) !important; letter-spacing: .14em !important; text-transform: uppercase !important; }

/* поля */
:root input, :root select, :root textarea { border: 1px solid var(--line-2); background-color: transparent; }
:root input[type=checkbox], :root input[type=radio] { accent-color: var(--text); }
:root label { color: var(--text-2); }

/* полоски, плашки, метки */
:root .progress { height: 3px; background: var(--line); }
:root .progress i { background: var(--text); }
:root .progress.ok i { background: var(--good); }
:root .alert { border: 0; background: var(--paper-2); }
:root .alert.ok { background: color-mix(in srgb, var(--good) 8%, var(--paper-2)); }
:root .alert.bad { background: color-mix(in srgb, var(--bad) 8%, var(--paper-2)); }
:root .badge, :root .chip-stat { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; background: transparent; }

/* окна */
:root dialog { border: 1px solid var(--line); background: var(--bg); box-shadow: 0 24px 60px rgba(20, 21, 23, .18); }
:root dialog::backdrop { background: rgba(20, 21, 23, .35); }

/* меню: снизу на телефоне — подписи разрядкой; слева на компьютере — словами, выбранное с тонкой чертой */
:root nav.tabs { background: var(--bg); border-top: 1px solid var(--line); }
:root nav.tabs::after { background: var(--bg); }
:root nav.tabs a { font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
:root nav.tabs a .ic { color: var(--text-2); stroke-width: 1.5; }
:root nav.tabs a.on, :root nav.tabs a.on .ic { color: var(--text); font-weight: 600; }
@media (min-width: 1180px) {
  :root nav.tabs { border-top: 0; border-right: 1px solid var(--line); }
  :root nav.tabs::before { content: ""; display: block; width: 52px; height: 52px; border-radius: 50%; margin: 4px 0 26px 14px; background: url("bear.jpg") center / cover; mix-blend-mode: multiply; flex: none; }
  :root html.nav-mini nav.tabs::before, html.nav-mini nav.tabs::before { width: 40px; height: 40px; margin: 4px auto 20px; }
  :root nav.tabs a { font-size: 11px; letter-spacing: .16em; padding: 12px 14px; position: relative; }
  :root nav.tabs a:hover { background: transparent; color: var(--text); }
  :root nav.tabs a.on { background: transparent; font-weight: 600; }
  :root nav.tabs a.on::before { content: ""; position: absolute; left: -6px; top: 50%; width: 14px; height: 1px; background: var(--text); }
  :root .top h1::before { display: none; }
  :root .nav-toggle { border-radius: 50%; }
}
@media (min-width: 1180px) and (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) nav.tabs::before { mix-blend-mode: normal; opacity: .85; } }
@media (min-width: 1180px) { :root[data-theme="dark"] nav.tabs::before { mix-blend-mode: normal; opacity: .85; } }

/* «Сегодня важно», боковые блоки Мастерской, «Ближайшее» Директа — без розовых подложек */
:root .today-banner { background: var(--paper-2); border: 0; }
:root .tb-k, :root .nt-k { color: var(--text-2); letter-spacing: .16em; font-weight: 500; font-size: 11px; }
:root .tb-date { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; font-size: 24px; }
:root .tb-item { background: var(--bg); border: 0; border-top: 1px solid var(--text); }
:root .tb-item:hover { transform: none; }
:root .nav-today, :root .nav-soon { background: transparent; border: 0; border-top: 1px solid var(--line); }
:root .nav-side { border-top-color: var(--line); }

/* общие мелочи: прямые углы у всего «карточного», цвет — только в линиях и точках */
:root :is(.lg-f, .fl-check-item, .fl-builder, .arc-warn, .l-hl, .kw-item, .cover-ph, .pick-list, .l-live, .d-st) { }
:root .fl-check-item { background: transparent !important; border-bottom: 1px solid var(--line); }
:root .l-hl { background: var(--paper-2) !important; }
:root .fl-panel { background: transparent !important; border: 0 !important; border-top: 1px solid var(--line) !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important; }
:root .up { color: var(--good); } :root .down { color: var(--bad); } :root .warnc { color: var(--warn); }
/* правки к «Бумаге и графиту»: плитка-кнопка, неделя Планера, заголовки разделов одного размера */
:root .stat.stat-btn, :root button.stat { font: inherit !important; letter-spacing: normal !important; text-transform: none !important; text-align: left; min-height: 0 !important; padding: 12px 0 4px !important;
  background: transparent !important; border: 0 !important; border-top: 1px solid var(--text) !important; color: var(--text) !important; cursor: pointer; }
:root .stat.stat-btn .s { text-transform: none; letter-spacing: normal; }
:root .wday { border-color: transparent !important; background: transparent !important; }
:root .wday.on { border-color: var(--text) !important; }
:root .wday.today .wk-n { text-decoration: underline; text-underline-offset: 4px; }
:root .wday .wk-n { font-family: var(--font-display); font-weight: 400; font-size: 22px; }
:root main h2 { font-size: 22px !important; font-weight: 400 !important; }
:root .psec-h h2, :root .home-h h2 { font-size: 24px !important; }
:root :is(main, dialog) button.stat.stat-btn.stat-btn { border: 0 !important; border-top: 1px solid var(--text) !important; background: transparent !important; box-shadow: none !important; padding: 12px 0 4px !important; }
:root :is(main, dialog) button.stat.stat-btn .s { color: var(--text-2); }
/* боковая колонка «Доходов» (Сегодня, цель, Ближайшее) — так же плоско, как разделы */
:root .side-k { font-size: 11px; font-weight: 500; letter-spacing: .16em; color: var(--text-2); }
:root .side-date { font-family: var(--font-display); font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
:root .side-card { background: transparent; border: 0; border-top: 1px solid var(--text); padding: 12px 0 6px; }
:root a.side-card:hover { border-color: var(--text); background: transparent; }
:root .side-big { font-family: var(--font-display); font-weight: 400; font-size: 30px; letter-spacing: .01em; }
:root .side-big .small { font-family: var(--font-body); font-weight: 400; }
:root .side-actions button, :root .side-actions .btn { font: 500 11px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; min-height: 40px; padding: 0 14px;
  background: transparent; color: var(--text); border: 1px solid var(--line-2); }
:root .side-actions button:hover, :root .side-actions .btn:hover { border-color: var(--text); }

/* =====================================================================================================
   Сочетание прежнего и нового (владелица, 01.11.2026: «уродливые прямоугольные рамки», «скомбинируй старый стиль с новым — во всём»).
   От сайта остаются шрифты, бумага и графит; от прежнего вида — мягкие скруглённые формы, кнопки-«таблетки» с мягкой заливкой
   вместо рамок, мягкие карточки. Жёстких прямоугольных рамок нет нигде.
   ===================================================================================================== */
:root { --soft: #ececE8; --soft-2: #e3e3de; --card: #fcfcfa; --r-card: 20px; --r-tile: 16px; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --soft: #222326; --soft-2: #2b2c30; --card: #18191c; } }
:root[data-theme="dark"] { --soft: #222326; --soft-2: #2b2c30; --card: #18191c; }

/* карточки — мягкие, чуть светлее бумаги, без рамки и тени */
:root .card { background: var(--card); border: 0; border-radius: var(--r-card); padding: 18px 20px 20px; margin: 0 0 14px; }
:root .card .card { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 4px; margin: 0; }
:root .item { border-radius: 14px !important; }

/* плитки цифр — мягкие скруглённые, цифра шрифтом обложки */
:root .stat, :root .tiles > div { background: var(--soft); border: 0; border-radius: var(--r-tile); padding: 12px 14px; }
:root .card .stat, :root .card .tiles > div { background: var(--soft); }
:root .stat .v, :root .tiles .v, :root .big, :root .day-sum, :root .tax-sum { font-size: 28px; }
:root .stat .k, :root .tiles .k { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: none; }
:root .stat.stat-btn, :root button.stat,
:root :is(main, dialog) button.stat.stat-btn.stat-btn { background: var(--soft) !important; border: 0 !important; border-radius: var(--r-tile) !important; padding: 12px 14px !important; }
:root :is(main, dialog) button.stat.stat-btn.stat-btn:hover { background: var(--soft-2) !important; }

/* кнопки — «таблетки» с мягкой заливкой, обычными буквами; главная — графитовая таблетка */
:root :is(main, dialog, .top, aside, .side) :is(button, .btn):not(.link):not(.chip):not(.dl):not(.wide):not([aria-label]):not(.icon-btn):not(.wday):not(.stat):not(.nav-arr):not(.plus-btn):not(.lg-tabs button):not(.nt-btn),
:root .side-actions :is(button, .btn) {
  font: 500 14px/1.2 var(--font-body); letter-spacing: 0; text-transform: none; min-height: 42px; padding: 0 18px;
  background: var(--soft); color: var(--text); border: 1px solid transparent; border-radius: 999px;
}
:root :is(main, dialog, .top, aside, .side) :is(button, .btn):not(.primary):not(.link):not(.chip):not(.dl):not([aria-label]):not(.icon-btn):not(.wday):not(.stat):not(.nav-arr):not(.plus-btn):not(.lg-tabs button):hover,
:root .side-actions :is(button, .btn):hover { background: var(--soft-2); border-color: transparent; }
:root button.primary, :root .btn.primary, :root :is(main, dialog, .top) button.primary { background: var(--text) !important; color: var(--bg) !important; border-color: var(--text) !important; border-radius: 999px; }
:root button.primary:hover, :root .btn.primary:hover { background: color-mix(in srgb, var(--text) 85%, var(--bg)) !important; color: var(--bg) !important; }
:root .small-btn { font-size: 13px !important; min-height: 34px !important; padding: 0 14px !important; }
:root button.danger, :root button.danger:not(.primary) { color: var(--bad); border-color: transparent; background: color-mix(in srgb, var(--bad) 8%, var(--soft)); }
:root .top button[aria-label], :root button[aria-label].tb { border: 0; background: var(--soft); border-radius: 50%; }
:root .top button[aria-label]:hover { background: var(--soft-2); }
:root .nav-toggle { border: 0 !important; background: var(--soft); }
:root button.nt-btn { border-radius: 999px; border: 0; background: var(--soft); font: 500 13px/1.2 var(--font-body); }
:root .nt-btns button.nt-btn:first-child { background: var(--text); color: var(--bg); border: 0; }

/* «пилюли»-переключатели — мягкая заливка у выбранного; вкладки Легенды и Аналитики остаются тонкой линией (её выбор) */
:root .chip { border: 0; border-radius: 999px; padding: 6px 14px; margin-right: 6px; min-height: 34px; font: 500 14px/1.2 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--text-2); background: transparent; }
:root .chip:hover { background: var(--soft); }
:root .chip.on { background: var(--soft); color: var(--text); border: 0; }

/* поля — мягко скруглённые */
:root input:not([type=checkbox]):not([type=radio]), :root select, :root textarea { border-radius: 12px; border: 1px solid var(--line); background-color: var(--card); }
:root input:not([type=checkbox]):not([type=radio]):focus, :root select:focus, :root textarea:focus { border-color: var(--line-2); }

/* полоски и плашки */
:root .progress { height: 4px; border-radius: 999px; background: var(--soft-2); }
:root .progress i { border-radius: 999px; }
:root .alert { border-radius: var(--r-tile); }
:root .badge, :root .chip-stat { border-radius: 999px; font-size: 12px; letter-spacing: 0; text-transform: none; background: var(--soft); border: 0; }
:root dialog { border-radius: 22px; border: 0; }

/* неделя Планера: выбранный день — мягкой подложкой, сегодня — число графитом с точкой */
:root .wstrip button.wday, :root .week .wstrip button.wday { border: 0 !important; border-radius: 14px !important; background: transparent !important; }
:root .wstrip button.wday.on, :root .week .wstrip button.wday.on { background: var(--soft) !important; border: 0 !important; }
:root .wstrip button.wday:hover { background: var(--soft) !important; }
:root .wday.today .wk-n { text-decoration: none; color: var(--text); font-weight: 400; }
:root .wday.today .wk-d { color: var(--text); }

/* меню слева: выбранное — мягкой подложкой, без черты */
@media (min-width: 1180px) {
  :root nav.tabs a { border-radius: 12px; }
  :root nav.tabs a:hover { background: var(--soft); }
  :root nav.tabs a.on { background: var(--soft); }
  :root nav.tabs a.on::before { display: none; }
}

/* боковые колонки: «Сегодня» Мастерской, «Сегодня» Доходов, «Ближайшее» Директа — спокойные строки */
:root .nav-today, :root .nav-soon { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
:root .nt-date { font: 500 11px/1.3 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
:root .nt-t { font-weight: 400; font-size: 14px; line-height: 1.4; }
:root .nt-item > i { width: 6px; height: 6px; margin-top: 8px; opacity: .8; }
:root .nt-more, :root .nt-more * { font-weight: 500; text-decoration: none; }
:root .side-card { background: var(--card); border: 0; border-radius: var(--r-tile); padding: 14px 16px; }
:root a.side-card:hover { background: var(--soft); }
:root .today-banner { border-radius: var(--r-card); background: var(--card); }
:root .tb-item { border-radius: 14px; background: var(--soft); border: 0; }

/* то, что раньше выпрямили, — снова мягкое */
:root :is(.lg-f, .fl-check-item, .fl-builder, .arc-warn, .l-hl, .kw-item, .cover-ph, .pick-list, .l-live, .d-st) { border-radius: 14px !important; }
:root .fl-panel { background: var(--card) !important; border: 0 !important; border-radius: var(--r-card) !important; padding-left: 18px !important; padding-right: 18px !important; }
:root button.nav-arr, :root button.plus-btn { background: transparent !important; border: 0 !important; border-radius: 50% !important; box-shadow: none !important; }
:root button.nav-arr:hover, :root button.plus-btn:hover { background: var(--soft) !important; }
/* ничего не прилипает к краю подложки (владелица, 01.11.2026: «прилипать нигде ничего ни к чему не должно») */
:root .wstrip button.wday, :root .week .wstrip button.wday { padding: 10px 0 10px !important; gap: 4px !important; }
:root .wk-dots { height: 6px; margin-top: 1px; }
:root details[open] > summary { margin-bottom: 10px; }
:root details > summary + * { margin-top: 0; }
:root details.card > .item:first-of-type { border-top: 0; }
:root .l-hl { margin: 8px 0 !important; border-bottom: 0 !important; }
:root .l-hl + .l-hl { margin-top: 10px !important; }
:root .tag { padding: 3px 10px; }
/* строки списков — прямые линии-разделители (скругление гнуло линию снизу); скругляются только строки с подложкой */
:root .item { border-radius: 0 !important; }
:root .item.l-hl, :root .item.idea.open, :root .item[class*="hl"] { border-radius: 14px !important; }
/* подпись под цифрой в плитке переносится, а не упирается в край */
:root .stat .s, :root .tiles .s { white-space: normal; overflow-wrap: anywhere; }

/* круглые кнопки остаются круглыми (галочка «Сделано», значки) — квадраты владелица не хочет */
:root button.td-ok, :root button.icon-btn, :root .top button[aria-label], :root button.nav-toggle, :root button[aria-label].round { border-radius: 50% !important; }
:root button.td-ok { background: transparent !important; }
/* переключатель «Открытые · Готово · Корзина»: одна мягкая дорожка, выбранное — светлой таблеткой */
:root .idea-seg { background: var(--soft); }
:root :is(main, dialog) .idea-seg > button { background: transparent !important; border: 0 !important; font: 500 14px/1.2 var(--font-body); }
:root :is(main, dialog) .idea-seg > button.on { background: var(--card) !important; box-shadow: none; }
:root :is(main, dialog) .idea-pk.idea-pk { border: 0 !important; background-color: var(--soft); font-weight: 500; }
/* цифры — шрифтом текста (Golos Text), ровно и легко читать (владелица выбрала вариант «А», 01.11.2026); заголовки остаются шрифтом сайта */
:root { --font-num: var(--font-body); }
:root :is(.stat .v, .tiles .v, .big, .day-sum, .tax-sum, .side-big, .kv b, .taxline .tl-v, .bh-tile b, .app-direct .ln-stats b) {
  font-family: var(--font-num) !important; font-weight: 600 !important; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums;
}
:root :is(.stat .v, .tiles .v) { font-size: 24px; }
:root .wday .wk-n { font-family: var(--font-num) !important; font-weight: 500 !important; font-size: 18px !important; }
:root .wday.on .wk-n, :root .wday.today .wk-n { font-weight: 600 !important; }
/* заголовки — Playfair Display обычными буквами (владелица выбрала вариант «В», 01.11.2026); Oranienbaum заглавными больше нет */
:root { --font-display: "Playfair Display", Georgia, "Times New Roman", serif; }
:root :is(h1, h2, .tb-date, .side-date) { font-family: var(--font-display); font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; line-height: 1.2; }
:root .top h1 { font-size: 26px; font-weight: 700 !important; }
:root main h2 { font-size: 21px !important; }
:root .psec-h h2, :root .home-h h2 { font-size: 22px !important; }
:root .side-date, :root .tb-date { font-size: 19px; }
/* меню на телефоне — только иконки, без подписей (владелица, 01.11.2026); подпись остаётся во всплывающей подсказке и для экранного диктора */
@media (max-width: 1179px) {
  :root nav.tabs a .nl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  :root nav.tabs a { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 8px 0 6px; }
  :root nav.tabs a b { font-size: 0; line-height: 0; }
  :root nav.tabs a .ic { width: 24px; height: 24px; }
  :root nav.tabs a::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: transparent; }
  :root nav.tabs a.on::after { background: var(--text); }
}
/* заголовки и кнопки — Jost, «спорт-шик» (владелица выбрала вариант «А», 01.11.2026); цифры остаются Golos Text — её выбор */
:root { --font-display: "Jost", "Golos Text", system-ui, sans-serif; }
:root :is(h1, h2, .tb-date, .side-date) { font-weight: 500 !important; letter-spacing: .005em !important; }
:root .top h1 { font-weight: 500 !important; font-size: 27px; }
:root :is(main, dialog, .top, aside, .side) :is(button, .btn):not(.link):not(.dl):not(.icon-btn):not(.stat):not(.lg-tabs button),
:root .side-actions :is(button, .btn), :root .chip { font-family: var(--font-display) !important; font-weight: 500 !important; letter-spacing: .015em; }
/* меню слева — Jost обычными буквами, без разрядки; «Ближайшее» — спокойные строки текста (владелица: «эти шрифты тоже не нравятся») */
@media (min-width: 1180px) {
  :root nav.tabs a { font-family: var(--font-display); font-size: 15px; font-weight: 400; letter-spacing: .01em; text-transform: none; }
  :root nav.tabs a.on { font-weight: 500; }
  :root nav.tabs a.nav-side-i { font-family: var(--font-body); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; line-height: 1.45; color: var(--text); padding: 8px 12px; border-radius: 12px; background: transparent; }
  :root nav.tabs a.nav-side-i:hover { background: var(--soft); }
  :root nav.tabs a.nav-side-i::before { display: none; }
  :root .nav-side-i span { font-family: var(--font-body); font-size: 12px; letter-spacing: 0; color: var(--text-2); margin-bottom: 1px; }
  :root .nav-side-h, :root .nt-date, :root .side-k { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: .01em; text-transform: none; color: var(--text-2); }
}
:root .side-k, :root .nt-date { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: .01em; text-transform: none; }
/* сумма в плитке сама чуть уменьшается, если плитка узкая, — никогда не вылезает за край */
:root :is(.stat, .tiles > div) .v { font-size: min(24px, 16cqi) !important; line-height: 1.15; }
/* «Доходы» на компьютере с правой колонкой: плитки по две в ряд, пока места мало для четырёх, — цифры остаются крупными */
@media (min-width: 1180px) and (max-width: 1640px) { html:not(.app-writer) main .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
/* iPhone: нижнее меню всегда у настоящего низа экрана (сдвиг считает js/vvfix.js) */
@media (max-width: 1179px) { nav.tabs { transform: translate3d(0, var(--nav-shift, 0px), 0); } }
/* ---------- Сайт → Обзор · Почта (01.11.2026) ---------- */
/* три входа на сайт — мягкие плитки с иконкой и подписью вместо жирных ссылок */
.site-go { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 12px; }
.site-go a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-tile, 16px); background: var(--soft); color: var(--text); text-decoration: none; min-width: 0; transition: background .2s; }
.site-go a:hover { background: var(--soft-2); }
.site-go .ic { width: 22px; height: 22px; flex-shrink: 0; color: var(--text-2); }
.site-go span { display: flex; flex-direction: column; min-width: 0; }
.site-go b { font: 500 15px/1.25 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-go small { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .site-go { grid-template-columns: 1fr; gap: 6px; } .site-go a { padding: 12px 14px; } }
.tiles .tile-go { cursor: pointer; transition: background .2s; }
.tiles .tile-go:hover { background: var(--soft-2) !important; }
/* переключатель-дорожка (30 дней · 90 дней · Всё время; Подтвердили · Ждут …) */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--soft); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
:root main .seg > button { background: transparent !important; border: 0 !important; box-shadow: none !important; min-height: 30px !important; padding: 0 12px !important; border-radius: 999px !important; font: 500 13px/1 var(--font-body) !important; color: var(--text-2) !important; white-space: nowrap; letter-spacing: 0 !important; }
:root main .seg > button.on { background: var(--card) !important; color: var(--text) !important; }
.mail-tiles { margin: 14px 0 12px; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 640px) { .mail-tiles { grid-template-columns: 1fr 1fr !important; } .mail-tiles > div:first-child { grid-column: 1 / -1; } }
.mail-chart { margin-top: 12px; min-height: 120px; }
.mail-chart svg { display: block; overflow: visible; }
.mail-area { fill: color-mix(in srgb, var(--text) 7%, transparent); }
.mail-line { stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mail-dot { fill: var(--text); }
.mail-cross { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.mail-tipt { font: 500 12px var(--font-body); fill: var(--text); }
.mail-find { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.mail-find input[type=search] { flex: 1 1 220px; min-width: 0; }
.mail-old { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--soft); }
.mail-list { margin-top: 8px; }
.mail-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mail-row:last-child { border-bottom: 0; }
.mail-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.mail-who b { font-weight: 500; }
.mail-meta { font-size: 12px; color: var(--text-2); white-space: nowrap; }
@media (max-width: 640px) { .mail-row { grid-template-columns: minmax(0, 1fr) auto; } .mail-meta { grid-column: 1; grid-row: 2; margin-top: -8px; } .mail-row .icon-btn { grid-row: 1 / span 2; grid-column: 2; } }
.mail-more { margin: 12px 0; }
.mail-more > summary { cursor: pointer; list-style: none; font-size: 14px; color: var(--text-2); padding: 6px 0; }
.mail-more > summary::-webkit-details-marker { display: none; }
.mail-more > summary::after { content: " ↓"; font-size: 12px; }
.mail-more[open] > summary::after { content: " ↑"; }
.mail-conn { display: grid; gap: 12px; }
.mail-conn label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
/* редактор письма: слева поля, справа письмо как его увидят; на телефоне — переключателем */
.ml-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 10px; }
.ml-mtabs { display: none !important; }
.ml-pvwrap { position: sticky; top: 14px; border-radius: var(--r-card, 20px); overflow: hidden; background: #f6f6f4; }
.ml-pvwrap iframe { display: block; width: 100%; height: 640px; border: 0; background: transparent; }
@media (max-width: 1000px) {
  .ml-grid { grid-template-columns: 1fr; }
  .ml-mtabs { display: flex !important; margin-top: 10px; }
  .ml-grid:not(.show-pv) .ml-pvwrap { display: none; }
  .ml-grid.show-pv .ml-form { display: none; }
  .ml-pvwrap { position: static; }
}
.ml-f { display: grid; gap: 6px; margin: 0 0 16px; }
.ml-f > span { font-size: 13px; color: var(--text-2); }
.ml-f > small { font-size: 12px; color: var(--muted); }
.ml-f textarea { resize: none; overflow: hidden; line-height: 1.55; }
.ml-tgl { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; font-size: 15px; }
.ml-send { display: grid; gap: 12px; }
.ml-at { display: flex; gap: 10px; flex-wrap: wrap; }
.ml-at input { flex: 1 1 140px; min-width: 0; }
.ml-slots { display: flex; flex-wrap: wrap; gap: 6px; }
:root main .ml-slots > button { background: var(--soft) !important; border: 0 !important; box-shadow: none !important; min-height: 30px !important; padding: 4px 12px !important; border-radius: 999px !important; font: 400 13px/1.3 var(--font-body) !important; color: var(--text-2) !important; text-align: left; letter-spacing: 0 !important; }
:root main .ml-slots > button.on { background: var(--text) !important; color: var(--card) !important; }
.ml-btns { gap: 14px; flex-wrap: wrap; align-items: center; }
.ml-pvbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--soft); }
.ml-pvwrap.dark { background: #141517; }
/* свой цвет акцентов: ползунки оттенка и насыщенности, три образца тонов */
.own-prev { display: flex; gap: 10px; margin: 2px 0 6px; }
.own-prev i { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
:root input.own-range { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; padding: 0; margin: 8px 0 4px; border: 0 !important; border-radius: 999px; background-color: transparent; cursor: pointer; }
:root input.own-hue { background: linear-gradient(90deg, hsl(0 55% 72%), hsl(40 55% 72%), hsl(80 55% 72%), hsl(120 55% 72%), hsl(160 55% 72%), hsl(200 55% 72%), hsl(240 55% 72%), hsl(280 55% 72%), hsl(320 55% 72%), hsl(359 55% 72%)); }
:root input.own-sat { background: linear-gradient(90deg, var(--own-from, #ddd), var(--own-to, #888)); }
input.own-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
input.own-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--text); }
.acc-own i { position: relative; }
/* шапка на телефоне — с воздухом (владелица: «разлепи тексты, чтобы гармонично читалось»): название, под ним имя
   (вровень с названием, не под медведем), ниже — кнопки; во всех трёх приложениях */
@media (max-width: 760px) {
  :root .top { row-gap: 14px; align-items: flex-start; padding-bottom: 8px; }
  :root .top h1 { margin: 0; line-height: 1.15; }
  :root .top small { display: block; margin-top: 6px; line-height: 1.35; padding-left: 50px; }
  :root .top .row { gap: 8px; }
  :root .top + main, :root .top ~ main { padding-top: 10px; }
}
/* адреса в Почте — страницами: «‹ 1–10 из 136 ›» */
.mail-pg { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.mail-pg span { min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
:is(main) .mail-pg button.nav-arr[disabled] { opacity: .3; pointer-events: none; }
/* выделение цветом в редакторе — снова тёмно-изумрудное, как в Google Документе (общий --link стал графитовым) */
:root { --mark: #0b6b4f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mark: #6fd0aa; } }
:root[data-theme="dark"] { --mark: #6fd0aa; }
.editor [data-c="#0b6b4f"] { color: var(--mark) !important; }
:root button.ed-ic.ed-color span { color: var(--mark); border-bottom-color: var(--mark); }
/* значки панели редактора — прозрачные, как раньше (не «таблетки»); при наведении — мягкая подложка */
:root button.ed-ic { background: transparent !important; border-radius: 10px !important; padding: 0 9px !important; min-height: 34px; box-shadow: none !important; }
:root button.ed-ic:hover { background: var(--soft, var(--surface-2)) !important; }

/* Experimental statistical token highlight: CSS Highlight API only (no document mutation). */
.ed-wm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.ed-wm-row[hidden] { display: none !important; }
.ed-wm-row .ed-wm-btn { min-height: 32px; padding: 0 12px; border: 1px solid var(--line) !important; border-radius: 9px; color: var(--text-2) !important; font-size: 12px; font-weight: 500; background: transparent; }
.ed-wm-row .ed-wm-btn[aria-pressed="true"] { border-color: var(--accent) !important; color: var(--accent) !important; }
.ed-wm-row .ed-wm-status { flex: 1 1 240px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.ed-wm-row .ed-wm-status[hidden] { display: none; }
::highlight(writer-experimental-watermark) { background-color: rgba(218, 126, 83, .42); text-decoration: underline dotted #b46d46; }
/* ---------- свёрнутые разделы (fold в ui.js): второстепенное — одной строкой, раскрывается по нажатию ---------- */
.card.folds { padding-top: 6px; padding-bottom: 6px; }
details.fold { border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.card.folds > details.fold:first-child, .card.folds > h2 + details.fold { border-top: 0; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 14px 26px 14px 0; position: relative; margin: 0 !important; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ''; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
details.fold[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.fold-t { font: 500 16px/1.3 var(--font-display, inherit); color: var(--text); }
.fold-s { font-size: 13px; color: var(--muted); margin-left: auto; text-align: right; }
.fold-b { padding: 2px 0 16px; }
/* карточка внутри раздела — без своей подложки и без повторного заголовка (он уже в строке раздела) */
.fold-b > .card, .fold-b > .ct-wrap { background: none !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; border: 0 !important; }
.fold-b > .card > h2:first-child, .fold-b > .card > .row.between:first-child > h2, .fold-b > .ct-wrap > .row.between:first-child > h2 { display: none; }
.fold-b > .card > .row.between:first-child, .fold-b > .ct-wrap > .row.between:first-child { justify-content: flex-end; margin-top: 0 !important; }
.fold-b > .card > .row.between:first-child:not(:has(> :not(h2))) { display: none; }
/* «Ещё N» в длинных списках */
details.fold-more > summary { list-style: none; cursor: pointer; display: inline-block; margin: 10px 0 2px; font-size: 14px; color: var(--text-2); border-bottom: 1px solid currentColor; }
details.fold-more > summary::-webkit-details-marker { display: none; }
details.fold-more .fm-c, details.fold-more[open] .fm-o { display: none; }
details.fold-more[open] .fm-c { display: inline; }
details.fold-more[open] > summary { order: 2; }
details.fold-more[open] { display: flex; flex-direction: column; }
details.fold-more[open] > summary { align-self: flex-start; }
/* «Скоро» в левой колонке — обычными буквами, как остальное меню (заглавные с разрядкой владелица отвергла) */
:root .nav-soon .nt-k { text-transform: none !important; letter-spacing: 0 !important; font-size: 12px; }
@media (max-width: 600px) { .fold-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; } }
/* вкладки тонкой линией (Финансы, Читатели, Маркетинг…) — обычными буквами, шрифт заголовков */
:root main .lg-tabs button { text-transform: none !important; letter-spacing: 0 !important; font: 500 15px/1.2 var(--font-display) !important; }
:root .money-tabs { margin: 0 0 14px; }
/* синопсис для чтения (Маркетинг → Для издательства) */
.syn-read p { margin: 0 0 6px; line-height: 1.55; }
.syn-read .syn-h { font-weight: 600; margin: 14px 0 4px; }
.syn-read .syn-h:first-child { margin-top: 4px; }
.prof-row { gap: 8px; flex-wrap: wrap; align-items: baseline; }
/* редактор главы: справа всегда место для колонки цифр (слова, знаки, а.л.) — на средних экранах она залезала на край страницы */
@media (min-width: 1380px) and (max-width: 1799px) { html.on-ed main { padding-right: 104px !important; } }
/* ---------- плитки-разделы (tiles в ui.js): страница книги и др. ---------- */
.tiles-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
:root main button.tile-b { display: grid !important; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center; text-align: left;
  min-height: 64px !important; padding: 12px 14px !important; border-radius: 16px !important; background: var(--soft) !important; border: 0 !important; color: var(--text) !important;
  font: 500 15px/1.25 var(--font-display) !important; letter-spacing: 0 !important; text-transform: none !important; box-shadow: none !important; transition: background .15s; }
:root main button.tile-b:hover { background: var(--soft-2, var(--surface-2)) !important; }
:root main button.tile-b.on { background: var(--text) !important; color: var(--bg) !important; }
.tile-b .tile-i { grid-row: 1 / span 2; display: flex; color: var(--muted); }
.tile-b .tile-i .ic { width: 20px; height: 20px; }
.tile-b .tile-t { grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-b .tile-s { grid-column: 2; font: 400 12.5px/1.3 var(--font-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-b:not(:has(.tile-s)) .tile-t { grid-row: 1 / span 2; }
.tile-b.on .tile-i, .tile-b.on .tile-s { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.tile-pane { margin-top: 16px; padding-top: 4px; }
.tile-pane > .card, .tile-pane > .ct-wrap, .tile-pane > section { background: none !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; border: 0 !important; }
.tile-pane > .card > h2:first-child, .tile-pane > .card > .row.between:first-child > h2, .tile-pane > .ct-wrap > .row.between:first-child > h2 { display: none; }
.tile-pane > .card > .row.between:first-child, .tile-pane > .ct-wrap > .row.between:first-child { justify-content: flex-end; margin-top: 0 !important; }
@media (max-width: 600px) { .tiles-nav { grid-template-columns: 1fr 1fr; gap: 6px; } :root main button.tile-b { min-height: 58px !important; padding: 10px 12px !important; font-size: 14px !important; grid-template-columns: 18px 1fr; column-gap: 8px; } .tile-b .tile-i .ic { width: 17px; height: 17px; } }
.card.bk-more { padding: 14px; }
.card.bk-more .tile-pane { padding: 4px 6px 6px; }
@media (min-width: 900px) { .tiles-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Мастерская → Сайт: книги на сайте и выбор бесплатного фрагмента (09.11.2026, владелица: «простой механизм выбора глав, сейчас всё непонятно») */
.site-bk{display:grid;gap:10px}
.site-bk .sub{display:block;margin-top:2px}
.site-bk-acts{display:flex;flex-wrap:wrap;gap:8px}
.frag-list{display:grid;gap:2px;margin:14px 0 10px;max-height:52vh;overflow:auto}
.frag-row{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:12px;cursor:pointer;color:var(--muted);transition:background .15s}
.frag-row input{position:absolute;opacity:0;pointer-events:none}
.frag-row:hover{background:var(--soft,var(--surface-2))}
.frag-ok{flex:0 0 22px;width:22px;height:22px;border-radius:50%;border:1px solid var(--line);display:inline-flex;align-items:center;justify-content:center}
.frag-ok svg{width:13px;height:13px;opacity:0}
.frag-row.on{color:var(--text)}
.frag-row.on .frag-ok{background:var(--text);border-color:var(--text);color:var(--bg,#fff)}
.frag-row.on .frag-ok svg{opacity:1}
.frag-row:has(input:checked){background:var(--soft,var(--surface-2))}
.frag-t{flex:1;min-width:0}
.frag-n{font-size:13px;color:var(--muted);white-space:nowrap}
.frag-sum{margin:6px 0 10px;font-weight:600}

/* Директ: раздела «Учёба» больше нет (10.11.2026) — ссылки «Почему так →» на уроки не показываем */
button[data-act="l.lesson"] { display: none; }
.pult-funnel { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 8px 0 4px; }
.pult-c h2 { color: var(--text); }

/* Переключатель приложений (12.11.2026): свёрнут в круглую кнопку, по нажатию «таблетка» плавно выезжает влево */
:root .eco-w { display: inline-flex; align-items: center; gap: 6px; }
:root .eco { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--soft, var(--surface-2)); max-width: 0; opacity: 0; overflow: hidden; padding: 3px 0; transition: max-width .35s ease, opacity .25s ease, padding .35s ease; white-space: nowrap; }
:root .eco-w.open .eco { max-width: 420px; opacity: 1; padding: 3px; }
:root .eco a, :root .eco span { padding: 7px 13px; border-radius: 999px; font: 500 14px/1.2 var(--font-display); color: var(--text-2); text-decoration: none; white-space: nowrap; }
:root .eco a:hover { color: var(--text); }
:root .eco .on { background: var(--text); color: var(--bg); }
:root button.eco-t { width: 34px; height: 34px; min-height: 34px; padding: 0 !important; border-radius: 50% !important; display: inline-grid; place-items: center; transition: transform .35s ease; }
:root .eco-w.open button.eco-t { transform: rotate(45deg); }
@media (max-width: 720px) {
  /* телефон: аккуратное выпадающее меню под кнопкой — столбиком, поверх содержимого, закрывается само (13.11.2026: «плохо работают в моб. версии») */
  :root .top .row { position: relative; }
  :root .eco { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; display: none; flex-direction: column; gap: 2px; min-width: 200px; max-width: none; opacity: 1;
    padding: 6px; border-radius: 18px; background: var(--surface, #fff); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.12); overflow: visible; transition: none; }
  :root .eco-w.open .eco { display: flex; max-width: none; padding: 6px; animation: eco-in .16s ease; }
  :root .eco a, :root .eco span { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; font-size: 16px; color: var(--text); }
  :root .eco a:active { background: var(--soft, var(--surface-2)); }
  :root .eco .on { background: var(--soft, var(--surface-2)); color: var(--text); }
  :root .eco .on::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text); }
  :root .eco-w.open button.eco-t { transform: none; background: var(--text) !important; color: var(--bg) !important; }
}
@keyframes eco-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Единая шкала шрифтов во всех трёх приложениях — телефон и компьютер (12.11.2026, её просьба: «слишком мелкие и негармоничные цифры в первом блоке»):
   заголовки разделов 22 px Jost, подписи плиток 12,5 px, цифры плиток 24 px (на узкой плитке чуть меньше, но не меньше 20 px), пояснения 13 px */
:root main h2, :root .psec-h h2, :root .home-h h2 { font-size: 22px !important; }
:root :is(.stat, .tiles > div) .k { font-size: 12.5px; }
:root :is(.stat, .tiles > div) .s { font-size: 13px; }
@media (max-width: 720px) { :root :is(.stat, .tiles > div) .v { font-size: max(20px, min(24px, 16cqi)) !important; } :root :is(.stat, .tiles > div) { padding: 14px 14px 12px; } }

/* Режим фокуса в редакторе главы (только компьютер): текст на бумаге и одна тихая строка инструментов сверху */
.ed-focus-btn { display: none !important; }
.ed-chapter button.ed-ic.ed-leg { width: 34px; padding: 0 !important; margin-left: 2px; gap: 0; }
.ed-chapter .ed-add .ic { width: 18px; height: 18px; }
@media (min-width: 901px) {
  .ed-focus-btn { display: inline-flex !important; }
  html.ed-focus, html.ed-focus body { background: var(--paper, var(--surface)); }
  html.ed-focus nav.tabs, html.ed-focus .top, html.ed-focus .demo, html.ed-focus .ed-draft { display: none !important; }
  html.ed-focus.app-writer #app { padding: 0 !important; }
  html.ed-focus.app-writer main { max-width: none; padding: 0; margin: 0; }
  /* панель — отдельная «капсула» по центру, не прилеплена к краю; пока печатаешь — исчезает, шевельнула мышью — вернулась */
  html.ed-focus .ed-bar { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 20; width: max-content; max-width: calc(100vw - 48px); margin: 0;
    display: flex; align-items: center; gap: 4px; padding: 5px 8px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface, #fff);
    transition: opacity .35s ease, transform .35s ease; }
  html.ed-focus.ed-typing .ed-bar:not(:hover):not(:focus-within) { opacity: 0; transform: translate(-50%, -8px); pointer-events: none; }
  html.ed-focus .ed-tools { margin: 0; flex-wrap: nowrap; gap: 2px; }
  html.ed-focus .ed-tools .ed-style { border: 0 !important; background-color: transparent !important; box-shadow: none !important; padding-left: 14px; font-size: 13.5px; }
  html.ed-focus .ed-bar button.ed-ic { border-radius: 999px !important; min-width: 32px; min-height: 32px; padding: 0 8px !important; }
  html.ed-focus .ed-nav { position: static; flex-wrap: nowrap; gap: 6px; order: 2; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--line); }
  html.ed-focus .ed-nav .btn.back, html.ed-focus .ed-nav .ed-auto, html.ed-focus .ed-nav > button.primary,
  html.ed-focus .ed-chapter > *:not(.ed-focus-btn) { display: none !important; }
  html.ed-focus .ed-status { margin: 0; font-size: 12px; white-space: nowrap; color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
  html.ed-focus .ed-chapter { order: 2; }
  html.ed-focus .ed-focus-btn { background: var(--soft, var(--surface-2)) !important; }
  html.ed-focus .ed-wm-row { display: none; }
  html.ed-focus .ed-find:not([hidden]) { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--surface, #fff); border: 1px solid var(--line); padding: 8px 12px; border-radius: 16px; width: max-content; }
  html.ed-focus .ed-paper { border: 0; border-radius: 0; background: none; max-width: 740px; margin: 0 auto; padding: 132px 20px 40vh; min-height: 100vh; }
  html.ed-focus .ed-paper .ed-stats { opacity: .28; }
  html.ed-focus .ed-paper .ed-stats:hover { opacity: 1; }
}
@media (min-width: 901px) and (max-width: 1100px) { html.ed-focus .ed-status { display: none; } }

/* Знаки в выделенном тексте — первой строкой в колонке цифр редактора */
.ed-paper .ed-stats .es-sel b { color: var(--mark, var(--good)); }
@media (min-width: 1180px) { .ed-paper .ed-stats .es-sel { padding-bottom: 14px; border-bottom: 1px solid var(--line); } }
html.ed-focus .ed-paper .ed-stats:has(.es-sel) { opacity: 1; }

/* «Рынок»: подзаголовки внутри карточки, строки с полосой, пометка «ваш», выбор подборки */
.mk-sub { margin: 18px 0 6px; font: 500 15px/1.3 var(--font-display); color: var(--text); }
.mk-b { margin-top: 12px; } .mk-b .progress { height: 6px; margin: 6px 0 0; }
.mk-me { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 11px; vertical-align: 1px; }
select.mk-sel { width: auto; max-width: 220px; min-height: 34px; padding: 4px 30px 4px 12px; font-size: 14px; }
.mk-page .card h2 { font-size: 20px; }

/* Пульт: этап кампании и следующий шаг */
.pult-stage { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--soft, var(--surface-2)); }
.pult-next { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Главная Мастерской: рабочий стол — сегодняшний текст, дела, книги, ритм (13.11.2026) */
.hm { display: grid; gap: 0 22px; grid-template-columns: minmax(0, 1fr); }
.hm-main, .hm-side { min-width: 0; }
@media (min-width: 1100px) { .hm { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; } .hm-side { position: sticky; top: 16px; } }
@media (max-width: 1099px) { .hm { display: flex; flex-direction: column; } .hm-main, .hm-side { display: contents; } .hm-hero { order: 1; } .hm-side > * { order: 2; } .hm-main > *:not(.hm-hero) { order: 3; } }
.hm-hero { padding: 26px 28px 22px; }
.hm-day { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 500 14px/1.2 var(--font-display); color: var(--muted); }
.hm-now { margin-top: 14px; }
.hm-big { font-size: 54px; font-weight: 600; line-height: 1; font-family: var(--font-num, inherit); letter-spacing: -.02em; color: var(--text); white-space: nowrap; }
.hm-big span { font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.hm-goal { margin-top: 14px; } .hm-goal .progress { height: 6px; margin: 0 0 8px; }
.hm-act { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.hm-month { display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: baseline; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.hm-month button.link { font-size: 14px; font-weight: 400; text-decoration: none; }
.hm-sub { margin: 16px 0 2px; font: 500 14px/1.3 var(--font-display); color: var(--muted); }
.hm-todo .item .badge { white-space: nowrap; }
.hm-week h3 { margin: 14px 0 4px; font-size: 14px; }
@media (max-width: 700px) { .hm-hero { padding: 22px 20px 18px; } .hm-big { font-size: 44px; } .hm-act .primary { width: 100%; } }

/* Рынок (13.11.2026): её книга против топа, книги тропа, линия доли тропа */
.mk-cap { font-size: 12.5px; color: var(--muted); margin: 0 0 2px; }
.mk-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
button.mk-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--soft, var(--surface-2)); color: var(--text); font: inherit; font-size: 13px; line-height: 1.35; cursor: pointer; text-transform: none; letter-spacing: 0; min-height: 0; }
button.mk-chip b { font-size: 15px; font-weight: 600; }
.mk-tr { cursor: pointer; border-radius: 10px; padding: 6px 8px; margin: 0 -8px; }
.mk-tr:hover { background: var(--soft, var(--surface-2)); }
.mk-sp { vertical-align: -2px; margin-right: 8px; color: var(--muted); }
.mk-ann { margin-top: 4px; font-style: italic; color: var(--text-2); }
button.mk-chip { border-radius: 14px !important; height: auto !important; padding: 12px 16px !important; white-space: normal; }
.sheet .list a, .mk-page .list a { color: inherit; text-decoration: none; }

.mk-rank { padding: 12px 0; border-top: 1px solid var(--line); } .mk-rank:first-of-type { border-top: 0; }
.mk-place { font-family: var(--font-num, inherit); font-weight: 600; font-size: 22px; }
svg.mk-rk { display: block; width: 100%; height: 54px; margin: 6px 0 4px; color: var(--text); }
svg.mk-rk .mk-rel { stroke: var(--good, #2e7d5b); stroke-width: 8; stroke-linecap: round; fill: none; }
/* Календарь запуска книги (Мастерская → книга → «Запуск») */
.lt-day { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.lt-day.past { opacity: .55; }
.lt-day.now .lt-date b, .lt-day.next .lt-date b { color: var(--text); }
.lt-date { display: flex; flex-direction: column; line-height: 1.2; } .lt-date b { font-family: var(--font-num, inherit); font-weight: 600; font-size: 15px; } .lt-date span { font-size: 12.5px; color: var(--muted); }
.lt-day.now .lt-date span { color: var(--good); font-weight: 600; }
.lt-ev > div { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.45; padding: 1px 0; }
.lt-ev i { flex: none; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
.ch-leak { display: block; white-space: normal; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; color: var(--down, #b0413e); margin-top: 2px; }
/* Единая шкала — мелкие подписи не меньше 12 px (13.11.2026, проверка всех экранов на телефоне) */
:root button.wday .wk-d, :root .wd small, :root .nl-date i, :root .cc-months span, :root .tag { font-size: 12px; }
@media (max-width: 720px) { :root .bh-cover-edit { font-size: 12px; } }
/* Планер на телефоне: «Сегодня» отдельно, дата — строкой ниже (без висящей точки) */
@media (max-width: 720px) { .plan-dayh .dn-d { display: block; font: 400 15px/1.3 var(--font-body, inherit); color: var(--text-2); margin-top: 4px; } .plan-dayh .dn-dot { display: none; } }
/* Меню приложений на телефоне: под кнопкой, в пределах экрана (место считает ecoPlace в ui.js) */
@media (max-width: 720px) { :root .eco { position: fixed; top: var(--eco-top, 120px); left: var(--eco-left, 16px); right: auto; width: 220px; min-width: 0; z-index: 60; } }
/* Главная Мастерской: «+» нового дела — мягкий круг, как у кнопок шапки */
:root button.plus-btn.hm-plus { width: 34px; height: 34px; min-width: 34px; min-height: 34px; background: var(--soft, var(--surface-2)) !important; color: var(--text) !important; }
:root button.plus-btn.hm-plus:hover { background: var(--text) !important; color: var(--bg) !important; }
:root button.plus-btn.hm-plus .ic { width: 18px; height: 18px; stroke-width: 1.9; }
.hm-more { margin-top: 12px; text-align: right; }
/* Планер: строка «Новое дело» внизу дня — без рамки, тонкая линия сверху, Enter добавляет */
.pq-add { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.pq-add .pq-plus { flex: none; display: inline-grid; place-items: center; width: 22px; color: var(--muted); }
.pq-add .pq-plus .ic { width: 18px; height: 18px; stroke-width: 1.8; }
:root .pq-add input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 8px 0 !important; font: inherit; font-size: 15px; color: var(--text); outline: none; min-height: 0; }
:root .pq-add input::placeholder { color: var(--muted); }
.pq-add:focus-within .pq-plus { color: var(--text); }
.pq-add { flex-wrap: wrap; } .pq-add .pq-hint { display: none; flex-basis: 100%; padding-left: 32px; font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.pq-add:focus-within .pq-hint { display: block; }
.mk-fc { padding: 10px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; border-top: 1px solid var(--line); } .mk-fc:hover { background: var(--soft, var(--surface-2)); }
.pr-ya { margin: -4px 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--soft, var(--surface-2)); font-size: 14px; }
.pr-ya ol { margin: 6px 0 0; padding-left: 20px; } .pr-ya li { margin: 3px 0; line-height: 1.45; }
/* Пираты: «Да, удалили / Нет, висит» рядом; окно «Что ещё можно» */
.pr-yn { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.pr-more p { margin: 0 0 12px; line-height: 1.5; font-size: 14.5px; }
:root a.small-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--soft, var(--surface-2)); color: var(--text); font: 500 14px/1 var(--font-display); text-decoration: none; }
:root a.small-btn:hover { background: var(--text); color: var(--bg); }
@media (max-width: 720px) { .pr-item > .row.between:has(.pr-yn) { flex-wrap: wrap; } .pr-item .pr-yn { width: 100%; justify-content: flex-start; margin-top: 8px; } }
.pr-more a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
/* ===== Блокнот: Заметки · Идеи · Промты (заметки — как в Simplenote: список слева, текст справа) ===== */
.nb-tabs { margin-bottom: 14px; }
.nb-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.nb-wrap .nb-ed { display: none; }
.nb-wrap.nb-has .nb-list { display: none; }
.nb-wrap.nb-has .nb-ed { display: flex; }
@media (min-width: 900px) {
  .nb-wrap { grid-template-columns: 300px minmax(0, 1fr); }
  .nb-wrap .nb-list, .nb-wrap.nb-has .nb-list { display: flex; position: sticky; top: 12px; max-height: calc(100vh - 150px); }
  .nb-wrap .nb-ed { display: flex; min-height: calc(100vh - 150px); }
  .nb-back { display: none !important; }
}
:root .card.nb-list { display: flex; flex-direction: column; padding: 12px 10px 10px; margin: 0; }
.nb-head { display: flex; gap: 8px; align-items: center; padding: 0 4px; }
:root .nb-head .nb-q { flex: 1; min-width: 0; min-height: 40px; border-radius: 999px; padding: 0 16px; background: var(--soft); border: 0; }
.nb-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 4px 6px; scrollbar-width: none; flex: none; }
.nb-chips::-webkit-scrollbar { display: none; }
:root :is(main, dialog) button.nb-chip { flex: none; min-height: 30px !important; padding: 0 12px !important; border-radius: 999px !important; background: transparent !important; border: 0 !important; color: var(--text-2) !important; font: 500 13px/1 var(--font-body) !important; white-space: nowrap; }
:root :is(main, dialog) button.nb-chip span { color: var(--muted); margin-left: 3px; }
:root :is(main, dialog) button.nb-chip:hover { background: var(--soft) !important; color: var(--text) !important; }
:root :is(main, dialog) button.nb-chip.on { background: var(--text) !important; color: var(--bg) !important; }
:root :is(main, dialog) button.nb-chip.on span { color: inherit; opacity: .7; }
.nb-items { overflow-y: auto; flex: 1; min-height: 0; padding: 2px 0; }
:root main button.nb-item { display: block !important; width: 100%; text-align: left; min-height: 0 !important; padding: 11px 12px !important; margin: 1px 0; border: 0 !important; border-radius: 12px !important; background: transparent !important; color: var(--text) !important; font: inherit !important; }
:root main button.nb-item:hover { background: var(--soft) !important; }
:root main button.nb-item.on { background: var(--soft-2, var(--soft)) !important; }
.nb-it-t { display: flex; align-items: baseline; gap: 8px; }
.nb-it-t b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px/1.35 var(--font-body); }
.nb-it-t small { flex: none; font-size: 12px; color: var(--muted); }
.nb-pin { flex: none; display: inline-grid; color: var(--text-2); } .nb-pin .ic { width: 14px; height: 14px; }
.nb-it-p { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-empty { padding: 14px 12px; margin: 0; }
.nb-foot { display: flex; gap: 16px; justify-content: center; padding: 8px 4px 2px; border-top: 1px solid var(--line); flex: none; }
:root .nb-foot button.link { font: 500 13px/1.3 var(--font-body) !important; color: var(--muted) !important; }
:root .card.nb-ed { flex-direction: column; margin: 0; padding: 12px 22px 14px; }
.nb-bar { display: flex; align-items: center; gap: 2px; margin: 0 -10px 4px; }
.nb-sp { flex: 1; }
:root main button.nb-back { display: inline-flex; align-items: center; gap: 2px; background: transparent !important; border: 0 !important; padding: 0 8px !important; min-height: 36px !important; color: var(--text) !important; font: 500 15px/1 var(--font-display) !important; }
.nb-back .ic { transform: rotate(180deg); width: 18px; height: 18px; }
:root main .nb-bar button.ed-ic { width: 36px; height: 36px; padding: 0 !important; display: inline-grid; place-items: center; border-radius: 50% !important; }
:root main .nb-bar button.ed-ic.on { background: var(--soft) !important; }
:root main .nb-bar button.ed-ic[disabled] { opacity: .35; }
:root main textarea.nb-text { flex: 1; width: 100%; min-height: 55vh; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none; resize: none; padding: 6px 0 !important; font: 400 17px/1.65 var(--font-body); color: var(--text); border-radius: 0 !important; }
.nb-view { flex: 1; min-height: 40vh; font: 400 17px/1.65 var(--font-body); padding: 6px 0; overflow-wrap: anywhere; }
.nb-view p { margin: 0; } .nb-view .nb-gap { height: .8em; }
.nb-view :is(h3, h4, h5) { font-family: var(--font-display); font-weight: 500; margin: .6em 0 .2em; line-height: 1.3; }
.nb-view h3 { font-size: 24px; } .nb-view h4 { font-size: 20px; } .nb-view h5 { font-size: 17px; }
.nb-view :is(ul, ol) { margin: .2em 0; padding-left: 22px; }
.nb-view a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.nb-view ul.nb-checks { list-style: none; padding: 0; }
.nb-checks li { display: flex; gap: 10px; align-items: flex-start; padding: 3px 0; }
:root main button.nb-box { flex: none; width: 20px; height: 20px; min-height: 20px !important; padding: 0 !important; margin-top: 4px; border-radius: 6px !important; border: 1.5px solid var(--muted) !important; background: transparent !important; }
:root main .nb-checks li.on button.nb-box { background: var(--text) !important; border-color: var(--text) !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") !important; background-size: 14px !important; background-position: center !important; background-repeat: no-repeat !important; }
.nb-checks li.on span { color: var(--muted); text-decoration: line-through; }
.nb-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.nb-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.nb-tg { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; color: var(--text-2); }
:root main .nb-tg button { min-height: 0 !important; padding: 0 6px !important; background: transparent !important; border: 0 !important; color: var(--muted) !important; font: 400 15px/1 var(--font-body) !important; }
:root main input.nb-tagin { width: 90px; min-height: 28px; padding: 0 4px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 13.5px; }
.nb-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
:root main select.nb-book { width: auto; max-width: 220px; min-height: 30px; padding: 0 26px 0 10px; border: 0; background-color: var(--soft); border-radius: 999px; font-size: 13px; }
.nb-blank { margin: auto; text-align: center; }
.nb-trash { padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.nb-steps { padding-left: 20px; line-height: 1.5; } .nb-steps li { margin: 4px 0; }
/* промты */
.nb-prhead { gap: 14px; margin-bottom: 14px; align-items: flex-end; flex-wrap: wrap; }
:root .card.nb-prlist { padding: 12px 10px 14px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 6px 4px 0; }
.pr-card { padding: 12px 14px; border-radius: 16px; background: var(--soft); cursor: pointer; transition: background .15s; }
.pr-card:hover { background: var(--soft-2, var(--soft)); }
.pr-card .row b { font: 600 15px/1.35 var(--font-body); }
:root main .pr-card button.ed-ic { width: 32px; height: 32px; min-width: 32px; padding: 0 !important; display: inline-grid; place-items: center; border-radius: 50% !important; margin: -6px -6px 0 0; }
.pr-prev { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.pr-found b { display: block; margin-bottom: 4px; } .pr-f { padding: 8px 0; border-top: 1px solid var(--line); gap: 10px; }
.pr-f .sub { display: block; font-size: 13px; color: var(--muted); }
textarea.pr-text { min-height: 220px; font-size: 15px; line-height: 1.5; }
.pr-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
:root dialog .pr-vars button.nb-chip { background: var(--soft) !important; color: var(--text-2) !important; }
.pr-pick { padding: 12px 0; border-top: 1px solid var(--line); } .pr-pick:first-child { border-top: 0; padding-top: 0; }
.pr-pick .pr-prev { margin-bottom: 8px; }
.nb-pin { align-self: center; }
.nb-view > p:first-child { font: 600 20px/1.4 var(--font-display); margin-bottom: 4px; }
@media (max-width: 899px) { :root .nb-wrap.nb-has .card.nb-list { display: none; } :root .card.nb-ed { min-height: calc(100vh - 230px); } }
.nb-back .ic { transform: none; }
/* галочка чек-листа — цветом фона, видна и в тёмной теме */
:root main .nb-checks li.on button.nb-box { background-image: none !important; color: var(--bg) !important; display: inline-grid; place-items: center; }
:root main .nb-checks button.nb-box svg { display: none; } :root main .nb-checks li.on button.nb-box svg { display: block; }
/* ===== Директ: «Диагноз кампании» ===== */
.dg-head { display: flex; gap: 16px; align-items: center; margin: 4px 0 6px; }
.dg-score { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 600 24px/1 var(--font-num, inherit); background: var(--soft); color: var(--text); border: 3px solid var(--line); }
.dg-score.dg-good { border-color: var(--good); } .dg-score.dg-ok { border-color: #c9a227; } .dg-score.dg-weak { border-color: #d98a3a; } .dg-score.dg-bad { border-color: var(--bad, #c0392b); }
.dg-score.dg-wait { color: var(--muted); }
.dg-score.dg-sm { width: 38px; height: 38px; font-size: 15px; border-width: 2.5px; }
.dg-grade { font: 500 20px/1.3 var(--font-display); }
.card h3 { margin-top: 22px; }
.dg-funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.dg-fs { background: var(--soft); border-radius: var(--r-tile, 14px); padding: 10px 12px; }
.dg-fs b { display: block; font: 600 20px/1.3 var(--font-num, inherit); margin: 2px 0; }
.dg-neck { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-tile, 14px); background: var(--soft); border-left: 3px solid var(--text); }
.dg-neck.dg-none { border-left-color: var(--good); } .dg-neck.dg-data { border-left-color: var(--muted); }
.dg-chart { display: block; margin-top: 4px; overflow: visible; }
.dg-chart .dg-lv { stroke: var(--good); stroke-dasharray: 4 4; stroke-width: 1.2; }
.dg-chart .dg-mk { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.dg-chart .dg-dot { fill: transparent; } .dg-chart .dg-dot:hover { fill: var(--soft-2, var(--soft)); }
.dg-grp { margin-top: 12px; }
.dg-gh { font: 500 15px/1.3 var(--font-display); margin-bottom: 4px; }
.dg-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr); gap: 4px 14px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.dg-rl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.dg-bar { height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; } .dg-bar i { display: block; height: 100%; background: var(--text-2); border-radius: 4px; }
.dg-rv { display: grid; grid-template-columns: 1fr .9fr .8fr 1.1fr; gap: 8px; white-space: nowrap; }
.dg-rv span:last-child { text-align: right; }
@media (max-width: 600px) { .dg-row { grid-template-columns: 1fr; } .dg-rv { grid-template-columns: repeat(4, auto); justify-content: space-between; } }
a.dg-strip { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; padding: 8px 12px; border-radius: var(--r-tile, 14px); background: var(--soft); color: var(--text); text-decoration: none; }
a.dg-strip:hover { background: var(--soft-2, var(--soft)); }
a.dg-strip .dg-more { margin-left: auto; white-space: nowrap; color: var(--text-2); }
.dg-plan b { font-weight: 600; }
:root .tiles.dg-econ { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { :root .tiles.dg-econ { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card .dg-h, .dg-wrap h3 { font: 500 17px/1.3 var(--font-display); margin: 24px 0 10px; }
@media (max-width: 600px) { .dg-rv { display: flex !important; flex-wrap: wrap; gap: 2px 12px; justify-content: flex-start !important; } .dg-rv span:last-child { margin-left: auto; } }

/* «Все кампании — кто работает лучше» и «Тест объявлений» (Директ) */
.cmp-row.cmp-go { cursor: pointer; }
.cmp-row.cmp-go:hover .cmp-n { text-decoration: underline; text-underline-offset: 3px; }
.cmp-r { display: flex; align-items: center; gap: 10px; text-align: right; white-space: nowrap; flex: none; }
.dg-guide { padding-left: 20px; margin: 0 0 10px; }
.dg-guide li { margin: 0 0 10px; line-height: 1.55; }

/* «Рынок» по разделам (19.11.2026): площадка — тонкой линией, разделы — мягкими кнопками-словами под ней */
.mk-page .mk-ptabs { margin: 12px 0 8px; }
.mk-stabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 16px; }
main .mk-stabs button { min-height: 32px; padding: 5px 13px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font: 500 14px/1.2 var(--font-display); box-shadow: none; }
main .mk-stabs button:hover { background: var(--soft); }
main .mk-stabs button.on { background: var(--soft); color: var(--text); }
@media (max-width: 600px) { .mk-stabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -4px; margin-right: -4px; } .mk-stabs::-webkit-scrollbar { display: none; } main .mk-stabs button { flex: none; } }
.mk-how { margin: 4px 0 10px; line-height: 1.5; }
.mk-rv-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; color: var(--text-2); }
.mk-ll { display: block; }
.mk-lg .small-btn { white-space: nowrap; }
@media (max-width: 600px) { .item.mk-rv > .row.between:first-child, .item.mk-lg > .row.between:first-child { flex-wrap: wrap; } .item.mk-rv > .row.between:first-child > div:first-child, .item.mk-lg > .row.between:first-child > div:first-child { flex: 1 1 100%; } .mk-rv-r { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; } }

/* Пульт: цена цели и «когда на покупки» (19.11.2026) — полоска и шкала, без стены текста */
.pult-gp { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.gp-l { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.gp-l b { font: 600 14px/1.3 var(--font-num, inherit); color: var(--text); text-align: right; white-space: nowrap; }
.gp-l b.down { color: var(--bad, #b3261e); } .gp-l b.up { color: var(--good); }
.gp-bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.gp-bar i { display: block; height: 100%; border-radius: 99px; background: var(--text-2); }
.gp-bar.ok i { background: var(--good); }
.gp-s { font-size: 12.5px; color: var(--text-2); min-height: 0; }
.gp-s:empty { display: none; }
.gp-sc { position: relative; height: 52px; margin: 2px 8px 4px; }
.gp-sc::before { content: ''; position: absolute; left: 0; right: 0; top: 22px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--bad, #b3261e) 22%, transparent); }
.gp-ok { position: absolute; left: 0; top: 22px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--good) 45%, transparent); }
.gp-m { position: absolute; top: 0; height: 52px; transform: translateX(-50%); }
.gp-m i { position: absolute; left: 50%; transform: translateX(-50%); display: block; border-radius: 50%; }
.gp-m em { position: absolute; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11.5px; line-height: 1; color: var(--text-2); white-space: nowrap; }
.gp-m.rec i { top: 20px; width: 10px; height: 10px; background: var(--good); }
.gp-m.rec em { top: 2px; color: var(--good); }
.gp-m.max i { top: 16px; width: 2px; height: 18px; border-radius: 2px; background: var(--muted); }
.gp-m.max em { top: 38px; }
.gp-m.now i { top: 19px; width: 12px; height: 12px; background: var(--text); box-shadow: 0 0 0 3px var(--surface); }
.gp-m.now em { top: 38px; color: var(--text); font-weight: 600; }
.gp-why { justify-self: start; margin-top: 2px; }

/* Рынок → «Для вас»: советы строками с цветной меткой и карта тропов (19.11.2026) */
.mk-tips { display: grid; gap: 12px; }
.mk-tip { display: grid; grid-template-columns: 8px 1fr; gap: 12px; align-items: stretch; line-height: 1.5; }
.mk-tip > i { border-radius: 99px; background: var(--line); }
.mk-tip.t-up > i { background: var(--good); } .mk-tip.t-down > i { background: var(--bad, #b3261e); }
.mk-q { display: block; margin: 10px 0 0; overflow: visible; }
.mk-q-niche { fill: color-mix(in srgb, var(--good) 10%, transparent); }
.mk-q-ax { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.mk-q-c { fill: var(--muted); font-size: 11.5px; }
.mk-q-a { fill: var(--muted); font-size: 11px; }
circle.mk-q-d { cursor: pointer; fill: color-mix(in srgb, var(--text-2) 28%, transparent); stroke: var(--surface); stroke-width: 1.5; }
circle.mk-q-d.me { fill: var(--text); }
circle.mk-q-d:hover { fill: var(--text-2); }
.mk-q-l { fill: var(--text-2); font-size: 12px; pointer-events: none; }
.mk-q-l.me { fill: var(--text); font-weight: 600; }

/* Блокнот: окно «Экспорт заметок» — кнопки столбиком */
.nb-exp { display: grid; gap: 8px; justify-items: stretch; }
.nb-exp .link { justify-self: start; margin-top: 2px; }

/* Блокнот: фильтр заметок одной тихой строкой (вместо ряда тегов) */
.nb-filter { display: block; padding: 8px 4px 4px; flex: none; }
:root .nb-filter select { width: auto; max-width: 100%; min-height: 30px; padding: 2px 22px 2px 2px; border: 0 !important; background-color: transparent !important; box-shadow: none !important;
  font: 500 13.5px/1.2 var(--font-body); color: var(--text-2); cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
  background-position: calc(100% - 9px) 55%, calc(100% - 5px) 55%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
:root .nb-filter select:hover, :root .nb-filter select:focus { color: var(--text); outline: none; }
