:root {
  color-scheme: light;
  font-family: Figtree, Arial, Helvetica, sans-serif;
  line-height: 1.5;
  --brand-accent: #82ff1f;
  --brand-accent-soft: #c9ff90;
  --brand-bg: #111111;
  --brand-surface: #1a1a1a;
  --brand-surface-muted: #2f2f2f;
  --brand-copy: #f8f8f8;
  --brand-copy-muted: #b8b8b8;
  --brand-border: #3b3b3b;
  background: var(--brand-bg);
  color: var(--brand-copy);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #2a2a2a 0%, var(--brand-bg) 42%, #0a0a0a 100%);
}

.brand-shell {
  color: var(--brand-copy);
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.page-shell-top {
  min-height: auto;
  padding-top: 24px;
}

.panel {
  width: 100%;
  max-width: 720px;
  background: rgba(26, 26, 26, 0.92);
  border: 1px solid var(--brand-border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-accent);
  margin-bottom: 8px;
}

h1, h2 {
  margin: 0 0 12px;
  color: var(--brand-copy);
}

.lead {
  margin: 0 0 24px;
  color: var(--brand-copy-muted);
}

.stack {
  display: grid;
  gap: 16px;
}

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

.field span,
.result-grid dt,
.summary-row span {
  font-size: 0.92rem;
  color: var(--brand-copy-muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 1rem;
  color: var(--brand-copy);
  background: #121212;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  appearance: none;
}

button,
.button-link {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--brand-accent);
  color: #111111;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 13px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.secondary {
  background: #2a2a2a;
  color: var(--brand-copy);
  border: 1px solid var(--brand-border);
}

.inline-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.status-banner,
.result-card,
.summary-card,
.consent-box {
  margin-top: 20px;
  border-radius: 14px;
  padding: 18px;
}

.status-banner {
  background: rgba(130, 255, 31, 0.12);
  border: 1px solid rgba(130, 255, 31, 0.32);
  color: var(--brand-accent-soft);
}

.status-banner.error {
  background: rgba(220, 68, 68, 0.14);
  border: 1px solid rgba(220, 68, 68, 0.38);
  color: #ff9a9a;
}

.result-card,
.summary-card,
.consent-box {
  background: rgba(47, 47, 47, 0.48);
  border: 1px solid var(--brand-border);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.result-grid dd,
.summary-row strong {
  margin: 4px 0 0;
  color: var(--brand-copy);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--brand-border);
}

.summary-row:last-child {
  border-bottom: 0;
}

.auth-panel {
  max-width: 520px;
}

.splash-panel {
  max-width: 640px;
  text-align: center;
}

.brand-logo {
  display: block;
  max-width: 100%;
  height: auto;
}

.login-logo {
  width: 240px;
  margin-bottom: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 32px 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  width: 180px;
}

.topbar-title {
  margin: 0;
  font-size: 2rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #232323;
  cursor: pointer;
  padding: 0;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: block;
}

.icon-button {
  width: 48px;
  min-width: 48px;
  padding: 12px 0;
  font-size: 1.2rem;
}

.session-user {
  color: var(--brand-copy-muted);
}

.admin-layout {
  padding: 24px 32px 40px;
  display: grid;
  gap: 20px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-tab {
  background: #232323;
  color: var(--brand-copy);
  border: 1px solid var(--brand-border);
}

.nav-tab.is-active {
  background: var(--brand-accent);
  color: #111111;
  border-color: transparent;
}

.tab-panel .panel {
  max-width: none;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--brand-border);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 16px 0 20px;
}

.user-create-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-copy-muted);
}

.checkbox-field.compact {
  white-space: nowrap;
}

.checkbox-field input {
  width: auto;
}

.context-card {
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

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

.table-meta {
  color: var(--brand-copy-muted);
  margin: 12px 0 16px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

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

.history-table th {
  color: var(--brand-copy-muted);
  font-size: 0.9rem;
}

.history-table td {
  color: var(--brand-copy);
}

.status-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-pill.verified {
  background: rgba(130, 255, 31, 0.12);
  color: var(--brand-accent-soft);
}

.status-pill.pending {
  background: rgba(255, 255, 255, 0.08);
  color: var(--brand-copy-muted);
}

.did-table-wrap {
  max-height: 70vh;
}

.table-input {
  min-width: 180px;
}

a {
  color: var(--brand-accent-soft);
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .topbar,
  .admin-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel {
    padding: 24px;
  }

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

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

  .user-create-grid {
    grid-template-columns: 1fr;
  }

  .inline-input,
  .summary-row,
  .topbar,
  .panel-header {
    grid-template-columns: 1fr;
    display: grid;
  }
}
