:root {
  --bg: #0e1418;
  --panel: #162026;
  --panel-soft: #1a262d;
  --text: #d9e6ea;
  --muted: #93a8b0;
  --teal: #1db5a7;
  --teal-soft: rgba(29, 181, 167, 0.18);
  --danger: #e06a6a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(29, 181, 167, 0.22), rgba(29, 181, 167, 0) 28%),
    radial-gradient(circle at 10% 0%, #18232b, var(--bg) 38%);
  color: var(--text);
}

.card {
  background: var(--panel);
  border: 1px solid #2a4548;
  box-shadow: 0 0 0 1px rgba(29, 181, 167, 0.08);
  color: var(--text);
}

h1,
.h4,
.h5 {
  color: #c7f3ee;
}

.text-secondary {
  color: var(--muted) !important;
}

.btn-teal {
  background: var(--teal);
  color: #081214;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-teal:hover {
  background: #2ecabc;
  color: #061012;
}

.auth-panel {
  min-width: 250px;
}

.form-control,
.form-select {
  background: var(--panel-soft);
  color: var(--text);
  border-color: #2a3942;
}

.form-control::placeholder {
  color: #8ea5ad;
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 0.2rem var(--teal-soft);
  background: var(--panel-soft);
  color: var(--text);
}

.form-select option {
  background: #152028;
  color: var(--text);
}

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

.people-grid.logged-out-grid {
  grid-template-columns: 1fr;
}

.person-card {
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  min-height: 0;
}

.person-card.dragging {
  opacity: 0.8;
  transform: scale(1.01);
  border-color: var(--teal);
}

.person-card.saving {
  border-color: #4c95e9;
}

.person-card.save-error {
  border-color: var(--danger);
}

.avatar {
  max-width: 62px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid #2a3942;
}

.emoji-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-btn {
  border: 1px solid #2a3942;
  background: var(--panel-soft);
  border-radius: 14px;
  min-width: 54px;
  height: 46px;
  font-size: 2rem;
  line-height: 1;
  transition: border-color 120ms ease, background 120ms ease;
}

.emoji-btn.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.emoji-view-only {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guest-card .emoji-view-only {
  justify-content: flex-end;
}

.emoji-chip {
  border: 1px solid #2a3942;
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 2rem;
  line-height: 1;
}

.sam-inline-text {
  color: #d6e2e8;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.guest-right-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.guest-left-meta {
  min-width: 0;
}

.guest-bio {
  margin-top: 0;
}

.subtle-login-link {
  color: #8ea5ad;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.subtle-login-link:hover {
  color: #b2c4cb;
}

.guest-disclaimer {
  font-size: 0.82rem;
  color: #8ea5ad;
  max-width: 300px;
}

.readonly-value {
  border: 1px solid #2a3942;
  border-radius: 6px;
  padding: 6px 10px;
  background: #141d24;
  color: var(--text);
  min-height: 34px;
}

.save-status {
  min-height: 1rem;
}

.key-list {
  columns: 2;
  column-gap: 1.25rem;
}

.key-list p {
  break-inside: avoid;
}

.key-list strong {
  color: #9ee9df;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.reorder-modal-card {
  max-width: 520px;
}

.reorder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.reorder-item {
  border: 1px solid #2a3942;
  background: #1a262d;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: grab;
  user-select: none;
}

.reorder-item.dragging {
  opacity: 0.7;
  border-color: var(--teal);
}

.captcha-submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.evidence-submit-btn {
  white-space: nowrap;
  transform: translateY(-2px);
}

.alert-info {
  background: #1f2c34;
  border-color: #30424d;
  color: #c9d6db;
}

code {
  color: #93efe4;
}

@media (max-width: 900px) {
  .people-grid {
    grid-template-columns: 1fr;
  }

  .key-list {
    columns: 1;
  }

  .captcha-submit-row {
    flex-wrap: wrap;
  }

  .captcha-submit-row .evidence-submit-btn {
    margin-left: 0 !important;
  }
}
