:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, #111827 0%, #030712 55%);
  color: #e2e8f0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
}

#root {
  padding: 2.5rem;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: rgba(15, 23, 42, 0.86);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(94, 234, 212, 0.05);
}

.panel header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.overview-header {
  align-items: flex-start;
  gap: 1.5rem;
}

h1,
 h2,
 h3 {
  margin: 0;
  font-weight: 600;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: rgba(226, 232, 240, 0.65);
  font-size: 0.95rem;
}

.identity-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.identity-label {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-tag,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(94, 234, 212, 0.15);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.35);
}

.tier-pill {
  background: rgba(244, 114, 182, 0.16);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.35);
}

.tier-mythic {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.tier-ascendant {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.tier-aligned {
  background: rgba(190, 242, 100, 0.18);
  color: #bef264;
  border-color: rgba(190, 242, 100, 0.4);
}

.tier-initiate,
.tier-observer {
  background: rgba(165, 180, 252, 0.12);
  color: #c7d2fe;
  border-color: rgba(165, 180, 252, 0.35);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.metric-card {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.metric-card .label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.8);
}

.metric-card .value {
  font-size: 1.6rem;
  font-weight: 600;
}

.metric-card .hint {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.7);
}

.login textarea,
.login input,
input,
textarea {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.75);
  padding: 0.75rem;
  color: inherit;
  resize: vertical;
}

.login label,
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

button {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  color: #0b1120;
  padding: 0.75rem 1.5rem;
  border-radius: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.35);
}

.ghost-button {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e2e8f0;
}

.payload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.advanced-toggle {
  margin-top: 0.75rem;
  align-self: flex-start;
}

.advanced-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.error-text {
  color: #fda4af;
  font-size: 0.9rem;
}

.hint {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.75);
}

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

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

th,
td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.75rem 0.5rem;
  text-align: left;
}

th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.7);
}

.log-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.log-item {
  background: rgba(15, 23, 42, 0.65);
  border-radius: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.log-primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.log-secondary {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.75);
}

.log-wallet {
  font-size: 0.95rem;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.log-wallet:hover,
.log-wallet:focus-visible {
  color: #5eead4;
  text-decoration: underline;
}

.mirror-log__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mirror-log__search {
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.55rem 1rem;
  color: inherit;
  min-width: 220px;
}

.mirror-log__viewport {
  margin-top: 1rem;
  max-height: 380px;
  overflow-y: auto;
}

.mirror-log--mobile .mirror-log__viewport {
  max-height: 460px;
}

.mirror-log--mobile .log-secondary {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.log-type {
  text-transform: capitalize;
}

.log-timestamp {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.6);
}

.vote-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

textarea::-webkit-scrollbar,
.log-list::-webkit-scrollbar {
  width: 6px;
}

textarea::-webkit-scrollbar-thumb,
.log-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}

.modal-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 1rem;
  padding: 1.5rem;
  width: min(400px, 100%);
  border: 1px solid rgba(94, 234, 212, 0.25);
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.55);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-body {
  display: grid;
  gap: 0.85rem;
}

.modal-field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-field .label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.7);
}

.modal-field .value {
  font-size: 0.95rem;
  word-break: break-all;
}

.modal-avatar {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.modal-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(94, 234, 212, 0.45);
}

.modal-close {
  padding: 0.35rem 0.75rem;
}

@media (max-width: 960px) {
  #root {
    padding: 1.5rem;
  }
  .panel {
    padding: 1.25rem;
  }
  .dashboard-meta {
    flex-wrap: wrap;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #root {
    padding: 1rem;
  }
  .panel header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .mirror-log__controls {
    width: 100%;
  }
  .mirror-log__search {
    width: 100%;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .advanced-grid {
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
  }
}
