:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #121826;
  --text-2: #56617a;
  --text-3: #8d96a8;
  --line: #e4e8ef;
  --line-2: #d3d9e3;
  --accent: #2a9fff;
  --accent-600: #1680d6;
  --accent-700: #0f6cb8;
  --accent-50: #eaf4ff;
  --accent-100: #d4e8ff;
  --amber-50: #fff7e6; --amber-200: #ffd98a; --amber-900: #7a4e00;
  --green-50: #e9f8ef; --green-200: #a8e0bc; --green-900: #145c32;
  --rose-50: #fff1f1; --rose-200: #f3b4b4; --rose-900: #8a1f1f;
  --r-lg: 18px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 24, 38, 0.04), 0 12px 32px -14px rgba(18, 24, 38, 0.14);
  --shadow-float: 0 8px 28px -8px rgba(18, 24, 38, 0.22);
  --font: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --thread: 780px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }

.app { height: 100%; display: flex; flex-direction: column; }

/* ── шапка ── */
.top {
  height: 58px; flex: 0 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(243, 245, 249, 0.86); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #3aa9ff, #1680d6); display: flex; align-items: center; justify-content: center; font-size: 19px; box-shadow: 0 6px 16px -6px rgba(22, 128, 214, 0.6); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.top-right { display: flex; align-items: center; gap: 8px; }
.chip-status { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; cursor: default; max-width: 260px; }
.chip-status img { width: 18px; height: 18px; }
.chip-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent-700); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.round { width: 34px; padding: 0; justify-content: center; }
.icon-btn.confirm { background: var(--rose-50); border-color: var(--rose-200); color: var(--rose-900); }

.user-wrap { position: relative; }
.icon-btn .ava { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #3aa9ff, #1680d6); display: inline-block; }
.menu { position: absolute; right: 0; top: 42px; min-width: 260px; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-float); padding: 8px; z-index: 9; }
.menu-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); padding: 6px 10px 4px; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 9px; cursor: pointer; color: var(--text); }
.menu-item:hover { background: var(--accent-50); color: var(--accent-700); }
.menu-hint { font-size: 12px; color: var(--text-3); padding: 6px 10px 4px; line-height: 1.4; }
.my-briefs { max-height: 260px; overflow-y: auto; margin-bottom: 4px; }
.my-briefs a { display: block; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--text); }
.my-briefs a:hover { background: var(--surface-2); }
.my-briefs a.cur { background: var(--accent-50); }
.my-briefs .bt { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-briefs .bs { font-size: 12px; color: var(--text-3); }
.my-briefs .empty { padding: 8px 10px; font-size: 13px; color: var(--text-3); }
.readonly { max-width: var(--thread); margin: 10px auto 0; padding: 9px 16px; border-radius: 12px; background: var(--amber-50); border: 1px solid var(--amber-200); color: var(--amber-900); font-size: 14px; }
.readonly .link-btn { color: var(--amber-900); }
.share-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 12.5px; }
body.ro .composer-wrap { display: none; }
body.ro .card:not(.answered) button, body.ro .card:not(.answered) input { pointer-events: none; }

/* ── лента ── */
.scroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.thread { max-width: var(--thread); margin: 0 auto; padding: 18px 20px 8px; display: flex; flex-direction: column; gap: 18px; }
#bottom-pad { height: 118px; }

.msg { display: flex; gap: 12px; animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--accent); color: #fff; border-radius: 18px 18px 6px 18px; padding: 10px 16px; max-width: 78%; white-space: pre-wrap; word-break: break-word; box-shadow: 0 6px 18px -10px rgba(22, 128, 214, 0.7); }
.msg.assistant .avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 17px; margin-top: 2px; }
.msg.assistant .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 auto; }
.bubble.text { background: var(--surface); border: 1px solid var(--line); border-radius: 6px 18px 18px 18px; padding: 13px 18px; box-shadow: var(--shadow); }
.text p { margin: 0 0 9px; } .text p:last-child { margin-bottom: 0; }
.text h3 { font-size: 15px; font-weight: 600; margin: 12px 0 6px; letter-spacing: -0.01em; } .text h3:first-child { margin-top: 0; }
.text ul, .text ol { margin: 4px 0 9px; padding-left: 22px; }
.text li { margin: 3px 0; }
.text code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.text a { color: var(--accent-700); }
.bubble.error { background: var(--rose-50); border-color: var(--rose-200); color: var(--rose-900); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bubble.error button { margin-left: auto; }

/* ── «думаю» ── */
.think { display: flex; flex-direction: column; gap: 8px; }
.think-status { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; min-height: 20px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.35; animation: pulse 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; } .dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.9); } 40% { opacity: 1; transform: scale(1.1); } }
.think-status .label { transition: opacity 0.2s; }
.think-status .label.swap { opacity: 0; }
.think .stream { display: none; }
.think.streaming .stream { display: block; }
.think.streaming .stream::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 2px; vertical-align: -2px; animation: caret 1s steps(2) infinite; }
@keyframes caret { to { opacity: 0; } }
.shimmer { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 0%, #f0f3f8 40%, var(--line) 80%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.think .shimmer + .shimmer { margin-top: 8px; width: 70%; }

/* ── карточки ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.card .heading { font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.card .heading svg { width: 18px; height: 18px; flex: 0 0 18px; }
.card.tips { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-900); box-shadow: none; }
.card.info { background: var(--accent-50); border-color: var(--accent-100); color: var(--accent-700); box-shadow: none; }
.card.info .heading { color: var(--accent-700); }
.card.hints { background: var(--green-50); border-color: var(--green-200); color: var(--green-900); box-shadow: none; }
.card ul.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.card ul.plain li { display: flex; gap: 9px; align-items: flex-start; }
.card ul.plain li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.55; flex: 0 0 6px; margin-top: 9px; }
.card.highlight { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card.highlight .value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent-700); line-height: 1.1; font-variant-numeric: tabular-nums; }
.card.highlight .label { color: var(--text-2); font-size: 14px; }

.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.fstep { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; position: relative; }
.fstep .fnum { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.fstep .ftitle { font-weight: 600; font-size: 14px; }
.fstep .fdesc { color: var(--text-2); font-size: 13px; line-height: 1.4; margin-top: 2px; }

table.summary { border-collapse: collapse; width: 100%; font-size: 14px; }
table.summary td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.summary td:first-child { color: var(--text-2); width: 42%; }
table.summary tr:nth-child(even) td { background: var(--surface-2); }
table.summary tr:last-child td { border-bottom: 0; }

.q-text { font-weight: 600; margin-bottom: 12px; letter-spacing: -0.01em; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid transparent; background: var(--accent-50); color: var(--accent-700); border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s, transform 0.08s; }
.chip:hover { background: var(--accent-100); }
.chip:active { transform: scale(0.98); }
.chip.ghost { background: var(--surface); border-color: var(--line-2); color: var(--text-2); }
.chip.ghost:hover { border-color: var(--accent); color: var(--accent-700); }
.chip.picked { background: var(--accent); color: #fff; }
.card.answered { opacity: 0.55; pointer-events: none; }
.card.answered .chip.picked { opacity: 1; }

.inline-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.field { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; height: 42px; transition: border-color 0.15s, box-shadow 0.15s; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.field input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; min-width: 0; flex: 1 1 auto; height: 100%; }
.field .suffix { color: var(--text-3); margin-left: 6px; }
.field.grow { flex: 1 1 220px; }
.field.num { width: 190px; }
.hint { color: var(--text-2); font-size: 13px; margin: -4px 0 12px; line-height: 1.45; }
.link-btn { background: none; border: 0; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent-700); }

.btn { font: inherit; font-size: 14px; font-weight: 600; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 18px -10px rgba(22, 128, 214, 0.8); }
.btn.primary:hover { background: var(--accent-600); }
.btn.soft { background: var(--accent-50); border-color: transparent; color: var(--accent-700); }
.btn.soft:hover { background: var(--accent-100); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg, .btn img { width: 18px; height: 18px; }

.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color 0.15s, background 0.15s; user-select: none; }
.ch:hover { border-color: var(--accent); }
.ch { position: relative; }
.ch input, .checklist .ck input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; }
.ch .ico { width: 24px; height: 24px; flex: 0 0 24px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.ch .ico img { width: 24px; height: 24px; border-radius: 6px; }
.ch .ico svg { width: 20px; height: 20px; }
.ch .lbl { flex: 1 1 auto; font-size: 14px; line-height: 1.3; }
.ch .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: 0 0 20px; display: flex; align-items: center; justify-content: center; }
.ch .tick svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.ch.on { border-color: var(--accent); background: var(--accent-50); }
.ch.on .tick { background: var(--accent); border-color: var(--accent); }
.ch.on .tick svg { opacity: 1; }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.option { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; display: flex; gap: 10px; align-items: flex-start; transition: border-color 0.15s, background 0.15s; }
.option:hover { border-color: var(--accent); background: var(--accent-50); }
.option .ot { font-weight: 600; margin-bottom: 3px; } .option .od { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.option svg { width: 18px; height: 18px; color: var(--text-3); flex: 0 0 18px; margin-left: auto; margin-top: 2px; }

/* ── Метрика ── */
.metrika-card { padding: 0; overflow: hidden; }
.metrika-card .m-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; }
.metrika-card .m-head img { width: 34px; height: 34px; border-radius: 9px; }
.metrika-card .m-title { font-weight: 600; font-size: 15px; }
.metrika-card .m-sub { color: var(--text-3); font-size: 12px; }
.metrika-card .m-body { padding: 10px 18px 16px; }
.metrika-card .m-body .text { margin: 0 0 10px; }
.benefits { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 14px; color: var(--text-2); }
.benefits li { display: flex; gap: 8px; align-items: center; }
.benefits svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 16px; }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.m-actions .links { display: flex; gap: 10px; margin-left: auto; }
.counters .ok { display: flex; align-items: center; gap: 8px; color: var(--green-900); background: var(--green-50); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.counters .ok svg { width: 16px; height: 16px; }
.counter-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0 12px; }
.counter-list button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); font: inherit; cursor: pointer; }
.counter-list button:last-child { border-bottom: 0; }
.counter-list button:hover { background: var(--surface-2); }
.counter-list button.sel { background: var(--accent-50); }
.counter-list .cn { font-weight: 500; font-size: 14px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counter-list .cs { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.counter-list .empty { padding: 12px; color: var(--text-3); font-size: 13px; }

/* ── действия, чеклист, объявления, калькулятор ── */
.card.actions .q-text { margin-bottom: 10px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; flex: 0 0 auto; }
.checklist .ck { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.checklist .ck:first-of-type { border-top: 0; }
.checklist .ck .tick { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); flex: 0 0 20px; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.checklist .ck .tick svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.checklist .ck.on .tick { background: #2fb36a; border-color: #2fb36a; } .checklist .ck.on .tick svg { opacity: 1; }
.checklist .ck.on .lbl { text-decoration: line-through; color: var(--text-3); }
.checklist .ck .body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.checklist .ck .lbl { font-weight: 500; }
.checklist .ck .hint { margin: 0; font-size: 13px; }
.ads .ad { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: var(--surface-2); }
.ad-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.ad-mark { background: #e9ecf2; border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.ad-top .link-btn { margin-left: auto; padding: 0; }
.ad-title { color: #1a0dab; font-weight: 600; font-size: 16px; line-height: 1.3; }
.ad-text { font-size: 14px; margin-top: 3px; }
.ad-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: #1a0dab; }
.ad-callouts { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.calc .sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 6px 0 12px; }
.sl-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.sl-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.sl input[type=range] { width: 100%; accent-color: var(--accent); }
.kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kv { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-2); }
.kv b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.kv.profit { background: var(--green-50); color: var(--green-900); } .kv.profit b { color: var(--green-900); }
.kv.profit.bad { background: var(--rose-50); color: var(--rose-900); } .kv.profit.bad b { color: var(--rose-900); }

.budget .bs { padding: 8px 0; border-top: 1px solid var(--line); }
.budget .bs:first-of-type { border-top: 0; }
.bs-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bs-top .ico { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.bs-top .ico img { width: 22px; height: 22px; border-radius: 5px; } .bs-top .ico svg { width: 18px; height: 18px; }
.bs-name { flex: 1 1 auto; font-weight: 500; }
.bs-top b { font-variant-numeric: tabular-nums; font-weight: 600; }
.bs-bar { height: 8px; border-radius: 4px; background: var(--surface-2); margin: 6px 0 4px; overflow: hidden; }
.bs-bar div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-600)); border-radius: 4px; }
.bs-why { font-size: 13px; color: var(--text-2); }
.bs-expected { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--green-50); color: var(--green-900); font-size: 13.5px; }
.bs-expected svg { width: 16px; height: 16px; flex: 0 0 16px; }

.audit-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.audit-head .heading { margin-bottom: 2px; }
.ring { width: 64px; height: 64px; border-radius: 50%; flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring b, .ring span { position: relative; line-height: 1; } .ring b { font-size: 20px; } .ring span { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.ring.good { --c: #2fb36a; } .ring.mid { --c: #f0a500; } .ring.bad { --c: #e2544a; }
.audit-list { display: flex; flex-direction: column; }
.ai { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.ai .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; margin-top: 7px; }
.ai.ok .dot { background: #2fb36a; } .ai.warn .dot { background: #f0a500; } .ai.bad .dot { background: #e2544a; }
.ai .lbl { font-weight: 500; } .ai .hint { margin: 0; font-size: 13px; }
.demand-total b { font-size: 26px; font-weight: 700; color: var(--accent-700); } .demand-total span { color: var(--text-2); }
.bars { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.bar { display: grid; grid-template-columns: minmax(120px, 1.4fr) 2fr 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar .bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .bt { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; } .bar .bt i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
.season { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-top: 8px; }
.sc { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.sc i { display: block; width: 100%; background: var(--accent-100); border-radius: 3px 3px 0 0; } .sc span { font-size: 10px; color: var(--text-3); }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.comp { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.comp .cn { font-weight: 600; } .comp .cs { font-size: 12.5px; color: var(--accent-700); text-decoration: none; }
.comp .cu { font-size: 13.5px; }
.comp .cl { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; margin-top: 4px; }
.comp .cl.plus { color: var(--green-900); } .comp .cl.minus { color: var(--rose-900); }

/* ── завершение ── */
.done-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r-md); background: var(--green-50); border: 1px solid var(--green-200); color: var(--green-900); font-size: 14px; }
.done-bar svg { width: 18px; height: 18px; }
.done-bar .chips { margin-left: auto; }

/* ── ввод ── */
.composer-wrap { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 20px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 70%, rgba(243, 245, 249, 0)); z-index: 4; pointer-events: none; }
.composer { pointer-events: auto; max-width: var(--thread); margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 7px 7px 7px 18px; box-shadow: var(--shadow-float); transition: border-color 0.15s, box-shadow 0.15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-50), var(--shadow-float); }
.composer textarea { flex: 1 1 auto; border: 0; outline: 0; resize: none; font: inherit; font-size: 15px; line-height: 1.45; padding: 9px 0; max-height: 160px; background: transparent; color: var(--text); }
.composer textarea::placeholder { color: var(--text-3); }
.send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 38px; transition: background 0.15s, transform 0.08s; }
.send:hover { background: var(--accent-600); } .send:active { transform: scale(0.95); }
.send:disabled { background: var(--line-2); cursor: default; }
.send svg { width: 18px; height: 18px; }
.composer-hint { text-align: center; color: var(--text-3); font-size: 11.5px; margin-top: 7px; }

/* ── рейка хода брифа ── */
.rail { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; background: transparent; border: 0; cursor: pointer; padding: 8px 4px; opacity: 0.45; transition: opacity 0.2s; z-index: 6; }
.rail:hover, .rail.open { opacity: 1; }
.rail-track { width: 4px; height: 150px; border-radius: 4px; background: var(--line-2); overflow: hidden; display: block; position: relative; }
.rail-fill { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: var(--accent); border-radius: 4px; transition: height 0.4s; }
.rail-label { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 0.04em; }
.rail.done .rail-fill { background: #2fb36a; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(18, 24, 38, 0.25); z-index: 7; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw; background: var(--surface); box-shadow: -12px 0 40px -20px rgba(18, 24, 38, 0.4); transform: translateX(104%); transition: transform 0.25s ease; z-index: 8; padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.drawer-title { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.drawer-title.small { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin: 18px 0 10px; }
.drawer-sub { color: var(--text-3); font-size: 13px; }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; color: var(--text-3); position: relative; }
.steps li .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: 0 0 22px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: var(--surface); z-index: 1; }
.steps li + li::before { content: ""; position: absolute; left: 10.5px; top: -8px; height: 12px; width: 1.5px; background: var(--line); }
.steps li.done { color: var(--text-2); }
.steps li.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps li.done + li::before { background: var(--accent-100); }
.steps li.current { color: var(--text); font-weight: 600; }
.steps li.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.collected { display: flex; flex-direction: column; gap: 6px; }
.collected .row { background: var(--surface-2); border-radius: 10px; padding: 8px 11px; }
.collected .k { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.collected .v { font-size: 13.5px; font-weight: 500; word-break: break-word; margin-top: 1px; }
.collected .empty { color: var(--text-3); font-size: 13px; }

.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #1b2230; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-float); z-index: 20; max-width: 90vw; }

@media (max-width: 720px) {
  .top { padding: 0 14px; height: 54px; }
  .icon-btn span { display: none; }
  .icon-btn { width: 34px; padding: 0; justify-content: center; }
  .chip-status { max-width: 150px; }
  .thread { padding: 14px 12px 8px; gap: 14px; }
  .msg.user .bubble { max-width: 88%; }
  .composer-wrap { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .composer-hint { display: none; }
  .rail { right: 4px; }
  .rail-track { height: 110px; }
  .funnel { grid-template-columns: 1fr; }
  .fstep { display: flex; gap: 10px; align-items: flex-start; }
  .fstep .fnum { margin: 2px 0 0; flex: 0 0 22px; }
  .field.num { width: 100%; }
  .m-actions .links { margin-left: 0; }
}
