:root{color-scheme:dark;--bg:#090b11;--surface:#10131b;--surface2:#161a25;--surface3:#1d2230;--sidebar:#0d1017;--line:rgba(255,255,255,.075);--text:#f4f6fb;--muted:#929bad;--muted2:#697386;--accent:#7d55ff;--accent2:#536dff;--accentSoft:rgba(125,85,255,.14);--user:#202536;--code:#080a0f;--success:#43d690;--shadow:0 22px 65px rgba(0,0,0,.3);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
html[data-theme=dark]{--accent:#c9cfdb;--accent2:#8f99aa;--accentSoft:rgba(255,255,255,.075);--user:#1c212c}
html[data-theme=blue]{--accent:#4e9cff;--accent2:#48c4ff;--accentSoft:rgba(78,156,255,.13);--user:#1b2a3c}
html[data-theme=green]{--accent:#42cf90;--accent2:#2caeaa;--accentSoft:rgba(66,207,144,.12);--user:#173028}
html[data-theme=orange]{--accent:#ff9950;--accent2:#ff6d62;--accentSoft:rgba(255,153,80,.13);--user:#36251d}
html[data-theme=light]{color-scheme:light;--bg:#f7f8fb;--surface:#fff;--surface2:#f2f4f8;--surface3:#eceff5;--sidebar:#fff;--line:rgba(25,31,44,.09);--text:#202532;--muted:#687184;--muted2:#8a92a2;--accent:#6555d9;--accent2:#4774dc;--accentSoft:rgba(101,85,217,.1);--user:#eae9fb;--code:#151820;--shadow:0 20px 60px rgba(40,48,67,.1)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}body{font-size:14px}button,textarea,select,input{font:inherit}.hidden{display:none!important}.app{display:grid;grid-template-columns:268px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;padding:16px 13px 11px;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--line);background:var(--sidebar);z-index:20}.brandRow{display:flex;align-items:center;justify-content:space-between;min-height:50px}.brand{display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none}.brand img{width:42px;height:42px}.brand strong,.brand small{display:block}.brand strong{font-size:17px}.brand small{color:var(--muted);font-size:10px}.iconBtn{width:34px;height:34px;border:1px solid var(--line);border-radius:10px;background:transparent;color:var(--text);cursor:pointer}.sidebarClose{display:none;font-size:20px}.newChat{width:100%;min-height:41px;margin:17px 0 13px;border:0;border-radius:11px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;font-weight:750;cursor:pointer}.nav{display:grid;gap:2px}.navItem{min-height:37px;padding:0 10px;display:flex;align-items:center;gap:8px;border:0;border-radius:9px;background:transparent;color:var(--muted);cursor:pointer;text-align:left}.navItem.active,.navItem:hover{background:var(--accentSoft);color:var(--text)}.navItem b{margin-left:auto;min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;border-radius:999px;background:var(--surface3);font-size:9px}.sectionTitle{margin:18px 8px 6px;color:var(--muted2);font-size:9px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.history{flex:1;overflow:auto;scrollbar-width:thin}.historyGroup{margin:6px 0 11px}.historyGroupTitle{margin:0 8px 4px;color:var(--muted2);font-size:9px}.historyItem{width:100%;min-height:33px;padding:6px 8px;border:0;border-radius:8px;background:transparent;color:var(--muted);text-align:left;font-size:11px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.historyItem:hover,.historyItem.active{background:var(--accentSoft);color:var(--text)}.historyEmpty{padding:10px 8px;color:var(--muted2);font-size:10px}.sidebarFooter{min-height:35px;padding:8px 7px 0;display:flex;align-items:center;gap:7px;border-top:1px solid var(--line);color:var(--muted);font-size:10px}.sidebarFooter i{width:7px;height:7px;border-radius:50%;background:var(--success)}.sidebarFooter small{margin-left:auto;color:var(--muted2)}.sidebarBackdrop{display:none}
.main{min-width:0;display:flex;flex-direction:column;min-height:100vh}.topbar{position:sticky;top:0;z-index:15;height:58px;padding:0 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(16px)}.menuBtn{display:none}.conversationHeading{min-width:0;flex:1}.conversationHeading strong,.conversationHeading small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversationHeading strong{font-size:12.5px}.conversationHeading small{color:var(--muted2);font-size:9px}.topActions{display:flex;align-items:center;gap:7px}.planPill{padding:5px 8px;border:1px solid color-mix(in srgb,var(--accent) 32%,var(--line));border-radius:999px;background:var(--accentSoft);font-size:9px;font-weight:800}.themePicker{min-height:32px;padding:0 6px;border:1px solid var(--line);border-radius:9px;background:var(--surface);display:flex;align-items:center}.themePicker select{max-width:84px;border:0;outline:0;background:transparent;color:var(--text);font-size:10px}.avatar{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;text-decoration:none;font-size:10px;font-weight:800}
.content{flex:1}.chatPanel{min-height:calc(100vh - 86px);display:flex;flex-direction:column}.messages{width:100%;max-width:820px;margin:0 auto;padding:32px 24px 180px}.welcome{text-align:center;padding-top:15vh}.welcomeLogo{width:56px;height:56px}.welcome h1{margin:9px 0 4px;font-size:26px;letter-spacing:-.04em}.welcome p{margin:0;color:var(--muted);font-size:12px}.msg{display:flex;margin:17px 0}.msg.user{justify-content:flex-end}.bubble{max-width:min(700px,94%);overflow-wrap:anywhere}.user .bubble{padding:9px 12px;border:1px solid var(--line);border-radius:14px;background:var(--user);white-space:pre-wrap;font-size:12.5px;line-height:1.48}.assistant .bubble{width:min(700px,100%);font-size:13px;line-height:1.62}.assistantHead{display:flex;align-items:center;gap:6px;margin-bottom:7px;font-size:10px;font-weight:800}.assistantHead img{width:21px;height:21px}.meta{margin-top:6px;color:var(--muted2);font-size:9px}.markdown>:first-child{margin-top:0}.markdown>:last-child{margin-bottom:0}.markdown p{margin:0 0 .78em}.markdown h1,.markdown h2,.markdown h3{margin:1.1em 0 .4em;line-height:1.2}.markdown h1{font-size:17px}.markdown h2{font-size:15px}.markdown h3{font-size:13.5px}.markdown ul,.markdown ol{margin:.4em 0 .75em;padding-left:1.25em}.markdown li{margin:.14em 0}.markdown a{color:var(--accent)}.markdown img.chatImage{display:block;width:min(100%,620px);max-height:68vh;object-fit:contain;border-radius:13px;border:1px solid var(--line);background:var(--surface);margin:10px 0}.imageActions{display:flex;gap:6px;margin:7px 0 4px}.imageActions button,.imageActions a{min-height:28px;padding:0 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface2);color:var(--text);font-size:9px;text-decoration:none;cursor:pointer}.markdown code:not(pre code){padding:.1em .32em;border-radius:5px;background:var(--surface3);font-family:Consolas,monospace;font-size:.88em}.codeBlock{margin:.8em 0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--code)}.codeTop{min-height:31px;padding:0 8px 0 10px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(255,255,255,.07);color:#99a2b4;font-size:9px}.copyCode{min-height:22px;padding:0 7px;border:1px solid rgba(255,255,255,.1);border-radius:6px;background:rgba(255,255,255,.05);color:#dce1eb;cursor:pointer;font-size:9px}.codeBlock pre{margin:0;padding:11px;overflow-x:auto}.codeBlock code{color:#e4e8f0;font:11px/1.5 Consolas,monospace;white-space:pre}.sources{margin-top:10px;padding-top:8px;border-top:1px solid var(--line)}.sourcesTitle{color:var(--muted2);font-size:8.5px;font-weight:800}.sourceList{margin-top:5px;display:flex;flex-wrap:wrap;gap:5px}.sourceChip{max-width:210px;padding:4px 6px;border:1px solid var(--line);border-radius:7px;background:var(--surface2);color:var(--muted);font-size:9px;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.composer{position:fixed;left:268px;right:0;bottom:22px;z-index:12;width:min(760px,calc(100vw - 312px));margin:auto;padding:7px 8px 6px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--surface) 95%,transparent);box-shadow:var(--shadow);backdrop-filter:blur(16px)}.referenceBar{min-height:35px;padding:4px 5px;display:flex;align-items:center;gap:7px;border-bottom:1px solid var(--line);color:var(--muted);font-size:10px}.referenceBar img{width:29px;height:29px;object-fit:cover;border-radius:7px}.referenceBar span{flex:1}.referenceBar button{border:0;background:transparent;color:var(--muted);cursor:pointer}.attachmentPreview{display:flex;gap:6px;flex-wrap:wrap;padding:0 2px}.attachmentCard{position:relative;width:46px;height:46px;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface2)}.attachmentCard img{width:100%;height:100%;object-fit:cover}.attachmentDoc{width:auto;max-width:150px;padding:0 8px;display:flex;align-items:center;font-size:9px;color:var(--muted)}.attachmentCard button{position:absolute;top:2px;right:2px;width:16px;height:16px;border:0;border-radius:50%;background:rgba(0,0,0,.7);color:#fff;font-size:9px;cursor:pointer}.mediaToolbar{display:flex;align-items:center;gap:5px;padding:4px 3px;color:var(--muted);font-size:9px}.mediaChoice{min-height:24px;padding:0 7px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--muted);cursor:pointer}.mediaChoice.active{background:var(--accentSoft);color:var(--text);border-color:color-mix(in srgb,var(--accent) 30%,var(--line))}
.inputRow{display:flex;align-items:flex-end;gap:5px}.attachButton{width:32px;height:32px;display:grid;place-items:center;flex:none;border:1px solid var(--line);border-radius:9px;background:var(--surface2);cursor:pointer;font-size:16px}.attachButton input{display:none}.inputRow textarea{flex:1;min-height:34px;max-height:145px;padding:7px 4px;resize:none;border:0;outline:0;background:transparent;color:var(--text);font-size:12.5px;line-height:1.42}.sendButton{width:34px;height:34px;flex:none;border:0;border-radius:9px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;cursor:pointer}.composerBottom{display:flex;align-items:center;justify-content:space-between;gap:7px;padding:3px 2px 0}.composerOptions{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.optionChip{height:26px;padding:0 7px;display:flex;align-items:center;gap:5px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--muted);font-size:9px;cursor:pointer}.optionChip input{position:absolute;opacity:0}.optionChip i{width:18px;height:10px;border-radius:999px;background:var(--surface3);position:relative}.optionChip i:after{content:"";position:absolute;top:2px;left:2px;width:6px;height:6px;border-radius:50%;background:var(--muted)}.optionChip input:checked+i{background:var(--accent)}.optionChip input:checked+i:after{left:10px;background:#fff}.actionChip.active{background:var(--accentSoft);color:var(--text)}
.usageBar{height:28px;padding:0 17px;display:flex;align-items:center;justify-content:flex-end;color:var(--muted2);font-size:9px}.memoriesPanel{max-width:850px;margin:0 auto;padding:48px 24px}.memoriesHeader{display:flex;align-items:flex-end;justify-content:space-between;gap:18px}.eyebrow{color:var(--accent);font-size:8.5px;font-weight:800;letter-spacing:.1em}.memoriesHeader h1{margin:6px 0 4px;font-size:25px}.memoriesHeader p{margin:0;color:var(--muted);font-size:11px}.secondaryButton{min-height:32px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);cursor:pointer;font-size:10px}.memoriesList{margin-top:20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.memoryCard,.emptyCard{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}.memoryCard p{margin:0;font-size:11.5px;line-height:1.48}.memoryMeta{margin-top:7px;display:flex;justify-content:space-between;color:var(--muted2);font-size:8.5px}.emptyCard{grid-column:1/-1;color:var(--muted);font-size:10px}
.imageModeSheet{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:18px;background:rgba(0,0,0,.58);backdrop-filter:blur(6px)}.sheetCard{position:relative;width:min(92vw,500px);padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}.sheetCard>img{width:44px;height:44px}.sheetCard h2{margin:7px 0 3px}.sheetCard p{margin:0 0 14px;color:var(--muted);font-size:11px}.sheetCard textarea{width:100%;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--surface2);color:var(--text);resize:vertical;outline:0;font-size:12px}.sheetRow{margin-top:9px;display:flex;gap:8px}.sheetRow select{flex:1;padding:0 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface2);color:var(--text);font-size:10px}.sheetRow button{min-height:36px;padding:0 13px;border:0;border-radius:9px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;font-size:10px;font-weight:750;cursor:pointer}.sheetClose{position:absolute;top:10px;right:10px;border:0;background:transparent;color:var(--muted);font-size:20px;cursor:pointer}.toast{position:fixed;right:14px;bottom:14px;z-index:60;max-width:330px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:var(--shadow);font-size:10px}.toast.error{border-color:var(--danger)}
@media(max-width:900px){.app{grid-template-columns:1fr}.sidebar{position:fixed;left:0;transform:translateX(-105%);width:268px;box-shadow:var(--shadow);transition:transform .2s}.sidebar.open{transform:translateX(0)}.sidebarClose,.menuBtn{display:grid;place-items:center}.sidebarBackdrop.show{display:block;position:fixed;inset:0;z-index:19;background:rgba(0,0,0,.5)}.composer{left:10px;right:10px;width:auto;bottom:10px}.topbar{padding:0 12px}.messages{padding-inline:15px}}
@media(max-width:560px){.planPill{display:none}.themePicker select{max-width:68px}.conversationHeading small{display:none}.messages{padding-top:24px;padding-bottom:168px}.welcome{padding-top:12vh}.welcome h1{font-size:23px}.assistant .bubble{font-size:12.6px}.user .bubble{font-size:12px}.memoriesList{grid-template-columns:1fr}.composerOptions{gap:3px}.optionChip{padding:0 6px}}
/* === AJUSTE DE LEGIBILIDADE ATLAS === */
body {
  font-size: 14px;
}

.brand small,
.navItem,
.historyItem,
.historyGroupTitle,
.sidebarFooter,
.conversationHeading small,
.planPill,
.themePicker select,
.usageBar,
.optionChip,
.fileCount,
.meta,
.sourcesTitle,
.sourceChip,
.memoryMeta,
.sectionTitle {
  font-size: 12px !important;
}

.user .bubble {
  font-size: 13.5px !important;
}

.assistant .bubble,
.markdown {
  font-size: 14px !important;
}

.composer textarea {
  font-size: 13.5px !important;
}

/* === ATLAS UI SCALE FIX V6 === */
body{font-size:15px}
.app{grid-template-columns:300px minmax(0,1fr)}
.sidebar{padding:19px 16px 13px}
.brand img{width:48px;height:48px}
.brand strong{font-size:19px}
.brand small{font-size:12px}
.newChat{min-height:46px;font-size:13px}
.navItem{min-height:42px;padding-inline:12px;font-size:13px}
.navItem b,.sectionTitle,.historyGroupTitle,.sidebarFooter{font-size:11px}
.historyItem{min-height:38px;padding:8px 10px;font-size:13px}
.topbar{height:66px;padding-inline:24px}
.conversationHeading strong{font-size:15px}
.conversationHeading small{margin-top:2px;font-size:12px}
.planPill{padding:7px 10px;font-size:11px}
.themePicker{min-height:38px;padding-inline:9px}
.themePicker select{max-width:105px;font-size:12px}
.avatar{width:38px;height:38px;border:0;cursor:pointer;font-size:13px}
.topActions{position:relative}
.accountMenu{position:absolute;top:calc(100% + 10px);right:0;z-index:40;width:230px;padding:10px;border:1px solid var(--line);border-radius:13px;background:var(--surface);box-shadow:var(--shadow)}
.accountIdentity{padding:6px 7px 10px;border-bottom:1px solid var(--line)}
.accountIdentity strong,.accountIdentity small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.accountIdentity strong{font-size:13px}
.accountIdentity small{margin-top:3px;color:var(--muted);font-size:11px}
.accountPlanRow{padding:10px 7px;display:flex;justify-content:space-between;color:var(--muted);font-size:11px}
.accountPlanRow b{color:var(--text)}
.accountMenuAction{width:100%;min-height:36px;border:1px solid var(--line);border-radius:9px;background:var(--surface2);color:var(--text);cursor:pointer;font-size:12px}
.messages{max-width:960px;padding:40px 28px 210px}
.welcomeLogo{width:66px;height:66px}
.welcome h1{margin-top:12px;font-size:34px}
.welcome p{font-size:15px}
.user .bubble{padding:12px 15px;font-size:14px;line-height:1.55}
.assistant .bubble,.markdown{font-size:15px;line-height:1.68}
.assistantHead{margin-bottom:9px;font-size:12px}
.assistantHead img{width:25px;height:25px}
.meta{font-size:11px}
.markdown h1{font-size:21px}
.markdown h2{font-size:18px}
.markdown h3{font-size:16px}
.sourcesTitle,.sourceChip{font-size:11px}
.composer{left:300px;bottom:28px;width:min(940px,calc(100vw - 350px));padding:11px 12px 9px;border-radius:20px}
.inputRow{gap:8px}
.attachButton{width:40px;height:40px;border-radius:11px;font-size:20px}
.inputRow textarea{min-height:42px;max-height:190px;padding:10px 5px;font-size:15px;line-height:1.5}
.sendButton{width:42px;height:42px;border-radius:11px;font-size:16px}
.composerBottom{padding-top:7px}
.optionChip{height:32px;padding-inline:10px;gap:7px;font-size:12px}
.optionChip i{width:23px;height:13px}
.optionChip i:after{width:9px;height:9px}
.optionChip input:checked+i:after{left:12px}
#fileCount{font-size:11px}
.attachmentCard{width:56px;height:56px}
.mediaToolbar{padding-block:6px;font-size:11px}
.mediaChoice{min-height:29px;padding-inline:9px;font-size:11px}
.referenceBar{min-height:42px;font-size:12px}
.referenceBar img{width:34px;height:34px}
.usageBar{height:34px;padding-inline:22px;font-size:11px}
.memoriesHeader h1{font-size:30px}
.memoriesHeader p{font-size:13px}
.memoryCard p{font-size:13px}
.memoryMeta{font-size:10px}
@media(max-width:900px){
  .app{grid-template-columns:1fr}
  .sidebar{width:300px}
  .composer{left:10px;right:10px;bottom:12px;width:auto}
  .messages{padding-inline:18px}
}
@media(max-width:560px){
  body{font-size:14px}
  .topbar{height:60px}
  .welcome h1{font-size:28px}
  .welcome p{font-size:13px}
  .assistant .bubble,.markdown{font-size:14px}
  .user .bubble{font-size:13.5px}
  .optionChip{height:30px;padding-inline:8px;font-size:11px}
}
/* === END ATLAS UI SCALE FIX V6 === */
