:root {
  color-scheme: dark;
  --bg: #171c24;
  --bg-deep: #0f131a;
  --steel: #4a5260;
  --steel-soft: #8a96a8;
  --steel-light: #c0c8d2;
  --surface: rgba(18, 22, 30, 0.78);
  --surface-soft: rgba(24, 29, 38, 0.72);
  --surface-raised: rgba(34, 40, 51, 0.82);
  --text: #f6f7f8;
  --muted: rgba(246, 247, 248, 0.62);
  --faint: rgba(246, 247, 248, 0.42);
  --line: rgba(246, 247, 248, 0.2);
  --line-soft: rgba(246, 247, 248, 0.12);
  --line-strong: rgba(246, 247, 248, 0.62);
  --accent: #c0c8d2;
  --button: #2e333c;
  --button-hover: #3a414d;
  --button-text: #ffffff;
  --focus: #c0c8d2;
  --danger: #ff8f86;
  --danger-bg: rgba(77, 25, 24, 0.72);
  --ok: #9ad7aa;
  --ok-bg: rgba(20, 62, 37, 0.62);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Jost", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(192, 200, 210, 0.34), transparent 48%),
    radial-gradient(ellipse at 12% 18%, rgba(138, 150, 168, 0.2), transparent 44%),
    linear-gradient(142deg, #1b2029 0%, #4a5260 48%, #1a1f28 100%);
}

body::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 5px);
  opacity: 0.7;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid rgba(246, 247, 248, 0.26);
  background: var(--button);
  color: var(--button-text);
  padding: 8px 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
  white-space: normal;
  overflow-wrap: anywhere;
}

button:hover {
  background: var(--button-hover);
  border-color: var(--line-strong);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button.secondary {
  background: rgba(246, 247, 248, 0.06);
  color: var(--text);
  border-color: var(--line);
}

button.secondary:hover {
  background: rgba(246, 247, 248, 0.11);
}

button.danger {
  background: var(--danger-bg);
  border-color: rgba(255, 143, 134, 0.72);
  color: #ffffff;
}

button.danger:hover {
  background: rgba(98, 29, 28, 0.86);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.link {
  min-height: auto;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 0 0 1px;
  vertical-align: baseline;
}

button.link:hover {
  background: transparent;
  color: var(--steel-light);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: rgba(10, 13, 18, 0.46);
  color: var(--text);
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 4px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  outline: 2px solid rgba(192, 200, 210, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

select option {
  color: #11151c;
}

input[type="file"] {
  min-height: 42px;
  padding: 7px;
}

input::file-selector-button {
  border: 1px solid var(--line);
  background: var(--button);
  color: var(--text);
  border-radius: 4px;
  padding: 6px 9px;
  margin-right: 10px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  background: rgba(18, 22, 30, 0.86);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  margin-bottom: 14px;
  border-radius: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand {
  color: var(--text);
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.notice {
  border: 1px solid var(--line);
  background: rgba(18, 22, 30, 0.86);
  color: var(--text);
  padding: 10px 12px;
  margin: 0 0 14px;
  border-radius: 6px;
}

.notice.error {
  background: var(--danger-bg);
  border-color: rgba(255, 143, 134, 0.72);
  color: #ffd0cc;
}

.notice.ok {
  background: var(--ok-bg);
  border-color: rgba(154, 215, 170, 0.62);
  color: #d8f2df;
}

.auth {
  min-height: calc(100vh - 44px);
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.auth-box {
  width: min(460px, 100%);
  padding: 6px 4px;
}

.auth-logo {
  text-align: center;
  margin: 0 auto 16px;
}
.auth-logo img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: grayscale(1) brightness(0.78);
}

.auth-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  position: relative;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.auth-avatar span,
.auth-avatar span::before,
.auth-avatar span::after {
  display: block;
  position: absolute;
}

.auth-avatar span {
  width: 54px;
  height: 54px;
}

.auth-avatar span::before {
  content: "";
  width: 22px;
  height: 22px;
  left: 50%;
  top: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  transform: translateX(-50%);
}

.auth-avatar span::after {
  content: "";
  width: 42px;
  height: 22px;
  left: 50%;
  bottom: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  border-bottom: 0;
  border-radius: 42px 42px 0 0;
  transform: translateX(-50%);
}

.auth-title {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  margin-bottom: 34px;
}

.auth-title h1 {
  font-size: 26px;
  font-weight: 300;
}

.auth-title .muted {
  font-size: 11px;
  color: var(--faint);
}

.auth-form {
  gap: 22px;
}

.auth-field {
  gap: 7px;
  color: rgba(246, 247, 248, 0.76);
  font-size: 13px;
}

.auth-field input {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  min-height: 42px;
  padding: 7px 0 10px;
}

.auth-field input:focus {
  border-color: var(--line-strong);
  outline: 0;
}

.auth-form .actions {
  margin-top: 4px;
}

.auth-form .actions button {
  width: 100%;
  min-height: 52px;
}

.switch-line {
  margin: 2px 0 0;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}

.section,
.admin-header {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow-x: auto;
}

.admin-header {
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 0;
  line-height: 1.2;
  font-weight: 400;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.metrics div {
  background: rgba(10, 13, 18, 0.34);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 10px;
}

.metrics strong {
  display: block;
  font-size: 22px;
  font-weight: 300;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
}

.admin-board {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.admin-main,
.admin-side {
  display: grid;
  gap: 14px;
}

.staff-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 14px;
  align-items: start;
}

.staff-main,
.staff-side,
.account-zones,
.account-list,
.quick-actions {
  display: grid;
  gap: 12px;
}

.quick-actions button {
  width: 100%;
}

.account-card,
.profile-photo-card,
.chat-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-card {
  margin-bottom: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-photo-card {
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 13, 18, 0.28);
  padding: 12px;
}

.profile-photo-card > div {
  text-align: center;
}

.small-avatar,
.mini-avatar,
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--line-soft);
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
}

.small-avatar img,
.mini-avatar img,
.profile-avatar img,
.dc-avatar img,
.welcome-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  position: absolute;
  inset: 0;
}

.profile-avatar {
  width: 86px;
  height: 86px;
  margin: 0 auto;
  font-size: 28px;
}

.small-avatar {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.mini-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.avatar-fallback {
  font-weight: 600;
}

.staff-side {
  position: sticky;
  top: 84px;
}

.side-card {
  margin-bottom: 0;
}

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

.account-zone {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 13, 18, 0.28);
  padding: 10px;
}

.zone-head,
.account-summary,
.leader-row,
.chat-message > div,
.evidence-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.zone-head {
  margin-bottom: 9px;
}

.account-row {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(246, 247, 248, 0.035);
  padding: 9px;
  display: grid;
  gap: 8px;
}

.account-summary {
  font-size: 13px;
  flex-wrap: wrap;
}

.account-summary > div {
  display: grid;
  gap: 2px;
  min-width: 140px;
}

.account-row details {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.account-row summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.ban-note {
  margin: 0;
  color: #ffd0cc;
  font-size: 13px;
}

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

.mini-form button {
  grid-column: 1 / -1;
}

.ban-form {
  margin-top: 8px;
}

.compact-actions {
  margin-top: 0;
}

.evidence-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  background: rgba(10, 13, 18, 0.3);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.meeting-note {
  margin: 4px 0 0;
}

.full-page-panel {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.scroll-box {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.scroll-box .history {
  min-width: 640px;
}

.leaderboard,
.chat-list {
  display: grid;
  gap: 8px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 13, 18, 0.3);
  padding: 8px;
}

.leader-rank {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
}

.leader-row div {
  min-width: 0;
  flex: 1;
  display: grid;
}

.leaderboard-full,
.issue-list {
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 4px;
}

.leader-row small,
.chat-message span,
.chat-message small {
  color: var(--muted);
}

.chat-card {
  max-height: 560px;
}

.chat-list {
  max-height: 350px;
  overflow: auto;
  padding-right: 2px;
}

.chat-list-full {
  max-height: calc(100vh - 250px);
  align-content: start;
}

.chat-message {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 13, 18, 0.3);
  padding: 8px;
}

.chat-author {
  justify-content: flex-start;
}

.chat-message p {
  margin: 6px 0;
  overflow-wrap: anywhere;
}

.chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
}

.chat-form-full {
  margin-top: 0;
}

.issue-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.issue-form textarea {
  grid-column: 1 / -1;
}

.issue-form button {
  grid-column: 1 / -1;
}

.issue-item p {
  overflow-wrap: anywhere;
}

.ban-screen {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.ban-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 143, 134, 0.72);
  background: rgba(77, 25, 24, 0.54);
  border-radius: 6px;
  padding: 18px;
}

.danger-status {
  border-color: rgba(255, 143, 134, 0.72);
  color: #ffffff;
  background: var(--danger-bg);
}

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

.panel-button {
  min-height: 82px;
  text-align: left;
  background: rgba(10, 13, 18, 0.32);
  color: var(--text);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  display: grid;
  align-content: space-between;
}

.evidence-tile {
  min-height: 96px;
  text-align: center;
  place-items: center;
  align-content: center;
}

.panel-button:hover {
  background: rgba(246, 247, 248, 0.09);
}

.panel-button strong {
  font-size: 15px;
  font-weight: 500;
}

.panel-button span {
  color: var(--muted);
  font-size: 13px;
}

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

.item {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 10px;
  background: rgba(10, 13, 18, 0.28);
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.item-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.kv {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
}

.kv dt {
  color: var(--muted);
}

.kv.compact {
  grid-template-columns: 72px minmax(0, 1fr);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.history {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: rgba(10, 13, 18, 0.28);
}

.history th,
.history td {
  border: 1px solid var(--line-soft);
  text-align: left;
  padding: 7px 8px;
  vertical-align: top;
}

.history th {
  color: var(--muted);
  font-weight: 500;
  background: rgba(10, 13, 18, 0.38);
}

.status {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: rgba(10, 13, 18, 0.34);
}

@media (max-width: 920px) {
  .grid,
  .admin-board,
  .staff-layout,
  .account-zones,
  .profile-grid,
  .mini-form,
  .chat-form,
  .issue-form,
  .metrics {
    grid-template-columns: 1fr;
  }

  .staff-side {
    position: static;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 18px, 1180px);
    padding-top: 9px;
  }

  .topbar,
  .section-head,
  .item-head,
  .account-summary,
  .evidence-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    top: 6px;
  }

  .auth {
    padding: 24px 10px;
  }

  .auth-title h1 {
    font-size: 23px;
  }

  .section,
  .admin-header {
    padding: 12px;
  }

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

/* ── Crop modal ── */
.crop-modal {
  max-width: 360px;
  width: 100%;
}
.crop-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}
#cropCanvas {
  border-radius: 8px;
  cursor: grab;
  max-width: 100%;
  display: block;
  background: #0a0d12;
}
.crop-zoom-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.crop-zoom-label input {
  flex: 1;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.crop-hint {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  margin: 4px 0 0;
}

/* ── Welcome banner (staff home) ── */
.welcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(74,82,96,0.5) 0%, rgba(18,22,30,0.7) 100%);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.welcome-avatar { flex: 0 0 auto; }
.welcome-avatar-img {
  width: 56px;
  height: 56px;
  font-size: 20px;
  overflow: hidden;
  position: relative;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.welcome-text {
  flex: 1;
  display: grid;
  gap: 2px;
}
.welcome-greeting { font-size: 12px; color: var(--muted); }
.welcome-nick { font-size: 18px; font-weight: 600; }
.welcome-rank { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.welcome-tier {
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 6px;
  border: 1px solid;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tier-head { border-color: #ffd700; color: #ffd700; background: rgba(255,215,0,.08); }
.tier-high { border-color: #86c8ff; color: #86c8ff; background: rgba(134,200,255,.08); }
.tier-medium { border-color: #9ad7aa; color: #9ad7aa; background: rgba(154,215,170,.08); }
.tier-chatmod { border-color: #d4a6f5; color: #d4a6f5; background: rgba(212,166,245,.08); }
.tier-low { border-color: #ffb86a; color: #ffb86a; background: rgba(255,184,106,.08); }
.tier-learner { border-color: var(--steel-soft); color: var(--steel-soft); background: rgba(138,150,168,.08); }
.welcome-pts { text-align: center; }
.welcome-pts-num { display: block; font-size: 26px; font-weight: 300; line-height: 1; }
.welcome-pts-label { font-size: 11px; color: var(--muted); }

/* ── Evidence tile icon ── */
.ev-icon { font-size: 22px; line-height: 1; }
.evidence-tile { gap: 4px; padding: 12px; }

/* ── Discord-style chat ── */
.dc-chat-panel { gap: 0; }
.dc-list {
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
}
.dc-msg, .dc-reply {
  display: flex;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 80ms;
}
.dc-msg:hover, .dc-reply:hover {
  background: rgba(255,255,255,0.035);
}
.dc-avatar-col { flex: 0 0 auto; padding-top: 2px; }
.dc-avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dc-body { flex: 1; min-width: 0; }
.dc-header {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.dc-rank {
  font-size: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.dc-nick {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}
.dc-time {
  font-size: 11px;
  color: var(--faint);
  margin-left: auto;
  flex-shrink: 0;
}
.dc-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.dc-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.dc-input-row input {
  border-radius: 20px;
  padding: 8px 16px;
}

/* ── Leaderboard podium ── */
.top3-podium {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}
.leader-row.podium {
  padding: 10px 12px;
}
.leader-pts-badge {
  font-size: 16px;
  font-weight: 300;
  white-space: nowrap;
}

/* ── Issue cards (forum) ── */
.issue-card {
  display: flex;
  gap: 12px;
  background: rgba(10,13,18,0.3);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--steel);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  transition: border-color 120ms, background 120ms;
}
.issue-card:hover { background: rgba(10,13,18,0.45); }
.issue-card.resolved { border-left-color: rgba(154,215,170,0.6); opacity: 0.8; }
.issue-card-left { flex: 0 0 auto; }
.issue-card-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.issue-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.issue-card-title {
  font-size: 15px;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  min-height: unset;
  text-align: left;
  line-height: 1.3;
  transition: color 120ms;
}
.issue-card-title:hover { color: var(--steel-light); background: transparent; }
.issue-card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.issue-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.issue-card-btn {
  font-size: 12px;
  min-height: 28px;
  padding: 2px 10px;
  margin-left: auto;
}
.issue-new-details { margin-bottom: 12px; }
.issue-new-summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 12px;
  border: 1px dashed var(--line-soft);
  border-radius: 4px;
  list-style: none;
  transition: background 120ms;
}
.issue-new-summary:hover { background: rgba(255,255,255,0.05); }

/* ── Issue detail ── */
.issue-detail-section {}
.issue-post-card {
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--steel);
  border-radius: 6px;
  background: rgba(10,13,18,0.28);
  padding: 14px;
  display: grid;
  gap: 12px;
}
.replies-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.replies-count { font-size: 14px; font-weight: 500; color: var(--muted); }

/* ── Profile photo upload ── */
.avatar-upload-label { cursor: pointer; display: block; }
.profile-avatar-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto 10px;
}
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  opacity: 0;
  transition: opacity 150ms;
}
.avatar-upload-label:hover .avatar-upload-overlay { opacity: 1; }
.profile-pts-badge {
  display: inline-block;
  background: rgba(192,200,210,0.1);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 2px 12px;
  font-size: 13px;
  margin-top: 4px;
}

/* ── Leaderboard medals ── */
.leader-row.gold {
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.07);
}
.leader-row.silver {
  border-color: rgba(192, 192, 192, 0.45);
  background: rgba(192, 192, 192, 0.07);
}
.leader-row.bronze {
  border-color: rgba(205, 127, 50, 0.45);
  background: rgba(205, 127, 50, 0.07);
}
.leader-rank.gold {
  border-color: rgba(255, 215, 0, 0.7);
  color: #ffd700;
  font-weight: 600;
}
.leader-rank.silver {
  border-color: rgba(192, 192, 192, 0.7);
  color: #c0c0c0;
  font-weight: 600;
}
.leader-rank.bronze {
  border-color: rgba(205, 127, 50, 0.7);
  color: #cd7f32;
  font-weight: 600;
}

/* ── Evidence locked tile ── */
.evidence-tile.locked {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.6);
  border-style: dashed;
}
.evidence-tile.locked strong,
.evidence-tile.locked span {
  color: var(--faint);
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}

.modal-content {
  background: #171c24;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 18px;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.54);
  display: grid;
  gap: 12px;
}

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

.modal-head h3 {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.modal-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-soft);
  background: var(--button);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  transition: background 120ms;
}
.modal-download:hover {
  background: var(--button-hover);
}

.modal-content img {
  max-width: 100%;
  border-radius: 4px;
  display: block;
}

.modal-content iframe {
  width: 100%;
  height: 480px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #fff;
}

/* ── Like / dislike bar ── */
.like-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.like-btn,
.dislike-btn {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
  background: rgba(10, 13, 18, 0.32);
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.like-btn:hover {
  border-color: rgba(154, 215, 170, 0.5);
  color: var(--ok);
}
.dislike-btn:hover {
  border-color: rgba(255, 143, 134, 0.5);
  color: var(--danger);
}
.like-btn.active {
  background: var(--ok-bg);
  border-color: rgba(154, 215, 170, 0.62);
  color: var(--ok);
}
.dislike-btn.active {
  background: var(--danger-bg);
  border-color: rgba(255, 143, 134, 0.62);
  color: var(--danger);
}

/* ── Issue detail page ── */
.issue-detail-body {
  display: grid;
  gap: 14px;
}

.issue-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.issue-text {
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.replies-section {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.reply-item {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 13, 18, 0.28);
  padding: 10px;
}

.reply-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.reply-author small {
  color: var(--muted);
  font-size: 12px;
}

.reply-form {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

/* ── Issue list card meta row ── */
.issue-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

/* ── Profile cosmetics ── */
.profile-cosmetic-section {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 13, 18, 0.28);
  padding: 12px;
  display: grid;
  gap: 10px;
}

/* Emoji horizontal scroll list */
.emoji-scroll-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--steel) transparent;
}
.emoji-scroll-list.dragging {
  cursor: grabbing;
  user-select: none;
}
.emoji-scroll-list::-webkit-scrollbar {
  height: 4px;
}
.emoji-scroll-list::-webkit-scrollbar-thumb {
  background: var(--steel);
  border-radius: 4px;
}

.emoji-scroll-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(10, 13, 18, 0.32);
  padding: 10px 12px;
  min-width: 72px;
  transition: border-color 120ms, background 120ms;
}
.emoji-scroll-item.owned {
  border-color: rgba(192, 200, 210, 0.3);
}
.emoji-scroll-item.active {
  border-color: rgba(192, 200, 210, 0.7);
  background: rgba(192, 200, 210, 0.08);
}

.emoji-big {
  font-size: 28px;
  line-height: 1;
}

/* Color picker button + popover */
.color-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-picker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--swatch-bg, #f6f7f8);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-block;
}
.color-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  background: #1a1f28;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  min-width: 220px;
}
.color-popover-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.color-popover-swatch {
  width: 42px;
  height: 42px;
  min-height: unset;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: var(--swatch-bg, #f6f7f8);
  position: relative;
  transition: border-color 120ms, transform 80ms;
}
.color-popover-swatch:hover {
  transform: scale(1.12);
}
.color-popover-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35);
}
.color-popover-swatch.locked {
  opacity: 0.65;
  cursor: pointer;
}
.color-cost-badge {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1f28;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 9px;
  padding: 1px 4px;
  white-space: nowrap;
  color: var(--muted);
  pointer-events: none;
}

/* ── Admin evidence search status badges ── */
.status-ok {
  display: inline-block;
  background: var(--ok-bg);
  border: 1px solid rgba(154, 215, 170, 0.5);
  color: var(--ok);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
}
.status-bad {
  display: inline-block;
  background: var(--danger-bg);
  border: 1px solid rgba(255, 143, 134, 0.5);
  color: var(--danger);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
}
