:root {
  --bg: #f7f9ff;
  --paper: #ffffff;
  --ink: #0b1022;
  --muted: #5e6a85;
  --accent: #3f7fe8;
  --accent-dark: #245fbd;
  --accent-soft: #eaf2ff;
  --pill-bg: #eaf2ff;
  --pill-border: #c7d9ff;
  --pill-text: #245fbd;
  --control: #f7f9ff;
  --control-hover: #eef4ff;
  --danger: #8b2f2f;
  --border: #e1e7fb;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.1rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.brand-block {
  min-width: 12rem;
  display: flex;
  align-items: center;
  gap: 0.78rem;
}

.brand-mark {
  width: 3.4rem;
  height: 3.4rem;
  display: block;
  flex: 0 0 auto;
}

.brand-copy {
  min-width: 0;
}

.brand-block h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}

.brand-block h1 span {
  color: var(--accent);
}

.brand-block p {
  margin: 0.32rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.subtle { color: var(--muted); }
.page { padding: 1.5rem 2rem 2rem; display: grid; gap: 1rem; }

.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
  min-width: 0;
}

.topnav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-nav {
  gap: 0.5rem;
}

.signed-in-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: right;
}

.topnav a,
.button-link,
button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  padding: 0.46rem 0.78rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  line-height: 1.1;
  min-height: 2rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 2px 8px rgba(27, 39, 94, 0.04);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.topnav a:hover,
.button-link:hover,
button:hover:not(:disabled) {
  background: var(--control-hover);
  border-color: #ccd8ff;
}

.topnav a:active,
.button-link:active,
button:active:not(:disabled) {
  transform: translateY(1px);
}

.topnav form button,
button[type="submit"]:not(.ghost-button):not(.danger-button) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.topnav form button:hover,
button[type="submit"]:not(.ghost-button):not(.danger-button):hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.secondary-button {
  background: #ffffff;
  color: var(--ink);
}

.compact-button {
  padding: 0.38rem 0.7rem;
  font-size: 0.9rem;
  box-shadow: none;
}

.topnav form { margin: 0; }

.nav-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-alert-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
}

.email-health-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid #e7b0b0;
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  background: #fff4f4;
  color: var(--danger);
}

.email-health-banner div {
  display: grid;
  gap: 0.15rem;
}

.email-health-banner span {
  font-size: 0.86rem;
}

.email-health-banner a {
  flex: 0 0 auto;
  color: var(--danger);
  font-weight: 700;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 30px rgba(41, 45, 34, 0.04);
}

.error-panel {
  max-width: 46rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.error-panel h2 {
  margin: 0;
}

.error-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff3f3;
  border: 1px solid #f0b5b5;
  color: var(--danger);
  font-weight: 900;
}

.error-actions {
  justify-content: flex-start;
}

.narrow { max-width: 30rem; }
.stack { display: grid; gap: 0.8rem; }

.login-panel {
  width: 100%;
  margin: 2.5rem auto 0;
}

.login-panel .stack > button[type="submit"] {
  width: min(100%, 14rem);
  justify-self: center;
  margin-top: 0.55rem;
  padding-inline: 1.25rem;
}

.login-account-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
  border-top: 1px solid var(--border);
}

.login-account-actions .login-secondary-action {
  min-height: 1.9rem;
  padding: 0.4rem 0.68rem;
  background: #ffffff;
  border-color: var(--border);
  color: var(--ink);
  box-shadow: none;
  font-size: 0.88rem;
  white-space: nowrap;
}

.login-account-actions .login-secondary-action:hover {
  background: var(--control-hover);
  border-color: #ccd8ff;
}

.login-recovery-action {
  margin-left: auto;
}

.fixed-textarea {
  resize: none;
}

.two-col, .three-col, .card-grid {
  display: grid;
  gap: 1rem;
}

.two-col { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.three-col { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

.apps-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-launch-panel {
  display: grid;
  gap: 1rem;
}

.app-launch-list {
  display: grid;
  gap: 0.75rem;
}

.app-launch-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcff;
}

.app-symbol {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.app-symbol img {
  display: block;
  width: 100%;
  height: 100%;
}

.app-launch-item h4 {
  margin: 0 0 0.25rem;
}

.app-launch-item p {
  margin: 0;
}

.app-launch-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.app-guide-download {
  color: var(--muted);
}

.guide-section-stack {
  display: grid;
  gap: 1rem;
  width: 100%;
}

.guide-download-index {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 1.25rem;
}

.guide-download-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.guide-download-entry > div {
  display: grid;
  gap: 0.2rem;
}

.guide-download-entry span {
  color: var(--muted);
  font-size: 0.85rem;
}

.guide-section {
  scroll-margin-top: 1rem;
}

.guide-section > * {
  max-width: 72rem;
}

.guide-jump-panel {
  width: 100%;
}

.guide-jump-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.guide-page h1,
.guide-page h2,
.guide-page h3,
.guide-page h4 {
  margin-top: 1.35rem;
}

.guide-page h1:first-child,
.guide-page h2:first-child {
  margin-top: 0;
}

label { display: grid; gap: 0.3rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  background: #fff;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-field input {
  padding-right: 2.6rem;
  flex: 1;
}

.password-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  background: transparent;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  appearance: none;
  -webkit-appearance: none;
  z-index: 1;
}

.password-toggle:hover:not(:disabled),
.password-toggle.is-active {
  background: var(--control-hover);
}

.password-toggle:active:not(:disabled) {
  transform: translateY(calc(-50% + 1px));
}

.password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: var(--muted);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.checkbox input,
.inline-form .checkbox input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.5rem 0.75rem;
}

.harbor-agent-group {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.55rem;
  background: var(--control);
}

.harbor-agent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.harbor-agent-toggle {
  justify-content: flex-start;
  width: auto;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  background: transparent;
  border-color: transparent;
}

.harbor-agent-toggle:hover {
  background: var(--paper);
  border-color: var(--border);
}

.harbor-agent-toggle [data-harbor-agent-toggle-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
}

.harbor-agent-list {
  margin-top: 0.45rem;
}

.harbor-agent-group.is-collapsed .harbor-agent-list,
.harbor-agent-list[hidden],
.harbor-agent-group[hidden] {
  display: none !important;
}

.harbor-agent-select-all {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.harbor-feature-block {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: 0.25rem;
}

.feature-help {
  display: block;
  flex-basis: 100%;
  margin-left: 1.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
}

.admin-header,
.section-head,
.toolbar,
.dialog-header,
.dialog-actions,
.supervisor-row,
.action-menu-list {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-header,
.section-head,
.dialog-header {
  justify-content: space-between;
}

.toolbar,
.dialog-actions,
.action-menu-list {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dialog-actions-split {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.dialog-actions {
  justify-content: flex-end;
}

.dialog-toolbar {
  justify-content: flex-end;
  gap: 0.75rem;
}

.dialog-error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #f0b5b5;
  border-radius: 8px;
  background: #fff3f3;
  color: var(--danger);
  font-weight: 700;
}

.admin-notice {
  margin: 0 0 1rem;
}

.account-request-list {
  display: grid;
  gap: 0.6rem;
}

.account-request-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
}

.account-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.account-request-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
  min-width: 0;
}

.account-request-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.account-request-title .subtle {
  font-size: 0.76rem;
}

.account-request-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem 1rem;
  margin: 0;
}

.account-request-details div {
  min-width: 0;
}

.account-request-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.account-request-details dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.account-request-notes {
  grid-column: auto;
}

.email-diagnostics-grid {
  display: grid;
  grid-template-columns: minmax(24rem, 1.35fr) minmax(20rem, 0.85fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.email-health-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.email-health-card {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
}

.email-health-card span,
.email-health-card small {
  color: var(--muted);
}

.email-health-card span {
  font-size: 0.76rem;
  font-weight: 700;
}

.email-health-card strong {
  font-size: 1.08rem;
}

.email-health-card small {
  line-height: 1.35;
}

.pagination-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.pagination-summary,
.pagination-page {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.pagination-actions,
.pagination-size-form,
.pagination-size-form label,
.pagination-control > .pagination-actions > label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-size-form {
  margin: 0;
}

.pagination-size-form select,
.pagination-control > .pagination-actions > label select {
  width: 5rem;
  min-width: 5rem;
  padding: 0.35rem 0.45rem;
}

.pagination-disabled,
.pagination-control button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.email-health-critical,
.email-health-attention {
  border-color: #e7b0b0;
  background: #fff7f7;
}

.email-health-retrying {
  border-color: #f0d28a;
  background: #fffaf0;
}

.email-health-healthy {
  border-color: #b9dec8;
  background: #f5fcf7;
}

.email-diagnostics-grid h3 {
  margin-top: 0;
}

.email-config-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.9rem;
  margin: 1rem 0;
}

.email-config-list div {
  min-width: 0;
}

.email-config-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.email-config-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.email-feature-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.compact-copy {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.email-diagnostics-table {
  font-size: 0.82rem;
}

.email-diagnostics-table th,
.email-diagnostics-table td {
  min-width: 5rem;
}

.email-error-cell {
  width: 34%;
  min-width: 18rem !important;
}

.email-error-cell pre {
  max-width: 34rem;
  max-height: 9rem;
  overflow: auto;
  margin: 0;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--control);
  color: var(--danger);
  font: 0.76rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice {
  margin-top: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control);
  color: var(--muted);
  font-weight: 650;
}

.warning-notice {
  border-color: #f0d28a;
  background: #fff8e7;
  color: #684b00;
}

.table-wrap {
  overflow-x: auto;
}

.actions-cell {
  width: 1%;
  white-space: nowrap;
}

.menu-button,
.ghost-button,
.icon-button {
  border-radius: 8px;
}

.menu-button {
  justify-content: flex-start;
  text-align: left;
}

.ghost-button {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

.danger-button {
  background: #fff3f3;
  border-color: #d5a7a7;
  color: var(--danger);
}

.stack-list {
  margin: 0;
  padding-left: 1rem;
}

.compact-meta {
  display: grid;
  gap: 0.25rem;
}

.access-summary-cell {
  min-width: 8.5rem;
  font-size: 0.72rem;
  line-height: 1.3;
}

.access-summary {
  gap: 0.15rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 2rem;
}

.tag,
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.18rem 0.34rem 0.18rem 0.52rem;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  min-height: 1.35rem;
  width: fit-content;
  max-width: 100%;
}

.tag-remove,
.filter-pill button {
  appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  min-height: 0;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 1;
  border: 0 !important;
  background: transparent !important;
  color: var(--pill-text) !important;
  box-shadow: none !important;
  font-size: 0.7rem;
  font-weight: 800;
}

.tag-remove:hover,
.filter-pill button:hover:not(:disabled) {
  background: rgba(36, 95, 189, 0.1) !important;
  border: 0 !important;
  transform: none;
}

.compact-tags {
  min-height: 0;
}

.more-contexts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
}

.more-contexts summary {
  list-style: none;
  cursor: pointer;
}

.more-contexts summary::-webkit-details-marker {
  display: none;
}

.more-context-list {
  flex-basis: 100%;
  margin-top: 0.15rem;
  min-height: 0;
}

.filter-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 0.25rem;
  margin: 0.45rem 0 0.7rem;
}

.membership-configs {
  display: grid;
  gap: 0.75rem;
}

.membership-card {
  display: grid;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  background: #fbfcff;
}

.membership-card h4 {
  margin: 0;
}

.supervisor-target-editor {
  border-left: 3px solid #c7d9ff;
  padding-left: 0.75rem;
}

.compact-grid {
  gap: 0.6rem;
}

.supervisor-row {
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
}

.supervision-group {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.compact-head {
  align-items: flex-end;
}

.compact-head h4 {
  margin: 0;
}

.supervisor-launch-form {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(8rem, 0.8fr) minmax(12rem, 1fr) auto;
  gap: 0.5rem;
  width: min(100%, 48rem);
}

.supervisor-launch-form input,
.supervisor-launch-form select {
  width: 100%;
}

.session-action-form {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto;
  gap: 0.5rem;
  min-width: 13rem;
}

.session-action-form select {
  width: 100%;
}

.fieldset-block {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
}

.fieldset-block legend {
  padding: 0 0.35rem;
  font-weight: 700;
}

.app-dialog {
  width: min(52rem, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  background: var(--paper);
  box-shadow: 0 30px 70px rgba(41, 45, 34, 0.18);
}

.filter-dialog {
  width: min(32rem, calc(100vw - 2rem));
}

.app-dialog::backdrop {
  background: rgba(18, 22, 18, 0.45);
}

.dialog-shell {
  margin: 0;
}

.dialog-header,
.dialog-body {
  padding: 1rem 1.1rem;
}

.dialog-header {
  border-bottom: 1px solid var(--border);
}

.dialog-header h3 {
  margin: 0;
}

.icon-button {
  width: auto;
  min-width: 2.25rem;
  padding: 0.45rem 0.7rem;
}

.is-disabled {
  opacity: 0.55;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.58rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.inline-list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

.inline-form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-form input {
  width: 10rem;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
}

.form-actions button {
  width: auto;
  flex: 0 0 auto;
}

.cost-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.cost-summary-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcff;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.35rem;
}

.cost-summary-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.cost-summary-card strong {
  font-size: 1.35rem;
}

#org-dialog {
  width: min(64rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

#org-dialog .dialog-body {
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

.notice-panel {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  padding: 0.8rem 0.9rem;
}

.compact-notice p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.access-catalog-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.access-catalog-group summary {
  cursor: pointer;
  font-size: 0.92rem;
}

.access-catalog-group[open] summary {
  margin-bottom: 8px;
}

.filter-pill.active {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}

.usage-bars {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.usage-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 4rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.usage-bar-row div {
  height: 0.65rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.usage-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.usage-bar-row b {
  text-align: right;
  font-size: 0.78rem;
}

.ledger-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.85rem 0 0.25rem;
}

.ledger-toolbar label {
  width: min(13rem, 100%);
}

.ledger-toolbar button {
  flex: 0 0 auto;
}

.stacked-form {
  display: grid;
  gap: 0.75rem;
}

.org-switch {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.profile-panel {
  display: grid;
  gap: 1rem;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(16rem, 0.8fr);
  gap: 1.25rem;
  align-items: start;
}

.profile-summary-grid h3 {
  margin-top: 0;
}

.profile-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.6rem;
}

.profile-list {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0.55rem 0.75rem;
  margin: 0 0 1rem;
}

.profile-list dt {
  color: var(--muted);
  font-weight: 650;
}

.profile-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.active-link {
  font-weight: 700;
  color: var(--accent);
}

.pill {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--pill-text);
  font-size: 0.84rem;
  font-weight: 650;
}

.pill.denied {
  background: #f5dcdc;
  color: var(--danger);
}

.pill.warn {
  background: #fff3cd;
  color: #7a4d00;
}

.pill.ok {
  background: #dff7e8;
  color: #16653a;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.action-row .spacer {
  flex: 1;
}

.model-settings-table th,
.model-settings-table td {
  min-width: 8rem;
  vertical-align: middle;
}

.model-settings-table td:nth-child(1),
.model-settings-table td:nth-child(2) {
  font-weight: 650;
}

.model-switch-controls {
  display: grid;
  gap: 12px;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.model-switch-controls .model-switch-option {
  display: grid;
  grid-template-columns: 18px minmax(0, auto);
  align-items: center;
  justify-content: start;
  gap: 10px;
  color: var(--text);
  width: max-content;
  max-width: 100%;
  font-weight: 650;
}

.model-switch-controls .model-switch-option input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  justify-self: start;
}

.model-switch-controls .model-switch-option span {
  line-height: 1.35;
}

.error {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 720px) {
  .topbar, .page { padding-left: 1rem; padding-right: 1rem; }
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-actions {
    justify-items: stretch;
  }
  .topnav {
    justify-content: flex-start;
  }
  .email-health-banner { align-items: flex-start; flex-direction: column; }
  .email-health-summary { grid-template-columns: 1fr; }
  .pagination-control,
  .pagination-actions { align-items: flex-start; flex-wrap: wrap; }
  .pagination-control { flex-direction: column; }
  .signed-in-note {
    text-align: left;
  }
  .cost-summary-grid { grid-template-columns: 1fr; }
  .profile-summary-grid { grid-template-columns: 1fr; }
  .app-launch-item { grid-template-columns: 1fr; gap: 0.75rem; }
  .app-launch-action { justify-content: flex-start; }
  .guide-download-entry {
    align-items: flex-start;
    flex-direction: column;
  }
  .supervisor-row,
  .admin-header,
  .account-request-head,
  .section-head,
  .dialog-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .account-request-details { grid-template-columns: 1fr; }
  .account-request-notes { grid-column: auto; }
  .account-request-title { align-items: flex-start; flex-direction: column; gap: 0.15rem; }
  .email-diagnostics-grid { grid-template-columns: 1fr; }
  .email-config-list { grid-template-columns: 1fr; }
}
