:root{
  color-scheme:dark;
  --bg:#050a0f;--panel:#09141d;--panel-2:#0d1a25;--line:#1d3442;
  --text:#edf8fc;--muted:#8eabb9;--cyan:#43ddff;--blue:#6385ff;--violet:#a46cff;
  --danger:#ff9eaa;--success:#68e9bd;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%;overflow:hidden}
body{margin:0;background:var(--bg);color:var(--text);display:grid;grid-template-rows:72px minmax(0,1fr)}
button,input,textarea{font:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
.ambient{position:fixed;border-radius:50%;filter:blur(120px);pointer-events:none;opacity:.16}
.ambient-a{width:520px;height:520px;background:#008cff;top:-330px;left:18%}
.ambient-b{width:440px;height:440px;background:#7f3cff;right:-260px;bottom:-250px}
.topbar{height:72px;padding:0 28px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(101,162,191,.17);background:rgba(5,10,15,.76);backdrop-filter:blur(18px);position:relative;z-index:20}
.brand{display:flex;align-items:center;gap:12px;color:var(--text);text-decoration:none}
.brand>span:last-child{display:grid;line-height:1.05}
.brand strong{font-size:1rem;letter-spacing:.01em}
.brand small{font-size:.68rem;color:var(--muted);margin-top:5px}
.brand-mark{width:34px;height:34px;border:1px solid rgba(67,221,255,.35);border-radius:11px;display:grid;place-items:center;background:linear-gradient(145deg,rgba(67,221,255,.16),rgba(164,108,255,.12));box-shadow:0 0 28px rgba(67,221,255,.13)}
.brand-mark:before,.brand-mark:after,.brand-mark i{content:"";position:absolute;width:14px;height:14px;border:1px solid var(--cyan);transform:rotate(45deg);border-radius:4px}
.brand-mark{position:relative}.brand-mark:after{transform:rotate(45deg) scale(.52);border-color:#c8f7ff}.brand-mark i{transform:rotate(45deg) scale(.2);background:#fff;border:0}
.top-actions{display:flex;align-items:center;gap:12px}
.model-badge{display:flex;align-items:center;gap:8px;border:1px solid rgba(104,233,189,.2);background:rgba(104,233,189,.06);color:#baf6df;padding:7px 12px;border-radius:999px;font-size:.78rem}
.model-badge i{width:7px;height:7px;border-radius:50%;background:var(--success);box-shadow:0 0 12px var(--success)}
.ghost{border:1px solid var(--line);background:rgba(15,29,40,.75);color:#d8e9f0;padding:9px 15px;border-radius:10px}
.ghost:hover{border-color:#36576a;background:#10222e}
main{height:auto;min-height:0;overflow:hidden;position:relative;z-index:1}
.login-card{width:min(440px,calc(100% - 32px));margin:clamp(28px,8vh,84px) auto;padding:38px;border:1px solid var(--line);border-radius:24px;background:linear-gradient(150deg,rgba(14,30,41,.96),rgba(7,17,25,.96));box-shadow:0 32px 100px rgba(0,0,0,.45),inset 0 1px rgba(255,255,255,.03)}
.login-card h1{font-size:clamp(2rem,5vw,2.7rem);line-height:1.02;margin:12px 0}
.muted{color:var(--muted);line-height:1.6}
.eyebrow{color:var(--cyan);font-size:.7rem;font-weight:750;letter-spacing:.16em;margin:0 0 8px}
label{display:block;color:#d9e8ee;font-size:.9rem;margin:18px 0 8px}
input:not([type=checkbox]),.login-card input{display:block;width:100%;margin-top:8px;border:1px solid #294454;background:#07121a;color:#fff;padding:13px 14px;border-radius:11px;outline:0}
input:focus{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(67,221,255,.1)}
.primary{border:0;background:linear-gradient(100deg,var(--cyan),#6fa1ff);color:#031018;font-weight:800;padding:13px 20px;border-radius:11px}
.wide{width:100%;margin-top:14px;display:flex;justify-content:space-between}
.ai-orb{width:78px;height:78px;border-radius:50%;margin:0 auto 24px;position:relative;background:conic-gradient(from 210deg,var(--cyan),var(--blue),var(--violet),#57f2c5,var(--cyan));filter:drop-shadow(0 0 25px rgba(92,153,255,.38));animation:float 4s ease-in-out infinite}
.ai-orb:before{content:"";position:absolute;inset:4px;border-radius:50%;background:radial-gradient(circle at 32% 28%,#d9fbff 0 3%,#62dff5 12%,#193868 43%,#080d1a 72%)}
.ai-orb:after{content:"";position:absolute;inset:-8px;border:1px solid rgba(105,218,255,.24);border-radius:50%;animation:pulse 2.7s ease-out infinite}
.ai-orb i{position:absolute;z-index:1;inset:20px;border-radius:50%;border:1px solid rgba(255,255,255,.2)}
.ai-orb.small{width:54px;height:54px;margin:0 0 22px}.ai-orb.small i{inset:14px}
@keyframes float{50%{transform:translateY(-7px)}}@keyframes pulse{70%,100%{transform:scale(1.35);opacity:0}}
.chat-app{height:100%;min-height:0;display:grid;grid-template-columns:240px minmax(0,1fr);overflow:hidden}
.side-panel{border-right:1px solid rgba(101,162,191,.14);background:rgba(7,15,22,.58);padding:24px 18px;display:flex;flex-direction:column}
.new-chat{width:100%;display:flex;gap:10px;align-items:center;border:1px solid #2b4a5b;background:linear-gradient(115deg,rgba(67,221,255,.1),rgba(99,133,255,.08));color:#eafaff;border-radius:12px;padding:12px 14px;font-weight:680}
.new-chat:hover{border-color:var(--cyan);box-shadow:0 0 24px rgba(67,221,255,.08)}
.new-chat span{font-size:1.25rem;color:var(--cyan)}
.side-copy{margin-top:36px;color:#aac1cc;font-size:.84rem}
.side-copy .eyebrow{color:#698493;margin:0 8px 16px}
.side-copy p:not(.eyebrow){display:flex;align-items:center;gap:10px;padding:9px 8px;margin:0}
.side-copy p span{color:#70dff5;width:18px;text-align:center}
.privacy{margin:auto 8px 0;padding-top:18px;border-top:1px solid var(--line);font-size:.78rem;color:#a5bcc7;line-height:1.45}
.privacy>span{color:var(--success);margin-right:5px}.privacy small{color:#647e8b}
.conversation{position:relative;min-width:0;min-height:0;height:100%;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.conversation-head{min-height:66px;padding:15px clamp(20px,4vw,48px);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(101,162,191,.1)}
.conversation-head .eyebrow{margin:0}.welcome{margin:5px 0 0;color:var(--muted);font-size:.78rem}
.compact{display:none;padding:8px 10px;font-size:.78rem}
.messages{min-height:0;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:24px max(24px,calc((100% - 820px)/2));scrollbar-color:#3b667b #071018;scrollbar-width:auto}
.empty-state{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 0 40px}
.empty-state h1{font-size:clamp(2rem,4vw,3.25rem);line-height:1.08;letter-spacing:-.04em;margin:8px 0 15px}
.empty-state h1 span{background:linear-gradient(90deg,#63e5ff,#8ea7ff,#c183ff);-webkit-background-clip:text;background-clip:text;color:transparent}
.empty-state>p:not(.eyebrow){color:var(--muted);margin:0;max-width:500px}
.suggestions{display:flex;flex-wrap:wrap;justify-content:center;gap:9px;margin-top:26px}
.suggestions button{border:1px solid #213c4d;background:rgba(12,28,39,.75);color:#bcd1dc;padding:9px 13px;border-radius:999px;font-size:.78rem}
.suggestions button:hover{border-color:#46758c;color:#fff}
.message{display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;margin:18px 0;animation:message-in .25s ease-out}
.message:before{content:"";width:34px;height:34px;border-radius:10px;background:linear-gradient(145deg,#16bddd,#687bf5);box-shadow:0 0 22px rgba(67,221,255,.14)}
.message.user:before{background:#122632;border:1px solid #31505f}
.message-body{min-width:0;border:1px solid #1d3442;background:linear-gradient(145deg,rgba(13,28,39,.96),rgba(9,20,29,.96));border-radius:4px 16px 16px 16px;padding:15px 18px;line-height:1.68;white-space:pre-wrap;overflow-wrap:anywhere}
.message.user .message-body{background:rgba(15,38,48,.74);border-color:#244959}
.message-content p{margin:.28em 0}.message-content p.spacer{height:.65em;margin:0}.message-content p.bullet{padding-left:1.15em;position:relative}.message-content p.bullet:before{content:"•";position:absolute;left:.15em;color:var(--cyan)}.message-content h2,.message-content h3{margin:1em 0 .35em;line-height:1.25}.message-content h2{font-size:1.18rem}.message-content h3{font-size:1rem}
.message-title{display:block;color:var(--cyan);font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;margin-bottom:7px}
.message-content{color:#e4f0f5}
.message-meta{color:#829eaa;font-size:.77rem;margin:10px 0 0}
.listen-button{margin-top:13px;border:1px solid #294b5b;border-radius:9px;background:#0a1c26;color:#92dff0;padding:7px 10px;font-size:.72rem}.listen-button:hover{border-color:#4b849a;color:#fff}.listen-button.speaking{border-color:var(--cyan);background:rgba(67,221,255,.1);color:#d8fbff}.listen-button span{font-size:.9rem;margin-right:3px}
.sources{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;padding-top:13px;border-top:1px solid #213b49}
.sources strong{width:100%;font-size:.72rem;color:#8faab6;text-transform:uppercase;letter-spacing:.08em}
.sources a{color:#8be8fa;text-decoration:none;border:1px solid #294b5b;border-radius:999px;padding:6px 10px;font-size:.75rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.thinking .message-body{width:92px}.dots{display:flex;gap:5px;padding:5px 0}.dots i{width:7px;height:7px;border-radius:50%;background:var(--cyan);animation:dots 1.2s infinite}.dots i:nth-child(2){animation-delay:.15s}.dots i:nth-child(3){animation-delay:.3s}
@keyframes dots{0%,70%,100%{opacity:.25;transform:translateY(0)}35%{opacity:1;transform:translateY(-4px)}}@keyframes message-in{from{opacity:0;transform:translateY(6px)}}
.composer-wrap{position:relative;padding:0 max(24px,calc((100% - 820px)/2)) 18px;background:linear-gradient(0deg,var(--bg) 72%,transparent)}
.composer{border:1px solid #294655;background:rgba(10,23,33,.94);border-radius:18px;padding:10px;box-shadow:0 18px 55px rgba(0,0,0,.36),0 0 0 1px rgba(255,255,255,.015);backdrop-filter:blur(18px)}
.composer:focus-within{border-color:#447389;box-shadow:0 18px 55px rgba(0,0,0,.4),0 0 0 3px rgba(67,221,255,.06)}
.composer textarea{display:block;width:100%;min-height:46px;max-height:170px;resize:none;border:0;outline:0;background:transparent;color:#eefaff;padding:10px 12px;font:inherit;line-height:1.5}
.composer textarea::placeholder{color:#6f8b98}
.composer-bar{display:flex;align-items:center;justify-content:space-between;gap:12px}
.composer-tools{display:flex;align-items:center;gap:7px}
.tool-button,.search-toggle{height:36px;display:flex;align-items:center;gap:7px;border:1px solid #213c4b;background:#0a1922;color:#a9c0ca;border-radius:10px;padding:0 11px;font-size:.77rem;margin:0}
.tool-button:hover,.search-toggle:hover{color:#fff;border-color:#3c667a}
.tool-button{cursor:pointer}.tool-button span:first-child{font-size:1.15rem;color:var(--cyan)}
.tool-button.recording{border-color:#ff6f80;background:rgba(255,80,103,.12);color:#ffd7dc}.tool-button.recording span:first-child{color:#ff6f80;animation:record-pulse 1s infinite}@keyframes record-pulse{50%{opacity:.35}}
.search-toggle input{position:absolute;opacity:0;pointer-events:none}
.search-toggle:has(input:checked){color:#d7fbff;border-color:#3c9eb5;background:rgba(67,221,255,.1)}
.search-toggle>span:first-of-type{font-size:1.05rem;color:#7fe9ff}
.send-button{height:38px;border:0;border-radius:11px;padding:0 8px 0 15px;display:flex;align-items:center;gap:10px;background:linear-gradient(110deg,var(--cyan),#77a1ff);color:#031018;font-size:.79rem;font-weight:800}
.send-button b{width:25px;height:25px;border-radius:8px;background:rgba(0,0,0,.14);display:grid;place-items:center;font-size:1rem}
.send-button:disabled,.tool-button:disabled{opacity:.5;cursor:wait}
.composer-note{text-align:center;color:#536f7d;font-size:.66rem;margin:8px 0 0}
.file-list{display:flex;gap:8px;overflow-x:auto;padding:0 2px}
.file-list:empty{display:none}
.file-chip{flex:0 0 auto;max-width:240px;display:flex;align-items:center;gap:9px;border:1px solid #274757;background:#0b1d27;border-radius:11px;padding:8px 9px}
.file-icon{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;background:rgba(67,221,255,.1);color:var(--cyan);font-size:.65rem;font-weight:800}
.file-info{min-width:0;display:grid}.file-info strong{font-size:.72rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-info small{color:#718d99;font-size:.64rem}
.file-remove{border:0;background:transparent;color:#7d99a5;padding:4px;font-size:1rem}.file-remove:hover{color:#fff}
.status{min-height:20px;margin:0 4px 6px;color:#8de9fb;font-size:.76rem}
.status.error{color:var(--danger)}
.drop-overlay{position:absolute;z-index:10;inset:67px 0 0;background:rgba(4,12,18,.84);backdrop-filter:blur(12px);padding:30px}
.drop-overlay>div{height:100%;border:2px dashed #47cae8;border-radius:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:rgba(31,184,218,.06);box-shadow:inset 0 0 90px rgba(67,221,255,.05)}
.drop-overlay span{font-size:3rem;color:var(--cyan)}.drop-overlay strong{font-size:1.35rem;margin:12px}.drop-overlay small{color:var(--muted)}
:focus-visible{outline:3px solid rgba(67,221,255,.8);outline-offset:3px}
@media(max-width:780px){
  body{grid-template-rows:64px minmax(0,1fr)}.topbar{height:64px;padding:0 16px}main{height:auto;min-height:0}
  .model-badge span{display:none}.model-badge{padding:9px}
  .chat-app{grid-template-columns:1fr}.side-panel{display:none}.compact{display:block}
  .conversation-head{min-height:58px;padding:11px 15px}
  .messages{padding:16px}.empty-state{padding:12px 0 24px}.empty-state h1{font-size:2rem}
  .suggestions{gap:7px}.suggestions button{font-size:.7rem;padding:8px 10px}
  .composer-wrap{padding:0 10px 10px}.composer-note{font-size:.59rem}
  .message{grid-template-columns:29px minmax(0,1fr);gap:8px}.message:before{width:28px;height:28px;border-radius:8px}.message-body{padding:13px}
}

/* Administração de usuários */
.users-link{display:flex;align-items:center;gap:10px;color:#a9bec9;text-decoration:none;border:1px solid #1c3846;background:#0a1922;border-radius:11px;padding:10px;margin:12px 0 0}
.users-link:hover{border-color:#3a687c;color:#fff}.users-link>span:first-child{width:28px;height:28px;border-radius:8px;background:#112a36;color:var(--cyan);display:grid;place-items:center}.users-link>span:last-child{display:grid;gap:2px}.users-link strong{font-size:.77rem}.users-link small{font-size:.62rem;color:#6d8996}
.users-page{overflow:auto;min-height:100%}.users-page main{height:auto}.back-link{text-decoration:none}.users-main{max-width:1040px;margin:0 auto;padding:54px 24px 80px}.users-heading h1{font-size:clamp(2.2rem,5vw,3.5rem);margin:8px 0 12px;letter-spacing:-.04em}.users-heading>p:last-child{color:var(--muted)}
.users-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:20px;margin-top:34px}.users-card{border:1px solid var(--line);border-radius:18px;background:linear-gradient(145deg,rgba(13,28,39,.96),rgba(7,17,25,.96));padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.24)}.users-card h2{margin:2px 0 10px;font-size:1.15rem}.card-title{display:flex;justify-content:space-between;align-items:flex-start}.count-badge{min-width:31px;height:31px;border-radius:999px;background:rgba(67,221,255,.1);border:1px solid #285164;color:var(--cyan);display:grid;place-items:center;font-size:.76rem}
.admin-user-list{display:grid;gap:8px;margin-top:17px}.admin-user{display:flex;align-items:center;gap:11px;padding:11px;border:1px solid #1b3543;border-radius:12px;background:#081720}.user-avatar{width:35px;height:35px;display:grid;place-items:center;border-radius:10px;background:linear-gradient(145deg,#1a5265,#514e9b);color:#fff;font-weight:800}.user-copy{display:grid;gap:2px;min-width:0;flex:1}.user-copy strong{font-size:.86rem}.user-copy small{font-size:.67rem;color:#718d99}.admin-user button{font-size:.69rem;padding:7px 9px}.admin-user .mini{border-radius:8px}.admin-status{position:fixed;right:22px;bottom:22px;max-width:420px;margin:0;border:1px solid #285164;background:#0b202b;color:#9eedfd;padding:11px 14px;border-radius:11px;box-shadow:0 14px 45px #000;font-size:.8rem}.admin-status:empty{display:none}.admin-status.error{color:var(--danger);border-color:#6b3440}.reset-dialog{width:min(540px,calc(100% - 28px))}
@media(max-width:760px){.users-grid{grid-template-columns:1fr}.users-main{padding:34px 16px 70px}.admin-user{flex-wrap:wrap}.user-copy{min-width:120px}.back-link{font-size:.72rem;padding:8px}.admin-status{left:14px;right:14px;bottom:14px}}
@media(max-width:420px){
  .send-button span,.tool-button span:last-child,.search-toggle span:last-child{display:none}
  .send-button{padding:0 7px}.tool-button,.search-toggle{width:38px;padding:0;justify-content:center}
  .login-card{padding:26px}.empty-state br{display:none}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;scroll-behavior:auto!important}}

/* Navegação, histórico e Gems */
.mobile-menu{display:none;width:40px;height:40px;padding:0}
.chat-app{grid-template-columns:286px minmax(0,1fr)}
.side-panel{padding:18px 14px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;min-height:0;z-index:18;scrollbar-width:auto;scrollbar-color:#315265 #071018}
.side-panel::-webkit-scrollbar{width:10px}.side-panel::-webkit-scrollbar-track{background:#071018}.side-panel::-webkit-scrollbar-thumb{background:#294d60;border:2px solid #071018;border-radius:999px}.side-panel::-webkit-scrollbar-thumb:hover{background:#3d728a}
.sidebar-section{display:flex;flex-direction:column;flex:0 0 auto;min-height:auto;margin-top:24px}
.history-section{flex:0 0 auto}.gems-section{flex:0 0 auto;margin-top:16px}
.sidebar-title{display:flex;align-items:center;justify-content:space-between;color:#698493;font-size:.66rem;font-weight:800;letter-spacing:.15em;padding:0 8px 8px}
.sidebar-title button{width:27px;height:27px;border:1px solid #294757;border-radius:8px;background:#0b1c26;color:var(--cyan);font-size:1rem;line-height:1;padding:0}
.side-list{display:flex;flex-direction:column;gap:3px;overflow:visible;min-height:0;padding-right:3px}
.history-item,.gem-item{width:100%;border:1px solid transparent;background:transparent;color:#a9bec9;border-radius:10px;padding:9px 10px;display:flex;align-items:center;gap:10px;text-align:left;min-width:0}
.history-item:hover,.gem-item:hover{background:#0c1c26;color:#f1fbff;border-color:#183442}
.history-item.active,.gem-item.active{background:linear-gradient(110deg,rgba(67,221,255,.11),rgba(99,133,255,.08));border-color:#285164;color:#fff}
.history-copy,.gem-item>span:nth-child(2){min-width:0;display:grid;gap:2px;flex:1}
.history-copy strong,.gem-item strong{font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:620}
.history-copy small,.gem-item small{font-size:.63rem;color:#698592;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-icon,.gem-icon{width:27px;height:27px;border-radius:8px;display:grid;place-items:center;flex:0 0 auto;background:#102733;color:#71e5fb;font-size:.75rem}
.history-delete,.gem-edit{opacity:0;width:26px;height:26px;border:0;background:transparent;color:#76919d;border-radius:7px;padding:0;flex:0 0 auto}
.history-item:hover .history-delete,.gem-item:hover .gem-edit{opacity:1}.history-delete:hover,.gem-edit:hover{background:#19313d;color:#fff}
.side-empty{font-size:.69rem;line-height:1.4;color:#536f7d;padding:7px 9px;margin:0}
.privacy{margin:14px 8px 0;flex:0 0 auto}
.active-gem{border:1px solid #2d5365;background:rgba(67,221,255,.07);color:#9bebfb;border-radius:999px;padding:7px 11px;font-size:.71rem}
.sidebar-backdrop{position:fixed;inset:64px 0 0;z-index:17;border:0;background:rgba(0,0,0,.62);backdrop-filter:blur(3px)}
.messages{overflow-y:scroll;scrollbar-color:#3b667b #071018;scrollbar-width:auto}
.messages::-webkit-scrollbar{width:12px}.messages::-webkit-scrollbar-track{background:#071018}.messages::-webkit-scrollbar-thumb{background:#294d60;border:3px solid #071018;border-radius:999px}.messages::-webkit-scrollbar-thumb:hover{background:#3d728a}

/* Editor de Gem */
.gem-dialog{width:min(680px,calc(100% - 28px));max-height:90vh;overflow:auto;border:1px solid #284554;border-radius:22px;background:linear-gradient(145deg,#0c1a24,#071119);color:var(--text);padding:0;box-shadow:0 35px 120px #000}
.gem-dialog::backdrop{background:rgba(0,5,9,.76);backdrop-filter:blur(8px)}
.gem-dialog form{padding:26px}.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.dialog-head h2{margin:2px 0 8px;font-size:1.55rem}
.dialog-close{width:36px;height:36px;border:1px solid var(--line);border-radius:10px;background:#10212c;color:#bdd1da;font-size:1.4rem}
.gem-dialog input:not([type=checkbox]),.gem-dialog textarea{display:block;width:100%;margin-top:8px;border:1px solid #294454;background:#07121a;color:#fff;padding:12px 13px;border-radius:10px;outline:0;resize:vertical}
.gem-dialog textarea{line-height:1.5}.gem-dialog input:focus,.gem-dialog textarea:focus{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(67,221,255,.08)}
.dialog-check{display:flex;gap:11px;align-items:flex-start;border:1px solid #243f4e;border-radius:11px;padding:12px;margin-top:18px}.dialog-check input{margin-top:3px}.dialog-check span{display:grid;gap:3px}.dialog-check small{color:#78929e;font-size:.72rem}
.dialog-actions{display:flex;align-items:center;gap:9px;margin-top:17px}.dialog-actions>span{flex:1}.dialog-actions button{padding:10px 14px;border-radius:10px}
.danger{border:1px solid rgba(255,111,128,.35);background:rgba(255,80,103,.08);color:#ff9eaa}
.gem-knowledge{margin-top:18px;border:1px solid #243f4e;border-radius:14px;background:rgba(7,18,26,.72);padding:14px}.knowledge-head{display:flex;align-items:center;justify-content:space-between;gap:14px}.knowledge-head>span{display:grid;gap:4px}.knowledge-head strong{font-size:.88rem}.knowledge-head small,.knowledge-note{color:#78929e;font-size:.69rem;line-height:1.45}.knowledge-head button{white-space:nowrap;padding:8px 11px}.gem-file-list{display:grid;gap:7px;margin-top:12px}.knowledge-file{display:flex;align-items:center;gap:9px;border:1px solid #1e3b49;border-radius:10px;background:#091923;padding:8px}.knowledge-file .file-info{flex:1}.knowledge-empty{margin:4px 2px;color:#587481;font-size:.73rem}.knowledge-note{margin:10px 2px 0}

@media(max-width:780px){
  .mobile-menu{display:block}.brand{margin-right:auto}.topbar{gap:10px}
  .side-panel{display:flex;position:fixed;top:64px;bottom:0;left:0;width:min(310px,88vw);transform:translateX(-105%);transition:transform .22s ease;background:#071018;box-shadow:20px 0 60px rgba(0,0,0,.5)}
  .side-panel.open{transform:translateX(0)}
  .conversation-head{padding-left:16px}.active-gem{max-width:44%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .messages{scrollbar-width:thin}.messages::-webkit-scrollbar{width:7px}
  .gem-dialog form{padding:20px}.dialog-actions{flex-wrap:wrap}.dialog-actions>span{display:none}.dialog-actions button{flex:1}.knowledge-head{align-items:flex-start;flex-direction:column}.knowledge-head button{width:100%}
}
