:root {
  --ink: #111111;
  --muted: #555555;
  --line: #d8d8d8;
  --soft: #f6f6f6;
  --panel: #ffffff;
  --husky-purple: #32006e;
  --spirit-purple: #4b2e83;
  --husky-gold: #b7a57a;
  --heritage-gold: #85754d;
  --spirit-gold: #ffc700;
  --purple: var(--husky-purple);
  --purple-2: var(--spirit-purple);
  --gold: var(--husky-gold);
  --teal: #007c89;
  --green: #2f7d4f;
  --red: #a34134;
  --blue: #2563a7;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --topbar-height: 72px;
  --sticky-gap: 14px;
  --app-view-transition-ms: 240ms;
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --glass-soft: rgba(246, 246, 246, 0.78);
  --glass-border: rgba(255, 255, 255, 0.5);
  font-family: "Encode Sans", "Open Sans", "Uni Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-padding-top: calc(var(--topbar-height) + var(--sticky-gap));
}

body {
  margin: 0;
  background: #f7f7f7;
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.58)),
    url("./assets/campus-rainier-background.jpg") center / cover no-repeat,
    #f7f7f7;
  pointer-events: none;
  transform: translateZ(0);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(3px) saturate(1.05);
  pointer-events: none;
  transform: translateZ(0);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  padding-top: var(--topbar-height);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(1.18);
  box-shadow: 0 1px 0 rgba(50, 0, 110, 0.06);
  transform: translateZ(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-logo-full {
  display: block;
  width: min(320px, 34vw);
  height: auto;
}

.brand-logo-mark {
  display: none;
  width: 42px;
  height: auto;
}

.brand-label {
  display: grid;
  gap: 2px;
  max-width: 520px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.15;
}

.brand-label strong {
  color: var(--husky-purple);
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.page-context,
.metric small,
.range-value,
.lab-meta,
.guide-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.topnav,
.segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(12px) saturate(1.1);
}

.nav-button,
.segment {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
}

.nav-button {
  padding: 9px 13px;
}

.nav-button.is-active,
.segment.is-active {
  background: var(--soft);
  color: var(--purple);
  box-shadow: none;
}

.identity-switcher {
  display: grid;
  grid-template-columns: auto 112px 150px;
  gap: 8px;
  align-items: center;
  padding: 4px 4px 4px 10px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(12px) saturate(1.1);
}

.identity-switcher[hidden] {
  display: none;
}

.identity-switcher label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.identity-switcher select,
.identity-switcher input {
  min-height: 34px;
}

.identity-switcher input {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

.auth-session {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px) saturate(1.1);
}

.auth-session[hidden] {
  display: none !important;
}

.auth-session span {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-session .secondary-button {
  min-height: 30px;
}

main {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.header-actions[hidden],
.topnav[hidden],
.intro-view[hidden],
.database-view[hidden],
.database-page[hidden] {
  display: none !important;
}

.intro-view.is-app-view-entering,
.database-view.is-app-view-entering {
  animation: app-view-fade-in var(--app-view-transition-ms, 240ms) ease-out both;
  will-change: opacity, transform;
}

.intro-view.is-app-view-exiting,
.database-view.is-app-view-exiting {
  animation: app-view-fade-out var(--app-view-transition-ms, 240ms) ease-in both;
  will-change: opacity, transform;
}

@keyframes app-view-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes app-view-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-view.is-app-view-entering,
  .database-view.is-app-view-entering,
  .intro-view.is-app-view-exiting,
  .database-view.is-app-view-exiting {
    animation: none;
    transform: none;
  }
}

.intro-view {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--topbar-height) - 62px);
  padding: clamp(36px, 8vh, 84px) 0;
}

.database-page {
  min-width: 0;
}

.intro-card {
  width: min(780px, 100%);
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 60px rgba(17, 17, 17, 0.18);
  backdrop-filter: blur(20px) saturate(1.16);
  text-align: center;
}

.intro-card h1 {
  max-width: none;
  margin: 0;
  color: var(--husky-purple);
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  font-weight: 900;
  line-height: 1;
}

.intro-subtitle {
  max-width: 640px;
  margin: 12px auto 0;
  color: var(--ink);
  font-size: clamp(1.02rem, 2vw, 1.42rem);
  font-weight: 800;
  line-height: 1.35;
}

.intro-body {
  max-width: 560px;
  margin: 28px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(50, 0, 110, 0.14);
  color: #30343b;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.55;
}

.intro-login-button {
  margin-top: 26px;
}

.command-band {
  padding: 12px 0 14px;
}

.page-context {
  margin: 0 0 6px;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: min(100%, 980px);
  margin-bottom: 0;
  font-size: 1.55rem;
  line-height: 1.25;
}

.role-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 12px;
  padding: 9px 10px;
  max-width: 780px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--husky-gold);
  border-radius: 6px;
  color: #333333;
  font-size: 0.9rem;
  backdrop-filter: blur(16px) saturate(1.12);
}

.role-banner strong {
  color: var(--purple);
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.search-panel {
  padding: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(16px) saturate(1.12);
}

.search-panel label,
.filter-group label,
.filter-group legend {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: 24px 1fr 34px;
  gap: 10px;
  align-items: center;
  padding: 0 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.search-row svg {
  color: var(--muted);
}

.search-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.icon-button,
.dialog-close,
.listing-fullscreen-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.icon-button:hover,
.dialog-close:hover,
.listing-fullscreen-toggle:hover {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) repeat(3, minmax(92px, 0.333fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.filters,
.results-panel,
.tab-panel,
.admin-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: 0 10px 32px rgba(17, 17, 17, 0.08);
}

.metric {
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--purple);
  font-size: 1.45rem;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.filters {
  position: sticky;
  top: calc(var(--topbar-height) + var(--sticky-gap));
  max-height: calc(100vh - var(--topbar-height) - (var(--sticky-gap) * 2));
  overflow-y: auto;
  padding: 14px;
  scrollbar-gutter: stable;
}

.filter-header,
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-header {
  margin-bottom: 16px;
}

.listing-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.listing-sort-control select {
  min-width: 210px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.filter-header h2 {
  font-size: 1.05rem;
}

.filter-group {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

#listing-department option.is-parent {
  font-weight: 800;
}

#listing-department option.is-division {
  color: #30343b;
}

.department-combobox {
  position: relative;
}

.department-filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.department-filter-button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.department-filter-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 360px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  box-shadow: var(--shadow);
}

.department-filter-menu[hidden] {
  display: none;
}

.department-filter-option {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.department-filter-option:hover,
.department-filter-option.is-selected {
  background: var(--soft);
}

.department-filter-option.is-parent {
  font-weight: 900;
}

.department-filter-option.is-division {
  padding-left: 24px;
  color: #30343b;
}

.department-filter-count {
  color: var(--muted);
  font-weight: 700;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list label,
.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.92rem;
}

.toggle-row {
  margin-bottom: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}

.icon-filter-row {
  cursor: pointer;
}

.icon-filter-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon-filter-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.84);
}

.saved-filter-row {
  cursor: pointer;
}

.saved-filter-row:hover .saved-filter-star,
.saved-filter-row.is-active .saved-filter-star {
  border-color: var(--gold);
  background: #f8f5ec;
}

.remote-filter-row {
  cursor: pointer;
}

.remote-filter-row:hover .remote-filter-icon,
.remote-filter-row.is-active .remote-filter-icon {
  border-color: #c9dfd0;
  background: #eef7f1;
}

.icon-filter-checkbox:focus-visible + .icon-filter-control {
  outline: 2px solid var(--spirit-gold);
  outline-offset: 2px;
}

.icon-filter-row.is-pop .favorite-icon {
  animation: favorite-pop 220ms ease-out;
}

.toggle-row span:not(.toggle-count):not(.icon-filter-control) {
  flex: 1;
}

.toggle-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 900;
}

.range-value {
  margin-top: 7px;
  text-align: right;
}

.more-filters {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.more-filters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  color: var(--purple);
  background: transparent;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.more-filters-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 160ms ease;
}

.more-filters-toggle.is-expanded svg {
  transform: rotate(180deg);
}

.more-filters-toggle:focus-visible {
  outline: 2px solid var(--spirit-gold);
  outline-offset: 3px;
}

.more-filters-panel {
  display: grid;
  gap: 14px;
  padding-top: 10px;
}

.more-filters-panel[hidden] {
  display: none;
}

.participation-filter-group {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.participation-filter-group legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.participation-filter-group .toggle-row {
  align-items: flex-start;
  min-height: 0;
  padding: 9px 10px;
  line-height: 1.35;
}

.participation-filter-group input {
  margin-top: 2px;
}

.results-panel {
  min-height: 520px;
  padding: 14px;
}

.results-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.database-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.84);
  font-weight: 800;
}

.database-refresh-button:hover {
  border-color: var(--purple);
  background: #f7f4fb;
}

.database-refresh-button:focus-visible {
  outline: 2px solid var(--spirit-gold);
  outline-offset: 2px;
}

.database-refresh-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.database-refresh-button[aria-busy="true"] svg {
  animation: refresh-spin 900ms linear infinite;
}

.toolbar-actions,
.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.segment {
  display: grid;
  place-items: center;
  width: 36px;
  height: 34px;
}

.segment svg {
  pointer-events: none;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 26px;
  margin: 12px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 0 7px;
  color: var(--purple-2);
  background: #f5f2f8;
  border: 1px solid #ddd4e8;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.lab-grid.is-list {
  grid-template-columns: 1fr;
}

.listing-results {
  display: grid;
  gap: 20px;
}

.listing-section {
  display: grid;
  gap: 10px;
}

.listing-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.listing-section-heading.is-clickable {
  cursor: pointer;
}

.listing-section-heading.is-clickable:hover .listing-section-toggle {
  color: var(--husky-purple);
}

.listing-section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.listing-section-count {
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.listing-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.98rem;
  font-weight: 800;
}

.listing-section-toggle:hover {
  color: var(--husky-purple);
}

.listing-section-toggle:focus-visible {
  outline: 2px solid var(--spirit-gold);
  outline-offset: 3px;
}

.section-toggle-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

.listing-section.is-collapsed .section-toggle-icon {
  transform: rotate(0deg);
}

.listing-section.is-collapsed .lab-grid {
  display: none;
}

.listing-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.listing-pagination-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.lab-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  min-height: 230px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.07);
}

.lab-card.is-archived {
  background: rgba(251, 250, 248, 0.86);
  border-style: dashed;
}

.lab-card.is-draft {
  background: #eaf3ff;
  border-color: #8ab7e8;
}

.lab-grid.is-list .lab-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  min-height: 0;
}

.lab-card,
.lab-title,
.lab-meta,
.lab-meta-primary,
.lab-investigator,
.lab-department,
.lab-location,
.lab-description,
.tag,
.netid-tag,
.button-row,
.card-actions {
  min-width: 0;
}

.lab-title,
.lab-meta,
.lab-meta-primary,
.lab-investigator,
.lab-department,
.lab-location,
.lab-description,
.tag,
.netid-tag {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lab-card:hover {
  border-color: var(--husky-gold);
}

.lab-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lab-title {
  margin: 0 0 6px;
  font-size: 1.125rem;
  line-height: 1.25;
}

.lab-meta {
  display: grid;
  gap: 2px;
}

.lab-meta-primary {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 15px;
  line-height: 1.2;
}

.lab-investigator,
.lab-department {
  font-size: 15px;
}

.lab-investigator {
  font-weight: 700;
  color: var(--ink);
}

.lab-department {
  font-style: italic;
  color: var(--muted);
}

.lab-location {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.lab-hours {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.lab-description {
  margin-bottom: 0;
  color: #3f4550;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.multiline-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inline-listing-note {
  color: var(--purple);
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-stack {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.status.Open {
  color: var(--green);
  background: #e8f4ed;
}

.status.Limited {
  color: #8a650e;
  background: #fff4d8;
}

.status.Closed {
  color: var(--red);
  background: #f9e7e4;
}

.status.Draft {
  color: #235f9c;
  background: #d7eaff;
}

.archive-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  color: #6b556a;
  background: #eee7ee;
  font-size: 0.76rem;
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tag-row {
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 7px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #3f4550;
  font-size: 0.78rem;
}

.netid-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.netid-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 800;
}

.primary-netid {
  color: #372163;
  background: #f5f2f8;
  border: 1px solid #ddd4e8;
}

.delegate-netid {
  color: #4a412d;
  background: #f8f5ec;
  border: 1px solid #ded4b8;
}

.remote-tag {
  color: #244d35;
  background: #eef7f1;
  border-color: #c9dfd0;
}

.lab-card .participation-tag {
  color: #102f45;
  background: #a2d6f9;
  border-color: #83c2ec;
  font-weight: 800;
}

.lab-card .participation-tag.is-highlighted {
  color: #244d35;
  background: #eef7f1;
  border-color: #c9dfd0;
}

.listing-deadline {
  margin-top: 8px;
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-actions.is-readonly {
  justify-content: flex-end;
}

.card-indicators {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 6px;
  font-weight: 800;
}

.primary-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--purple);
  color: white;
  background: var(--purple);
}

.secondary-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--purple);
  background: rgba(255, 255, 255, 0.84);
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.84);
}

.remote-icon-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 1px solid #c9dfd0;
  border-radius: 6px;
  background: #eef7f1;
}

.remote-icon-indicator.is-mostly-remote {
  border-color: #e7d48c;
  background: #fff6d7;
}

.lab-card .button-row .primary-button,
.lab-card .button-row .secondary-button {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.favorite-button:hover,
.favorite-button.is-favorite {
  border-color: var(--gold);
  background: #f8f5ec;
}

.favorite-button:focus-visible {
  outline: 2px solid var(--spirit-gold);
  outline-offset: 2px;
}

.favorite-icon {
  display: block;
  width: 21px;
  height: 21px;
}

.remote-icon {
  display: block;
  width: 21px;
  height: 21px;
}

.favorite-button.is-pop .favorite-icon {
  animation: favorite-pop 220ms ease-out;
}

@keyframes favorite-pop {
  0% {
    transform: scale(0.82);
  }

  55% {
    transform: scale(1.22);
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .favorite-button.is-pop .favorite-icon,
  .icon-filter-row.is-pop .favorite-icon,
  .icon-filter-row.is-pop .remote-icon {
    animation: none;
  }
}

button:disabled,
.disabled-button {
  cursor: not-allowed;
  border-color: #cfd5df;
  color: #6c7480;
  background: #e7eaf0;
  box-shadow: none;
}

.danger-button {
  color: var(--red);
  border-color: #e0c0ba;
}

.text-button {
  border: 0;
  color: var(--purple);
  background: transparent;
}

.empty-state {
  padding: 44px 16px;
  text-align: center;
  color: var(--muted);
}

.restricted-results {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 42px auto;
  padding: 24px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
  color: var(--muted);
}

.restricted-results h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
}

.restricted-results p {
  margin: 0;
  line-height: 1.5;
}

.tab-panel {
  margin-top: 18px;
  padding: 16px;
}

.section-heading {
  margin-bottom: 14px;
}

.admin-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.superadmin-unlock-button {
  min-width: max-content;
}

.superadmin-tools {
  margin-bottom: 12px;
}

.superadmin-tool-grid {
  margin-bottom: 12px;
}

.superadmin-login-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.superadmin-login-form label {
  display: grid;
  gap: 6px;
}

.superadmin-login-field {
  display: grid;
  gap: 6px;
}

.temp-user-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.superadmin-login-form input,
.superadmin-login-form select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.superadmin-login-form input:focus,
.superadmin-login-form select:focus {
  border-color: var(--purple);
  outline: 3px solid rgba(75, 0, 130, 0.14);
}

.superadmin-login-form .temp-user-password-toggle {
  width: 40px;
  height: 40px;
  border-color: var(--line);
  background: white;
}

.superadmin-login-form .temp-user-password-toggle:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.superadmin-login-form .temp-user-password-toggle:focus-visible {
  border-color: var(--purple);
  outline: 3px solid rgba(75, 0, 130, 0.14);
}

.superadmin-login-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.superadmin-login-status.is-success {
  border: 1px solid #acd8bd;
  background: #f0faf4;
  color: #176338;
}

.superadmin-login-status.is-error {
  border: 1px solid #f3b4b4;
  background: #fff5f5;
  color: #8f1d1d;
}

.guide-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

.guide-card {
  padding: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.07);
}

.guide-card p,
.guide-body p {
  color: #3f4550;
  line-height: 1.5;
}

.guide-card .primary-button {
  margin-top: 14px;
}

.guide-article {
  padding: 22px;
}

.guide-article-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.guide-article-card .secondary-button {
  justify-self: start;
}

.guide-article-header {
  display: grid;
  gap: 8px;
}

.guide-article-header h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1.18;
}

.guide-body {
  display: grid;
  gap: 12px;
}

.guide-body p {
  margin: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 12px;
}

.admin-card,
.account-card {
  padding: 16px;
}

.admin-card,
.account-card {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.07);
}

.data-mode-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.data-mode-card p {
  margin: 0;
  color: #3f4550;
}

.data-mode-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-mode-option {
  position: relative;
}

.data-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.data-mode-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--purple);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.78);
}

.data-mode-option input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.data-mode-option input:checked + span {
  color: white;
  border-color: var(--purple);
  background: var(--purple);
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 12px;
}

.account-card {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(14px) saturate(1.1);
}

.account-actions {
  margin-top: 16px;
}

.account-listings {
  display: grid;
  gap: 10px;
}

.account-listing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}

.account-listing span,
.muted-note {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-table-card {
  margin-top: 12px;
  overflow-x: auto;
}

.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 6px;
}

.admin-table-toolbar h3 {
  margin: 0;
}

.admin-table-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-table-toolbar select {
  min-width: 210px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.admin-table-toolbar .admin-table-toggle {
  gap: 6px;
  min-width: max-content;
}

.admin-table-toolbar .admin-table-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

.admin-table-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.admin-search-filter {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-search-filter input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 500;
}

.admin-filter-group,
.admin-age-filter {
  min-width: 0;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-filter-group summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-filter-options {
  max-height: 190px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.admin-filter-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.25;
}

.admin-filter-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--purple);
}

.admin-age-filter {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px 12px;
}

.admin-age-filter label {
  display: grid;
  grid-template-columns: max-content minmax(58px, 80px) max-content;
  align-items: center;
  gap: 8px;
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-age-filter input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
}

.admin-age-filter input[type="range"] {
  width: 100%;
  accent-color: var(--purple);
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-table .admin-draft-title {
  font-style: italic;
}

.admin-table td span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-data-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-data-summary-module {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
}

.admin-data-summary-module span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

.admin-data-summary-module strong {
  color: var(--purple);
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1;
}

.admin-analytics-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-review-flags-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-analytics-card h3,
.admin-analytics-card p,
.admin-review-flags-card h3,
.admin-review-flags-card p {
  margin: 0;
}

.admin-analytics-dialog,
.admin-review-flags-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.admin-analytics-content,
.admin-review-flags-content {
  max-height: min(780px, calc(100vh - 32px));
  overflow: auto;
  padding: 24px;
}

.admin-analytics-header,
.admin-review-flags-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.admin-analytics-header h3,
.admin-review-flags-header h3 {
  margin: 0 0 6px;
}

.admin-analytics-header p,
.admin-review-flags-header p {
  margin: 0;
  color: var(--muted);
}

.admin-analytics-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-export-menu {
  position: relative;
}

.admin-export-menu summary {
  list-style: none;
  cursor: pointer;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.86rem;
  font-weight: 800;
}

.admin-export-menu summary::-webkit-details-marker {
  display: none;
}

.admin-export-menu[open] summary {
  border-color: rgba(74, 0, 114, 0.45);
  box-shadow: 0 0 0 2px rgba(74, 0, 114, 0.08);
}

.admin-export-menu-items {
  position: absolute;
  right: 0;
  z-index: 4;
  margin-top: 6px;
  min-width: 210px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(27, 24, 35, 0.16);
}

.admin-export-menu-items button {
  width: 100%;
  justify-content: flex-start;
}

.admin-analytics-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin: 14px 0 10px;
}

.admin-review-flags-controls {
  display: grid;
  grid-template-columns: minmax(160px, 260px);
  gap: 10px;
  margin: 14px 0 10px;
}

.admin-analytics-controls label,
.admin-review-flags-controls label {
  display: grid;
  gap: 7px;
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-analytics-controls select,
.admin-review-flags-controls select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 500;
}

.admin-listing-analytics-table {
  overflow-x: auto;
}

.admin-listing-analytics-table table,
.admin-review-flags-table table {
  min-width: 980px;
}

.admin-review-flag-detail {
  margin-top: 16px;
}

.admin-table .numeric-cell {
  text-align: right;
  white-space: nowrap;
}

.text-link-button {
  display: inline;
  padding: 0;
  border: 0;
  color: var(--purple);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-link-button:hover,
.text-link-button:focus-visible {
  color: var(--purple-dark);
}

.lab-dialog,
.listing-dialog,
.confirm-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-strong);
  box-shadow: 0 18px 60px rgba(17, 17, 17, 0.22);
  backdrop-filter: blur(18px) saturate(1.12);
}

.listing-dialog.is-fullscreen {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
}

.netid-inventory-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.netid-inventory-content {
  max-height: min(780px, calc(100vh - 32px));
  overflow: auto;
  padding: 24px;
}

.netid-inventory-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding-right: 52px;
  margin-bottom: 12px;
}

.netid-inventory-header h2 {
  margin: 0 0 4px;
}

.netid-inventory-header p {
  margin: 0;
  color: var(--muted);
}

.netid-inventory-search {
  display: grid;
  gap: 7px;
  max-width: 420px;
  margin: 0 0 12px;
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

.netid-inventory-search input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 500;
}

.netid-inventory-search input:focus {
  outline: 2px solid rgba(74, 0, 114, 0.24);
  outline-offset: 2px;
  border-color: rgba(74, 0, 114, 0.45);
}

.netid-inventory-table table {
  min-width: 1040px;
}

.netid-listing-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.netid-listing-list li strong,
.netid-listing-list li span {
  display: block;
}

.lab-dialog::backdrop,
.listing-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(16, 18, 24, 0.58);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 60;
  border-color: var(--red);
  background: var(--red);
  color: white;
  box-shadow: 0 10px 26px rgba(61, 16, 10, 0.22);
}

.dialog-close:hover {
  border-color: #7f2f26;
  background: #7f2f26;
  color: white;
}

.dialog-profile {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
}

.profile-aside {
  padding: 16px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  backdrop-filter: blur(12px) saturate(1.08);
}

.avatar {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 14px;
  border-radius: 6px;
  color: white;
  background: var(--purple);
  font-size: 1.6rem;
  font-weight: 900;
}

.avatar span {
  position: relative;
  z-index: 1;
}

.profile-main p {
  line-height: 1.55;
}

.profile-department {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.profile-last-edited,
.form-submeta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.profile-website {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-website strong {
  font-weight: 800;
}

.profile-website a {
  color: var(--purple);
  font-weight: 800;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.detail-item {
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}

.detail-item strong {
  display: block;
  margin-bottom: 3px;
}

.listing-activity-panel,
.listing-review-panel,
.listing-history-panel {
  margin: 0 22px 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}

.listing-activity-panel + .listing-review-panel,
.listing-review-panel + .listing-history-panel,
.listing-activity-panel + .listing-history-panel {
  margin-top: -6px;
}

.listing-activity-heading,
.listing-review-heading {
  margin-bottom: 14px;
}

.listing-activity-heading h3,
.listing-review-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.listing-activity-heading p,
.listing-review-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.listing-review-current {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.listing-review-current p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.listing-review-status {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(74, 0, 114, 0.1);
  color: var(--purple);
  font-size: 0.76rem;
  font-weight: 900;
}

.listing-review-status.is-resolved {
  background: rgba(42, 122, 75, 0.12);
  color: #1f6d3e;
}

.listing-review-note-field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

.listing-review-note-field textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 500;
}

.listing-review-latest-note {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.review-flag-detail-card {
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

.review-flag-detail-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.review-flag-detail-header h3 {
  margin: 0 0 4px;
}

.review-flag-detail-header p {
  margin: 0;
  color: var(--muted);
}

.listing-review-notes {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.listing-review-notes h4 {
  margin: 0;
}

.listing-review-note {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.listing-review-note div {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

.listing-review-note p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.listing-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.listing-activity-metric {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}

.listing-activity-metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.listing-activity-metric strong {
  color: var(--purple);
  font-size: 1.25rem;
}

.listing-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.listing-history-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.listing-history-heading p,
.listing-history-actor,
.listing-history-row-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.listing-history-filter-label {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.listing-history-filter-label select {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.listing-history-timeline {
  display: grid;
  gap: 10px;
}

.listing-history-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
}

.listing-history-marker {
  width: 10px;
  height: 10px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 4px rgba(74, 0, 132, 0.12);
}

.listing-history-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.listing-history-row-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.listing-history-row-header strong {
  color: var(--ink);
}

.listing-history-row-header time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.listing-history-details {
  margin-top: 8px;
}

.listing-history-details summary {
  color: var(--purple);
  cursor: pointer;
  font-weight: 800;
}

.listing-history-change {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.listing-history-change > strong {
  display: block;
  margin-bottom: 6px;
}

.listing-history-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.listing-history-value-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.listing-history-value {
  max-height: 6.8rem;
  margin: 0;
  padding: 8px;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.listing-dialog {
  width: min(900px, calc(100vw - 32px));
  overflow: visible;
}

.confirm-dialog {
  width: min(460px, calc(100vw - 32px));
}

.auth-dialog {
  width: min(480px, calc(100vw - 32px));
}

.auth-form {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 24px;
}

.auth-form h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.3rem;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f3b4b4;
  border-radius: 6px;
  background: #fff5f5;
  color: #8f1d1d;
  font-weight: 800;
}

.confirm-content {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.confirm-content h2 {
  font-size: 1.18rem;
}

.confirm-content p {
  margin-bottom: 4px;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.listing-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(780px, calc(100vh - 32px));
  max-height: min(780px, calc(100vh - 32px));
  padding: 22px;
  overflow: hidden;
}

.listing-dialog.is-fullscreen form {
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
}

@supports (height: 100dvh) {
  .listing-dialog form {
    height: min(780px, calc(100dvh - 32px));
    max-height: min(780px, calc(100dvh - 32px));
  }

  .listing-dialog.is-fullscreen form {
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

.form-header,
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-header {
  margin-bottom: 18px;
}

.form-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.form-header .dialog-close,
.form-header .listing-fullscreen-toggle {
  position: static;
}

.listing-fullscreen-toggle {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
}

.listing-fullscreen-toggle:hover {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.listing-fullscreen-toggle.is-bouncing {
  animation: listing-editor-toggle-bounce 220ms ease-out;
}

.listing-fullscreen-toggle img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

@keyframes listing-editor-toggle-bounce {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(0.94);
  }

  70% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .listing-fullscreen-toggle.is-bouncing {
    animation: none;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 4px 0;
}

.listing-preview-panel {
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 4px 0;
}

.listing-preview-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #d9cfe8;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

.listing-preview-banner strong {
  display: block;
  color: var(--purple);
  font-size: 1rem;
  font-weight: 900;
}

.listing-preview-banner p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.4;
}

#listing-form.is-previewing #listing-form-note {
  display: none;
}

#listing-form.is-previewing .listing-preview-panel {
  display: block;
  height: 100%;
  min-height: 0;
}

#listing-form.is-previewing .form-footer-actions {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#listing-form.is-previewing #back-to-listing-editing {
  margin-right: auto;
}

.listing-preview-panel .dialog-profile {
  padding: 0;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: #30343b;
  font-size: 0.86rem;
  font-weight: 800;
}

.field-label {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  position: relative;
}

.field-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.required-marker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.character-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.character-count.is-near-limit {
  color: #8a650e;
}

.character-count.is-over-limit {
  color: var(--red);
}

.field-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--purple);
  background: white;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  cursor: help;
}

.field-help:hover,
.field-help[aria-expanded="true"] {
  border-color: var(--purple);
  background: var(--soft);
}

.field-help-dialog-trigger {
  width: auto;
  min-width: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.field-help:focus-visible {
  outline: 2px solid var(--spirit-gold);
  outline-offset: 2px;
}

.field-help-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.field-help-bubble {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 40;
  width: max-content;
  max-width: min(280px, calc(100vw - 48px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 120ms ease;
  visibility: hidden;
}

.field-help[aria-expanded="true"] + .field-help-bubble {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.field-help-bubble.is-align-left {
  right: 0;
  left: auto;
}

.field-help-bubble[aria-hidden="true"] {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .field-help-bubble {
    transition: none;
  }
}

.help-dialog {
  width: min(680px, calc(100vw - 32px));
}

.help-dialog-content {
  position: relative;
  padding: 24px;
}

.help-dialog-content h2 {
  margin: 0 36px 10px 0;
}

.help-dialog-content p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.help-definition-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.help-definition-list div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.help-definition-list dt {
  margin: 0 0 5px;
  color: var(--purple);
  font-weight: 900;
}

.help-definition-list dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.help-definition-list dd p {
  margin: 0 0 10px;
}

.help-definition-list dd p:last-child {
  margin-bottom: 0;
}

.form-grid label[hidden] {
  display: none;
}

.checkbox-field {
  align-content: start;
}

.checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.form-grid .checkbox-control input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.form-grid input[readonly] {
  color: var(--muted);
  background: #f4f5f8;
}

.form-grid input.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(163, 65, 52, 0.2);
}

.chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.chip-input.has-error {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(163, 65, 52, 0.2);
}

.chip-input.is-readonly {
  background: #f4f5f8;
}

.chip-input-list {
  display: contents;
}

.delegate-chip,
.field-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 7px;
  color: #4a412d;
  background: #f8f5ec;
  border: 1px solid #ded4b8;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
}

.field-chip {
  color: #372163;
  background: #f5f2f8;
  border-color: #ddd4e8;
}

.field-chip.is-selected {
  border-color: var(--purple);
  background: #ede5f6;
  box-shadow: 0 0 0 2px rgba(50, 0, 110, 0.16);
}

.delegate-chip button,
.field-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #4a412d;
  background: #eee5cf;
  font-weight: 900;
  line-height: 1;
}

.field-chip button {
  color: #372163;
  background: #e9e2f2;
}

.chip-input-field {
  flex: 1 1 150px;
  min-width: 120px;
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
}

.chip-input-empty {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
}

.chip-error,
.field-error {
  margin: -2px 0 0;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.chip-error[hidden],
.field-error[hidden] {
  display: none;
}

.form-grid textarea {
  resize: vertical;
}

.form-wide {
  grid-column: 1 / -1;
}

.form-footer {
  margin-top: 0;
  padding-top: 18px;
}

.form-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-footer span {
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 920px) {
  .topbar,
  .workspace,
  .summary-grid,
  .account-layout,
  .admin-grid,
  .dialog-profile {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo-full {
    display: none;
  }

  .brand-logo-mark {
    display: block;
  }

  .brand-label {
    max-width: min(100%, 520px);
    padding-left: 0;
    border-left: 0;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .identity-switcher {
    width: 100%;
    grid-template-columns: auto minmax(96px, 0.5fr) minmax(140px, 1fr);
  }

  .auth-session {
    width: 100%;
    justify-content: space-between;
  }

  .nav-button {
    flex: 1;
    min-width: max-content;
  }

  .filters {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 820px) {
  .lab-grid.is-list .lab-card {
    grid-template-columns: 1fr;
  }

  .lab-grid.is-list .card-actions {
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100vw - 20px, 1440px);
    padding-top: 12px;
  }

  h1 {
    font-size: 1.35rem;
  }

  .search-row {
    grid-template-columns: 22px 1fr 32px;
  }

  .lab-grid,
  .guide-list {
    grid-template-columns: 1fr;
  }

  .lab-grid.is-list .lab-card {
    grid-template-columns: 1fr;
  }

  .admin-data-summary {
    grid-template-columns: 1fr;
  }

  .admin-analytics-header {
    display: grid;
  }

  .admin-analytics-controls {
    grid-template-columns: 1fr;
  }

  .admin-table-filters {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .account-listing,
  .form-header,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-switcher {
    grid-template-columns: 1fr;
  }
}
