
/* Shared shell contract: every PHP page renders sidebar + main in this grid. */
.pos-shell-page{margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh;background:var(--shell-bg);color:var(--shell-text)}
.pos-shell-page *{box-sizing:border-box}
.pos-shell-page>.shell,
body[data-shell-scope="control"]>.shell,
body[data-shell-scope="account"]>.shell{
  width:100%;
  min-height:100vh;
  display:grid;
  grid-template-columns:270px minmax(0,1fr);
  align-items:stretch;
}
.pos-shell-page>.shell>main,
body[data-shell-scope="control"]>.shell>main,
body[data-shell-scope="account"]>.shell>main{
  min-width:0;
  min-height:100vh;
  overflow:hidden;
}
body.nav-collapsed.pos-shell-page>.shell,
body.nav-collapsed[data-shell-scope="control"]>.shell,
body.nav-collapsed[data-shell-scope="account"]>.shell{
  grid-template-columns:78px minmax(0,1fr);
}
[hidden]{display:none!important}
@media(max-width:800px){
  .pos-shell-page>.shell,
  body[data-shell-scope="control"]>.shell,
  body[data-shell-scope="account"]>.shell{grid-template-columns:minmax(0,1fr)}
}
:root{--shell-bg:#02070d;--shell-text:#eaf7ff;--shell-muted:#8fa9ba;--shell-cyan:#54d7ff;--shell-line:rgba(84,215,255,.18);--shell-panel:rgba(5,14,24,.96)}
body.light{--shell-bg:#aabfca;--shell-text:#061421;--shell-muted:#365d70;--shell-cyan:#2584ad;--shell-line:rgba(31,75,98,.30);--shell-panel:rgba(239,247,251,.98)}
.pos-shared-sidebar{position:sticky;top:0;height:100vh;min-width:0;padding:18px 14px;border-right:1px solid var(--shell-line);background:rgba(3,8,16,.92);display:flex;flex-direction:column;overflow-y:auto;backdrop-filter:blur(18px)}
body.light .pos-shared-sidebar{background:#d2e2e9}
.pos-shared-brand{display:flex;align-items:center;gap:12px;margin:8px 0 30px;padding-left:14px;color:inherit;text-decoration:none}
.pos-shared-brand>img{width:52px;height:52px;flex:0 0 52px;filter:drop-shadow(0 0 18px rgba(84,215,255,.55))}
.pos-shared-brand>span{min-width:0}.pos-shared-brand .word{display:block;width:145px;max-width:100%;height:auto}.pos-shared-brand small{display:block;margin-top:5px;color:var(--shell-cyan);font-size:11px;letter-spacing:.15em;text-transform:uppercase}
body.light .pos-shared-brand .word{content:url('/assets/positronic-wordmark-light.png')}
.pos-shared-sidebar-section{margin:14px 10px 7px;color:var(--shell-muted);font-size:10px;letter-spacing:.15em;text-transform:uppercase}
.pos-shared-sidebar>a:not(.pos-shared-brand){display:flex;align-items:center;gap:10px;margin:2px 0;padding:10px 11px;border:1px solid transparent;border-radius:11px;color:inherit;text-decoration:none}
.pos-shared-sidebar>a:hover,.pos-shared-sidebar>a.active{background:rgba(84,215,255,.10);border-color:rgba(84,215,255,.22)}
.pos-shared-session{margin-top:auto;padding:13px;border:1px solid var(--shell-line);border-radius:15px;background:rgba(84,215,255,.045);display:grid;gap:6px}
.pos-shared-session small{color:var(--shell-muted);font-size:10px;letter-spacing:.12em}.pos-shared-session span{color:#75ffae;font-size:12px}
.pos-shared-topbar{height:74px;display:flex;align-items:center;gap:15px;padding:0 24px;position:sticky;top:0;z-index:80;border-bottom:1px solid var(--shell-line);background:rgba(2,8,15,.78);color:var(--shell-text);backdrop-filter:blur(20px) saturate(145%)}
body.light .pos-shared-topbar{background:rgba(228,240,247,.88);color:#061421}
.pos-shared-burger,.pos-shared-icon{width:42px;height:42px;display:grid;place-items:center;border:1px solid transparent;border-radius:50%;background:transparent;color:inherit;cursor:pointer}
.pos-shared-burger:hover,.pos-shared-icon:hover{box-shadow:0 0 18px 7px rgba(84,215,255,.13)}
.pos-shared-navlinks{display:flex;align-items:center;gap:22px}.pos-shared-navlinks a{position:relative;color:inherit;text-decoration:none;text-transform:uppercase;letter-spacing:.13em;font-size:12px}
.pos-shared-navlinks a.active{color:var(--shell-cyan);font-weight:800}.pos-shared-navlinks a.active::after{content:'';position:absolute;left:0;right:0;bottom:-13px;height:2px;border-radius:2px;background:currentColor}
.pos-shared-spacer{flex:1}.pos-shared-search{width:min(460px,34vw);height:42px;padding:0 16px;border:1px solid var(--shell-line);border-radius:999px;background:rgba(255,255,255,.04);color:inherit}
.pos-shared-profile{display:flex;align-items:center;gap:9px;padding:5px 7px;border:0;border-radius:999px;background:transparent;color:inherit;cursor:pointer}
.pos-shared-profile:hover{background:rgba(84,215,255,.10)}.pos-shared-profile img,.pos-shared-profile .control-profile-avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:linear-gradient(135deg,rgba(84,215,255,.24),rgba(111,86,255,.36))}
.pos-shared-profile>span:nth-child(2){display:grid;text-align:left;line-height:1.15}.pos-shared-profile small{margin-top:3px;color:var(--shell-muted);font-size:9px;letter-spacing:.1em}
.pos-shared-user-menu{position:fixed;right:18px;top:66px;z-index:150;width:260px;padding:10px;border:1px solid var(--shell-line);border-radius:16px;background:var(--shell-panel);color:var(--shell-text);box-shadow:0 20px 70px rgba(0,0,0,.4);display:none}
.pos-shared-user-menu.open{display:block}.pos-shared-menu-title{padding:8px 10px;color:var(--shell-muted);font-size:11px;letter-spacing:.12em;text-transform:uppercase}
.pos-shared-user-menu a,.pos-shared-user-menu button{width:100%;display:flex;align-items:center;gap:10px;padding:10px;border:0;border-radius:10px;background:transparent;color:inherit;text-decoration:none;text-align:left;cursor:pointer}
.pos-shared-user-menu a:hover,.pos-shared-user-menu button:hover,.pos-shared-user-menu a.active{background:rgba(84,215,255,.10)}
body.nav-collapsed .pos-shared-brand>span,body.nav-collapsed .pos-shared-sidebar-section,body.nav-collapsed .pos-shared-sidebar>a span,body.nav-collapsed .pos-shared-session{display:none}
body.nav-collapsed .pos-shared-sidebar>a{justify-content:center}
body.nav-collapsed .pos-shared-brand{padding-left:0}
.pos-page-loader{min-height:180px;display:grid;place-items:center;color:var(--shell-muted)}.pos-page-loader img{width:58px;filter:drop-shadow(0 0 18px rgba(84,215,255,.5))}
@media(max-width:1000px){.pos-shared-navlinks{display:none}.pos-shared-search{display:none}}
@media(max-width:800px){.pos-shared-sidebar{display:none}.pos-shared-topbar{padding:0 12px}.pos-shared-profile>span:nth-child(2){display:none}}

body.pos-v2.pos-with-sidebar .pos-shared-topbar{margin-left:300px}
body.pos-v2.pos-with-sidebar #positronic-v2-app{height:calc(100vh - 102px)!important;padding-top:0!important}
body.pos-v2.pos-chat-nav-collapsed .pos-shared-topbar{margin-left:78px}
body.pos-v2 .pos-shared-user-menu{top:66px}
body.pos-v2.pos-chat-nav-collapsed .pos-shell-footer{left:78px}
@media(max-width:980px){body.pos-v2.pos-with-sidebar .pos-shared-topbar{margin-left:0}}

/* Shared footer and lower-shell spacing */
.pos-shell-page .pos-shell-footer,
body[data-shell-scope="control"] .pos-shell-footer,
body[data-shell-scope="account"] .pos-shell-footer{
  position:fixed;
  left:270px;
  right:0;
  bottom:0;
  z-index:75;
  min-height:28px;
  padding:5px clamp(24px,5vw,72px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  border-top:1px solid var(--shell-line);
  background:rgba(2,7,13,.94);
  color:var(--shell-muted);
  font-size:11px;
  backdrop-filter:blur(16px);
}
.pos-shell-footer a{margin-right:10px;color:#8fcde0;text-decoration:none}
.pos-shell-footer a:hover{color:#eafaff}
body.light .pos-shell-footer{background:rgba(224,236,243,.97);color:#4b6b7d}
body.light .pos-shell-footer a{color:#246b91}
body.nav-collapsed .pos-shell-footer{left:78px}

/* Calm session status: readable without neon glare. */
.pos-shared-session span{color:#55c985;text-shadow:none}
body.light .pos-shared-session span{color:#1d7049;font-weight:650}

/* Keep the Chat composer clear of the fixed footer. */
body.pos-v2.pos-with-sidebar #chat-form,
body.pos-v2.pos-with-sidebar .pos-v2-composer{
  bottom:10px!important;
  margin-bottom:0!important;
}
body.pos-v2.pos-with-sidebar #messages,
body.pos-v2.pos-with-sidebar .pos-v2-messages{
  padding-bottom:96px!important;
}
body.pos-v2.pos-with-sidebar .pos-shell-footer{left:300px}
body.pos-v2.pos-chat-nav-collapsed .pos-shell-footer{left:78px}

@media(max-width:800px){
  .pos-shell-page .pos-shell-footer,
  body[data-shell-scope="control"] .pos-shell-footer,
  body[data-shell-scope="account"] .pos-shell-footer,
  body.pos-v2.pos-with-sidebar .pos-shell-footer{left:0;padding-inline:14px}
  .pos-shell-footer-links{display:none}
}

/* Public variant of the shared topbar. */
.pos-shared-topbar-brand{display:flex;align-items:center;gap:12px;flex:0 0 auto;color:inherit;text-decoration:none}
.pos-shared-topbar-brand .core{width:44px;height:44px;filter:drop-shadow(0 0 14px rgba(84,215,255,.42))}
.pos-shared-topbar-brand .word{display:block;width:260px;height:42px;object-fit:contain;object-position:left center}
body.light .pos-shared-topbar-brand .core{content:url('/assets/positronic-loader-light.svg')}
body.light .pos-shared-topbar-brand .word{content:url('/assets/positronic-wordmark-light.png')}
.pos-shared-login-link{display:flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid var(--shell-line);border-radius:999px;color:inherit;text-decoration:none}
.pos-shared-login-link:hover,.pos-shared-login-link.active{color:var(--shell-cyan);background:rgba(84,215,255,.09);border-color:rgba(84,215,255,.38)}
@media(max-width:720px){.pos-shared-topbar-brand .word{display:none}.pos-shared-topbar-brand .core{width:38px;height:38px}.pos-shared-topbar{gap:10px}}

body.pos-v2.pos-with-sidebar .pos-v2-chat-panel{height:calc(100vh - 102px)!important;}

/* Control navbar scrolls naturally with the page. */
body[data-shell-scope="control"] .pos-shared-topbar{position:relative!important;top:auto!important}

/* Chat composer is viewport-anchored above the 28px footer. */
body.pos-v2.pos-with-sidebar #chat-form,
body.pos-v2.pos-with-sidebar .pos-v2-composer{position:fixed!important;left:calc(300px + clamp(48px,6.25vw,120px))!important;right:clamp(24px,3.15vw,60px)!important;bottom:38px!important;width:auto!important;margin:0!important}
body.pos-v2.pos-chat-nav-collapsed #chat-form,
body.pos-v2.pos-chat-nav-collapsed .pos-v2-composer{left:calc(78px + clamp(48px,6.25vw,120px))!important}
@media(max-width:980px){body.pos-v2.pos-with-sidebar #chat-form,body.pos-v2.pos-with-sidebar .pos-v2-composer{left:12px!important;right:12px!important;bottom:calc(38px + env(safe-area-inset-bottom,0px))!important}}

/* Original Positronic raster lockup used by the landing design. */
.pos-shared-topbar-brand .word{width:260px!important;height:42px!important;flex:0 0 260px!important;object-fit:contain!important;object-position:left center!important}


/* Public navbar finishing: larger official lockup and Login as a right-side action. */
body[data-shell-scope="public"] .pos-shared-topbar-brand{width:300px;overflow:visible}
body[data-shell-scope="public"] .pos-shared-topbar-brand .word{
  width:420px!important;height:58px!important;flex:0 0 250px!important;
  max-width:none!important;transform:scale(1.42);transform-origin:left center;
}
body[data-shell-scope="public"] .pos-shared-login-link.active{
  color:var(--shell-cyan);background:rgba(84,215,255,.13);border-color:rgba(84,215,255,.48);
  box-shadow:0 0 20px rgba(84,215,255,.10);
}
@media(max-width:1180px){
  body[data-shell-scope="public"] .pos-shared-topbar-brand{width:240px}
  body[data-shell-scope="public"] .pos-shared-topbar-brand .word{transform:scale(1.18);flex-basis:200px!important}
}


/* Shared public brand, footer and back-to-top control. */
body[data-shell-scope="public"] .pos-shared-topbar-brand{width:330px}
body[data-shell-scope="public"] .pos-shared-topbar-brand .core{width:50px;height:50px;flex:0 0 50px}
body[data-shell-scope="public"] .pos-shared-topbar-brand .word{
  width:460px!important;height:64px!important;flex-basis:270px!important;
  transform:scale(1.55);transform-origin:left center;
}
.back-to-top{
  position:fixed;right:24px;bottom:24px;width:48px;height:48px;border-radius:50%;
  border:1px solid rgba(120,231,255,.28);background:rgba(5,12,20,.9);
  color:var(--shell-text,#eef7fb);display:grid;place-items:center;cursor:pointer;
  box-shadow:0 18px 50px rgba(0,0,0,.3);opacity:0;pointer-events:none;
  transform:translateY(12px);transition:.18s ease;z-index:1100;
}
.back-to-top.is-visible{opacity:1;pointer-events:auto;transform:translateY(0)}
.back-to-top:hover{color:var(--shell-cyan,#54d7ff);border-color:var(--shell-cyan,#54d7ff)}
body.light .back-to-top{background:rgba(239,247,251,.94);color:#061421}
@media(max-width:1180px){
  body[data-shell-scope="public"] .pos-shared-topbar-brand{width:260px}
  body[data-shell-scope="public"] .pos-shared-topbar-brand .word{transform:scale(1.28);flex-basis:210px!important}
}
