/* V5 visual layer. Existing RC4 selectors, APIs and state remain authoritative. */
:root,body,body[data-ws="proton"]{color-scheme:dark;--red:#818cf8;--muted:#94a3b8;--line:#263449;font-family:Inter,system-ui,-apple-system,sans-serif;color:#e2e8f0;background:#020617}
body{min-height:100dvh;background:radial-gradient(ellipse at 80% 0,#312e811a,transparent 45%),#020617}
button,input,select,textarea{font-family:inherit}button,.button{background:#1e293b;border-color:#334155;border-radius:11px;font-weight:600;min-height:44px;max-width:100%;white-space:normal}button:hover,.button:hover{background:#29374d;border-color:#6366f1}button:focus-visible,a:focus-visible{outline:2px solid #a5b4fc;outline-offset:3px}
.primary,.accent,#loginDialog .primary{background:#4f46e5;border-color:#6366f1;color:#fff}.primary:hover{background:#4338ca}input,textarea,select,#loginDialog input{color:#f1f5f9;background:#020617;border-color:#334155}input:focus,textarea:focus,select:focus,body[data-ws="proton"] input:focus,body[data-ws="proton"] textarea:focus{outline:2px solid #6366f155;border-color:#818cf8}label{color:#cbd5e1}
.shell{grid-template-columns:232px minmax(0,1fr);min-height:100dvh}.shell>*{min-width:0}.sidebar{width:auto;height:100dvh;padding:20px 14px;gap:24px;background:#0f172a;border-color:#1e293b;overflow-y:auto;overscroll-behavior:contain}.sidebar .mark{background:linear-gradient(135deg,#4f46e5,#8b5cf6);color:#fff;border:0;flex:none}.brand{font-size:12px}.brand small{color:#94a3b8}.sidebar .foot{line-height:1.7;color:#94a3b8}.sidebar .foot b{color:#cbd5e1}
.main{align-self:start;margin:0 auto;padding:24px 28px 40px;max-width:1500px}.top{min-height:48px;margin-bottom:25px;padding-bottom:20px;border-bottom:1px solid #1e293b}.topDate{color:#64748b}.account{font-size:11px}.hero h1{font-size:clamp(24px,2.4vw,32px);letter-spacing:-.8px}.hero p{font-size:13px;max-width:650px}.eyebrow{color:#a5b4fc;letter-spacing:1.7px}.hero>.badge{flex-shrink:0}
.card,.glass{background:#0f172a;border:1px solid #1e293b;box-shadow:0 8px 26px #0002;border-radius:18px;backdrop-filter:none;-webkit-backdrop-filter:none}.card{padding:20px}.stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.stat strong{color:#f8fafc;font-size:30px}.stat .muted{font-size:12px}.grid{grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:18px}.grid>*,.knowledge-grid>*,.kc-layout>*,.toolbar>*{min-width:0}.item{background:#111c30;border-color:#273449}.item:hover{background:#17243a;border-color:#6366f1}.empty b{color:#cbd5e1}.empty .symbol{color:#64748b}
.badge{background:#25324b;color:#cbd5e1}.badge.green,.green,.kc-msg.good{background:#064e3b55;color:#6ee7b7}.badge.warn,.warn,.kc-dirty,.notice,.window-status{background:#78350f33;color:#fcd34d;border-color:#92400e55}.red,.error,.kc-msg.bad{color:#fda4af;background:transparent}.biz-pill.recond,.biz-pill.proton{background:#312e81;color:#e0e7ff;border:1px solid #4f46e5}.biz-tag{background:#78350f55;color:#fcd34d}
.nav{display:grid}.nav .ws-head,#moreBody .ws-head{background:#172036;border:1px solid #263449;color:#cbd5e1;font-size:10px;letter-spacing:.04em;justify-content:flex-start}.nav button{color:#94a3b8;font-size:12px}.nav button.active,.ws-grp.proton .ws-sub button.active,body[data-ws="proton"] .nav button.active{background:#4f46e529;color:#c7d2fe;border:1px solid #4f46e56b;box-shadow:none}.ws-sub{border-color:#334155;padding-left:4px;margin-left:2px}.ws-sub button{min-height:44px}.nav span.nav-label{width:auto;font-size:12px;text-align:left}.nav span:not(.nav-label):not(.dot){flex:none;width:22px}.ws-head .dot{background:#a78bfa;width:8px;height:8px}.ws-grp.proton .ws-head .dot{background:#38bdf8}
.picker-card,.picker-card:hover{background:#0f172a;border-color:#334155;box-shadow:none}.picker-card:hover{border-color:#818cf8}.picker-card small{color:#94a3b8}.picker-card em{color:#c7d2fe}.picker-card .pc-tag,.picker-card.proton .pc-tag{color:#a5b4fc}
.knowledge-text,.agent-model,.stage-content,.draft-preview,.fact-grid>div,.classification-strip>div,.flow-outcomes>div,.workflow li>span{background:#172036;color:#cbd5e1;border-color:#334155}.agent-icon{color:#818cf8}.bar{background:#334155}.timeline{border-color:#263449}.kc-text{font-family:inherit;background:#080f21;line-height:1.75}.kc-help ul{color:#94a3b8}.kc-msg{color:#94a3b8}.kc-layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:20px;align-items:start}.kc-tabs{display:grid;gap:6px;position:sticky;top:20px;margin:0}.kc-tabs button{flex:none;justify-content:flex-start;text-align:left;font-size:12px}.kc-layout .section:first-child{margin-top:0}.kc-layout .kc-test{margin-top:0}.kc-actions button{font-size:12px}
.inbox-layout{grid-template-columns:minmax(0,.38fr) minmax(0,.62fr);align-items:stretch;gap:16px}.conversation-list{max-height:calc(100dvh - 240px);min-height:420px;overflow-y:auto}.chat-window{padding:0;max-height:calc(100dvh - 240px);height:680px;min-height:420px;display:flex}.chat-header{padding:14px}.chat-window .chat{background:#080f21;min-height:0}.bubble{background:#1e293b;color:#e2e8f0}.bubble.ai{background:#4338ca}.bubble.human{background:#075985}.composer{background:#0f172a;padding:12px;flex-shrink:0}.composer textarea{margin:0 0 8px;min-height:56px}.chat-actions button{font-size:11px;min-height:44px}.selected-thread{border-color:#6366f1;background:#312e8133}.chat-identity{overflow-wrap:anywhere}.chat-actions{gap:6px}.chat-actions,.composer .row{flex-wrap:wrap}.mobile-back{display:none}
dialog{color:#e2e8f0;background:#0f172a;border:1px solid #334155;max-height:calc(var(--visible-height) - 24px)}dialog::backdrop{background:#020617b3}#loginDialog{width:min(460px,calc(100% - 24px))}.login{padding:12px;margin:22px auto}.login h1{font-size:25px}#toast{background:#312e81;border:1px solid #6366f1;bottom:24px}#moreDialog{width:min(520px,calc(100% - 24px))}.bottom-nav{display:none!important}#mobileMenu{display:none}#sidebarToggle{align-self:flex-start;min-width:44px;padding:8px;font-size:20px}.chat-header button{flex-shrink:0}img,video{max-width:100%}
@media(min-width:1280px){#sidebarToggle{display:none}}
@media(min-width:768px) and (max-width:1023px){.shell{grid-template-columns:76px minmax(0,1fr)}.sidebar{padding:16px 10px}.sidebar .brand>div:not(.mark),.sidebar .foot,.sidebar .ws-head b,.sidebar .ws-head i,.sidebar .nav-label{display:none}.sidebar .brand{justify-content:center}.sidebar .nav button{justify-content:center;padding:10px 6px}.sidebar .ws-sub{padding:0;margin:0;border:0}.sidebar .ws-head{min-height:44px}.main{padding:20px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.grid{grid-template-columns:minmax(0,1fr)}.inbox-layout{grid-template-columns:minmax(0,.37fr) minmax(0,.63fr);gap:12px}.conversation-list{padding:12px}.hero{align-items:flex-start}.hero>.badge{display:none}.knowledge-grid{grid-template-columns:1fr}.kc-layout{grid-template-columns:150px minmax(0,1fr);gap:14px}.kc-actions button{flex:1 1 100%}.sidebar-expanded .shell{grid-template-columns:232px minmax(0,1fr)}.sidebar-expanded .sidebar{padding:16px 12px}.sidebar-expanded .sidebar .brand>div:not(.mark),.sidebar-expanded .sidebar .ws-head b,.sidebar-expanded .sidebar .ws-head i,.sidebar-expanded .sidebar .nav-label{display:block}.sidebar-expanded .sidebar .nav button{justify-content:flex-start}.sidebar-expanded .inbox-layout{grid-template-columns:minmax(0,.37fr) minmax(0,.63fr)}}
@media(min-width:1024px) and (max-width:1279px){.stats{grid-template-columns:repeat(3,minmax(0,1fr))}.main{padding:22px}.grid:not(.inbox-layout){grid-template-columns:minmax(0,1fr)}.sidebar-collapsed .shell{grid-template-columns:76px minmax(0,1fr)}.sidebar-collapsed .sidebar{padding:16px 10px}.sidebar-collapsed .sidebar .brand>div:not(.mark),.sidebar-collapsed .sidebar .foot,.sidebar-collapsed .sidebar .nav-label,.sidebar-collapsed .sidebar .ws-head b,.sidebar-collapsed .sidebar .ws-head i{display:none}.sidebar-collapsed .sidebar .nav button{justify-content:center;padding:10px 6px}.sidebar-collapsed .ws-sub{border:0;margin:0;padding:0}.kc-layout{grid-template-columns:150px minmax(0,1fr)}}
@media(max-width:767px){.shell{display:block}.sidebar{display:none}.main{padding:16px max(14px,env(safe-area-inset-right)) 26px max(14px,env(safe-area-inset-left))}.top{gap:10px;margin-bottom:20px;padding-bottom:14px}.top>.row{width:100%;justify-content:space-between}.top .account{max-width:65%;font-size:11px}#mobileMenu{display:inline-flex;min-width:44px;font-size:20px}.top #topDate{display:none}.hero{align-items:flex-start;margin-bottom:18px}.hero>.badge{display:none}.hero h1{font-size:25px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.card{padding:16px}.grid,.knowledge-grid,.fields,.flow-columns{grid-template-columns:1fr}.kc-layout{display:block}.kc-tabs{position:static;grid-template-columns:1fr 1fr;margin-bottom:16px}.kc-tabs button{font-size:12px}.kc-text{height:44dvh;min-height:260px}.inbox-layout{display:block}.conversation-list{max-height:none;min-height:0}.chat-window{display:none}.chat-open .sidebar,.chat-open .top,.chat-open #globalStatus,.chat-open .inbox-heading,.chat-open .conversation-list{display:none!important}.chat-open .main{padding:0;margin:0;max-width:none}.chat-open .inbox-layout{margin:0}.chat-open .chat-window{display:flex;position:fixed;top:var(--v5-viewport-top,0px);left:0;right:0;height:var(--visible-height);max-height:var(--visible-height);min-height:0;border-radius:0;border:0;padding:env(safe-area-inset-top) 0 0;z-index:30}.chat-open .chat{min-height:0}.chat-open .composer{padding:10px 12px max(10px,env(safe-area-inset-bottom))}.chat-header{padding:10px 12px}.chat-actions{gap:5px;padding:8px 12px}.chat-actions button{font-size:10px;padding:8px}.mobile-back{display:inline-flex}.composer button{padding:9px 10px;font-size:12px}.flow-outcomes,.fact-grid{grid-template-columns:1fr 1fr}.classification-strip{grid-template-columns:1fr}.toolbar input{min-width:0;flex-basis:100%}#toast{bottom:20px}.picking .main{padding-bottom:24px}}
@media(max-width:359px){.stats,.kc-tabs,.fact-grid{grid-template-columns:1fr}.portal-card{padding:32px 20px}.portal-card h1{font-size:19px}}
@media(max-height:550px) and (max-width:767px){.chat-open .chat-actions,.chat-open .window-status,.chat-open .composer>small{display:none}.chat-open .composer textarea{height:44px;min-height:44px}.chat-open .chat-header{padding:6px 10px}}
/* V5.1 language preference; selector remains available in both workspaces. */
.language-control{margin:0;flex:0 0 auto}.language-control select{width:auto;min-width:145px;min-height:44px;font-size:12px;padding:10px 30px 10px 12px}.top .language-control{margin-left:auto}
@media(max-width:767px){.top .language-control{width:100%;margin:0}.language-control select{width:100%}}
/* Keep the restored public scenery design independent from dashboard colours. */
#landing .ls-head h2{color:#f1f5f9}#landing .ls-chip{color:#fcd34d}
