:root {
  --accent: var(--accent-light-config, #00a9d6);
  --bg: #eef3f6;
  --fg: #101820;
  --panel: color-mix(in srgb, var(--accent) 3%, #e7eef2);
  --panel-strong: color-mix(in srgb, var(--accent) 5%, #dfe8ed);
  --line: color-mix(in srgb, var(--accent) 20%, #65717b);
  --muted: color-mix(in srgb, var(--fg) 58%, transparent);
  --shadow: color-mix(in srgb, #111 18%, transparent);
  --radius: 7px;
  --radius-sm: 5px;
}

.dark {
  --accent: var(--accent-dark-config, #ff0000);
  --bg: #050505;
  --fg: #ffffff;
  --panel: color-mix(in srgb, var(--accent) 3%, #0b0b0b);
  --panel-strong: color-mix(in srgb, var(--accent) 6%, #0d0d0d);
  --line: color-mix(in srgb, var(--accent) 24%, transparent);
  --muted: color-mix(in srgb, var(--fg) 62%, transparent);
  --shadow: color-mix(in srgb, var(--accent) 10%, transparent);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Space Grotesk", Arial, sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.24;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

.shell {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.topbar,
.query,
.results {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent),
    0 16px 46px color-mix(in srgb, #000 24%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--accent) 3%, transparent);
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
}

.brand,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}

.brand-title,
.node-label,
.nav-link,
label,
dt,
.eyebrow {
  font-weight: 900;
  text-transform: uppercase;
}

.brand-title {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.node-label,
.nav-link {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--accent);
}

.button-link {
  font: inherit;
}

.actions {
  gap: 8px;
}

.nav-group {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 3%, transparent);
}

.nav-group .nav-link,
.nav-group .node-label,
.nav-group .button-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.nav-group .avatar-link {
  width: 34px;
  min-width: 34px;
  padding: 0;
  overflow: visible;
  position: relative;
}

.discord-avatar {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}

.profile-popover[hidden] {
  display: none;
}

.profile-popover {
  position: fixed;
  top: 86px;
  right: max(22px, calc((100vw - 1120px) / 2));
  z-index: 140;
  width: min(380px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--profile-accent, var(--accent)) 8%, transparent), transparent 62%),
    color-mix(in srgb, var(--bg) 96%, #000 4%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--profile-accent, var(--accent)) 10%, transparent),
    0 24px 80px color-mix(in srgb, #000 34%, transparent),
    inset 0 0 34px color-mix(in srgb, var(--profile-accent, var(--accent)) 4%, transparent);
  animation: modalIn 180ms ease both;
}

.profile-popover.has-profile-effect {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--profile-accent, var(--accent)) 22%, transparent),
    0 0 34px color-mix(in srgb, var(--profile-accent, var(--accent)) 24%, transparent),
    0 24px 90px color-mix(in srgb, #000 38%, transparent),
    inset 0 0 42px color-mix(in srgb, var(--profile-accent, var(--accent)) 8%, transparent);
}

.profile-banner {
  min-height: 112px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, #111 65%), color-mix(in srgb, var(--bg) 92%, #000 8%));
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

.profile-body {
  padding: 0 18px 18px;
}

.profile-avatar-wrap {
  width: 86px;
  height: 86px;
  position: relative;
  margin-top: -43px;
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px var(--line), 0 0 28px color-mix(in srgb, var(--profile-accent, var(--accent)) 24%, transparent);
}

.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-decoration {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: contain;
  pointer-events: none;
}

.profile-name {
  margin: 14px 0 0;
  color: var(--fg);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.profile-username,
.profile-note,
.profile-bio,
.profile-status {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.profile-username {
  margin-top: 4px;
  font-size: 13px;
}

.profile-bio {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--profile-accent, var(--accent)) 14%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--profile-accent, var(--accent)) 4%, transparent);
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.profile-info {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.profile-info-row span {
  color: var(--muted);
}

.profile-info-row strong {
  color: var(--fg);
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-activity {
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--profile-accent, var(--accent)) 14%, transparent);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: color-mix(in srgb, var(--profile-accent, var(--accent)) 4%, transparent);
}

.profile-activity-label {
  color: var(--profile-accent, var(--accent));
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.profile-activity-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.profile-activity-cover {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--profile-accent, var(--accent)) 18%, transparent);
}

.profile-activity-empty {
  display: grid;
  place-items: center;
  color: var(--profile-accent, var(--accent));
  background: color-mix(in srgb, var(--profile-accent, var(--accent)) 8%, transparent);
  font-weight: 900;
}

.profile-activity strong,
.profile-activity span {
  display: block;
  overflow-wrap: anywhere;
}

.profile-activity strong {
  color: var(--fg);
  font-size: 15px;
}

.profile-activity span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-chip {
  min-height: 54px;
  border: 1px solid color-mix(in srgb, var(--profile-accent, var(--accent)) 14%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: color-mix(in srgb, var(--profile-accent, var(--accent)) 3%, transparent);
}

.profile-chip span,
.profile-badges-label {
  display: block;
  color: var(--profile-accent, var(--accent));
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.profile-chip strong {
  display: block;
  margin-top: 6px;
  color: var(--fg);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.profile-badge {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--profile-accent, var(--accent)) 28%, transparent);
  border-radius: 50%;
  padding: 0;
  color: var(--fg);
  background:
    radial-gradient(circle at 35% 28%, color-mix(in srgb, #fff 34%, transparent), transparent 34%),
    color-mix(in srgb, var(--profile-accent, var(--accent)) 20%, transparent);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 10px color-mix(in srgb, var(--profile-accent, var(--accent)) 16%, transparent);
}

.profile-badge-symbol {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--bg);
  background: var(--profile-accent, var(--accent));
  font-size: 10px;
  line-height: 1;
}

.profile-note {
  margin-top: 12px;
  font-size: 12px;
}

.nav-group .nav-link,
.nav-group .button-link {
  background: transparent;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-group .nav-link:hover,
.nav-group .button-link:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.nav-group .node-label {
  color: color-mix(in srgb, var(--fg) 70%, transparent);
}

.nav-group .node-label.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 20%, transparent);
}

.button-link {
  height: 34px;
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--muted);
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}

.logout-icon span {
  transform: translateX(1px);
}

.logout-pill {
  width: 44px;
  min-width: 44px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  cursor: pointer;
  position: relative;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.logout-pill::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 10px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
}

.logout-pill::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 8px;
  width: 2px;
  height: 12px;
  border-radius: 999px;
  background: var(--muted);
}

.logout-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.logout-pill:hover::before {
  border-color: var(--accent);
}

.logout-pill:hover::after {
  background: var(--accent);
}

.theme-toggle {
  min-width: 42px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.theme-toggle:hover,
button.primary:hover {
  color: var(--accent);
  background: transparent;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-self: start;
}

.admin-layout {
  grid-template-columns: 300px minmax(0, 1fr);
}

.query {
  padding: 22px;
  display: grid;
  gap: 22px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

h1 {
  margin: 10px 0 0;
  color: var(--fg);
  font-size: 46px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 span,
#message {
  color: var(--accent);
}

h1 span {
  text-shadow: 0 0 28px color-mix(in srgb, var(--accent) 55%, transparent);
}

.copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 10px;
}

.lookup-form {
  grid-template-columns: minmax(0, 1fr) 130px;
  margin-bottom: 10px;
}

label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
}

input,
button {
  height: 46px;
  border-radius: var(--radius-sm);
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  padding: 0 13px;
  border: 1px solid var(--line);
  outline: none;
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 3%, var(--bg));
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

button.primary {
  border: 1px solid var(--accent);
  color: var(--bg);
  background: var(--accent);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

#message {
  min-height: 38px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.inline-message {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.results {
  padding: 14px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.section-card {
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%),
    var(--panel-strong);
  position: relative;
  overflow: hidden;
}

.section-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 52%;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.section-card h2 {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-total {
  margin-top: 12px;
  color: var(--fg);
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
}

.section-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-lines span {
  white-space: nowrap;
}

.section-lines strong {
  color: var(--fg);
  font-weight: 900;
}

.summary,
.details {
  display: grid;
  gap: 10px;
}

.summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 10px;
}

.details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.key-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.metric,
.table-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%),
    var(--panel-strong);
  position: relative;
  overflow: hidden;
}

.metric {
  min-height: 96px;
  padding: 14px;
}

.metric::after,
.scanline {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.metric::after {
  content: "";
  position: absolute;
  left: 0;
  right: 46%;
  bottom: 0;
  height: 2px;
}

.metric.primary {
  min-height: 128px;
}

dt {
  color: color-mix(in srgb, var(--accent) 75%, var(--fg));
  font-size: 10px;
  letter-spacing: 0.14em;
}

dd {
  margin: 14px 0 0;
  color: var(--fg);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric.primary dd {
  font-size: clamp(34px, 4vw, 48px);
}

.table-panel {
  padding: 14px;
  margin-top: 10px;
}

.table-panel h2 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.row {
  min-height: 36px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--muted);
  font-size: 13px;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%),
    var(--bg);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent),
    0 0 70px var(--shadow),
    inset 0 0 34px color-mix(in srgb, var(--accent) 5%, transparent);
}

.modal-panel .key-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-panel .metric {
  min-height: 88px;
}

.modal-panel dd {
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.18;
}

.modal-panel .mono {
  font-size: clamp(14px, 1.5vw, 20px);
  word-break: break-word;
}

.scanline {
  height: 2px;
  width: 100%;
}

.admin-shell {
  width: min(1128px, calc(100vw - 32px));
  grid-template-rows: auto auto auto 1fr auto;
  gap: 18px;
}

.login-screen[hidden] {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%),
    color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
}

.login-card {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%),
    var(--bg);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent),
    0 0 70px var(--shadow),
    inset 0 0 34px color-mix(in srgb, var(--accent) 5%, transparent);
  animation: modalIn 180ms ease both;
}

.login-card .brand {
  margin-bottom: 18px;
}

.login-card h1 {
  margin-bottom: 18px;
}

.admin-hero,
.admin-workspace,
.lookup-panel,
.activity-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 58%),
    var(--panel);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 7%, transparent),
    0 18px 60px color-mix(in srgb, var(--accent) 10%, transparent),
    inset 0 0 30px color-mix(in srgb, var(--accent) 4%, transparent);
}

.admin-hero {
  min-height: 150px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.admin-hero::after,
.admin-workspace::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 42%, color-mix(in srgb, var(--accent) 12%, transparent) 48%, transparent 56% 100%);
  transform: translateX(-120%);
  animation: sweep 6s ease-in-out infinite;
}

.hero-copy {
  max-width: 520px;
  display: grid;
  gap: 10px;
  justify-self: end;
}

.admin-tools {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  justify-self: end;
  align-items: stretch;
}

.tool-row {
  min-height: 42px;
}

.admin-tools > .tool-row:first-child {
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: 42px auto;
  align-content: start;
  gap: 10px;
}

.quick-form {
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}

.quick-form input,
.quick-form button {
  height: 42px;
}

.compact-button {
  width: 100%;
  height: 42px;
}

.admin-tools .inline-message {
  min-height: 16px;
  margin: 0;
  align-self: start;
}

.tool-message {
  grid-column: 2;
}

.admin-sections {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.section-card {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  animation: riseIn 520ms ease both;
}

.section-card:hover,
.lookup-panel:hover,
.activity-panel:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 82%, var(--fg));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
    0 22px 80px color-mix(in srgb, var(--accent) 14%, transparent),
    inset 0 0 34px color-mix(in srgb, var(--accent) 5%, transparent);
}

.section-card:nth-child(2) {
  animation-delay: 70ms;
}

.section-card:nth-child(3) {
  animation-delay: 140ms;
}

.section-card:nth-child(4) {
  animation-delay: 210ms;
}

.featured-card {
  min-height: 178px;
}

.admin-workspace {
  position: relative;
  overflow: hidden;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 12px;
}

.lookup-panel,
.activity-panel {
  min-height: 270px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  animation: riseIn 560ms ease both;
}

.activity-panel:nth-child(2) {
  animation-delay: 90ms;
}

.activity-panel:nth-child(3) {
  animation-delay: 160ms;
}

.lookup-panel h2,
.activity-panel h2 {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lookup-form {
  grid-template-columns: 1fr;
  margin-top: 16px;
}

.lookup-form button {
  width: 100%;
}

.activity-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.activity-row {
  width: 100%;
  min-height: 68px;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-sm);
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  text-align: left;
  font: inherit;
  animation: riseIn 420ms ease both;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.activity-row:hover {
  transform: translateX(3px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.activity-button {
  height: auto;
  cursor: pointer;
}

.activity-row strong {
  color: var(--fg);
  font-size: 15px;
  line-height: 1.2;
}

.activity-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.modal-list {
  max-height: 420px;
  overflow-y: auto;
}

.modal-panel {
  animation: modalIn 180ms ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sweep {
  0%, 55% {
    transform: translateX(-120%);
  }
  78%, 100% {
    transform: translateX(120%);
  }
}

@media (max-width: 980px) {
  .layout,
  .admin-layout,
  .admin-hero,
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    justify-self: start;
  }

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

  .admin-tools > .tool-row:first-child {
    grid-row: auto;
    grid-template-rows: auto;
  }

  .tool-message {
    grid-column: auto;
  }

  .admin-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .summary,
  .details,
  .section-grid,
  .admin-sections,
  .key-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 520px);
    padding: 16px 0;
  }

  .topbar,
  .actions,
  .section-grid,
  .admin-sections,
  .summary,
  .details,
  .key-details,
  .lookup-form {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  h1 {
    font-size: 38px;
  }
}
