/* Генератор презентаций «Царицыно» — a chat UI in the college brand:
   white background, Manrope, orange pill buttons, hairline borders, no shadows. */
@font-face{font-family:'Manrope';font-style:normal;font-weight:200 800;font-display:swap;
  src:url('/ds/fonts/Manrope-Variable-lat.woff2') format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2122;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:200 800;font-display:swap;
  src:url('/ds/fonts/Manrope-Variable-cyr.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}

:root{
  --orange:#F2A900; --orange-100:#FDF0D4; --orange-300:#F6C963; --orange-600:#D99700;
  --terracotta:#CB563D; --ink:#12100E; --grey-700:#4A4A4A; --grey-500:#6B6B6B;
  --grey-300:#C9C9C9; --grey-200:#E6E6E6; --grey-100:#F5F5F4; --white:#FFFFFF;
  --error:#B3432E; --success:#4C7A4A;
  --r-sm:16px; --r-md:24px; --pill:100px;
  --top:77px;
}
*{box-sizing:border-box;}
html,body{margin:0;background:var(--white);color:var(--ink);height:100%;
  font-family:'Manrope',system-ui,sans-serif;font-size:17px;line-height:1.45;}
body{display:flex;flex-direction:column;overflow:hidden;}
[hidden]{display:none!important;}
h1{font-size:34px;line-height:1.15;font-weight:700;margin:0;letter-spacing:-.01em;}
h2{font-size:22px;line-height:1.25;font-weight:700;margin:0;}
.muted{color:var(--grey-500);}
.small{font-size:15px;}
a{color:inherit;}

/* ---- header */
.top{display:flex;align-items:center;gap:20px;padding:14px 24px;border-bottom:1.5px solid var(--grey-200);flex:none;}
.brand img{height:44px;display:block;}
.top-title{font-weight:600;color:var(--grey-700);flex:1;padding-left:20px;border-left:1.5px solid var(--grey-200);}
.top .side-toggle{display:none;}

/* ---- buttons: always full pills */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 24px;
  border-radius:var(--pill);border:2px solid transparent;font:700 17px/1 'Manrope',sans-serif;
  text-decoration:none;cursor:pointer;background:none;color:var(--ink);white-space:nowrap;}
.btn-primary{background:var(--orange);border-color:var(--orange);}
.btn-primary:hover{background:var(--orange-600);border-color:var(--orange-600);}
.btn-dark{background:var(--ink);border-color:var(--ink);color:var(--white);}
.btn-dark:hover{background:#2A2724;}
.btn-outline{border-color:var(--ink);}
.btn-outline:hover{background:var(--grey-100);}
.btn-sm{min-height:44px;padding:0 18px;font-size:15px;}
.btn-icon{width:44px;min-height:44px;padding:0;}
.btn:disabled,.btn.busy{opacity:.45;cursor:not-allowed;}
.btn.busy{cursor:progress;}
.btn:focus-visible,.chip:focus-visible,.tool:focus-visible,.thumb:focus-visible,.send:focus-visible,.clip:focus-visible,
.rc:focus-visible,.slide-link:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ink),0 0 0 6px var(--orange-300);}

.chev{width:11px;height:11px;border:solid var(--ink);border-width:0 3px 3px 0;display:block;}
.chev-l{transform:rotate(135deg);margin-left:4px;}
.chev-r{transform:rotate(-45deg);margin-right:4px;}

.chips{display:flex;flex-wrap:wrap;gap:10px;}
.chip{min-height:44px;padding:0 20px;border-radius:var(--pill);border:1.5px solid var(--grey-500);background:var(--white);
  font:600 16px 'Manrope',sans-serif;color:var(--ink);cursor:pointer;}
.chip:hover{border-color:var(--ink);}
.chip.on{background:var(--ink);border-color:var(--ink);color:var(--white);}
.chip-sm{min-height:40px;padding:0 16px;font-size:15px;min-width:60px;}

/* ---- layout: chats | conversation | presentation */
.app{flex:1;min-height:0;display:grid;grid-template-columns:260px minmax(0,1fr);}
body.has-deck .app{grid-template-columns:260px minmax(380px,460px) minmax(0,1fr);}

/* ---- chats */
.side{border-right:1.5px solid var(--grey-200);overflow-y:auto;padding:16px 12px;background:var(--white);}
.side-head{font-weight:700;font-size:15px;color:var(--grey-500);padding:4px 12px 10px;text-transform:uppercase;letter-spacing:.04em;}
.side-empty{padding:0 12px;}
.recent{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;}
.rc{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border-radius:var(--r-sm);text-decoration:none;}
.rc:hover{background:var(--grey-100);}
.rc.on{background:var(--orange-100);}
.rc-title{font-weight:600;font-size:15px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.rc-meta{font-size:13px;color:var(--grey-500);display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
.tag{font-size:12px;font-weight:700;padding:2px 10px;border-radius:var(--pill);background:var(--grey-100);color:var(--ink);}
.tag.running,.tag.queued{background:var(--orange);}
.tag.error{background:#F6DDD7;color:var(--error);}

/* ---- conversation */
.chat{position:relative;display:flex;flex-direction:column;min-height:0;min-width:0;}
body.has-deck .chat{border-right:1.5px solid var(--grey-200);}
.msgs{flex:1;overflow-y:auto;padding:28px 24px 12px;}
.thread,.welcome{max-width:780px;margin:0 auto;}
.welcome{display:flex;flex-direction:column;gap:18px;padding:3vh 0 24px;}
.welcome-hero{display:flex;align-items:center;gap:20px;flex-wrap:wrap;}
.welcome-iskra{width:168px;height:160px;flex:none;display:flex;align-items:center;justify-content:center;}
.welcome-speech{display:inline-flex;flex-direction:column;gap:4px;padding:12px 18px;border-radius:22px 22px 22px 6px;
  background:var(--grey-100);border:1.5px solid var(--grey-200);max-width:440px;}
.speech-tag{font-size:13px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--terracotta);}
.speech-text{font-size:15px;font-weight:600;color:var(--ink);line-height:1.35;}
.lead{font-size:19px;color:var(--grey-700);margin:0;}
.count-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;}

.thread{display:flex;flex-direction:column;gap:20px;}
.msg{display:flex;gap:12px;align-items:flex-start;}
.msg.user{justify-content:flex-end;}
.msg.user .bubble{max-width:85%;background:var(--orange-100);border-radius:22px 22px 6px 22px;padding:12px 18px;
  display:flex;flex-direction:column;gap:10px;}
.msg.user.action .bubble{background:var(--grey-100);color:var(--grey-700);font-weight:600;font-size:15px;}
.msg.pending .bubble{opacity:.6;}
.msg-text{white-space:pre-wrap;overflow-wrap:anywhere;}
.avatar{width:36px;height:36px;flex:none;margin-top:2px;}
.msg-iskra{width:64px;height:61px;flex:none;margin-top:-6px;display:flex;align-items:center;justify-content:center;}
.msg.live{align-items:center;padding:14px 18px;border-radius:var(--r-md);background:var(--grey-100);border:1.5px solid var(--grey-200);}
.live-iskra{width:118px;height:112px;flex:none;display:flex;align-items:center;justify-content:center;}
.bot-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px;padding-top:6px;}
.msg.live .bot-body{padding-top:0;gap:8px;}
.msg.error .msg-text{color:var(--error);font-weight:600;}
.msg-actions,.msg-links{display:flex;gap:10px;flex-wrap:wrap;}
.slide-link{min-height:36px;padding:0 14px;border-radius:var(--pill);border:1.5px solid var(--grey-300);background:var(--white);
  font:600 14px 'Manrope',sans-serif;cursor:pointer;color:var(--ink);}
.slide-link:hover{border-color:var(--ink);}
.msg-files{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px;}
.msg-file{display:flex;align-items:center;gap:8px;padding:4px 12px 4px 4px;background:var(--white);border-radius:var(--pill);
  font-size:14px;font-weight:600;max-width:100%;}
.msg-file span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.msg-file img{width:28px;height:28px;border-radius:var(--pill);flex:none;}
.msg-file img.ic{padding:5px;filter:brightness(0);}
.msg-file img.ph{object-fit:cover;}

.live-msg{font-weight:700;font-size:19px;line-height:1.25;}
.live-sub{font-size:15px;color:var(--grey-700);line-height:1.35;}
.live-sub:empty{display:none;}
.bar{height:8px;border-radius:var(--pill);background:var(--grey-200);overflow:hidden;max-width:420px;}
.bar-fill{height:100%;width:0;background:var(--orange);border-radius:var(--pill);transition:width .4s;}
.live-note:empty{display:none;}

/* ---- composer */
.composer{flex:none;padding:8px 24px 16px;position:relative;}
.composer > *{max-width:780px;margin-left:auto;margin-right:auto;}
.box{display:flex;align-items:flex-end;gap:8px;border:1.5px solid var(--grey-500);border-radius:26px;padding:6px;background:var(--white);}
.box:focus-within{border-color:var(--ink);}
#input{flex:1;border:0;outline:none;resize:none;font:500 17px/1.45 'Manrope',sans-serif;color:var(--ink);
  padding:10px 4px;max-height:220px;background:none;}
#input::placeholder{color:#8E8E8E;}
.clip,.send{width:44px;height:44px;flex:none;border-radius:var(--pill);border:0;cursor:pointer;display:flex;
  align-items:center;justify-content:center;position:relative;}
.clip{background:var(--grey-100);}
.clip:hover{background:var(--grey-200);}
.clip img{width:22px;height:22px;filter:brightness(0);}
.clip-plus{position:absolute;right:5px;bottom:3px;font:800 16px/1 'Manrope',sans-serif;}
.send{background:var(--orange);}
.send:hover{background:var(--orange-600);}
.send img{width:22px;height:22px;filter:brightness(0);}
.clip:disabled,.send:disabled{opacity:.4;cursor:not-allowed;}
.composer-foot{display:flex;gap:16px;justify-content:space-between;padding:6px 8px 0;font-size:13px;}
.form-error{color:var(--error);font-weight:600;font-size:15px;}
.form-error:empty{display:none;}
.hint{margin-left:auto;}

.att{list-style:none;padding:0;margin:0 auto 8px;display:flex;flex-wrap:wrap;gap:8px;}
.att:empty{display:none;}
.att-item{display:flex;align-items:center;gap:8px;padding:4px 4px 4px 4px;border:1.5px solid var(--grey-200);border-radius:14px;max-width:260px;}
.att-item.bad{border-color:var(--error);}
.att-pic{width:40px;height:40px;border-radius:10px;flex:none;background:var(--orange-100);display:flex;align-items:center;justify-content:center;overflow:hidden;}
.att-pic img.ic{width:20px;height:20px;filter:brightness(0);}
.att-pic img.ph{width:100%;height:100%;object-fit:cover;}
.att-body{min-width:0;flex:1;}
.att-name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.att-size{font-size:12px;color:var(--grey-500);}
.att-item.bad .att-size{color:var(--error);}
.att-del{width:32px;height:32px;border:0;background:none;border-radius:var(--pill);font:600 20px/1 'Manrope',sans-serif;
  color:var(--grey-500);cursor:pointer;flex:none;}
.att-del:hover{background:var(--grey-100);color:var(--error);}
.att-sum{color:var(--error);font-weight:600;font-size:14px;margin-bottom:8px;}

.chat.over::after{content:'Отпустите, чтобы приложить файлы';position:absolute;inset:12px;border:2px dashed var(--orange);
  border-radius:var(--r-md);background:rgba(253,240,212,.92);display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:20px;pointer-events:none;z-index:5;}

/* ---- presentation */
.pane{overflow-y:auto;padding:20px 28px 40px;display:flex;flex-direction:column;gap:14px;min-width:0;}
.pane-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.pane-title{min-width:0;flex:1 1 260px;}
.pane-title h2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.pane-actions{display:flex;gap:10px;flex-wrap:wrap;}
.stage{position:relative;width:100%;aspect-ratio:16/9;border:1.5px solid var(--grey-200);border-radius:var(--r-sm);overflow:hidden;background:var(--white);flex:none;}
.stage iframe{position:absolute;inset:0;width:100%;height:100%;border:0;}
.stage-busy{position:absolute;inset:0;background:rgba(255,255,255,.72);display:flex;align-items:flex-end;justify-content:center;padding:20px;}
.stage-busy-pill{background:var(--ink);color:var(--white);font-weight:700;font-size:15px;padding:6px 20px 6px 10px;border-radius:var(--pill);
  display:inline-flex;align-items:center;gap:8px;}
.stage-busy-iskra{width:46px;height:44px;display:inline-flex;align-items:center;justify-content:center;flex:none;}
.stage-nav{display:flex;align-items:center;justify-content:center;gap:16px;}
.counter{font-weight:600;color:var(--grey-700);min-width:200px;text-align:center;font-size:15px;}

.tools{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;}
.tool{min-height:40px;padding:0 14px;border-radius:var(--pill);border:1.5px solid var(--grey-300);background:var(--white);
  font:600 14px 'Manrope',sans-serif;color:var(--ink);cursor:pointer;display:inline-flex;align-items:center;gap:6px;}
.tool:hover{border-color:var(--ink);}
.tool:disabled,.tool.off{opacity:.4;cursor:not-allowed;}
.tool-select select{border:0;background:none;font:600 14px 'Manrope',sans-serif;color:var(--ink);cursor:pointer;max-width:180px;}
.tool-danger:hover{border-color:var(--error);color:var(--error);}

.thumbs{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 8px;flex:none;}
.thumb{position:relative;flex:0 0 150px;border:0;padding:0;background:none;cursor:pointer;text-align:left;border-radius:10px;}
.thumb-frame{position:relative;width:100%;aspect-ratio:16/9;border-radius:8px;overflow:hidden;border:2px solid var(--grey-200);}
.thumb-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0;pointer-events:none;}
.thumb.on .thumb-frame{border-color:var(--orange);}
.thumb-cap{display:flex;gap:6px;align-items:center;font-size:13px;font-weight:600;color:var(--grey-500);margin-top:4px;}
.thumb.on .thumb-cap{color:var(--ink);}
.thumb-warn{width:9px;height:9px;border-radius:var(--pill);background:var(--terracotta);flex:none;}

.warn-box{padding:12px 18px;border-radius:var(--r-sm);border:1.5px solid var(--terracotta);font-size:15px;}
.warn-box b{color:var(--terracotta);}
.warn-box ul{margin:6px 0 0;padding-left:20px;}
.deck-warn{border:1.5px solid var(--grey-200);border-radius:var(--r-sm);padding:12px 18px;font-size:15px;}
.deck-warn summary{cursor:pointer;font-weight:600;}
.deck-warn ul{margin:10px 0 0;padding-left:20px;color:var(--grey-700);}

/* ---- narrow screens: chats slide in, presentation goes above the chat */
@media (max-width:1180px){
  body.has-deck .app{grid-template-columns:minmax(340px,420px) minmax(0,1fr);}
  .side{display:none;}
  .top .side-toggle{display:inline-flex;}
  body.side-open .side{display:block;position:fixed;top:var(--top);left:0;bottom:0;width:300px;z-index:20;border-right:1.5px solid var(--grey-200);}
  .app{grid-template-columns:minmax(0,1fr);}
}
@media (max-width:820px){
  body{overflow:auto;}
  .top{padding:10px 16px;gap:10px;}
  .top-title{display:none;}
  .brand img{height:36px;}
  .app,body.has-deck .app{display:flex;flex-direction:column;}
  .pane{order:-1;overflow:visible;padding:16px;}
  body.has-deck .chat{border-right:0;border-top:1.5px solid var(--grey-200);}
  .msgs{overflow:visible;padding:20px 16px 8px;}
  .composer{position:sticky;bottom:0;background:var(--white);padding:8px 16px 12px;}
  .hint{display:none;}
  h1{font-size:28px;}
}
