/* Тот же вид, что у PDF: Onest, тёмная плашка, палитра из src/стиль.css. */
@font-face { font-family: "Onest"; font-weight: 100 449; src: url("/fonts/Onest-400.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Onest"; font-weight: 450 549; src: url("/fonts/Onest-500.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Onest"; font-weight: 550 649; src: url("/fonts/Onest-600.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Onest"; font-weight: 650 749; src: url("/fonts/Onest-700.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Onest"; font-weight: 750 900; src: url("/fonts/Onest-800.ttf") format("truetype"); font-display: swap; }

:root {
  --paper: #f6f4f0;
  --card: #ffffff;
  --ink: #15171c;
  --ink-2: #3a3e47;
  --muted: #7a7f89;
  --line: #e4e0d8;
  --plate: #121419;
  --plate-2: #1c1f26;
  --red: #e3170a;
  --amber: #b26b00;
  --amber-bg: #fbf3e4;
  --green: #1d7a46;
  --green-bg: #e8f4ec;
  --r: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 15px/1.45 "Onest", system-ui, sans-serif; color: var(--ink); background: var(--paper);
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 30px; line-height: 1.1; font-weight: 750; letter-spacing: -0.02em; }
h2 { font-size: 19px; font-weight: 700; margin: 36px 0 12px; }
h3 { font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }
small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- шапка ---------- */
header.top {
  background: var(--plate); color: #c9ccd3;
  display: flex; align-items: center; gap: 28px;
  padding: 0 32px; height: 64px; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; }
.brand img { height: 22px; width: auto; display: block; }
.brand span { color: #8f95a1; font-size: 13px; font-weight: 500; padding-left: 14px; border-left: 1px solid #343843; }
header nav { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
header nav a {
  text-decoration: none; padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  color: #a9aeb8; font-weight: 500;
}
header nav a:hover { color: #fff; background: var(--plate-2); }
header nav a.on { color: #fff; background: var(--plate-2); box-shadow: inset 0 -2px 0 var(--red); }
.cnt { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; text-align: center; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13.5px; flex: none; }
.who form { display: inline; }
button.link { background: none; border: 0; color: #8f95a1; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: #fff; }

main { max-width: 1320px; margin: 0 auto; padding: 32px 32px 64px; }

/* ---------- кнопки, поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: #c9c3b6; }
.btn.primary { background: var(--plate); border-color: var(--plate); color: #fff; }
.btn.primary:hover { background: #262a33; }
.btn.small { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 16px; }
.btn:disabled { opacity: .5; cursor: wait; }

input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  padding: 9px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(21, 23, 28, .07); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--plate); }

.err { color: var(--red); font-weight: 500; margin: 8px 0; }
.okmsg { background: var(--green-bg); color: var(--green); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.warn { background: var(--amber-bg); color: #6b4a10; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.empty { padding: 40px 0; color: var(--muted); }
.foot { margin-top: 28px; color: var(--muted); font-size: 13px; max-width: 900px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st.ok { background: var(--green-bg); color: var(--green); }
.st.wait { background: var(--amber-bg); color: var(--amber); border-color: #efdcb8; }
.st.back { background: #fdeceb; color: #b3140a; }

.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head-row p { margin-top: 6px; }

/* ---------- вход ---------- */
body.login { display: grid; place-items: center; padding: 16px; background: var(--paper); }
.login-card { width: 100%; max-width: 380px; border-radius: 18px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.login-head { background: var(--plate); padding: 26px 28px; }
.login-head img { height: 28px; width: auto; display: block; }
.login-body { padding: 26px 28px 30px; display: grid; gap: 14px; }
.login-body h1 { font-size: 24px; }
.login-body label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.login-body .btn { margin-top: 6px; padding: 12px; }

/* ---------- календарь ---------- */
.events { list-style: none; display: grid; gap: 10px; }
.ev {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 20px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px;
}
.ev.hot { border-color: #f1b9b4; box-shadow: inset 4px 0 0 var(--red); }
.day { text-align: center; border-right: 1px solid var(--line); padding-right: 16px; }
.day b { display: block; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.day span { display: block; color: var(--red); font-weight: 600; font-size: 13px; margin-top: 2px; }
.day i { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.day.word span { color: var(--ink-2); font-size: 14px; font-weight: 650; }
.ev-title { font-weight: 700; font-size: 17px; }
.season { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12.5px; background: var(--paper); color: var(--ink-2); padding: 3px 9px; border-radius: 6px; }
.ev-side { display: flex; align-items: center; gap: 14px; justify-content: flex-end; flex-wrap: wrap; }
.ev-side .muted { font-size: 13px; }
.ev-side .btn { margin-left: auto; }
.tag { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.tag.hot { background: var(--red); color: #fff; }

/* ---------- сборка ---------- */
.build { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 28px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: grid; gap: 14px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.panel h1 { font-size: 24px; }
.step { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); grid-template-columns: 22px 1fr; align-items: center; }
.step > span { width: 22px; height: 22px; border-radius: 50%; background: var(--plate); color: #fff; font-size: 12px; display: grid; place-items: center; }
.step > select, .step > .formats, .step > input { grid-column: 1 / -1; }
.step.sub { grid-template-columns: auto 1fr; font-weight: 500; }
.step.sub > input { grid-column: 1 / -1; }
.step i { font-style: normal; color: var(--muted); font-weight: 400; }
.formats { display: grid; gap: 6px; }
.fmt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; font-weight: 500; color: var(--ink); }
.fmt:hover { border-color: #c9c3b6; }
.fmt input { width: auto; flex: none; accent-color: var(--red); }
.fmt .nm { flex: 1; }
.fmt .pr { color: var(--muted); font-size: 13px; white-space: nowrap; }
.fmt .ok { display: block; font-size: 11.5px; color: var(--green); font-weight: 600; }
.fmt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.edits { border-top: 1px solid var(--line); padding-top: 12px; }
.edits summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
.edits summary::before { content: "+"; width: 20px; height: 20px; border-radius: 6px; background: var(--paper); display: grid; place-items: center; font-weight: 700; }
.edits[open] summary::before { content: "−"; }
.edits summary b { font-size: 12px; background: var(--amber-bg); color: var(--amber); border-radius: 10px; padding: 1px 8px; }
.edits summary b:empty { display: none; }
.promo-list { list-style: none; display: grid; gap: 6px; }
.promo-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; background: var(--paper); border-radius: 8px; padding: 8px 10px; }
.promo-list li span { flex: 1; }
.promo-list li.off span { text-decoration: line-through; color: var(--muted); }
.promo-list li.new { background: var(--green-bg); }
.promo-list button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; white-space: nowrap; }
.promo-list button:hover { color: var(--red); }
.add-row { display: flex; gap: 8px; margin-top: 8px; }
.checks { display: grid; gap: 6px; }
.checks label { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.checks input { width: auto; }
.price-edit { display: flex; align-items: center; gap: 8px; }
.price-edit input { max-width: 160px; font-weight: 650; font-size: 17px; }

.sum { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 4px; }
.sum .big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.sum .lines { font-size: 13px; color: var(--ink-2); }
.sum .why { margin-top: 4px; }

.preview { min-width: 0; display: grid; gap: 18px; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 650; margin-bottom: 8px; }
.pv-head .muted { font-weight: 400; font-size: 13px; }
.pv-frame { position: relative; background: var(--plate-2); border-radius: var(--r); overflow: hidden; min-height: 240px; }
.pv-frame iframe { border: 0; width: 1920px; transform-origin: 0 0; display: block; background: var(--paper); }
.pv-load { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(18, 20, 25, .55); color: #fff; font-weight: 500; pointer-events: none; }
.pv-frame.busy .pv-load { display: flex; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.pv-err { position: absolute; inset: 0; background: var(--card); padding: 24px; color: var(--red); font-weight: 500; }
.letter textarea { font-size: 14px; line-height: 1.5; resize: vertical; background: var(--card); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr:last-child td { border-bottom: 0; }
.list td a { text-decoration: none; font-weight: 600; }
.list td a:hover { text-decoration: underline; }
.list .num { white-space: nowrap; }
.r { text-align: right; }
.prices .list td { vertical-align: middle; }
.decision { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.c { text-align: center; }
.list td.r input { max-width: 130px; text-align: right; font-weight: 600; }
.form-foot { display: flex; gap: 16px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

/* ---------- карточка КП и очередь ---------- */
.kp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { font-weight: 500; }
.edits-list { padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
pre { font-size: 12px; background: var(--paper); padding: 12px; border-radius: 8px; overflow: auto; margin-top: 8px; }
details summary { cursor: pointer; margin-top: 16px; color: var(--ink-2); font-size: 13.5px; }
.decide { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0 4px; }
.decide form { display: flex; gap: 8px; align-items: center; }
.decide .ret input { width: 240px; padding: 6px 10px; font-size: 13.5px; }
.queue { list-style: none; display: grid; gap: 12px; }
.q { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: start; }
.q-main a { text-decoration: none; }
.q-main a:hover { text-decoration: underline; }
.q .why { color: var(--amber); }
.q-price { text-align: right; display: grid; gap: 4px; justify-items: end; }
.q-price b { font-size: 22px; font-weight: 750; }
.q .decide { grid-column: 1 / -1; margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- узкий экран ---------- */
@media (max-width: 1000px) {
  .build { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .kp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  header.top { position: static; padding: 0 16px; height: auto; flex-wrap: wrap; gap: 6px 14px; padding-top: 10px; }
  .brand span { display: none; }
  header nav { order: 3; flex-basis: 100%; margin: 0 -8px; padding-bottom: 6px; }
  .who { margin-left: auto; }
  main { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
  .ev { grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 14px; }
  .day { padding-right: 10px; }
  .day b { font-size: 26px; }
  .ev-side { grid-column: 1 / -1; justify-content: space-between; }
  .q { grid-template-columns: 1fr; }
  .q-price { justify-items: start; text-align: left; }
  .decide .ret input { width: 100%; }
  .decide form.ret { flex: 1; }
  .list th, .list td { padding: 10px 12px; }
  .prices thead { display: none; }
  .prices table, .prices tbody { display: block; }
  .prices tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
  .prices tr:last-child { border-bottom: 0; }
  .prices .list td { display: block; padding: 0; border: 0; text-align: left; }
  .prices td:nth-child(1), .prices td:nth-child(2), .prices td:nth-child(4) { grid-column: 1 / -1; }
  .prices td:nth-child(2) { font-size: 13px; }
  .prices td:nth-child(2)::before { content: "В прошлых КП: "; }
  .prices td:nth-child(3) { grid-row: 4; }
  .prices td:nth-child(5) { grid-row: 4; grid-column: 2; display: flex; gap: 8px; align-items: center; font-size: 13px; }
  .prices td:nth-child(5)::before { content: "утвердить"; color: var(--muted); }
  .prices td.r input { max-width: none; text-align: left; }
}

/* Тексты КП, индикатор обновления, каталог руководителя. */
.ed textarea { width: 100%; font-size: 14px; line-height: 1.5; resize: vertical; background: var(--card); }
.ed h3 + textarea { margin-top: 2px; }
.upd { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--amber); }
.upd::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-right: 6px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.pv-frame.soft .pv-load { display: none; }
.pv-frame.soft iframe { opacity: .55; transition: opacity .15s; }
.sum .lines .tot { margin-top: 4px; font-weight: 700; color: var(--ink); }
tr.miss td { background: var(--amber-bg); }
.search { width: 100%; max-width: 480px; margin: 4px 0 10px; }
.prices h2 { margin-top: 26px; }
.disc { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.disc h3 { margin: 0; }
.disc-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.disc-row select { width: auto; }
.disc-row .btn.on { background: var(--plate); color: #fff; border-color: var(--plate); }
.disc .price-edit span:first-child { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }

/* Оформление PDF на сборке и экран «Темы». */
.look { grid-template-columns: 1fr; gap: 6px; }
.look .lbl { font-weight: 600; }
.look .hint { margin-top: 0; }
.themes { list-style: none; display: grid; gap: 12px; }
.theme { display: grid; gap: 8px; }
.th-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 17px; }
.tv { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.tv-name { min-width: 64px; font-weight: 600; font-size: 13.5px; }
.tv-name:empty { display: none; }
.sws { display: flex; gap: 4px; }
.sw { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .12); display: inline-block; }
.tv .bad { flex-basis: 100%; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.theme-ed { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 28px; align-items: start; margin-bottom: 28px; scroll-margin-top: 84px; }
.theme-ed .panel h2 { margin: 0; font-size: 19px; }
.te-colors { display: grid; gap: 6px; }
.te-c { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.te-c input[type=color] { width: 40px; height: 30px; padding: 2px; border-radius: 8px; cursor: pointer; }
.te-c code { font-size: 12px; color: var(--muted); }
.te-check .err ul { padding-left: 18px; margin-top: 6px; font-weight: 400; font-size: 13.5px; }
.te-check details summary { margin-top: 4px; }
.pairs { font-size: 13px; }
.pairs td, .pairs th { padding: 6px 8px; }
.te-name { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
@media (max-width: 1000px) { .theme-ed { grid-template-columns: 1fr; } }

/* ---------- кому слать и клиенты ---------- */
.nil { color: var(--muted); font-style: italic; font-weight: 400; }
.src { display: block; color: var(--muted); font-size: 12px; }
.back { display: inline-block; font-size: 13.5px; color: var(--ink-2); text-decoration: none; margin-bottom: 6px; }
.back:hover { text-decoration: underline; }
.head-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.send-ev { grid-template-columns: 96px 1fr auto; align-items: start; }
.sph { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.sph li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.stats { display: flex; gap: 8px; }
.stat { min-width: 84px; text-align: center; background: var(--paper); border-radius: 10px; padding: 8px 10px; }
.stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.hot { background: var(--red); color: #fff; }
.stat.hot span { color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 13.5px; color: var(--ink-2); }
.tab.on { background: var(--plate); color: #fff; border-color: var(--plate); }
.tab b { margin-left: 4px; }
.tab small { display: inline; margin: 0 0 0 6px; font-size: 12px; color: var(--muted); }
.tab.on small { color: #b9bdc6; }
.send-legend { list-style: none; display: grid; gap: 2px; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); max-width: 900px; }
.send-legend b { color: var(--ink); }
.stats-col { display: grid; gap: 4px; justify-items: end; align-content: start; }
.stats-note { margin: 0; font-size: 12px; }
.send-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; padding: 14px 18px; }
.send-bar label { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.send-bar select { max-width: 100%; }
.send-bar .btn { margin-left: auto; }
.list td small { display: block; }
.letters { list-style: none; display: grid; gap: 12px; }
.letter-item textarea { width: 100%; font-size: 14px; line-height: 1.5; margin-top: 10px; background: var(--paper); }
.li-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.li-act form { display: inline; }
.li-act small { margin-left: 4px; }
.client-form h3 { margin-top: 18px; }
.client-form input[name=nosend_why] { width: 100%; margin-top: 8px; }
.sph-checks { grid-template-columns: 1fr; }
.sph-group summary { margin-top: 4px; font-weight: 600; color: var(--ink); }
.sph-group summary small { color: var(--ink-2); font-weight: 500; }
.sph-group label { margin: 6px 0 0 14px; }
.facts.wide { grid-template-columns: 150px 1fr; }
.facts dd { overflow-wrap: anywhere; }
.kp-grid > div > .card + .card { margin-top: 20px; }
.hist { margin-top: 20px; }
.hist h2 { margin: 6px 0 12px; }
.hist .table-wrap + h2 { margin-top: 22px; }
.card h2 { font-size: 18px; margin: 0 0 12px; }
@media (max-width: 720px) {
  .send-ev { grid-template-columns: 1fr; }
  .send-ev .day { border-right: 0; text-align: left; display: flex; gap: 8px; align-items: baseline; padding: 0; }
  .stats { flex-wrap: wrap; }
  .facts, .facts.wide { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 8px; }
}
.warn-src { color: var(--amber); }
/* ---------- идеи для клиента ---------- */
.head-act { display: flex; gap: 8px; flex-wrap: wrap; }
.ideas { display: grid; grid-template-columns: 1fr minmax(360px, 520px); gap: 24px; align-items: start; }
.idea-cards { list-style: none; display: grid; gap: 12px; }
.idea-card { display: grid; gap: 8px; }
.idea-card.off { opacity: .6; }
.ic-head { display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.ic-head b { flex: 1; font-size: 16px; }
.ic-price { font-weight: 700; white-space: nowrap; text-align: right; }
.ic-why { font-size: 12.5px; }
.ic-short { font-size: 14px; color: var(--ink-2); }
.ic-steps { margin-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 2px; }
.ic-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; align-items: center; }
.ic-lbl { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ic-lbl i { font-style: normal; font-weight: 400; color: var(--muted); }
.ic-fit { width: 100%; font-size: 14px; line-height: 1.45; }
.ic-reset { justify-self: start; }
.ideas-panel { position: sticky; top: 84px; }
.ideas-panel input { width: 100%; }
@media (max-width: 960px) { .ideas { grid-template-columns: 1fr; } .ideas-panel { position: static; max-height: none; } }
/* ---------- база компаний, карточки сфер, закон ---------- */
.law ul { padding-left: 18px; margin: 6px 0; display: grid; gap: 4px; }
.law p { margin-top: 6px; }
.law small { color: #6b4a10; margin-top: 6px; }
.law details summary { margin-top: 6px; color: #6b4a10; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; align-items: end; margin-bottom: 14px; }
.filters label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.filters label.wide { grid-column: span 2; }
.filters label.chk { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }
.filters label.chk input { width: auto; }
.f-act { display: flex; gap: 8px; align-items: center; }
.found { margin: 4px 0 10px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
.add-form { display: inline-flex; gap: 6px; align-items: center; }
.add-form select { width: auto; max-width: 160px; padding: 5px 28px 5px 8px; font-size: 13px; }
.find-row { display: flex; gap: 8px; max-width: 560px; margin-top: 10px; }
.list.fin { font-size: 13.5px; }
.list.fin td, .list.fin th { padding: 6px 10px; }
.sphere-card > summary { margin-top: 0; font-size: 15px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; color: var(--ink); }
.sphere-card .facts dd { font-weight: 400; }
.months { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ms { background: var(--paper); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; }
.ms b { display: block; text-transform: capitalize; }
.ms span { display: block; font-weight: 600; }
.ms small { font-size: 11.5px; }
.ms.hot { background: #fdeceb; }
.ms.hot span { color: #b3140a; }
.ms.up { background: var(--amber-bg); }
.ms.down span { color: var(--muted); }
.examples { list-style: none; display: grid; gap: 10px; }
.examples li { background: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.examples p { margin-top: 4px; }
.law-art { border-top: 1px solid var(--line); padding-top: 6px; }
.law-art summary { margin-top: 4px; }
.law-art blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--line); font-size: 13.5px; color: var(--ink-2); background: var(--paper); border-radius: 0 8px 8px 0; }
.new-co { margin-top: 28px; }
@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr; }
  .filters label.wide { grid-column: auto; }
}

/* ---------- Мегамозг ---------- */
.mm { max-width: 860px; margin: 0 auto; }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.mm-title { display: flex; align-items: center; gap: 14px; }
.mm-title p { margin-top: 2px; font-size: 14px; }
.mm-logo, .mm-av {
  display: inline-grid; place-items: center; flex: none; border-radius: 12px; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 30% 25%, #ff5a4a, var(--red) 55%, #9e0f06);
  box-shadow: 0 6px 18px rgba(227, 23, 10, .25);
}
.mm-logo { width: 46px; height: 46px; font-size: 22px; }
.mm-av { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; box-shadow: none; }
.mm-tools { display: flex; gap: 8px; align-items: center; }
.mm-tools select { width: auto; max-width: 260px; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
.mm-stub { background: var(--amber-bg); color: #6b4a10; border: 1px dashed #e3c58f; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.mm-from { background: #fdeceb; color: #7d1208; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.mm-from a { font-weight: 600; }

.mm-feed { display: grid; gap: 16px; padding-bottom: 110px; }
.mm-msg { display: flex; gap: 10px; align-items: flex-start; animation: mm-in .25s ease-out; }
.mm-msg.me { justify-content: flex-end; }
.mm-body { min-width: 0; flex: 1; display: grid; gap: 10px; justify-items: start; }
.mm-msg.me .mm-body { justify-items: end; }
.mm-bubble { background: var(--card); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 10px 14px; max-width: 640px; overflow-wrap: anywhere; }
.mm-msg.me .mm-bubble { background: var(--plate); color: #fff; border-color: var(--plate); border-radius: 16px 4px 16px 16px; }
.mm-bubble small { color: inherit; opacity: .7; }
.mm-bad { background: #fdeceb; border-color: #f1b9b4; color: #7d1208; }
.mm-err .mm-bubble { background: #fdeceb; color: #7d1208; }
@keyframes mm-in { from { opacity: 0; transform: translateY(6px); } }
.mm-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.mm-tasks { display: grid; gap: 8px; width: 100%; max-width: 640px; }
.mm-task { display: grid; gap: 2px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.mm-task:hover:not(:disabled) { border-color: var(--red); transform: translateY(-1px); }
.mm-task small { margin: 0; }
.mm-task.off { display: flex; justify-content: space-between; align-items: center; cursor: default; color: var(--muted); background: transparent; border-style: dashed; }
.mm-task:disabled:not(.off) { cursor: default; opacity: .65; }

.mm-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; width: 100%; }
.mm-cand { display: grid; gap: 4px; align-content: start; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mm-cand b { font-size: 14px; line-height: 1.3; }
.mm-cand .muted { font-size: 13px; }
.mm-cand:hover:not(:disabled) { border-color: var(--ink-2); box-shadow: 0 4px 14px rgba(21, 23, 28, .07); }
.mm-cand.on { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.mm-cand.dim { opacity: .45; }
.mm-cand:disabled { cursor: default; }
.mm-cand-row { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.mm-lv { font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--paper); }
.mm-lv.top { background: var(--green-bg); color: var(--green); }
.mm-lv.hi { background: #eef6e8; color: #3d6b1f; }
.mm-lv.low { color: var(--muted); }

.mm-run, .mm-result { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.mm-run-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mm-run-h b { font-size: 16px; }
.mm-run-st { margin-left: auto; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.mm-run.done .mm-run-st { color: var(--green); font-weight: 600; }
.mm-ex { background: var(--amber-bg); color: var(--amber); }
.mm-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--red); animation: sp .8s linear infinite; }
.mm-steps { list-style: none; margin-top: 14px; display: grid; }
.mm-step { display: grid; grid-template-columns: 22px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.mm-step:last-child { padding-bottom: 0; }
.mm-step::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.mm-step:last-child::before { display: none; }
.mm-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); position: relative; z-index: 1; display: grid; place-items: center; }
.mm-step.ok .mm-dot { background: var(--green); border-color: var(--green); }
.mm-step.ok .mm-dot::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translate(0, -1px) rotate(45deg); }
.mm-step.run .mm-dot { border-color: var(--red); }
.mm-step.run .mm-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.mm-step.bad .mm-dot { background: var(--red); border-color: var(--red); }
.mm-step.bad .mm-dot::after { content: "!"; color: #fff; font-weight: 800; font-size: 12px; }
.mm-step-h { font-weight: 650; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mm-st { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mm-step.run .mm-st { color: var(--red); }
.mm-step .muted { font-size: 13.5px; }
.mm-out { margin-top: 8px; background: var(--paper); border-left: 3px solid var(--red); border-radius: 0 10px 10px 0; padding: 8px 12px; font-size: 13.5px; display: grid; gap: 2px; animation: mm-in .25s ease-out; }
.mm-out b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }

.mm-result { display: grid; gap: 12px; }
.mm-zs { display: grid; gap: 10px; }
.mm-z { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; transition: border-color .15s, background .15s; }
.mm-z.sel { border-color: #c9c3b6; background: #fffdf9; }
.mm-z-top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.mm-n { width: 30px; height: 30px; border-radius: 9px; background: var(--plate); color: #fff; display: grid; place-items: center; font-weight: 750; }
.mm-z.sel .mm-n { background: var(--red); }
h3.mm-hook { margin: 4px 0 0; font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.mm-score { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--green-bg); color: var(--green); }
.mm-z-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 13.5px; }
.mm-z-row span { color: var(--muted); }
.mm-z-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.mm-pick { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.mm-sum { font-size: 15px; }
.mm-z-btns { margin-left: auto; display: flex; gap: 6px; }
.mm-edit { display: grid; gap: 8px; justify-items: start; }
.mm-edit textarea { resize: vertical; font-size: 14px; }
.mm-total { font-weight: 650; }
.mm-ask { font-weight: 650; font-size: 16px; }
.mm-points summary, .mm-old summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.mm-points ul, .mm-old ol { margin: 8px 0 0 20px; font-size: 13.5px; display: grid; gap: 4px; }
.mm-old { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; color: var(--muted); width: 100%; }

.mm-input {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 12px 0 16px;
  background: linear-gradient(to bottom, rgba(246, 244, 240, 0), var(--paper) 30%);
}
.mm-input textarea { resize: none; min-height: 46px; max-height: 160px; border-radius: 14px; padding: 12px 14px; box-shadow: 0 4px 18px rgba(21, 23, 28, .06); }
.mm-input .btn { height: 46px; border-radius: 14px; }

@media (max-width: 720px) {
  .mm-av { display: none; }
  .mm-bubble { max-width: 100%; }
  .mm-cands { grid-template-columns: 1fr; }
  .mm-run, .mm-result { padding: 14px; }
  .mm-z-row { grid-template-columns: 1fr; gap: 0; }
  .mm-z-btns { margin-left: 0; }
  .mm-tools { width: 100%; }
  .mm-tools select { flex: 1; max-width: none; }
  .mm-input .btn { padding: 0 14px; }
}
.mm-z-name { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chip.main { background: var(--plate); color: #fff; }
.chip.pv { background: #fdeceb; color: #7d1208; }
.mm-warn { margin: 0 0 0 18px; font-size: 13px; color: var(--amber); display: grid; gap: 2px; }

/* Фильтры календаря — одна строка компактных «таблеток», как переключатели «Кому слать». */
.cal-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 16px; }
.cal-filter > span:first-child { font-size: 13px; margin-right: 4px; }
.cal-filter select { width: auto; max-width: 240px; padding: 6px 30px 6px 12px; border-radius: 999px; font-size: 13.5px;
  color: var(--ink-2); background-color: var(--card); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; cursor: pointer; }
.cal-filter select.on { border-color: var(--plate); color: var(--ink); font-weight: 600; }
.cal-filter #cf-count { font-size: 13px; margin-left: 6px; }
.chip.kind { background: var(--ink); color: var(--paper); }
.ev[hidden] { display: none; }
.tag.wait { background: var(--amber-bg); color: var(--amber); }

/* Мегамозг v2: вопросы, сегмент, готовность, картинка, исход */
.mm-q-n { font-size: 12px; margin: 4px 0 0 2px; }
.mm-pic { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; margin: 8px 0 10px; }
.mm-ready { margin-top: 8px; font-size: 13px; }
.mm-ready summary { cursor: pointer; color: var(--muted, #666); }
.mm-ready ul { list-style: none; padding: 6px 0 0; margin: 0; }
.mm-ready li { padding: 2px 0; overflow-wrap: anywhere; }
.mm-ready li b { display: inline-block; min-width: 34px; font-size: 11px; text-transform: uppercase; }
.mm-ready li.ok b { color: #1f8a4c; }
.mm-ready li.no b { color: #b5462f; }
.mm-seg p, .mm-lim li { overflow-wrap: anywhere; }
.mm-outcome { margin-top: 10px; }
.mm-outcome textarea { width: 100%; box-sizing: border-box; margin-top: 6px; }

/* Мегамозг v3: вид как у ChatGPT — слева чаты, справа лента; поле ввода закреплено внизу. */
main:has(> .mm) { max-width: none; padding: 0; }
.mm { max-width: none; margin: 0; display: grid; grid-template-columns: 284px minmax(0, 1fr); height: calc(100dvh - var(--top-h, 64px)); }
.mm-side { background: #efece6; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; min-height: 0; overflow: hidden; }
.mm-side-top { display: flex; align-items: center; justify-content: space-between; }
.mm-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.mm-brand .mm-logo { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
.mm-x { display: none; background: none; border: 0; font-size: 18px; padding: 6px 8px; cursor: pointer; color: var(--ink-2); }
.mm-newbtn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 650; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mm-newbtn span { font-size: 19px; line-height: 1; color: var(--red); }
.mm-newbtn:hover { border-color: var(--ink-2); box-shadow: 0 3px 12px rgba(21, 23, 28, .07); }
.mm-side input[type=search], .mm-side select { width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 14px; }
.mm-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px 12px; }
.mm-group { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 8px 6px; }
.mm-it { display: flex; align-items: center; border-radius: 10px; position: relative; }
.mm-it:hover, .mm-it.on { background: #e3dfd6; }
.mm-it.on { box-shadow: inset 3px 0 0 var(--red); }
.mm-it-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 8px 10px; cursor: pointer; display: grid; gap: 1px; }
.mm-it-t { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-it-t .mm-spin { flex: none; width: 11px; height: 11px; }
.mm-it-open small { margin: 0; font-size: 12px; }
.mm-it-tools { display: flex; gap: 2px; padding-right: 4px; opacity: 0; transition: opacity .15s; }
.mm-it:hover .mm-it-tools, .mm-it.on .mm-it-tools, .mm-it-tools:focus-within { opacity: 1; }
.mm-ic { background: none; border: 0; border-radius: 8px; padding: 4px 6px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.mm-ic:hover { background: var(--card); }
.mm-rn { width: 100%; font-size: 14px; padding: 3px 6px; border: 1px solid var(--ink-2); border-radius: 6px; }
.mm-empty { padding: 10px 8px; font-size: 13.5px; }
.mm-scrim { display: none; }

.mm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mm-bar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.mm-bar-t { display: grid; min-width: 0; }
.mm-bar-t b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-bar-t span { font-size: 12.5px; }
.mm-burger { display: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; flex: none; }
.mm-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.mm-scroll > .mm-stub { max-width: 820px; margin: 16px auto 0; }
.mm .mm-feed { max-width: 860px; margin: 0 auto; padding: 22px 24px 28px; }
.mm .mm-input { position: static; max-width: 860px; width: 100%; margin: 0 auto; padding: 8px 24px 14px; background: none; flex-wrap: wrap; }
.mm .mm-input textarea { flex: 1; min-width: 0; }
.mm-keys { flex-basis: 100%; text-align: center; margin: 2px 0 0; font-size: 11.5px; }
.mm-ro { max-width: 860px; margin: 0 auto 14px; padding: 10px 14px; border-radius: 12px; background: var(--amber-bg); color: #6b4a10; font-size: 13.5px; }

/* ассистент — без пузыря, как в ChatGPT; менеджер — тёмный пузырь справа */
.mm-msg.bot .mm-bubble { background: none; border: 0; padding: 4px 0; max-width: 100%; }
.mm-msg.bot .mm-bubble.mm-bad, .mm-err .mm-bubble { background: #fdeceb; border: 1px solid #f1b9b4; padding: 10px 14px; }
details.mm-run > summary { list-style: none; cursor: pointer; }
details.mm-run > summary::-webkit-details-marker { display: none; }
.mm-think { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mm-think::before { content: "▸ "; }
details[open] > summary .mm-think::before { content: "▾ "; }
details.mm-run.done { background: transparent; border-style: dashed; }

/* итог и письмо — крупно */
.mm-result h3.mm-hook { font-size: 17px; }
.mm-ideas { display: grid; gap: 10px; margin-top: 6px; padding: 14px; border-radius: 14px; background: #fbf7ef; border: 1px solid #ecdcbf; }
.mm-ideas-h { display: grid; gap: 2px; }
.mm-ideas-h b { font-size: 17px; }
.mm-ideas-h span { font-size: 13px; }
.mm-idea { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.mm-idea-h { display: grid; gap: 2px; }
.mm-idea h4 { font-size: 16px; line-height: 1.3; }
.mm-idea > p { font-size: 14.5px; }
.mm-kind { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.mm-letter { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; display: grid; gap: 12px; box-shadow: 0 6px 24px rgba(21, 23, 28, .06); }
.mm-letter-k { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mm-letter-cover { font-size: 13.5px; color: var(--ink-2); }
.mm-letter-cover span { display: inline-block; margin-right: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
h3.mm-letter-h { margin: 0; font-size: 24px; line-height: 1.22; font-weight: 750; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.mm-letter-b { display: grid; gap: 10px; font-size: 16px; line-height: 1.55; }
.mm-plate { display: flex; flex-wrap: wrap; gap: 10px 28px; background: var(--plate); color: #fff; border-radius: 14px; padding: 14px 18px; }
.mm-plate > div { flex: 1 1 150px; display: grid; gap: 2px; }
.mm-plate b { font-size: 20px; font-weight: 750; }
.mm-plate span { font-size: 12.5px; color: #b9bcc4; }
.mm-letter-call { font-size: 17px; font-weight: 650; padding-left: 14px; border-left: 3px solid var(--red); }
.mm-letter-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; font-size: 13px; }

@media (max-width: 860px) {
  .mm { grid-template-columns: minmax(0, 1fr); }
  .mm-side { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .2s ease-out; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .mm.side-open .mm-side { transform: none; }
  .mm-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(18, 20, 25, .35); }
  .mm-scrim[hidden] { display: none; }
  .mm-x, .mm-burger { display: block; }
  .mm-it-tools { opacity: 1; }
  .mm-bar { padding: 8px 12px; }
  .mm .mm-feed { padding: 16px 14px 20px; }
  .mm .mm-input { padding: 6px 12px 10px; }
  .mm-keys { display: none; }
  .mm-letter { padding: 16px; }
  h3.mm-letter-h { font-size: 20px; }
}
.mm .mm-feed { grid-template-columns: minmax(0, 1fr); }
.mm-scroll { overflow-x: hidden; }
.mm-msg, .mm-body { min-width: 0; }
.mm-msg.me .mm-body { flex: 0 1 auto; max-width: 85%; }
.mm-body > * { max-width: 100%; }
.mm-result, .mm-run, .mm-letter { min-width: 0; overflow-wrap: anywhere; }
.mm-result { grid-template-columns: minmax(0, 1fr); }
.mm-zs, .mm-ideas { grid-template-columns: minmax(0, 1fr); }
.mm-z, .mm-idea, .mm-z-top > div { min-width: 0; }
.mm-z-btns { flex-wrap: wrap; }
.mm-body { grid-template-columns: minmax(0, 1fr); }
.mm-chips .btn { white-space: normal; text-align: left; max-width: 100%; height: auto; }

/* Мегамозг: ответы на вопросы и данные из баз */
.mm-next .btn { border-style: dashed; }
.mm-typing { display: inline-flex; align-items: center; gap: 5px; padding: 6px 0; color: var(--muted); }
.mm-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.mm-typing span:nth-child(2) { animation-delay: .2s; }
.mm-typing span:nth-child(3) { animation-delay: .4s; }
.mm-typing em { font-style: normal; font-size: 13px; margin-left: 6px; }
.mm-data { display: grid; gap: 10px; min-width: 0; }
.mm-how { font-size: 13px; }
.mm-sec { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.mm-sec.web { border-style: dashed; background: #fbfaf7; }
.mm-sec-h { font-weight: 700; font-size: 15px; }
.mm-sec-sub { font-size: 13.5px; color: var(--ink-2); }
.mm-tbl { overflow-x: auto; }
.mm-tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mm-tbl th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px 6px; border-bottom: 1px solid var(--line); }
.mm-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.mm-tbl tr:last-child td { border-bottom: 0; }
.mm-tbl td:first-child { font-weight: 600; }
@media (max-width: 860px) { .mm-tbl table { font-size: 12.5px; } .mm-tbl td, .mm-tbl th { padding: 6px 5px; } }

/* меню руководителя — выпадающий список */
header nav { overflow: visible; }
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; margin: 0; font-size: inherit; padding: 8px 12px; border-radius: 8px; color: #a9aeb8; font-weight: 500; white-space: nowrap; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: " ▾"; font-size: 11px; }
.nav-more[open] > summary, .nav-more > summary:hover, .nav-more.on > summary { color: #fff; background: var(--plate-2); }
.nav-more.on > summary { box-shadow: inset 0 -2px 0 var(--red); }
.nav-more > div { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 200px; display: grid; gap: 2px; padding: 6px; background: var(--plate); border: 1px solid #2a2e37; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.nav-more > div a { padding: 8px 12px; }
.nav-more > div a small { color: #7d828d; font-size: 11.5px; font-weight: 400; margin-top: 1px; }
.err-next { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 1280px) { header.top { height: auto; min-height: 64px; flex-wrap: wrap; row-gap: 6px; padding-top: 8px; padding-bottom: 8px; } header nav { flex-wrap: wrap; } }
header nav { align-items: center; }

/* «Кому слать» v2: порог базы, счёт сферы, две кнопки у компании базы, метка тестового клиента */
.tabs.porog { align-items: center; flex-wrap: wrap; gap: 6px; }
.tabs.porog .muted { font-size: 13px; margin-right: 4px; }
.sph-n { font-size: 13.5px; line-height: 1.45; }
.co-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.co-act .add-form { margin: 0; }
.st.test { background: #f1ecff; color: #5b3fb5; }
.send-ev .sph li { display: grid; grid-template-columns: minmax(130px, 200px) 1fr auto; gap: 6px 12px; align-items: center; }
.send-ev .sph li .chip { justify-self: start; }
@media (max-width: 700px) { .send-ev .sph li { grid-template-columns: 1fr; } .send-ev .sph li .btn { justify-self: start; } }
.send-ev .stat { min-width: 70px; padding: 6px 8px; }

/* Мегамозг 22.10: поводы карточками с действиями, «название — значение» списком, готовые КП, правка письма */
.mm-pvs { display: grid; gap: 8px; }
.mm-pv-card { display: grid; grid-template-columns: 120px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.mm-pv-when { font-weight: 650; font-size: 13.5px; }
.mm-pv-body b { display: block; }
.mm-pv-body .muted { display: block; font-size: 13px; margin: 2px 0 8px; }
.mm-pv-body .mm-chips { margin-top: 0; }
.mm-kv { display: grid; gap: 10px; }
.mm-kv-row { border-top: 1px solid var(--line); padding-top: 10px; }
.mm-kv-row:first-of-type { border-top: 0; padding-top: 0; }
.mm-kv-row span { display: block; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.mm-kv-row p { margin: 0; line-height: 1.45; }
.mm-kp-list { display: grid; gap: 8px; margin: 10px 0; }
.mm-kp-ready { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.mm-kp-ready b { display: block; }
.mm-kp-ready span { display: block; }
.mm-kp-ready .mm-chips { margin: 0; }
.mm-rw { margin-top: 10px; }
.mm-rw > .muted { display: block; font-size: 13px; margin-bottom: 4px; }
.mm-letters > summary { font-weight: 650; }
@media (max-width: 600px) { .mm-pv-card { grid-template-columns: 1fr; gap: 4px; } }
.mm-task.on { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
/* таблицы компаний в чате: на ширину чата, название и короткие колонки без переноса, ссылки */
.mm-data { justify-self: stretch; width: 100%; }
.mm-tbl td.nw { white-space: nowrap; overflow-wrap: normal; }
.mm-tbl a.mm-co { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.mm-tbl a.mm-co:hover { color: var(--red); border-color: var(--red); }
.mm-mail { white-space: pre-wrap; font: inherit; font-size: 13.5px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mm-data .mm-tbl td { overflow-wrap: normal; word-break: normal; }
