/* App shell: mobile-first, desktop sidebar from 900px */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .25rem; padding: calc(.5rem + env(safe-area-inset-top)) 1rem .5rem; background: var(--glass); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); letter-spacing: .18em; }
.brand:hover { text-decoration: none; }
.spacer { flex: 1; }
.layout { max-width: 1060px; margin: 0 auto; }
#outlet { min-width: 0; width: 100%; max-width: 680px; margin: 0 auto; padding: .9rem .8rem calc(6rem + env(safe-area-inset-bottom)); outline: none; }
.view { animation: rise .25s ease both; }
.sidebar { display: none; }
.bottombar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: center; padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); background: var(--glass); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
.bottombar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--muted); min-height: 44px; justify-content: center; }
.bottombar a:hover { text-decoration: none; }
.bottombar a[aria-current] { color: var(--text); }
.bottombar a[aria-current] .icon { stroke: var(--violet); transform: translateY(-2px); }
.bottombar .fab { justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #fff; margin-top: -22px; box-shadow: 0 8px 22px rgba(99, 90, 246, .5); }
.badge { position: absolute; top: 0; right: 50%; transform: translateX(22px); min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .65rem; font-style: normal; text-align: center; font-weight: 700; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--solid); padding: .5rem 1rem; border-radius: 8px; }
#offline { position: fixed; z-index: 60; top: 0; left: 50%; transform: translateX(-50%); background: var(--danger); color: #fff; padding: .15rem 1rem; border-radius: 0 0 10px 10px; font-size: .8rem; }
.page-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; min-height: 44px; }
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1.2rem; padding: 1.5rem 1rem; }
.auth-brand { text-align: center; }
.auth-brand img { margin: 0 auto .4rem; filter: drop-shadow(0 0 22px rgba(110, 100, 255, .6)); }
.auth-brand h1 { font-size: 2rem; letter-spacing: .35em; padding-left: .35em; }
.auth-box { width: min(400px, calc(100vw - 2rem)); }
.auth-box > * + *, .auth-box form > * + * { margin-top: .75rem; }
.lang { width: auto !important; }
@media (min-width: 900px) {
  .topbar, .bottombar { display: none; }
  .layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; padding: 0 1rem; }
  .sidebar { display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1.2rem .5rem; }
  .sidebar .brand { margin: 0 .8rem 1.2rem; font-size: 1.2rem; }
  .sidebar a:not(.brand):not(.btn) { position: relative; display: flex; align-items: center; gap: .85rem; padding: .7rem .8rem; border-radius: 12px; color: var(--muted); transition: background .2s, color .2s; }
  .sidebar a:not(.btn):hover { text-decoration: none; background: var(--glass); }
  .sidebar a[aria-current]:not(.btn) { color: var(--text); background: var(--glass); box-shadow: inset 3px 0 var(--violet); }
  .sidebar .badge { right: .8rem; top: .75rem; transform: none; }
  .sidebar .compose { margin-top: 1rem; }
  #outlet { padding: 1.4rem 0 4rem; }
}



/* Compact responsive density and polished route transitions */
#outlet { padding-left: clamp(.55rem, 2vw, .85rem); padding-right: clamp(.55rem, 2vw, .85rem); }
.view { animation: orbix-view-in .22s cubic-bezier(.2,.75,.25,1) both; }
@keyframes orbix-view-in { from { opacity: 0; transform: translateY(7px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 380px) { .topbar { padding-left: .65rem; padding-right: .65rem; } .brand { gap: .4rem; letter-spacing: .12em; } .bottombar a { font-size: .61rem; } .bottombar .fab { width: 46px; height: 46px; } }

/* ORBIX 3.0 top bar */
.topbar { gap: .1rem; padding-left: .5rem; padding-right: .35rem; }
.topbar .brand { gap: .35rem; letter-spacing: .06em; white-space: nowrap; flex: none; font-size: .92rem; }
.top-search { flex: 1; min-width: 36px; display: flex; align-items: center; gap: .35rem; height: 36px; margin: 0 .25rem; padding: 0 .55rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: .85rem; overflow: hidden; white-space: nowrap; }
.top-search:hover { text-decoration: none; }
.top-search .icon { width: 18px; height: 18px; }
.topbar .icon-btn { position: relative; min-width: 36px; width: 36px; height: 36px; flex: none; }
.topbar .badge { right: auto; left: 50%; transform: none; }
.ai-img { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; }
.bottombar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 380px) { .topbar .brand strong { display: none; } }
#remote-banner { padding: .45rem .9rem; text-align: center; font-size: .85rem; background: var(--grad); color: #fff; }
#to-top { position: fixed; z-index: 19; right: .9rem; bottom: calc(5.2rem + env(safe-area-inset-bottom)); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--solid); border: 1px solid var(--line); box-shadow: var(--shadow); }
