/* One viewport, one scrolling conversation, and controls outside the messages. */
html:has(body.nexa-page), body.nexa-page {height:100%!important;min-height:0!important;overflow:hidden!important;position:static!important;touch-action:auto!important;}
.nexa-page *, .nexa-page *::before, .nexa-page *::after {box-sizing:border-box;}
.nexa-page .nexa-chat {position:fixed!important;inset:0!important;height:var(--nexa-viewport-height,100dvh)!important;min-height:0!important;max-height:none!important;grid-template-columns:286px minmax(0,1fr)!important;}
.nexa-page .nexa-main {display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;height:100%!important;min-height:0!important;overflow:hidden!important;}
.nexa-page .nexa-sidebar {width:286px!important;padding:18px 14px!important;gap:10px!important;overflow-y:auto!important;overflow-x:hidden!important;min-height:0!important;border-inline-end:1px solid #ffffff18;border-right:0;}
.nexa-page .nexa-brand h1 {font-size:24px;}
.nexa-page .nexa-brand p {font-size:12px;margin:4px 0;}
.nexa-page .nexa-sidebar > * {flex-shrink:0;}
.nexa-page .conversation-list {position:relative!important;flex:1 0 180px!important;height:auto!important;max-height:none!important;min-height:180px!important;overflow:visible!important;z-index:auto!important;}
.nexa-page .conversation-row {z-index:auto!important;}
.nexa-page .nexa-sidebar > button {min-height:42px!important;padding:9px 12px!important;}
.nexa-page .nexa-sidebar-utilities {display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.nexa-page .nexa-sidebar-utilities button {width:100%;min-height:44px;padding:9px 6px;font-size:12px;white-space:normal;}
.nexa-page #logoutButton {grid-column:1/-1;}
.nexa-page .nexa-topbar {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 16px;padding-top:max(10px,env(safe-area-inset-top));background:#111827;border-bottom:1px solid #ffffff18;min-width:0;position:relative;z-index:30;}
.nexa-navigation,.nexa-header-tools {display:flex;align-items:center;gap:8px;min-width:0;}
.nexa-page .nexa-topbar-title {font-size:18px;}
.nexa-page .nexa-topbar button,.nexa-page .nexa-topbar summary,.nexa-page .nexora-dashboard-back {min-height:44px!important;min-width:44px!important;}
.nexa-page .nexora-dashboard-back {position:static!important;inset:auto!important;transform:none!important;margin:0!important;box-shadow:none!important;padding:8px 10px!important;border-radius:10px!important;width:auto!important;height:44px!important;font-size:12px;z-index:auto!important;}
.nexa-page .nexora-dashboard-back__label {display:inline!important;}
.nexa-page #nexora-global-language {position:static!important;inset:auto!important;transform:none!important;box-shadow:none!important;max-width:180px!important;margin:0!important;z-index:auto!important;min-height:44px;}
.nexa-page #nexora-global-language select {max-width:120px!important;min-height:28px;font-size:12px!important;}
.nexa-page .nexa-services {position:relative!important;inset:auto!important;z-index:40!important;}
.nexa-page .nexa-services summary {margin:0!important;width:44px!important;height:44px!important;font-size:0;}
.nexa-page .nexa-services[open] {display:block!important;}
.nexa-page .nexa-services-grid {position:absolute;inset-inline-end:0;top:54px;width:min(350px,calc(100vw - 24px));max-height:calc(var(--nexa-viewport-height,100dvh) - 110px)!important;overscroll-behavior:contain;}
.nexa-page .feedback-floating-btn {position:static!important;inset:auto!important;padding:8px 12px!important;font-size:12px!important;box-shadow:none!important;margin:0!important;z-index:auto!important;}
.nexa-page .nexora-credit-widget {display:none!important;}
.nexa-page .chat-box {height:auto!important;max-height:none!important;padding:24px clamp(14px,3vw,45px)!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;scrollbar-gutter:stable;}
.nexa-page .message {max-width:100%!important;min-width:0;overflow-wrap:anywhere;}
.nexa-page .message-content pre {max-width:100%;overflow-x:auto;direction:ltr;text-align:left;}
.nexa-page .message-content table {display:block;max-width:100%;overflow-x:auto;}
.nexa-page .message img,.nexa-page .message video {max-width:100%!important;}
.nexa-page .message-actions {display:flex;flex-wrap:wrap;gap:6px;}
.nexa-page .message-actions button {min-height:36px;}
.nexa-page .chat-input {display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:12px clamp(12px,3vw,40px) max(12px,env(safe-area-inset-bottom))!important;align-items:center!important;overflow:visible!important;}
.nexa-page .chat-input > #userInput {order:1!important;flex:1 1 100%!important;width:100%!important;min-width:0!important;height:54px;min-height:54px!important;max-height:min(160px,30dvh)!important;overflow-y:auto!important;font-size:16px!important;padding:13px 14px!important;}
.nexa-page .chat-input > button {order:2!important;flex:0 0 44px!important;width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;position:static!important;margin:0!important;}
.nexa-page .chat-input > #sendButton {margin-inline-start:auto!important;flex:0 0 auto!important;min-width:96px!important;width:auto!important;padding:0 18px!important;}
.nexa-page .selected-file-preview {order:0!important;flex:0 0 100%!important;width:100%!important;max-width:100%!important;position:static!important;inset:auto!important;max-height:120px;overflow:auto;}
.nexa-page #selectedFileName {min-width:0;overflow-wrap:anywhere;}
.nexa-page .selected-file-preview .image-preview-container {flex-shrink:0;}
.nexa-page .connection-status {top:76px!important;max-width:calc(100vw - 24px);z-index:90!important;}
.nexa-page #closeNexaSidebar {display:none;}
.nexa-sidebar-backdrop {display:none;}
.nexa-page .settings-modal,.nexa-page .feedback-modal,.nexa-page .image-lightbox {z-index:200!important;padding:16px!important;}
.nexa-page .settings-panel,.nexa-page .feedback-card {max-height:calc(var(--nexa-viewport-height,100dvh) - 32px)!important;overflow-y:auto!important;overscroll-behavior:contain;z-index:auto!important;}
.nexa-page .settings-close,.nexa-page .feedback-close-btn {min-width:44px;min-height:44px;}
.nexa-page button:focus-visible,.nexa-page a:focus-visible,.nexa-page summary:focus-visible,.nexa-page select:focus-visible {outline:3px solid #c4b5fd!important;outline-offset:2px;}
.nexa-page button,.nexa-page summary {touch-action:manipulation;}
.nexa-page.light-theme .nexa-topbar {background:#f8fafc;color:#182033;border-color:#cbd5e1;}
.nexa-page.light-theme .nexa-topbar-title {color:#182033;}
@media(max-width:768px){
 .nexa-page .nexa-chat {grid-template-columns:minmax(0,1fr)!important;}
 .nexa-page .nexa-sidebar {position:fixed!important;inset-block:0!important;inset-inline-start:0!important;inset-inline-end:auto!important;left:auto!important;right:auto!important;inset-inline-start:0!important;width:min(340px,calc(100vw - 36px))!important;max-width:none!important;height:var(--nexa-viewport-height,100dvh)!important;min-height:0!important;max-height:none!important;z-index:120!important;transform:translateX(-110%);visibility:hidden;pointer-events:none!important;transition:transform .2s ease,visibility .2s; padding-top:max(16px,env(safe-area-inset-top))!important;}
 .nexa-page[dir=rtl] .nexa-sidebar {transform:translateX(110%);}
 .nexa-page .nexa-sidebar.mobile-open {transform:translateX(0)!important;visibility:visible;pointer-events:auto!important;left:auto!important;right:auto!important;inset-inline-start:0!important;inset-inline-end:auto!important;}
 .nexa-page #closeNexaSidebar {display:block;align-self:flex-end;width:44px!important;min-height:44px!important;font-size:26px;}
 .nexa-sidebar-backdrop:not([hidden]) {display:block;position:fixed;inset:0;background:#0009;z-index:110;border:0;}
 .nexa-page #mobileMenuButton {display:flex!important;position:static!important;inset:auto!important;width:44px!important;height:44px!important;z-index:auto!important;align-items:center;justify-content:center;font-size:22px;box-shadow:none!important;}
 .nexa-page .nexa-topbar {padding-inline:8px;gap:4px;}
 .nexa-navigation,.nexa-header-tools {gap:4px;}
 .nexa-page .nexa-topbar-title,.nexa-page .nexora-dashboard-back__label {display:none!important;}
 .nexa-page .nexora-dashboard-back {padding:0!important;width:44px!important;justify-content:center;}
 .nexa-page .feedback-floating-btn {width:44px!important;font-size:0!important;padding:0!important;}
 .nexa-page .feedback-floating-btn::before {content:'✉';font-size:22px;}
 .nexa-page #nexora-global-language {max-width:110px!important;padding:6px!important;gap:3px!important;}
 .nexa-page #nexora-global-language select {max-width:76px!important;}
 .nexa-page .chat-box {padding:16px 12px!important;scrollbar-gutter:auto;}
 .nexa-page .quick-prompts {grid-template-columns:1fr 1fr!important;gap:8px;}
 .nexa-page .welcome-title {font-size:24px;}
 .nexa-page .welcome-screen {padding:16px 0!important;}
}
@media(max-width:360px){.nexa-page #nexora-global-language{max-width:90px!important;}.nexa-page #nexora-global-language select{max-width:56px!important;}.nexa-page .quick-prompts{grid-template-columns:1fr!important;}}
@media(prefers-reduced-motion:reduce){.nexa-page *{animation:none!important;transition:none!important;scroll-behavior:auto!important;}}

.nexa-page .nexa-main {position:relative;}
.nexa-page .drop-zone {position:absolute!important;inset:72px 12px 12px!important;pointer-events:none!important;z-index:80!important;}
.nexa-page .chat-input > .nexa-router {order:0!important;flex:0 0 100%!important;width:100%!important;max-height:28dvh;overflow-y:auto;margin:0!important;}

/* Conversation cards reserve the entire width; actions expand inside their row. */
.nexa-page .conversation-row {display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;position:relative!important;width:100%!important;min-width:0!important;padding:6px!important;overflow:hidden!important;}
.nexa-page .conversation-row > .conversation-item {grid-column:1/-1!important;width:100%!important;min-width:0!important;padding:12px!important;padding-inline-end:54px!important;align-items:stretch!important;text-align:start!important;}
.nexa-page .conversation-title,.nexa-page .conversation-preview {width:100%!important;min-width:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-align:start!important;}
.nexa-page .conversation-date,.nexa-page .conversation-time {text-align:start!important;font-size:11px!important;}
.nexa-page .conversation-row > .conversation-more {display:flex!important;position:absolute!important;inset-block-start:12px!important;inset-inline-end:12px!important;width:38px!important;height:38px!important;align-items:center;justify-content:center;border:1px solid #ffffff20;border-radius:9px;background:#30264c;color:#fff;}
.nexa-page .conversation-row > .rename-conversation,.nexa-page .conversation-row > .pin-conversation,.nexa-page .conversation-row > .favorite-conversation,.nexa-page .conversation-row > .delete-conversation {display:none!important;}
.nexa-page .conversation-row.show-actions > button:not(.conversation-item):not(.conversation-more) {display:flex!important;position:static!important;inset:auto!important;width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;align-items:center;justify-content:center;z-index:auto!important;}
.nexa-page .conversation-row.show-actions::after {display:none!important;}

.nexa-page .conversation-row.show-actions > button:not(.conversation-item):not(.conversation-more) {background:#29253c!important;color:#fff!important;border:1px solid #ffffff20!important;border-radius:9px!important;}

/* V5: one contained panel; hidden actions never participate in card layout. */
.nexa-page .conversation-row > .conversation-action-panel {grid-column:1/-1!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;width:100%!important;min-width:0!important;position:static!important;}
.nexa-page .conversation-row > .conversation-action-panel[hidden] {display:none!important;}
.nexa-page .conversation-row .conversation-action-panel > button {display:flex!important;position:static!important;inset:auto!important;width:100%!important;min-width:0!important;height:44px!important;margin:0!important;padding:0!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;align-items:center!important;justify-content:center!important;background:#29253c!important;color:#fff!important;border:1px solid #ffffff20!important;border-radius:9px!important;transform:none!important;}

/* Explicit button rendering prevents native theme painting around cards. */
.nexa-page .conversation-row button {appearance:none!important;-webkit-appearance:none!important;background-clip:border-box!important;transform:none!important;transition:none!important;}
.nexa-page .conversation-row {isolation:isolate;background:#111827!important;}
body.light-theme .conversation-row {background:#f5f3ff!important;}
.nexa-page .conversation-list,.nexa-page .nexa-sidebar,.nexa-page .chat-box {scrollbar-width:thin;scrollbar-color:#7560aa #111827;}
.nexa-page .conversation-row > .conversation-item:focus-visible {outline:2px solid #c4b5fd!important;outline-offset:-3px!important;}

/* Let the list reserve its full content height before sidebar utilities. */
.nexa-page .conversation-list {flex:0 0 auto!important;height:auto!important;min-height:0!important;overflow:visible!important;}
.nexa-page .nexa-sidebar-utilities {position:static!important;inset:auto!important;flex:0 0 auto!important;width:100%;margin-top:12px;isolation:isolate;}
.nexa-page .nexa-sidebar-utilities > button {position:static!important;inset:auto!important;transform:none!important;background:#1c2438!important;color:#fff!important;border:1px solid #ffffff20!important;border-radius:10px!important;appearance:none!important;}

/* Visible file confirmation for documents, ZIP, images and video. */
.nexa-page #selectedFilePreview {display:none!important;margin:0!important;padding:10px 12px!important;gap:12px!important;border:1px solid #8b5cf659;border-radius:14px;background:#171c30;color:#f8fafc;}
.nexa-page #selectedFilePreview.active {display:flex!important;align-items:center!important;}
.nexa-page .selected-file-details {display:flex;flex:1 1 0;min-width:0;flex-direction:column;gap:4px;}
.nexa-page #selectedFileName {display:block!important;visibility:visible!important;color:#f8fafc!important;font-size:14px;line-height:1.5;white-space:normal!important;overflow-wrap:anywhere;word-break:break-word;}
.nexa-page #selectedFileMeta {display:block;color:#c4b5fd;font-size:12px;line-height:1.4;}
.nexa-page #removeSelectedFile {display:flex!important;align-items:center;justify-content:center;flex:0 0 40px!important;width:40px!important;height:40px!important;min-width:40px!important;border:1px solid #ffffff30;border-radius:10px;background:#ffffff12;color:#f8fafc;font-size:24px;cursor:pointer;}
.nexa-page #removeSelectedFile:focus-visible {outline:2px solid #c4b5fd;outline-offset:2px;}
.nexa-page #imagePreviewContainer {flex:0 0 64px;width:64px!important;min-width:64px!important;height:64px!important;margin:0!important;}
.nexa-page #imagePreview,.nexa-page #videoPreview {width:64px!important;height:64px!important;object-fit:cover;}
