/* NEXUS workspace. Layout and surfaces; action controls belong to controls.css. */
:root {
 --bg:#101113;--surface:#191b1e;--surface-solid:#202226;--surface-raised:#272a2f;--control-bg:#141619;
 --line:#303338;--line-soft:#282b30;--line-strong:#4a4f56;--text:#edf0f2;--muted:#a5abb4;
 --accent:#b6d98d;--accent-rgb:182,217,141;--accent-soft:#b6d98d17;--green:#b6d98d;--amber:#e3bd79;--red:#ef9b9b;
 --button-bg:#202328;--button-hover:#2b2f35;--track:#34383f;--display:var(--sans);
 --surface-highlight:linear-gradient(135deg,#ffffff06,transparent 65%);--surface-shadow:inset 0 1px 0 #ffffff04,0 3px 12px #0000001c;--orbit-grain:none;
}
html[data-orbit-ambient=true] {--orbit-grain:none}
html body.wave-shell:not(.reader-focus,.dialog-focus,.wave-focus) {width:100%;max-width:none;height:100dvh;margin:0;border:0;border-radius:0;grid-template-columns:216px minmax(0,1fr);grid-template-rows:58px minmax(0,1fr)}
html body .workspace-sidebar {padding:20px 12px 12px;background:var(--control-bg);border-right:1px solid var(--line)}
.workspace-sidebar>.brand {margin-bottom:18px;padding:0 8px}
.workspace-sidebar .brand-name {font-family:var(--sans);letter-spacing:.12em;font-size:14px;font-weight:600}
.workspace-sidebar .brand-mark {width:34px;height:34px}
.workspace-sidebar .brand-version {color:var(--muted);font-size:10px}
.workspace-sidebar nav a {min-height:36px;padding:8px 10px;border-radius:5px;font-size:13px}
.workspace-sidebar a[aria-current] {background:var(--accent-soft);box-shadow:inset 3px 0 var(--accent);color:var(--text)}
.workspace-sidebar .workspace-nav-group {margin-top:12px}
.workspace-sidebar nav a.workspace-group-title {font-size:10px;letter-spacing:1.3px;min-height:27px;box-shadow:none;background:transparent}
.workspace-sidebar nav a.workspace-group-title[aria-current] {color:var(--accent)}
html body.wave-shell>.workspace-header {height:58px;min-height:58px;padding:0 22px;background:var(--control-bg);border-bottom:1px solid var(--line)}
html body .workspace-header a.workspace-section {gap:8px;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.workspace-section .workspace-crumb {color:var(--text);font-weight:600;overflow:hidden;text-overflow:ellipsis}
.workspace-section .workspace-crumb::before {content:'/';margin-right:8px;color:var(--muted);font-weight:400}
html.embedded-page:not(.chat-widget) body:not(:has(#chatPage)) {padding:20px 24px}
html body .section-line {margin-bottom:16px;gap:12px;align-items:center}
html body .section-line h1,html body .settings-heading h1 {font-family:var(--sans);font-size:26px;line-height:1.25;font-weight:650;letter-spacing:-.6px}
html body #homeDashboard .home-heading {margin-bottom:18px;min-height:0}
html body #homeDashboard .home-heading h1 {font-family:var(--sans);font-size:29px;font-weight:650;letter-spacing:-.6px;margin:0 0 6px}
html body #homeDashboard .home-heading .nexus-emblem,html body #homeDashboard .home-eyebrow {display:none}
html body #homeDashboard .home-heading :is(#homeDate,.section-description) {font-size:13px;letter-spacing:0}
html body :is(.home-card,.module-card,.vpn-card,.server-manager,.settings-card,.settings-sidebar,.article-card,.project-card,.activity-card,.rt-panel,.pulse-panel,.pulse-stat,.balance-panel,.signal-panel,.kb-column,.anime-panel,.trophy-panel,.security-panel,.chat-panel,.storage-folder-card,.storage-row) {background:var(--surface);border-color:var(--line);border-radius:9px;box-shadow:var(--surface-shadow)}
html body #homeDashboard :is(.home-card,.module-card) {padding:14px}
html body #homeDashboard :is(.home-card-title h2,.module-heading h2) {font-family:var(--sans);font-size:15px;font-weight:600}
html body #homeDashboard :is(.home-card-title,.module-heading) .ui-icon {color:var(--muted);width:19px;height:19px}
html body #homeDashboard [data-home-card=pulse] {padding:14px 0}
html body #homeDashboard .home-metric strong {font-size:23px;font-variant-numeric:tabular-nums}
html body #homeDashboard .home-metric-label {font-size:11px;letter-spacing:.2px}
html body .page>main :is(.content-toolbar,.anime-toolbar,.trophy-toolbar,.reader-toolbar,.storage-toolbar,.kb-tools,.projects-toolbar,.rt-toolbar) {background:transparent;border:0;border-radius:0;box-shadow:none;padding:8px 0}
html body .page>main :is(.project-row,.storage-file-card,.wave-track,.balance-row,.signal-item) {box-shadow:none;border-color:var(--line-soft)}
html body .page>main :is(.project-row,.wave-track,.balance-row):hover {background:var(--button-hover)}
html body .page>main table {border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
html body .page>main :is(th,td) {border-color:var(--line-soft)}
html body .page>main th {color:var(--muted);font-weight:500}
html body .page>main tbody tr:hover {background:var(--button-hover)}
html body .settings-layout {gap:18px}
html body #settingsContent .settings-appearance .settings-card {padding:16px}
html body .settings-heading {padding-bottom:12px;margin-bottom:16px}
html body .settings-nav a[aria-current] {box-shadow:inset 2px 0 var(--accent);border-radius:4px}
html body .page>main :is(.chat-message,.chat-bubble) {border-color:var(--line-soft);box-shadow:none}
html body.wave-shell #wavePlayer:not(.expanded) {background:var(--control-bg);padding:8px 18px;border-top-color:var(--line)}
/* A real, optional companion. It never sends the current page to a provider. */
html body #workspaceCompanion {padding:0;border:1px solid var(--line);border-radius:0;background:var(--surface);overflow:hidden;color:var(--text)}
html body #workspaceCompanion[open] {display:flex;flex-direction:column;width:min(460px,calc(100vw - 24px));height:min(760px,calc(100dvh - 24px));max-width:none;max-height:none}
.companion-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);flex:none}
.companion-heading h2 {font-size:16px;margin:0}

#companionFrame {border:0;width:100%;flex:1;min-height:0;background:var(--surface)}
html.chat-widget #chatPage .chat-toolbar {display:grid;grid-template-columns:minmax(0,1fr) repeat(3,var(--ui-control-size));gap:6px}
html.chat-widget #chatProvider {grid-column:1/-1}
html.chat-widget body #chatPage #chatProvider {grid-column:1/-1;grid-row:1}
html.chat-widget body #chatPage #chatTopics {grid-column:1;grid-row:2;min-width:0}
html.chat-widget body #chatPage #chatNew {grid-column:2;grid-row:2}
html.chat-widget body #chatPage #chatRename {grid-column:3;grid-row:2}
html.chat-widget body #chatPage #chatDelete {grid-column:4;grid-row:2}
html.chat-widget #chatPage {border:0;border-radius:0;background:var(--surface)}
/* Companion uses the full chat panel, with a single compact toolbar. */
html.chat-companion body {padding:0!important;background:var(--surface)}
html.chat-companion #chatPage {height:100dvh!important;box-sizing:border-box;padding:12px 14px;border:0;border-radius:0;background:transparent;box-shadow:none}
html.chat-companion #chatPage .chat-toolbar {grid-template-columns:108px minmax(0,1fr) repeat(3,var(--ui-control-size));gap:6px}
html.chat-companion body #chatPage .chat-toolbar>#chatProvider {grid-column:1!important;grid-row:1;width:100%;min-width:0}
html.chat-companion body #chatPage .chat-toolbar>#chatTopics {grid-column:2;grid-row:1;width:100%;min-width:0}
html.chat-companion body #chatPage #chatNew {grid-column:3;grid-row:1}
html.chat-companion body #chatPage #chatRename {grid-column:4;grid-row:1}
html.chat-companion body #chatPage #chatDelete {grid-column:5;grid-row:1}
html.chat-companion #chatHistory {padding-right:0;scrollbar-width:none}
html.chat-companion #chatHistory::-webkit-scrollbar {display:none}
@media(max-width:339px),(pointer:coarse) {
 html.chat-companion #chatPage .chat-toolbar {grid-template-columns:minmax(0,1fr) repeat(3,var(--ui-control-size))}
 html.chat-companion body #chatPage .chat-toolbar>#chatProvider {grid-column:1/-1!important;grid-row:1;width:136px}
 html.chat-companion body #chatPage .chat-toolbar>#chatTopics {grid-column:1;grid-row:2}
 html.chat-companion body #chatPage #chatNew {grid-column:2;grid-row:2}
 html.chat-companion body #chatPage #chatRename {grid-column:3;grid-row:2}
 html.chat-companion body #chatPage #chatDelete {grid-column:4;grid-row:2}
}
html body.wave-shell:is(.reader-focus,.dialog-focus,.wave-focus)>#workspaceCompanion {display:none!important}
@media(min-width:1180px) {
 html body.wave-shell.with-companion:not(.reader-focus,.dialog-focus,.wave-focus) {grid-template-columns:216px minmax(0,1fr) 360px}
 html body.wave-shell.with-companion>.workspace-header {grid-column:2/-1}
 html body.wave-shell #workspaceCompanion[open] {position:static;grid-column:3;grid-row:2;width:100%;height:100%;margin:0;border:0;border-left:1px solid var(--line);border-radius:0;max-height:none}
}
/* Server console uses the existing selected-server state and APIs. */
html body [data-servers=pulse] .server-tabs {gap:8px;margin:0;padding:2px 0 8px}
html body [data-servers=pulse] .server-link {font-size:12px}
html body .page>main .pulse-stats {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border:1px solid var(--line);border-radius:8px;background:var(--surface);margin-bottom:12px;padding:12px 0}
html body .page>main .pulse-stats .pulse-stat {padding:0 16px;border:0;border-right:1px solid var(--line);border-radius:0;background:transparent;box-shadow:none}
html body .page>main .pulse-stats .pulse-stat:last-child {border-right:0}
html body .pulse-stat h2 {font-size:11px;font-weight:500;letter-spacing:.3px;color:var(--muted)}
html body .pulse-stats .pulse-stat>strong {font-size:24px;font-weight:600;letter-spacing:-.4px;font-variant-numeric:tabular-nums;color:var(--text)}
html body .pulse-stat>p {font-size:11px;margin-top:4px}
.console-toolbar {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:4px 0 12px;border-bottom:1px solid var(--line);padding-bottom:8px}
.console-tabs {display:flex;gap:4px}
html body #pulseJournal,.console-services {border:1px solid var(--line);border-radius:8px;background:var(--surface);padding:14px;margin:0 0 12px;min-width:0}
.console-journal-head {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.console-journal-head h2,.console-services>h2 {font-size:15px;font-weight:600;margin:0}
.console-journal-head .ui-actions {display:flex;gap:6px;flex-wrap:wrap}
#consoleJournalStatus {font-size:12px;color:var(--muted);line-height:1.5;margin:8px 0;overflow-wrap:anywhere}
#consoleJournalStatus:empty {display:none}
#consoleEvents {padding:0;margin:0;list-style:none;max-height:480px;overflow:auto}
.console-event {display:grid;grid-template-columns:130px 90px minmax(0,1fr);gap:10px;padding:11px 4px;border-top:1px solid var(--line-soft);font-size:12px;align-items:start}
.console-event time {font-family:var(--mono);font-size:11px;color:var(--muted)}
.console-event strong {font-weight:500;overflow-wrap:anywhere}
.console-event details {grid-column:3;min-width:0;color:var(--muted);line-height:1.5;overflow-wrap:anywhere}
.console-event details summary {cursor:pointer}
.console-event[data-level=warning] {border-left:2px solid var(--amber);background:color-mix(in srgb,var(--amber) 5%,transparent);padding-left:8px}
.console-event[data-level=critical] {border-left:2px solid var(--red);background:color-mix(in srgb,var(--red) 5%,transparent);padding-left:8px}
.console-event[data-level=warning] .console-level {color:var(--amber)}
.console-event[data-level=critical] .console-level {color:var(--red)}
.console-service {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 2px;border-bottom:1px solid var(--line-soft);font-size:13px}
.console-service:last-child {border-bottom:0}
.console-service strong {font-weight:500;overflow-wrap:anywhere;min-width:0}
.console-service span {flex:none;color:var(--muted)}
.console-service[data-state=active] span {color:var(--green)}
.console-service[data-state=failed] span {color:var(--red)}
#consoleServices>p {font-size:12px;margin-top:10px;line-height:1.5}
@media(max-width:800px) {
 html body.wave-shell:not(.reader-focus,.dialog-focus,.wave-focus) {grid-template-columns:minmax(0,1fr);grid-template-rows:58px minmax(0,1fr) auto}
 html body.wave-shell>.workspace-header {grid-column:1;padding:0 10px;gap:8px}
 html body.wave-shell>.workspace-body {grid-column:1}
 html body.wave-shell>.workspace-sidebar {display:none}
 .workspace-companion-open {display:none}
 html.embedded-page:not(.chat-widget) body:not(:has(#chatPage)) {padding:16px 12px}
 html body .section-line h1,html body .settings-heading h1,html body #homeDashboard .home-heading h1 {font-size:23px}
 html body #homeDashboard :is(.home-card,.module-card) {padding:12px}
 html body #homeDashboard [data-home-card=pulse] {padding:12px 0}
 html body .page>main .pulse-stats {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 0}
 html body .page>main .pulse-stats .pulse-stat {padding:0 12px}
 html body .page>main .pulse-stats .pulse-stat:nth-child(2) {border-right:0}
 html body .pulse-stat>strong {font-size:22px}
 .console-event {grid-template-columns:1fr auto;gap:5px 10px}
 .console-event>strong,.console-event details {grid-column:1/-1}
 html body #pulseJournal,.console-services {padding:12px}
 .console-toolbar>.ui-button {margin-left:auto}
}
@media(prefers-reduced-motion:no-preference) { .workspace-sidebar a,.settings-nav a {transition:background-color .16s,color .16s} }

/* Neutral graphite: accent belongs to selection, never to the base surfaces. */
html body:not(.wave-shell)>.page {max-width:none}
html body :is(.home-card,.module-card,.vpn-card,.server-manager,.settings-card,.article-card,.project-card,.activity-card,.rt-panel,.pulse-panel,.pulse-stat,.balance-panel,.signal-panel,.kb-column,.anime-panel,.trophy-panel,.security-panel,.storage-folder-card) {background:var(--surface-highlight),var(--surface);box-shadow:var(--surface-shadow)}
html body #homeDashboard[data-group] :is(.home-grid,.section-directory)>.home-card {background:var(--surface-highlight),var(--surface);border-color:var(--line);border-radius:9px;box-shadow:var(--surface-shadow)}
html body #homeDashboard[data-group] .home-card-title {margin-bottom:14px}
html body #homeDashboard[data-group] .home-card-title h2 {font-size:17px;font-weight:600;letter-spacing:-.15px}
html body #homeDashboard[data-group] #homeMedia .home-media-progress {max-width:none;width:100%}
html body #homeDashboard .home-weather-temperature {color:var(--text)}
html body.wave-shell>.workspace-header {background:#121416}
html body .workspace-sidebar {background:linear-gradient(180deg,#17191c,#131518)}
html body #pulseJournal,html body .console-services {background:var(--surface-highlight),var(--surface);box-shadow:var(--surface-shadow)}
@media(min-width:801px) {
 html body #homeDashboard[data-group] :is(.home-grid,.section-directory)>.home-card {padding:18px}
 html body #homeDashboard[data-group] :is(.home-grid,.section-directory)>[data-home-card=pulse] {padding:18px 0}
 html body #homeDashboard[data-group] .home-track {padding-block:9px}
 html body #homeDashboard[data-group] .home-track strong {font-size:13px;line-height:19px}
 html body #homeDashboard[data-group] .home-track small,html body #homeDashboard[data-group] #homeMedia .home-media-item small {font-size:11px;line-height:17px}
 html body #homeDashboard .home-metric strong {font-size:25px}
 html body #homeDashboard[data-group] .home-value {font-size:26px}
}
/* Every workspace uses the same outer canvas; reading measures stay local. */
html body .page>main .workspace-toolbar {display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 12px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;min-width:0}
html body .page>main .workspace-toolbar>label {margin-block:0}
@media(min-width:1000px) {
 html body .page>main .workspace-toolbar>input[type=search] {flex:1 1 220px;width:auto;min-width:160px;max-width:480px!important}
 html body .page>main .workspace-toolbar>select {flex:0 1 220px;width:auto;max-width:260px;min-width:120px}
}
#kanban {container:kanban / inline-size}
html body #kanban .kb-header {display:grid;gap:8px;margin-bottom:12px}
html body #kanban .kb-header>.kb-tools {margin:0;padding:0;border:0;border-radius:0;background:none;gap:8px;min-width:0;align-items:center}
html body #kanban .kb-header label {display:flex;align-items:center;gap:6px;white-space:nowrap;margin:0;flex:none}
@container kanban (min-width:1000px) {
 html body #kanban .kb-header {grid-template-columns:minmax(260px,.8fr) minmax(0,1.4fr);align-items:center}
 html body #kanban .kb-header>.kb-tools {flex-wrap:nowrap}
 html body #kanban .kb-header #kbSearch {flex:1 1 160px;width:0;min-width:0}
 html body #kanban .kb-header #kbTag {flex:0 1 120px;width:120px;min-width:80px}
 html body #kanban .kb-header #kbPriority {flex:0 0 154px;width:154px;min-width:0}
}
html body .console-server-summary {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:start;margin-bottom:12px}
html body .console-server-summary:has(>.pulse-about[open]) {align-items:stretch}
html body .console-server-summary .pulse-details>div {padding-block:3px}
html body .console-server-summary .pulse-details>div:last-child {padding-bottom:0}
html body .page>main .console-server-summary #pulseHost {margin-block:4px}
html body .page>main .console-server-summary>.pulse-about,html body .console-server-summary>.console-services {margin:0;min-width:0}
@media(min-width:1000px) {html body .console-server-summary {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
html body #pulseServerPanel:has(#pulseData[hidden]) .pulse-about {display:none}
html body #pulseServerPanel:has(#pulseData[hidden]) .console-server-summary {grid-template-columns:minmax(0,1fr)}
:root {--page-gutter:24px;--card-gap:12px}
html body :is(#helios,#hubSearch,#vpnDiagnostics) {width:100%;max-width:none;margin-inline:0}
html body .section-line {margin-bottom:18px}
html body .section-line h1,html body .settings-heading h1 {font-size:29px}
html body #settingsContent {container:settings / inline-size}
html body #settingsContent :is(.settings-panels,.settings-appearance,#homeSettings,.data-backup,.hub-updates) {width:100%;max-width:none}
html body #settingsContent[data-settings-section] .settings-panels {max-width:none}
html body #settingsContent .settings-appearance .settings-card {display:grid;gap:0 24px}
html body #settingsContent .appearance-options {min-width:0}
html body #settingsContent .appearance-options .settings-switch:first-child {margin-top:0}
html body #settingsContent #homeSettingsList {display:grid;gap:0 24px}
html body #settingsContent #dataBackupChoices {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:12px}
html body #settingsContent #dataBackupChoices>label {margin:0;min-width:0;height:100%}
html body #statisticsPage .activity-grid {grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr))}
html body #vpn .vpn-grid {grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr))}
@container settings (min-width:900px) {
 html body #settingsContent .settings-appearance .settings-card {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 html body #settingsContent .settings-appearance .settings-card>h2,
 html body #settingsContent .settings-appearance .settings-card>p {grid-column:1/-1}
 html body #settingsContent .settings-appearance .orbit-accents {margin-block:12px 0}
 html body #settingsContent .appearance-options {padding-top:12px}
 html body #settingsContent #homeSettingsList {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(min-width:801px) {
 html.embedded-page:not(.chat-widget) body:has(#chatPage) {padding:20px 24px}
}
@media(max-width:800px) {
 :root {--page-gutter:12px;--card-gap:10px}
 html body .section-line h1,html body .settings-heading h1 {font-size:23px}
}
