/* Shells: the signed-in app (sidebar, mobile drawer) and the focused auth layout. */

/* ===== APP SHELL ===== */
.app {
  min-height: 100vh;
}
.topbar {
  display: none;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--rule);
}
.nav {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}
.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 16px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--fg);
  font-weight: 500;
  text-decoration: none;
}
.nav__link .icon {
  flex: none;
  color: var(--muted);
}
.nav__label {
  flex: 1;
  min-width: 0;
}
.nav__code {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.nav__link:hover {
  background: var(--tint);
}
.nav__link:focus-visible {
  outline-offset: -2px;
}
.nav__link.is-active {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}
.nav__link.is-active .icon {
  color: var(--fg);
}
.nav__link.is-active .nav__code {
  color: var(--accent-ink);
  font-weight: 600;
}
.sidebar__foot {
  margin-top: auto;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.account {
  display: flex;
  flex-direction: column;
  padding: 4px 16px 8px;
  min-width: 0;
}
.account__email {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account__plan {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.sidebar__server {
  padding: 8px 16px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.scrim {
  display: none;
}
.content {
  margin-left: var(--sidebar-w);
  min-width: 0;
  padding: 22px var(--gutter) 64px;
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 8px 0 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
  }
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 0.18s ease,
      visibility 0s 0.18s;
    width: min(280px, 86vw);
  }
  .sidebar__brand {
    display: none;
  }
  .drawer-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.18s ease;
  }
  .drawer-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(20, 20, 20, 0.45);
  }
  .drawer-open {
    overflow: hidden;
  }
  .content {
    margin-left: 0;
    padding-top: 16px;
  }
}

/* ===== FOCUSED LAYOUT (sign in, device, invite) ===== */
.focus {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.focus__head {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.focus__main {
  flex: 1;
  display: grid;
  place-items: start center;
  padding: clamp(20px, 7vh, 72px) 16px 40px;
}
.focus__foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 14px 16px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.auth {
  width: min(440px, 100%);
  border: 1px solid var(--rule);
  background: var(--surface);
}
.auth > .frame {
  margin: 0;
  padding: 9px 16px;
  border-bottom: 1px solid var(--rule);
}
.auth__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 22px 24px;
}
.auth__title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.auth__lead {
  color: var(--muted);
}
.auth__lead--ok {
  color: var(--fg);
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.auth__foot {
  padding: 12px 22px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 13px;
}
.auth__foot a {
  color: var(--fg);
  font-weight: 600;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hair);
}
.code-big {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
