/* App shell: left sidebar, top bar, main area, mobile drawer. */
.shell{display:grid;grid-template-columns:260px 1fr;min-height:100vh}
#sidebar{position:sticky;top:0;height:100vh;padding:22px 16px;border-right:1px solid var(--line);background:var(--surface-sidebar);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);display:flex;flex-direction:column;gap:4px;overflow-y:auto}
.brand{display:flex;align-items:center;gap:10px;font:800 1.25rem var(--disp);letter-spacing:.06em;margin:4px 8px 22px}
.nexora-logo-frame{display:inline-grid;flex:none;place-items:center;padding:3px;border:1px solid var(--line);border-radius:12px;background:var(--surface-deep);box-shadow:0 0 16px rgba(124,58,237,.14)}
.nexora-logo{display:block;width:auto;height:34px;border-radius:8px;object-fit:contain}
.brand .nexora-logo{height:36px}
.mobile-brand{display:none;align-items:center;width:max-content}
.mobile-brand .nexora-logo-frame{padding:2px;border-radius:10px}
.mobile-brand .nexora-logo{height:30px;border-radius:7px}
.nav a{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:12px;color:var(--mute);font-weight:600;transition:background-color .2s,color .2s}
.nav a:hover{background:var(--surface-nav-hover);color:var(--ink)}
.nav a.on{background:var(--grad);color:var(--text-on-brand);box-shadow:var(--glow)}
.nav svg,.icon-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nav small{margin-left:auto;font-size:.62rem;opacity:.6}
.side-note{margin-top:auto;font-size:.78rem;color:var(--mute);padding:12px;border:1px dashed var(--line);border-radius:12px}
main{padding:0 28px 48px;min-width:0}
#topbar{display:flex;align-items:center;gap:12px;padding:18px 0;position:sticky;top:0;z-index:5;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
#topbar h1{font-size:1.35rem}
.sp{flex:1}
.icon-btn{position:relative;width:42px;height:42px;border-radius:12px;border:1px solid var(--line);background:var(--card);display:grid;place-items:center}
.icon-btn .dot{position:absolute;top:9px;right:10px;width:8px;height:8px;border-radius:50%;background:var(--c);box-shadow:0 0 8px var(--c)}
.menu{display:none}
.me{display:flex;align-items:center;gap:10px}
.profile-summary{display:flex;align-items:center;gap:8px;min-width:0;color:var(--ink)}
.profile-summary .generated-avatar{width:34px;height:34px}
.profile-summary .who{max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-points{color:var(--c);font-size:.72rem;font-weight:800;white-space:nowrap}
.profile-sign-in{padding:9px 12px;border:1px solid var(--line);border-radius:10px;color:var(--ink);font-size:.8rem;font-weight:700}
.auth-init-error{position:fixed;z-index:100;top:50%;left:50%;width:min(460px,calc(100% - 32px));transform:translate(-50%,-50%);color:var(--ink)}
body[data-auth-required] .shell{visibility:hidden}
.av{width:38px;height:38px;border-radius:50%;background:var(--grad);display:grid;place-items:center;font-weight:700;font-size:.8rem}
.scrim{display:none;padding:0;border:0;cursor:pointer}
.bottom-nav{display:none}
@media(max-width:900px){
  .shell{grid-template-columns:1fr}
  #sidebar{position:fixed;inset:0 auto 0 0;width:274px;z-index:30;transform:translateX(-102%);transition:transform .25s cubic-bezier(.2,.8,.2,1);background:var(--surface-drawer)}
  body.menu #sidebar{transform:none}
  body.menu .scrim{display:block;position:fixed;inset:0;z-index:20;background:var(--surface-backdrop)}
  .menu{display:grid}
  main{padding:0 16px calc(104px + env(safe-area-inset-bottom))}
  .bottom-nav{position:fixed;inset:auto 0 0;z-index:15;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface-sidebar);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}
  .bottom-nav a{display:flex;min-width:0;min-height:48px;align-items:center;justify-content:center;flex-direction:column;gap:3px;border-radius:10px;color:var(--mute);font-size:.64rem;font-weight:700}
  .bottom-nav svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .bottom-nav a[aria-current="page"]{background:var(--surface-nav-active);color:var(--ink)}
}
@media(max-width:700px){
  #topbar{display:grid;grid-template-columns:42px minmax(0,1fr) 42px 42px minmax(60px,auto);grid-template-areas:"menu title theme notify profile" "chip chip connect connect connect";gap:8px}
  #topbar .menu{grid-area:menu}
  #topbar .mobile-brand{grid-area:title;display:flex}
  #topbar h1{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  #topbar .notification-bell{grid-area:notify}
  #topbar .theme-toggle{grid-area:theme}
  #topbar .me{grid-area:profile;justify-self:end}
  #topbar .profile-summary{gap:4px}
  #topbar .profile-summary .generated-avatar{width:26px;height:26px}
  #topbar .profile-summary .who{max-width:50px;font-size:.58rem}
  #topbar .profile-points{font-size:.58rem}
  #topbar .chip{grid-area:chip;justify-self:start;white-space:nowrap}
  #topbar .btn{grid-area:connect;justify-self:end;white-space:nowrap;padding:8px 10px;font-size:.8rem}
  #topbar .sp{display:none}
}
