/* NexoMed — cadernos acadêmicos fundamentados */
.nexomed-workspace{max-width:1580px;margin:0 auto;padding:26px 26px 46px}
.nexomed-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:18px}
.nexomed-heading h1{font-size:36px;line-height:1;letter-spacing:-.055em;margin:3px 0 8px}
.nexomed-heading p{font-size:11px;color:var(--muted);margin:0;max-width:650px}
.nexomed-engine{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:15px;padding:10px 14px;box-shadow:var(--shadow-sm)}
.nexomed-engine>i{width:9px;height:9px;border-radius:50%;background:var(--green);box-shadow:0 0 0 5px rgba(32,185,139,.11)}
.nexomed-engine span{display:flex;flex-direction:column}.nexomed-engine strong{font-size:10px}.nexomed-engine small{font-size:8px;color:var(--muted);margin-top:3px}
.nexomed-notice,.nexomed-error{display:flex;align-items:center;gap:10px;border-radius:14px;padding:11px 14px;margin-bottom:14px;font-size:10px}
.nexomed-notice{background:var(--green-soft);border:1px solid #bde7d9;color:#14775b}
.nexomed-error{background:var(--danger-soft);border:1px solid #f0c5ce;color:var(--danger)}
.nexomed-notice span,.nexomed-error span{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;font-weight:900}
.nexomed-notice span{background:#d5f5e9}.nexomed-error span{background:#f8d7de}

.nexomed-shell{display:grid;grid-template-columns:245px minmax(0,1fr) 325px;min-height:calc(100vh - 188px);background:#fff;border:1px solid var(--line);border-radius:25px;overflow:hidden;box-shadow:0 22px 60px rgba(33,36,72,.085)}
.nexomed-shell.without-notebook{grid-template-columns:245px minmax(0,1fr)}
.notebook-rail{background:#f7f7fb;border-right:1px solid var(--line);padding:16px;display:flex;flex-direction:column;min-height:700px}
.rail-title{display:flex;align-items:center;justify-content:space-between;margin:2px 2px 13px}
.rail-title>div{display:flex;align-items:center;gap:8px}.rail-title span{font-size:11px;font-weight:900}.rail-title small{width:22px;height:22px;border-radius:8px;background:#e9e9f1;display:grid;place-items:center;font-size:8px;color:#747b91}
.rail-create-toggle{width:34px;height:34px;border:0;border-radius:11px;background:var(--purple);color:#fff;font-size:18px;cursor:pointer;box-shadow:0 8px 18px rgba(91,76,240,.2)}
.create-notebook-form{display:grid;gap:9px;background:#fff;border:1px solid #dedcf5;border-radius:15px;padding:12px;margin-bottom:13px;max-height:480px;overflow:hidden;transition:max-height .25s ease,padding .25s ease,margin .25s ease,border .25s ease}
.create-notebook-form.collapsed{max-height:0;padding-top:0;padding-bottom:0;margin-bottom:0;border-color:transparent}
.create-notebook-form label{display:grid;gap:5px}.create-notebook-form label>span{font-size:8px;font-weight:850;color:#7d8396;text-transform:uppercase;letter-spacing:.07em}
.create-notebook-form input,.create-notebook-form textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:9px 10px;font:inherit;font-size:10px;outline:0;background:#fbfbfd}
.create-notebook-form input:focus,.create-notebook-form textarea:focus{border-color:#b9b3ff;box-shadow:0 0 0 3px rgba(91,76,240,.08)}
.create-notebook-form button{height:36px;border:0;border-radius:10px;background:var(--purple);color:#fff;font-size:9px;font-weight:900;display:flex;align-items:center;justify-content:space-between;padding:0 12px;cursor:pointer}
.notebook-list{display:grid;gap:6px;overflow:auto;max-height:505px;padding-right:2px}
.notebook-item{display:flex;align-items:center;gap:9px;border:1px solid transparent;border-radius:13px;padding:9px;color:var(--ink)}
.notebook-item:hover{background:#fff;border-color:var(--line)}
.notebook-item.active{background:#fff;border-color:#d8d4ff;box-shadow:0 8px 20px rgba(49,44,112,.08)}
.notebook-symbol{width:32px;height:32px;flex:0 0 auto;border-radius:10px;background:#ece9ff;color:var(--purple);display:grid;place-items:center;font-size:11px;font-weight:950}
.notebook-copy{min-width:0;display:flex;flex:1;flex-direction:column}.notebook-copy strong{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.notebook-copy small{font-size:8px;color:var(--muted);margin-top:4px}.notebook-arrow{color:#b0b4c2;font-size:17px}
.empty-rail{text-align:center;padding:35px 15px;color:#969bad}.empty-rail span{font-size:28px}.empty-rail p{font-size:9px;line-height:1.6}
.nexomed-usage{margin-top:auto;border-top:1px solid var(--line);padding:15px 3px 2px}.nexomed-usage>div{display:flex;justify-content:space-between;font-size:8px;color:var(--muted)}.nexomed-usage strong{color:var(--ink)}
.nexomed-usage progress{width:100%;height:6px;border:0;border-radius:999px;margin:8px 0 5px;overflow:hidden}.nexomed-usage progress::-webkit-progress-bar{background:#e7e8ef}.nexomed-usage progress::-webkit-progress-value{background:linear-gradient(90deg,var(--purple),#8874ff)}.nexomed-usage progress::-moz-progress-bar{background:var(--purple)}.nexomed-usage small{font-size:8px;color:#9aa0b0}

.notebook-main{min-width:0;display:flex;flex-direction:column;background:#fff}
.notebook-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 24px 14px}
.notebook-kicker{font-size:8px;font-weight:900;letter-spacing:.11em;color:var(--purple);text-transform:uppercase}
.notebook-header h2{font-size:22px;letter-spacing:-.04em;margin:5px 0 5px}.notebook-header p{font-size:10px;color:var(--muted);line-height:1.55;margin:0;max-width:690px}
.notebook-settings{position:relative}.notebook-settings summary{list-style:none;width:36px;height:36px;border:1px solid var(--line);border-radius:11px;display:grid;place-items:center;cursor:pointer;color:#73798c;font-weight:900}
.notebook-settings summary::-webkit-details-marker{display:none}.settings-popover{position:absolute;right:0;top:42px;z-index:20;width:310px;background:#fff;border:1px solid var(--line);border-radius:15px;padding:13px;box-shadow:0 20px 50px rgba(27,30,62,.17)}
.settings-popover form{display:grid;gap:8px}.settings-popover label{display:grid;gap:4px;font-size:8px;font-weight:800;color:#747b8e}.settings-popover input,.settings-popover textarea{border:1px solid var(--line);border-radius:9px;padding:8px;font:inherit;font-size:9px}.settings-popover button{height:34px;border:0;border-radius:9px;background:var(--purple);color:#fff;font-size:9px;font-weight:900;cursor:pointer}.settings-popover form+form{margin-top:8px}.settings-popover .danger-action{background:#fff0f3;color:var(--danger);border:1px solid #f1c4ce}
.notebook-metrics{display:flex;gap:8px;flex-wrap:wrap;padding:0 24px 15px;border-bottom:1px solid var(--line)}.notebook-metrics span{background:#f6f6fa;border:1px solid #ededf3;border-radius:999px;padding:7px 10px;font-size:8px;color:#767c90}.notebook-metrics strong{color:var(--ink);margin-right:3px}
.conversation-toolbar{min-height:50px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 18px}
.conversation-tabs{display:flex;align-items:center;gap:5px;overflow:auto}.conversation-tabs a{max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border:1px solid transparent;border-radius:10px;padding:8px 10px;font-size:8px;font-weight:800;color:#747a8e}.conversation-tabs a span{color:var(--purple);margin-right:5px}.conversation-tabs a:hover{background:#f7f6ff}.conversation-tabs a.active{background:#f0edff;border-color:#d9d4ff;color:var(--purple)}
.new-conversation-inline button{white-space:nowrap;border:0;border-radius:10px;background:#242844;color:#fff;height:34px;padding:0 12px;font-size:8px;font-weight:900;cursor:pointer}
.conversation-panel{display:flex;flex:1;min-height:0;flex-direction:column}
.conversation-header{height:56px;flex:0 0 auto;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 20px}
.conversation-header>div{display:flex;align-items:center;gap:9px;min-width:0}.assistant-avatar{width:34px;height:34px;border-radius:11px;background:linear-gradient(145deg,var(--purple),#8a78ff);color:#fff;display:grid;place-items:center;font-size:11px;font-weight:950;box-shadow:0 8px 18px rgba(91,76,240,.2)}
.conversation-header>div>span:last-child{min-width:0;display:flex;flex-direction:column}.conversation-header strong{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:500px}.conversation-header small{font-size:8px;color:var(--muted);margin-top:3px}
.conversation-header form button{width:29px;height:29px;border:0;border-radius:9px;background:transparent;color:#a3a8b7;font-size:16px;cursor:pointer}.conversation-header form button:hover{background:#fff0f3;color:var(--danger)}
.conversation-messages{flex:1;min-height:420px;max-height:calc(100vh - 445px);overflow:auto;padding:25px 7%;scroll-behavior:smooth}
.nexomed-welcome,.conversation-empty{min-height:390px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:25px}
.nexomed-orb{width:65px;height:65px;border-radius:22px;background:linear-gradient(145deg,#4b3ce6,#917dff);color:#fff;display:grid;place-items:center;font-size:23px;font-weight:950;box-shadow:0 17px 36px rgba(91,76,240,.23)}.nexomed-orb.muted{background:#eceaf8;color:var(--purple);box-shadow:none}
.nexomed-welcome h3,.conversation-empty h3{font-size:23px;letter-spacing:-.04em;margin:18px 0 7px}.nexomed-welcome>p,.conversation-empty>p{max-width:530px;color:var(--muted);font-size:10px;line-height:1.65;margin:0}
.nexomed-prompts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:650px;margin-top:22px}.nexomed-prompts button{border:1px solid var(--line);background:#fff;border-radius:13px;padding:11px;text-align:left;color:var(--ink-soft);font-size:9px;font-weight:760;line-height:1.45;cursor:pointer}.nexomed-prompts button:hover{border-color:#c9c3ff;background:#f8f6ff;color:var(--purple)}
.conversation-empty form button{margin-top:20px;height:40px;border:0;border-radius:12px;background:var(--purple);color:#fff;padding:0 15px;display:flex;align-items:center;gap:28px;font-size:9px;font-weight:900;cursor:pointer}
.nexomed-message{display:flex;gap:12px;max-width:900px;margin:0 auto 24px}.nexomed-message.user{flex-direction:row-reverse}.message-avatar{width:34px;height:34px;flex:0 0 auto;border-radius:11px;background:#ece9ff;color:var(--purple);display:grid;place-items:center;font-size:10px;font-weight:950}.nexomed-message.user .message-avatar{background:#252944;color:#fff}
.message-body{max-width:min(800px,84%)}.message-meta{display:flex;align-items:center;gap:8px;margin:0 2px 7px}.nexomed-message.user .message-meta{justify-content:flex-end}.message-meta strong{font-size:9px}.message-meta small{font-size:8px;color:#a0a6b6}
.message-content{white-space:pre-wrap;overflow-wrap:anywhere;background:#f7f7fb;border:1px solid #ececf2;border-radius:6px 17px 17px 17px;padding:14px 16px;color:var(--ink-soft);font-size:11px;line-height:1.72}.nexomed-message.user .message-content{background:var(--purple);border-color:var(--purple);color:#fff;border-radius:17px 6px 17px 17px;box-shadow:0 10px 24px rgba(91,76,240,.15)}
.citation-drawer{margin-top:8px;border:1px solid #e3e1f7;border-radius:13px;background:#fbfaff;overflow:hidden}.citation-drawer summary{list-style:none;cursor:pointer;padding:10px 12px;font-size:8px;font-weight:900;color:#6158ba;display:flex;justify-content:space-between}.citation-drawer summary::-webkit-details-marker{display:none}.citation-drawer summary span{width:20px;height:20px;border-radius:7px;background:#e9e5ff;display:grid;place-items:center}
.citation-list{display:grid;gap:7px;padding:0 9px 9px}.citation-list article{display:flex;gap:9px;background:#fff;border:1px solid #eceaf7;border-radius:11px;padding:10px}.citation-number{width:24px;height:24px;flex:0 0 auto;border-radius:8px;background:#ece8ff;color:var(--purple);display:grid;place-items:center;font-size:8px;font-weight:950}.citation-list article>div:last-child{min-width:0}.citation-list strong{display:block;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.citation-list small{display:block;font-size:7px;color:#8a90a2;margin:3px 0}.citation-list p{font-size:8px;line-height:1.55;color:#646a7d;margin:5px 0}.citation-list a{font-size:7px;font-weight:900;color:var(--purple)}
.message-model{font-size:7px;color:#a1a6b4;text-transform:uppercase;letter-spacing:.06em;margin:6px 3px 0}
.nexomed-composer{margin:0 6%;border:1px solid #dcddea;border-radius:17px;padding:10px 11px 9px;background:#fff;box-shadow:0 14px 35px rgba(35,38,70,.09)}.nexomed-composer:focus-within{border-color:#bdb7ff;box-shadow:0 0 0 4px rgba(91,76,240,.08),0 14px 35px rgba(35,38,70,.09)}
.nexomed-composer textarea{display:block;width:100%;min-height:27px;max-height:190px;resize:none;border:0;outline:0;padding:4px 5px;background:transparent;color:var(--ink);font-size:11px;line-height:1.55}.composer-actions{display:flex;align-items:center;gap:10px;margin-top:5px}.composer-actions small{font-size:7px;color:#a0a5b5;padding-left:4px}.grounded-chip{margin-left:auto;background:var(--green-soft);color:#168665;border-radius:999px;padding:6px 9px;font-size:7px;font-weight:850}.composer-actions button{height:35px;border:0;border-radius:10px;background:var(--purple);color:#fff;padding:0 12px;display:flex;align-items:center;gap:12px;font-size:8px;font-weight:900;cursor:pointer}.composer-actions button:disabled{opacity:.65;cursor:wait}.nexomed-disclaimer{text-align:center;color:#999ead;font-size:7px;line-height:1.45;margin:8px 7% 13px}

.source-rail{background:#fafafd;border-left:1px solid var(--line);padding:14px;overflow:auto;max-height:calc(100vh - 188px)}
.source-section{background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px;margin-bottom:10px}.source-section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.source-section-title>div{display:flex;align-items:center;gap:7px}.source-section-title span{font-size:9px;font-weight:900}.source-section-title small{width:21px;height:21px;border-radius:7px;background:#ededf4;display:grid;place-items:center;font-size:7px}.privacy-badge{background:var(--green-soft);color:#168665;border-radius:999px;padding:5px 8px;font-size:7px!important}
.source-upload-form{display:grid;gap:8px}.drop-field{border:1px dashed #c9c5e7;border-radius:13px;background:#faf9ff;min-height:103px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;cursor:pointer;padding:12px}.drop-field:hover{border-color:#9f96ff;background:#f6f3ff}.drop-field input{position:absolute;opacity:0;pointer-events:none}.drop-icon{font-size:20px;color:var(--purple)}.drop-field strong{font-size:9px;margin-top:4px}.drop-field small{font-size:7px;color:var(--muted);margin-top:4px}.source-upload-form button{height:34px;border:0;border-radius:10px;background:#292d4d;color:#fff;font-size:8px;font-weight:900;cursor:pointer}
.selection-title{display:flex;flex-direction:column;margin-bottom:8px}.selection-title strong{font-size:9px}.selection-title small{font-size:7px;color:var(--muted);margin-top:3px}
.source-selection-form{display:grid;gap:6px;border-bottom:1px solid var(--line);padding-bottom:11px;margin-bottom:10px}.source-checkbox{display:flex;align-items:center;gap:7px;border:1px solid #ececf2;border-radius:11px;padding:8px;cursor:pointer}.source-checkbox:has(input:checked){border-color:#cfcaff;background:#f7f5ff}.source-checkbox input{accent-color:var(--purple)}.file-type{width:34px;height:27px;flex:0 0 auto;border-radius:8px;background:#ece9ff;color:var(--purple);display:grid;place-items:center;font-size:7px;font-weight:950}.source-checkbox>span:last-child{min-width:0;display:flex;flex-direction:column}.source-checkbox strong{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.source-checkbox small{font-size:7px;color:var(--muted);margin-top:3px}.source-selection-form>button{height:31px;border:0;border-radius:9px;background:var(--purple);color:#fff;font-size:8px;font-weight:900;cursor:pointer}
.all-sources{display:grid;gap:7px}.source-card{border:1px solid #ececf2;border-radius:12px;padding:9px}.source-card-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px}.source-state{display:flex;align-items:center;gap:5px;font-size:7px;color:#7d8395}.source-state i{width:7px;height:7px;border-radius:50%;background:#aeb3c0}.status-ready .source-state{color:#168665}.status-ready .source-state i{background:var(--green)}.status-processing .source-state,.status-queued .source-state{color:#b47a16}.status-processing .source-state i,.status-queued .source-state i{background:#f2ab33;box-shadow:0 0 0 4px rgba(242,171,51,.12)}.status-failed .source-state{color:var(--danger)}.status-failed .source-state i{background:var(--danger)}
.source-card>strong{display:block;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.source-card>small{display:block;font-size:7px;color:var(--muted);margin-top:4px}.source-card>p{font-size:7px;color:var(--danger);line-height:1.4;margin:6px 0 0}.source-actions{display:flex;align-items:center;gap:6px;margin-top:8px}.source-actions a,.source-actions button{border:0;background:transparent;padding:0;font-size:7px;font-weight:850;color:var(--purple);cursor:pointer}.source-actions form{display:inline}.source-actions .delete-source{color:var(--danger)}
.source-empty{text-align:center;padding:18px;color:#9ba0b0}.source-empty span{font-size:23px}.source-empty p{font-size:8px;line-height:1.5}
.chunk-search-form{display:flex;border:1px solid var(--line);border-radius:10px;overflow:hidden}.chunk-search-form input{min-width:0;flex:1;border:0;outline:0;padding:8px 9px;font-size:8px}.chunk-search-form button{width:34px;border:0;background:#efedff;color:var(--purple);font-size:13px;cursor:pointer}.chunk-results{display:grid;gap:7px;margin-top:10px}.chunk-results>strong{font-size:7px;color:#7d8395}.chunk-results article{border:1px solid #ececf2;border-radius:10px;padding:8px}.chunk-results article>span{display:block;font-size:7px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chunk-results article>small{display:block;font-size:7px;color:var(--purple);margin:3px 0}.chunk-results article>p,.no-result{font-size:7px;line-height:1.5;color:#73798b;margin:0}

.nexomed-first-run{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 8%}.first-run-visual{width:250px;height:180px;position:relative;margin-bottom:15px}.nexo-core{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:78px;height:78px;border-radius:26px;background:linear-gradient(145deg,var(--purple),#917dff);color:#fff;display:grid;place-items:center;font-size:28px;font-weight:950;box-shadow:0 20px 45px rgba(91,76,240,.26)}.orbit{position:absolute;background:#fff;border:1px solid #dedbea;border-radius:11px;padding:8px 10px;font-size:8px;font-weight:900;color:#666d80;box-shadow:0 9px 22px rgba(43,46,79,.08)}.orbit-a{left:10px;top:25px}.orbit-b{right:8px;top:20px}.orbit-c{left:20px;bottom:19px}.orbit-d{right:25px;bottom:12px}
.nexomed-first-run h2{font-size:29px;letter-spacing:-.05em;max-width:680px;margin:8px 0 10px}.nexomed-first-run>p{max-width:700px;font-size:11px;line-height:1.7;color:var(--muted);margin:0}.first-run-features{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:700px;margin:24px 0}.first-run-features span{display:flex;align-items:center;gap:9px;text-align:left;border:1px solid var(--line);border-radius:12px;padding:10px;font-size:9px;color:#636a7d}.first-run-features i{width:25px;height:25px;flex:0 0 auto;border-radius:8px;background:#ece9ff;color:var(--purple);display:grid;place-items:center;font-style:normal;font-weight:900}.nexomed-first-run>button{height:42px;border:0;border-radius:12px;background:var(--purple);color:#fff;padding:0 16px;display:flex;align-items:center;gap:35px;font-size:9px;font-weight:900;cursor:pointer}

@media(max-width:1280px){
  .nexomed-shell{grid-template-columns:215px minmax(0,1fr) 285px}
  .notebook-rail{padding:12px}.source-rail{padding:10px}
  .conversation-messages{padding-left:4%;padding-right:4%}.nexomed-composer{margin-left:4%;margin-right:4%}
}
@media(max-width:980px){
  .nexomed-shell{grid-template-columns:210px minmax(0,1fr)}
  .source-rail{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border-left:0;border-top:1px solid var(--line);max-height:none}
  .source-section{margin:0}.conversation-messages{max-height:none}
}
@media(max-width:760px){
  .nexomed-workspace{padding:17px 10px 92px}.nexomed-heading{align-items:flex-start}.nexomed-heading h1{font-size:30px}.nexomed-engine{padding:8px 10px}.nexomed-engine span{display:none}
  .nexomed-shell,.nexomed-shell.without-notebook{display:block;border-radius:20px;min-height:0}
  .notebook-rail{min-height:0;border-right:0;border-bottom:1px solid var(--line)}.notebook-list{display:flex;overflow:auto;max-height:none}.notebook-item{min-width:190px}.nexomed-usage{display:none}
  .notebook-header{padding:16px}.notebook-metrics{padding:0 16px 12px}.conversation-toolbar{padding:7px 10px}.conversation-messages{padding:18px 10px;min-height:360px}
  .nexomed-prompts{grid-template-columns:1fr}.message-body{max-width:87%}.message-content{font-size:10px}
  .nexomed-composer{margin-left:9px;margin-right:9px}.grounded-chip{display:none}.nexomed-disclaimer{margin-left:16px;margin-right:16px}
  .source-rail{display:block}.source-section{margin-bottom:9px}.nexomed-first-run{padding:35px 18px}.nexomed-first-run h2{font-size:24px}.first-run-features{grid-template-columns:1fr}
}
@media(max-width:480px){
  .notebook-header h2{font-size:19px}.settings-popover{width:270px}.notebook-metrics{gap:5px}.notebook-metrics span{padding:6px 8px}
  .conversation-header strong{max-width:210px}.nexomed-welcome h3,.conversation-empty h3{font-size:20px}.nexomed-message{gap:7px}.message-avatar{width:29px;height:29px;border-radius:9px}
  .citation-list article{padding:8px}.composer-actions button{height:33px}.nexomed-first-run h2{font-size:22px}
}
