:root {
  --shell-app-rail: 72px;
  --shell-feature-rail: 224px;
  --shell-rail-border: #e8ebf0;
  --shell-rail-muted: #687386;
  --shell-rail-active: #17202a;
  --shell-rail-active-bg: #eef4ff;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--shell-app-rail) var(--shell-feature-rail) minmax(0, 1fr);
  min-height: 100vh;
}

.app-rail,
.feature-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
}

.app-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 10px;
  border-right: 1px solid var(--shell-rail-border);
}

.app-rail a,
.feature-rail a {
  color: inherit;
  text-decoration: none;
}

.app-rail-link {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--shell-rail-muted);
}

.app-rail-link:hover,
.app-rail-link[aria-current="page"] {
  color: var(--shell-rail-active);
  border-color: #dfe6f2;
  background: var(--shell-rail-active-bg);
}

.feature-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 16px 18px;
  border-right: 1px solid var(--shell-rail-border);
}

.feature-brand {
  min-width: 0;
  margin: 2px 8px 24px;
}

.feature-brand-title {
  font-size: 20px;
  font-weight: 750;
  line-height: 1.2;
}

.feature-brand-subtitle {
  margin-top: 4px;
  color: var(--shell-rail-muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.feature-nav {
  display: grid;
  gap: 4px;
}

.feature-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--shell-rail-muted);
  font-size: 14px;
  font-weight: 650;
}

.feature-link:hover,
.feature-link.is-active {
  color: var(--shell-rail-active);
  border-color: #dfe6f2;
  background: var(--shell-rail-active-bg);
}

.feature-link svg { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; }
.feature-link .badge-n { margin-left: auto; }
.feature-rail-footer { display: grid; gap: 8px; margin-top: auto; }

.facebook-tenant-status,
.facebook-logout {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--shell-rail-border);
  border-radius: 12px;
  background: #fff;
  color: var(--shell-rail-muted);
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.facebook-logout { cursor: pointer; color: var(--shell-rail-active); font-weight: 700; }
.facebook-logout:hover { border-color: #cbd5e1; background: #f8fafc; }

.shell-content {
  min-width: 0;
  padding: 34px 44px 64px;
}

.feature-view { display: none; }
.feature-view.is-active { display: block; }
.facebook-views { min-width: 0; }
.facebook-views .card { max-width: 1080px; }

.app-rail a:focus-visible,
.feature-rail a:focus-visible,
.feature-rail button:focus-visible {
  outline: 3px solid #78a8ff;
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .app-rail,
  .feature-rail {
    position: static;
    width: 100%;
    height: auto;
    overflow-x: auto;
  }
  .app-rail {
    flex-direction: row;
    justify-content: flex-start;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--shell-rail-border);
  }
  .feature-rail {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--shell-rail-border);
  }
  .feature-brand { flex: 0 0 auto; margin: 0; }
  .feature-brand-subtitle { display: none; }
  .feature-nav { display: flex; flex: 0 0 auto; }
  .feature-link { white-space: nowrap; }
  .feature-rail-footer { display: none; }
  .shell-content { padding: 24px 20px 48px; }
}
