/* «Документы»: палитра светлой главной VOLOK, типографика рабочего чата демо-кабинета
   (ответ Manrope 15/1.85 400, сообщение пользователя 15/1.7, поле 16/1.6). */
@font-face{font-family:Manrope;src:url(/documents/assets/fonts/Manrope-cyrillic.woff2) format("woff2");unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;font-weight:200 800;font-display:swap}
@font-face{font-family:Manrope;src:url(/documents/assets/fonts/Manrope-latin.woff2) format("woff2");font-weight:200 800;font-display:swap}
:root{--bg:#eef4f8;--bg2:#e6eef4;--side:#e3ecf3;--panel:#f7fafc;--ink:#263f4e;--muted:#5b7384;--line:#c4d2dc;--orange:#e99738;--orange2:#d86a0a;--soft:#e2eaf1;--danger:#a33a2b;
  font:15px/1.6 Manrope,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink)}
*{box-sizing:border-box}html,body{height:100%}body{margin:0;background:radial-gradient(at 60% 8%,#f3f7fa 0%,#eaf1f6 55%,#e4edf3 100%);overflow:hidden}
button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;background:none;border:0;padding:0}a{color:var(--ink)}
[hidden]{display:none!important}:focus-visible{outline:2px solid var(--orange2);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.shell{display:grid;grid-template-columns:320px minmax(0,1fr);height:100dvh}
/* история */
.side{background:var(--side);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:24px 22px 18px;min-height:0;gap:6px}
.brand{display:flex;align-items:center;gap:14px;text-decoration:none;margin:0 0 22px 8px}.brand span{display:grid;line-height:1.1}.brand b{font-size:21px;letter-spacing:.12em}.brand small{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.newchat{display:flex;align-items:center;gap:12px;background:#fff;border-radius:12px;padding:12px 18px;font-weight:600;font-size:16px;box-shadow:0 1px 2px #263f4e14;min-height:48px}
.newchat:hover{box-shadow:0 2px 8px #263f4e22}
.hist-title{font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:24px 10px 6px}
.history{display:grid;gap:2px;overflow:auto;min-height:0;align-content:start;flex:1}
.history a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;text-decoration:none;font-size:15px;min-height:44px;overflow:hidden}
.history a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history a[aria-current]{background:#d6e2eb;font-weight:600}.history a:hover{background:#dde7ee}
.history .none{color:var(--muted);font-size:14px;padding:4px 12px}
.account{display:grid;gap:4px;padding-top:10px;border-top:1px solid var(--line);font-size:14px}.account .em{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account button,.loginbtn{text-align:left;padding:8px 10px;border-radius:8px;min-height:44px}.account button:hover{background:#dde7ee}
.loginbtn{border:1px solid var(--line);background:#fff8;font-weight:600;justify-self:start;padding:8px 18px}
.side-policy{font-size:13px;color:var(--muted);margin:8px 10px 0;text-decoration:none}.side-policy:hover{text-decoration:underline}
.scrim{display:none}
/* чат */
.chat{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0}
.top{display:flex;align-items:center;gap:18px;padding:18px 40px;border-bottom:1px solid var(--line)}
.top h1{font-size:22px;margin:0;line-height:1.2}.sub{margin:2px 0 0;font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:60vw}
.ttl{min-width:0;flex:1}.home{font-size:14px;color:var(--muted);text-decoration:none;white-space:nowrap;display:inline-flex;align-items:center;min-height:44px;padding:0 4px}.home:hover{color:var(--ink)}
.icon{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px;border-radius:10px;color:var(--ink)}.icon:hover{background:var(--soft)}
.thread{overflow:auto;padding:28px 40px 12px}
.day{text-align:center;font-size:13px;color:var(--muted);margin:6px 0 22px;font-weight:600}
.msg-user{max-width:min(560px,85%);margin:0 0 30px auto;background:#e3ebf2;border-radius:16px;padding:14px 20px;font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.msg-user .att{display:flex;align-items:center;gap:8px;font-weight:700;font-size:14px;margin-bottom:6px}.msg-user .att svg{width:18px;height:18px;color:#8a6a4a}
.msg-ai{display:grid;grid-template-columns:42px minmax(0,1fr);gap:0 14px;max-width:1010px;margin:0 auto 30px}
.ava{width:42px;height:42px;border-radius:12px;background:#f6e1c8;display:grid;place-items:center}.ava img{width:26px}
.msg-ai .who{font-weight:700;font-size:14px;line-height:42px}
.answer{grid-column:2;font-size:15px;line-height:1.85;font-weight:400}.answer p{margin:0 0 10px}.answer strong{font-weight:700}
.answer .warn{color:var(--muted)}.answer .err{color:var(--danger)}
.refs{grid-column:2;border-top:1px solid var(--line);margin-top:6px;padding-top:12px;font-size:13px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px 16px;align-items:baseline}
.refs button{color:var(--ink);text-decoration:underline;text-underline-offset:3px;text-decoration-color:#9fb1bf;font-size:13px;min-height:28px}
.pending{color:var(--muted);font-style:italic}
.empty{display:grid;place-items:center;height:100%;text-align:center;color:var(--muted)}.empty h2{color:var(--ink);font-size:24px;margin:0 0 8px}
/* поле ввода */
.compose{margin:0 auto;width:min(1066px,calc(100% - 80px));margin-bottom:max(24px,env(safe-area-inset-bottom));background:#fbfdfe;border:1px solid var(--line);border-radius:22px;padding:14px 16px 10px;box-shadow:0 6px 24px #263f4e12;display:grid;gap:6px;position:relative}
.compose textarea{border:0;background:transparent;resize:none;font-size:16px;line-height:1.6;outline:none;padding:6px 8px;min-height:52px;max-height:30dvh}
.tools{display:flex;align-items:center;gap:6px}.grow{flex:1}
.cam span{font-weight:600;font-size:15px}
.send{width:62px;height:62px;border-radius:16px;background:#f2b56c;color:#fff;display:grid;place-items:center}.send:hover{background:var(--orange)}.send:disabled{opacity:.55;cursor:default}
.send svg{width:26px;height:26px;stroke-width:2}
.clipwrap{position:relative}.clipmenu{position:absolute;left:0;bottom:56px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 12px 32px #263f4e26;padding:8px;display:grid;min-width:300px;z-index:4}
.clipmenu button{display:flex;align-items:center;gap:16px;white-space:nowrap;padding:12px 16px;border-radius:12px;font-size:17px;min-height:52px;text-align:left}.clipmenu button:hover{background:var(--soft)}
.drafts{display:flex;flex-wrap:wrap;gap:8px;padding:2px 4px}
.chip{display:flex;align-items:center;gap:8px;background:var(--soft);border-radius:12px;padding:6px 6px 6px 10px;font-size:13px;max-width:100%}
.chip img{width:44px;height:44px;object-fit:cover;border-radius:8px;cursor:zoom-in}.chip .nm{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip button{min-width:44px;min-height:44px;border-radius:8px;font-size:13px;color:var(--muted)}.chip button:hover{background:#d4dfe8;color:var(--ink)}
.voice{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--soft);border-radius:12px;padding:6px 8px;font-size:14px}
.voice .dot{width:10px;height:10px;border-radius:50%;background:#d0402b;animation:blink 1s infinite}@keyframes blink{50%{opacity:.25}}
.voice button{min-height:44px;padding:0 12px;border-radius:10px;font-weight:600}.voice button.pri{background:var(--orange);color:#fff}.voice audio{height:36px;max-width:220px}
.voice .note{color:var(--muted);font-size:12.5px;flex-basis:100%;padding-left:4px}
/* окна */
.dlg{width:min(580px,calc(100% - 24px));max-height:94dvh;overflow:auto;border:1px solid #8194a3;border-radius:16px;background:#f3f7fa;color:var(--ink);padding:28px 30px 24px}
.dlg::backdrop{background:#263f4e80}.x{position:absolute;right:14px;top:10px;font-size:26px;min-width:44px;min-height:44px}
.form{display:grid;gap:12px}.form h2{margin:0 36px 4px 0;font-size:26px;line-height:1.2}
.form label.f{display:grid;gap:4px;font-weight:600;font-size:14px}
.form input:not([type=checkbox]){border:1px solid #a9bac6;background:#fbfdfe;border-radius:10px;padding:11px 12px;font-size:16px;font-weight:400;min-height:46px}
.check{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.5}.check input{width:20px;height:20px;margin-top:2px;flex-shrink:0;accent-color:var(--orange2)}
.fine{font-size:13px;color:var(--muted);margin:0}.form .err{color:var(--danger);font-size:14px;min-height:1.2em;margin:0}
.btn{min-height:48px;border-radius:12px;background:var(--orange);color:#fff;font-weight:700;font-size:16px;padding:0 20px}.btn:hover{background:var(--orange2)}.btn:disabled{opacity:.55}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}.btn.danger{background:var(--danger)}
.link{text-decoration:underline;text-underline-offset:3px;justify-self:start;min-height:32px}.center{justify-self:center;font-size:14px}
.okmsg{background:#e5f1e8;border-radius:10px;padding:10px 12px;font-size:14px}
.preview img{max-width:100%;max-height:70dvh;display:block;margin:0 auto 14px;border-radius:8px}
.quote{border-left:3px solid var(--orange);padding:6px 12px;background:#fff;border-radius:0 8px 8px 0;white-space:pre-wrap}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(110px + env(safe-area-inset-bottom));background:var(--ink);color:#fff;padding:10px 16px;border-radius:12px;z-index:20;max-width:calc(100% - 32px);font-size:14px}
/* телефон */
@media (max-width:820px){
  .shell{grid-template-columns:1fr}
  .side{position:fixed;inset:0 auto 0 0;width:min(320px,86vw);z-index:10;transform:translateX(-102%);transition:transform .2s;padding-top:max(20px,env(safe-area-inset-top))}
  .side.open{transform:none;box-shadow:0 0 40px #263f4e40}.scrim{display:block;position:fixed;inset:0;background:#263f4e55;z-index:9}
  .top{padding:12px 16px;padding-top:max(12px,env(safe-area-inset-top));gap:10px}.top h1{font-size:22px}
  .thread{padding:18px 16px 8px}.msg-user{max-width:92%;margin-bottom:22px}.msg-ai{grid-template-columns:38px minmax(0,1fr);gap:0 12px}.ava{width:38px;height:38px}
  .compose{width:calc(100% - 20px);margin-bottom:max(10px,env(safe-area-inset-bottom));border-radius:18px;padding:10px 10px 8px}
  .cam span{display:none}.send{width:56px;height:56px}.clipmenu{min-width:min(300px,calc(100vw - 40px))}
}
@media (min-width:821px){.menu{display:none}}
/* документ согласия */
body.legal{overflow:auto}.legaldoc{max-width:760px;margin:0 auto;padding:32px 20px 60px;line-height:1.7}.legaldoc h1{font-size:28px;line-height:1.2}.legaldoc h2{font-size:18px;margin-top:24px}
