.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.app-sidebar {
  position: sticky; top: 0; z-index: 40; height: 100vh; display: flex; flex-direction: column;
  padding: 18px 14px; background: var(--sidebar); color: var(--sidebar-text); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand__mark { display: inline-grid; width: 36px; height: 36px; place-items: center; border-radius: var(--radius-md); background: #f1bf61; color: #29200e; font-weight: 850; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--sidebar-muted); font-size: 11px; }
.app-nav { display: grid; gap: 4px; margin-top: 28px; }
.app-nav__item {
  display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-md); color: var(--sidebar-text); text-decoration: none; font-weight: 600;
}
.app-nav__item:hover { background: rgb(255 255 255 / 8%); }
.app-nav__item.is-active { background: #e9f4f2; color: #123c38; }
.sidebar-boundary { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 14px 10px; border-top: 1px solid rgb(255 255 255 / 12%); }
.sidebar-boundary strong, .sidebar-boundary small { display: block; }
.sidebar-boundary small, .sidebar-version { color: var(--sidebar-muted); font-size: 11px; }
.scope-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgb(22 112 68 / 18%); }
.sidebar-version { padding: 8px 10px 0; }
.app-stage { min-width: 0; }
.app-topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--topbar-height); display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 95%); backdrop-filter: blur(8px);
}
.mobile-nav-toggle { display: none; }
.command-trigger { min-width: 240px; justify-content: flex-start; color: var(--text-muted); }
.command-trigger kbd { margin-left: auto; padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-subtle); font-size: 11px; }
.topbar-scope { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.profile-menu { position: relative; }
.profile-menu > summary { display: flex; min-height: 40px; align-items: center; gap: 8px; list-style: none; color: var(--text-strong); }
.profile-menu > summary::-webkit-details-marker { display: none; }
.avatar { display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: #0a524e; font-weight: 800; }
.profile-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); width: 220px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.profile-menu__panel a, .profile-menu__panel button { display: flex; width: 100%; justify-content: flex-start; border: 0; background: transparent; color: var(--text-strong); }
.app-content { width: min(100%, var(--content-max)); margin: 0 auto; padding: 22px 28px 48px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; color: var(--text-muted); font-size: 12px; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.page-header h1 { margin: 0; color: var(--text-strong); font-size: 30px; line-height: 1.2; }
.page-scope { display: flex; gap: 8px; align-items: center; color: var(--text-muted); font-size: 12px; }
.page-sections { display: grid; gap: 16px; }
.command-palette { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: 12vh; background: rgb(14 28 31 / 45%); }
.command-palette[hidden] { display: none; }
.command-dialog { width: min(620px, calc(100vw - 28px)); padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.command-dialog__header { display: flex; align-items: center; gap: 8px; }
.command-dialog__header label { flex: 1; font-size: 17px; }
.command-dialog input { margin: 12px 0; }
.command-dialog nav { display: grid; gap: 3px; max-height: 48vh; overflow-y: auto; }
.command-dialog nav a { display: flex; min-height: 42px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--text-strong); text-decoration: none; }
.command-dialog nav a:hover { background: var(--surface-subtle); }
.command-hint { margin: 10px 4px 0; color: var(--text-muted); font-size: 12px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 35; background: rgb(10 20 22 / 50%); }
.public-header { min-height: 68px; display: flex; align-items: center; gap: 24px; padding: 12px max(20px, calc((100vw - 1160px) / 2)); border-bottom: 1px solid var(--line); background: var(--surface); }
.brand--public { color: var(--text-strong); }
.brand--public small { color: var(--text-muted); }
.public-header nav { display: flex; gap: 6px; margin-left: auto; }
.public-header nav a { min-height: 40px; padding: 9px 11px; border-radius: var(--radius-md); color: var(--text); text-decoration: none; font-weight: 600; }
.public-header nav a[aria-current="page"] { background: var(--brand-soft); color: #0a524e; }
.public-content { width: min(100% - 32px, 1160px); min-height: calc(100vh - 150px); margin: 0 auto; padding: 30px 0 48px; }
.public-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 22px max(20px, calc((100vw - 1160px) / 2)); border-top: 1px solid var(--line); color: var(--text-muted); background: var(--surface); font-size: 12px; }
