:host {
  --nav-blue: #f0f4f9;
  --nav-blue-hover: #e8f0fe;
  --nav-blue-active: #e8f0fe;
  --nav-text: #1f1f1f;
  --nav-accent: #0b57d0;
  --nav-muted: #5f6368;
  --nav-border: #c9d7f2;
  /* The panels below become cells of #admin-view's grid. */
  display: contents;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  color: var(--nav-text);
}
* { box-sizing: border-box; }
button, input { font: inherit; color: inherit; }
svg { display: block; width: 24px; height: 24px; }
.brandbar, .panel, .drawer, .flyout { background: var(--nav-blue); }
.brandbar {
  grid-column: 1; grid-row: 1; position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 4px; height: 64px; padding: 0 8px;
}
.topbar {
  grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr);
  align-items: center; gap: 16px; height: 64px; padding: 0 16px;
  background: var(--nav-blue);
}
.topbar .narrow-brand { display: none; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--nav-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--nav-blue-hover); }
.icon-btn:focus-visible, .nav-item:focus-visible, .nav-link:focus-visible, .avatar:focus-visible, .result:focus-visible {
  outline: 2px solid var(--nav-accent); outline-offset: 2px;
}
.brand { color: #202124; font-size: 1.375rem; font-weight: 500; text-decoration: none; }
.search { grid-column: 2; position: relative; width: 100%; }
.search-box {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 8px 0 16px;
  border-radius: 24px; background: #ffffff; color: var(--nav-muted);
  box-shadow: 0 1px 3px rgb(60 64 67 / 30%), 0 4px 8px 3px rgb(60 64 67 / 15%);
}
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 1rem; color: var(--nav-text); }
.search-box input::placeholder { color: #5f6368; opacity: 1; }
.search-box input::-webkit-search-cancel-button { display: none; }
.clear-search { width: 36px; height: 36px; }
.clear-search[hidden] { display: none; }
.clear-search svg { width: 20px; height: 20px; }
.search-results {
  position: absolute; top: 52px; left: 0; right: 0; z-index: 70; max-height: min(480px, calc(100vh - 96px)); overflow-y: auto;
  margin: 0; padding: 8px 0; list-style: none; border-radius: 8px; background: #ffffff;
  box-shadow: 0 2px 6px rgb(60 64 67 / 30%), 0 8px 16px 4px rgb(60 64 67 / 15%);
}
.search-results[hidden] { display: none; }
.result {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; width: 100%; padding: 10px 16px;
  border: 0; background: transparent; color: var(--nav-text); font-size: 1rem; text-align: left; cursor: pointer;
}
.result.active, .result:hover { background: var(--nav-blue); }
.result mark { background: transparent; color: var(--nav-accent); font-weight: 500; }
.result.record mark { background: #fff59d; color: inherit; font-weight: inherit; }
.result .result-package { color: var(--nav-muted); font-size: 0.8125rem; white-space: nowrap; }
.results-heading { padding: 8px 16px 4px; color: var(--nav-muted); font-size: 0.8125rem; }
.results-empty { padding: 10px 16px; color: var(--nav-muted); }
.topbar-right { grid-column: 3; position: relative; display: flex; justify-content: flex-end; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: var(--nav-accent); color: #ffffff; font-size: 1.125rem; font-weight: 500; cursor: pointer;
}
.avatar svg { width: 22px; height: 22px; }
.account-card {
  position: absolute; top: 52px; right: 0; z-index: 70; width: 280px; padding: 20px;
  border-radius: 16px; background: #ffffff; text-align: center;
  box-shadow: 0 2px 6px rgb(60 64 67 / 30%), 0 8px 16px 4px rgb(60 64 67 / 15%);
}
.account-card[hidden] { display: none; }
.account-card .avatar { width: 64px; height: 64px; font-size: 1.75rem; cursor: default; }
.account-card .avatar svg { width: 34px; height: 34px; }
.account-card p { margin: 12px 0 16px; overflow-wrap: anywhere; font-size: 1rem; }
.sign-out {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px;
  border: 1px solid #dadce0; border-radius: 20px; background: #ffffff; color: #b3261e; font-weight: 500; cursor: pointer;
}
.sign-out:hover { background: #fce8e6; }
.sign-out svg { width: 20px; height: 20px; }
.panel {
  grid-column: 1; grid-row: 2; position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px);
  overflow-y: auto; padding: 8px 8px 24px;
  scrollbar-width: auto; scrollbar-color: #80868b transparent;
}
.panel::-webkit-scrollbar, .drawer::-webkit-scrollbar, .flyout::-webkit-scrollbar { width: 14px; }
.panel::-webkit-scrollbar-thumb, .drawer::-webkit-scrollbar-thumb, .flyout::-webkit-scrollbar-thumb {
  background: #80868b; border-radius: 8px;
}
.drawer {
  position: fixed; top: 64px; bottom: 0; left: 0; z-index: 50; width: 296px; max-width: calc(100vw - 48px);
  overflow-y: auto; padding: 8px 8px 24px; box-shadow: 0 8px 16px rgb(60 64 67 / 25%);
  transform: translateX(-105%); transition: transform 0.2s ease; visibility: hidden;
  scrollbar-width: auto; scrollbar-color: #80868b transparent;
}
.drawer.open { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 64px 0 0 0; z-index: 45; background: rgb(32 33 36 / 30%); }
.scrim[hidden] { display: none; }
.flyout {
  position: fixed; z-index: 60; width: 272px; max-height: calc(100vh - 80px); overflow-y: auto; padding: 8px;
  border: 1px solid var(--nav-border); border-radius: 12px; box-shadow: 0 4px 12px rgb(60 64 67 / 25%);
}
.flyout[hidden] { display: none; }
.group-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; padding: 8px 12px; font-size: 1rem; font-weight: 500; }
.group-title svg { color: #202124; }
.nav-item, .nav-link, .back-link {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; margin: 2px 0; padding: 8px 12px;
  border: 0; border-radius: 22px; background: transparent; color: var(--nav-text); font-size: 1rem;
  line-height: 20px; text-align: left; text-decoration: none; cursor: pointer;
}
.nav-item span { flex: 1; }
.nav-item .chevron { width: 18px; height: 18px; color: var(--nav-muted); }
.nav-item svg:first-child { color: #202124; }
.nav-item:hover, .nav-item.hovered, .nav-link:hover, .back-link:hover { background: var(--nav-blue-hover); }
.nav-item.selected { background: var(--nav-blue-active); font-weight: 500; }
.nav-link { padding-left: 48px; }
.flyout .nav-link { padding-left: 16px; }
.nav-link.active { background: var(--nav-blue-active); color: var(--nav-text); font-weight: 500; }
.back-link { min-height: 36px; color: var(--nav-muted); }
.back-link svg { width: 20px; height: 20px; }
@media (max-width: 900px) {
  .brandbar, .panel { display: none; }
  .topbar {
    grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 8px;
  }
  .topbar .narrow-brand { display: flex; }
  .search { grid-column: 2; }
  .brand { font-size: 1.25rem; }
}
