:root {
  color-scheme: light;
  --ink: #171a25;
  --muted: #5d6474;
  --indigo: #27358b;
  --gold: #d6aa55;
  --danger: #a12835;
  --surface: rgba(255, 255, 255, 0.94);
  --glass: rgba(247, 249, 255, 0.58);
  --glass-active: rgba(255, 255, 255, 0.76);
  --glass-edge: 2px;
  --line: rgba(255, 255, 255, 0.72);
  --shadow: 0 16px 34px rgba(21, 26, 54, 0.16), 0 3px 10px rgba(21, 26, 54, 0.12);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #e8ebf4; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(rgba(14, 18, 38, 0.42), rgba(14, 18, 38, 0.58)), url("/campus-corridor.webp") center / cover fixed;
}
button, input, select { font: inherit; letter-spacing: 0; }
button, input, select, summary { min-height: 44px; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.page-shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 48px; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; color: white; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,.65); border-radius: 8px;
  background: rgba(255,255,255,.15); box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
h1, h2, p { margin-top: 0; }
h1 { font-size: 1.25rem; margin-bottom: 0; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin-bottom: 8px; }
.eyebrow { margin-bottom: 8px; color: var(--indigo); font-size: .72rem; font-weight: 750; letter-spacing: .08em; }
.form-intro, #dataset-status { color: var(--muted); }

.glass-control {
  position: relative;
  min-height: 44px;
  border: var(--glass-edge) solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  color: var(--ink);
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(39,53,139,.08), var(--shadow);
  backdrop-filter: blur(18px) saturate(128%);
  -webkit-backdrop-filter: blur(18px) saturate(128%);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 240ms ease, transform 180ms ease;
}
.glass-control:hover { background: rgba(255,255,255,.68); border-color: rgba(255,255,255,.9); }
.glass-control:focus-visible {
  outline: 3px solid rgba(214,170,85,.82); outline-offset: 3px;
  background: var(--glass-active);
  box-shadow: inset 0 1px 0 white, 0 0 0 1px rgba(39,53,139,.28), 0 18px 36px rgba(21,26,54,.2);
}
.glass-control:active { transform: translateY(1px) scale(.995); }
.glass-control:disabled { cursor: wait; opacity: .62; }
.primary { color: white; background: rgba(39,53,139,.9); border-color: rgba(255,255,255,.76); }
.primary:hover { background: rgba(47,62,154,.94); }
.icon-command { color: white; background: rgba(24,29,56,.44); }

.unlock-view { min-height: calc(100vh - 132px); display: grid; place-items: center; }
.unlock-form, .search-view {
  background: rgba(245,247,253,.74); border: 1px solid rgba(255,255,255,.68);
  box-shadow: 0 24px 70px rgba(10,14,35,.25);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.unlock-form { width: min(560px, 100%); padding: 30px; border-radius: 8px; }
.unlock-form label { display: block; margin-bottom: 8px; font-weight: 650; }
.form-row, .search-form { display: grid; gap: 12px; }
.form-row { grid-template-columns: 1fr auto; }
input, select, button { padding: 10px 14px; }

.search-view { padding: 22px; border-radius: 8px; }
.workspace-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.connection-dot { width: 10px; height: 10px; margin: 10px; border-radius: 50%; background: #23865e; box-shadow: 0 0 0 5px rgba(35,134,94,.14); }
.search-form { grid-template-columns: auto minmax(160px, .7fr) auto minmax(220px, 1fr) auto; align-items: center; }
.search-form label { font-weight: 650; }
.status { min-height: 24px; color: var(--danger); margin: 10px 0; }
.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0; }
.result-summary p { margin-bottom: 0; font-weight: 650; }
.pagination { display: flex; align-items: center; gap: 8px; }

.table-shell { position: relative; }
.table-shell.has-overflow { padding-top: 34px; }
.table-scroll-hint {
  position: absolute; top: 0; right: 0; min-height: 28px; margin: 0; padding: 4px 10px;
  color: #343b56; background: rgba(237, 240, 251, 0.58); border: 1px solid rgba(255,255,255,.72); border-radius: 6px;
  opacity: 1; transition: opacity 180ms ease;
}
.table-scroll-hint[aria-hidden="true"], .table-scroll-hint.is-fading { opacity: 0; pointer-events: none; }
.table-region { overflow: auto; max-height: 62vh; background: rgba(255,255,255,.96); border: 1px solid rgba(39,53,139,.14); border-radius: 6px; }
table { width: 100%; min-width: 1100px; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #e2e5ed; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #f3f5fa; color: #31384d; }
tbody tr:hover { background: #f8f9fc; }
.guardian-block { display: grid; gap: 3px; padding: 7px 0; white-space: normal; min-width: 230px; }
.guardian-block + .guardian-block { border-top: 1px solid #e2e5ed; }
.record-label { color: var(--muted); font-weight: 650; }
.mobile-results { display: none; }

@supports not ((backdrop-filter: blur(18px)) or (-webkit-backdrop-filter: blur(18px))) {
  .glass-control, .unlock-form, .search-view { background: rgba(247, 249, 255, 0.96); }
}

@media (max-width: 760px) {
  body { background-attachment: scroll; }
  .page-shell { width: min(calc(100% - 20px), 680px); padding-top: 10px; }
  .topbar { min-height: 58px; }
  .unlock-view { min-height: calc(100vh - 94px); }
  .unlock-form { padding: 22px 18px; }
  .search-view { padding: 16px 12px; }
  .search-form, .form-row { grid-template-columns: 1fr; }
  .search-form label { margin-bottom: -8px; }
  .result-summary { align-items: stretch; flex-direction: column; }
  .pagination { justify-content: space-between; }
  .pagination .glass-control { flex: 1; }
  .table-shell { display: none; }
  .mobile-results { display: grid; gap: 10px; }
  .mobile-record { background: rgba(255,255,255,.96); border: 1px solid rgba(39,53,139,.14); border-radius: 6px; overflow: hidden; }
  .mobile-record summary { display: flex; align-items: center; justify-content: space-between; padding: 12px; cursor: pointer; font-weight: 700; }
  .mobile-record-body { display: grid; gap: 8px; padding: 0 12px 14px; overflow-wrap: anywhere; }
  .mobile-record .guardian-block { min-width: 0; padding-left: 10px; border-left: 2px solid rgba(39,53,139,.18); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .glass-control:active { transform: none; }
}