:root {
  color-scheme: dark;
  --accent: #22d3ee;
  --accent-light: #67e8f9;
  --accent-dark: #0e7490;
  --panel: #0e1822;
  --panel-alt: #0f1b26;
  --deep: #060a0f;
  --border: #1c2e3a;
  --border-light: #294251;
  --text: #f2f8fb;
  --muted: #93a7b6;
  --dim: #687e8e;
  --track: #16232d;
  --danger: #ff5c5c;
  --ok: #4ade80;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }
html { scroll-padding-top: 86px; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 18% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
    linear-gradient(rgba(34, 211, 238, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.025) 1px, transparent 1px),
    var(--deep);
  background-size: auto, 48px 48px, 48px 48px, auto;
  color: var(--text);
  font: 14px/1.55 "Inter", "Segoe UI", system-ui, sans-serif;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: var(--text); }

.top {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 10, 15, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  flex: 0 0 auto;
}

.brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); }
.mark { color: var(--accent); font-size: 11px; letter-spacing: 3px; }
.version { color: var(--dim); font-size: 11px; letter-spacing: 2px; }

.top-nav { display: flex; align-items: center; gap: 24px; flex: 1; min-width: 0; }
.top-nav a {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
  white-space: nowrap;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.top-nav a:hover, .top-nav a.active { color: var(--accent-light); border-bottom-color: rgba(34, 211, 238, 0.4); }
.top-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.top-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 1.4px;
  white-space: nowrap;
}
.top-status:hover { color: var(--accent-light); }
.top-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

@media (max-width: 1180px) {
  .top-nav { gap: 18px; }
  .top-status { display: none; }
}
@media (max-width: 1000px) {
  .top-nav { display: none; }
  .top-status { display: inline-flex; }
}

.nav { display: flex; gap: 22px; flex: 1; }
.nav a {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.6px;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a.active { color: var(--accent-light); border-bottom-color: rgba(34, 211, 238, 0.4); }

.who { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.badge, .pill {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.name { color: var(--text); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; }

.shell { width: min(1440px, calc(100% - 56px)); margin: 0 auto; padding: 42px 0 72px; flex: 1 0 auto; }

.hero { padding: 28px 0 34px; }
.eyebrow, .label {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
h1 { margin: 8px 0 12px; font-size: clamp(28px, 4vw, 46px); line-height: 1.08; font-weight: 600; }
h2 { margin: 6px 0 8px; font-size: 20px; font-weight: 600; }
h3 { margin: 6px 0 6px; font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
.lede { max-width: 720px; color: var(--muted); font-size: 16px; }

.actions, .head-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.12);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.4px;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: rgba(34, 211, 238, 0.22); color: var(--text); }
.button.ghost { border-color: var(--border); background: transparent; color: var(--muted); }
.button.ghost:hover { color: var(--text); border-color: var(--border-light); }
.button.small { padding: 4px 9px; font-size: 11px; }
.button.wide { width: 100%; }
.link {
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  letter-spacing: 1.4px;
  cursor: pointer;
  padding: 0;
}
.link:hover { color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; align-items: start; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .field-row { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, rgba(15, 27, 38, 0.94), rgba(14, 24, 34, 0.94));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}
.card .label { margin-bottom: 10px; }
.media-card { padding: 14px 14px 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); }
.media-placeholder {
  height: 150px;
  border: 1px dashed var(--border-light);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 60%);
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: 2px;
}
.media-placeholder small { color: var(--dim); letter-spacing: 1px; }

.access-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.access-row h3 { color: var(--accent-light); }
@media (max-width: 760px) { .access-row { grid-template-columns: 1fr 1fr; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { font-size: 32px; margin-bottom: 6px; }

.auth { display: grid; grid-template-columns: minmax(0, 520px); gap: 18px; }
.dev { border-color: rgba(255, 92, 92, 0.35); }

.form { display: grid; gap: 12px; margin-top: 14px; }
.form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; letter-spacing: 0.6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #080d12;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.inline-form { display: flex; align-items: end; gap: 10px; margin: 0; }
.inline-form label { flex: 1; }
.inline { display: inline; }

.alert {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--muted);
  background: rgba(15, 27, 38, 0.8);
}
.alert.ok { border-color: rgba(74, 222, 128, 0.4); color: var(--ok); }
.alert.error { border-color: rgba(255, 92, 92, 0.45); color: #ffb4b4; }
.codes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.codes .mono { color: var(--accent-light); }

.list { display: grid; gap: 14px; }
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.row-card > div { min-width: 0; }

.timeline { display: grid; gap: 14px; }

.plans .card { min-height: 160px; }
.plans { align-items: stretch; grid-auto-rows: 1fr; }
.pill { display: inline-block; margin-top: 8px; }

.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  text-align: left;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 8px; border-bottom: 1px solid rgba(28, 46, 58, 0.6); vertical-align: middle; }
.table.compact td, .table.compact th { padding: 6px; }
.table select { width: auto; padding: 4px 6px; }

.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.bio { color: var(--muted); border-left: 2px solid var(--accent-dark); padding-left: 10px; margin-top: 8px; white-space: pre-line; overflow-wrap: anywhere; max-height: 8em; overflow: hidden; }
.profile-row .profile-head { margin-bottom: 0; }
.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin: 4px 0 6px;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 1.4px;
}
.profile-meta a { color: var(--accent-light); letter-spacing: 0; font-size: 14px; }
.avatar-lg, .avatar-sm, .avatar-xl, .avatar-empty {
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #101a23;
  flex: 0 0 auto;
}
.avatar-sm { width: 40px; height: 40px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 112px; height: 112px; }
.avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}
.avatar-sm.avatar-empty { font-size: 14px; }
.avatar-lg.avatar-empty { font-size: 22px; }
.avatar-xl.avatar-empty { font-size: 36px; }

.session-list { display: grid; gap: 8px; margin-bottom: 12px; }
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.session-row p { margin: 2px 0 0; font-size: 11px; }

#network-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
.top, .shell, .status { position: relative; z-index: 1; }

.status {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 1.2px;
  background: #05080b;
  flex: 0 0 auto;
}
.status .right { margin-left: auto; }

@media (max-width: 640px) {
  .status { gap: 10px; font-size: 9px; letter-spacing: 0.8px; padding: 0 14px; }
  .status span:nth-child(2) { display: none; }
}

code { color: var(--accent-light); }

/* --- visual pass 2 --- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 32px;
  align-items: center;
  padding: 34px 0 28px;
}
.hero h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -1.5px; }
.hero .lede { font-size: 17px; }
.small { font-size: 11px; }
.hero-panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  background:
    radial-gradient(420px 220px at 80% -10%, rgba(34, 211, 238, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(15, 27, 38, 0.96), rgba(8, 14, 20, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}
.status-orbit {
  display: flex; align-items: center; gap: 8px; color: var(--accent-light);
  font-size: 10px; letter-spacing: 1.8px; margin-bottom: 18px;
}
.dot, .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 12px rgba(74, 222, 128, 0.8); }
.pulse { animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.hero-metric { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 12px 0; }
.hero-metric strong { font-size: 30px; font-weight: 600; color: var(--accent-light); }
.hero-metric span { color: var(--dim); font-size: 10px; letter-spacing: 1.6px; }
.hero-build { display: flex; justify-content: space-between; margin-top: 16px; gap: 10px; }
.stat-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  margin: 10px 0 24px; background: rgba(8, 14, 20, 0.7);
}
.stat-strip div { padding: 16px 18px; border-right: 1px solid var(--border); }
.stat-strip div:last-child { border-right: 0; }
.stat-strip strong { display: block; font-size: 24px; color: var(--accent-light); }
.stat-strip span { color: var(--dim); font-size: 9px; letter-spacing: 1.8px; }
.feature-card { transition: border-color 120ms ease, transform 120ms ease; }
.feature-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.access-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.access-row h3 { color: var(--accent-light); }
.tier { color: var(--dim); font-size: 9px; letter-spacing: 1.8px; }
.how { margin-top: 24px; }
.how-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.how-grid > div { border-top: 1px solid var(--border); padding-top: 14px; }
.step { color: var(--accent); font-size: 11px; letter-spacing: 1.6px; }
.how-grid h3 { margin-top: 8px; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip div:nth-child(2) { border-right: 0; }
  .stat-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .how-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) { .access-row { grid-template-columns: 1fr 1fr; } }

/* --- app shell --- */
.is-app .shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-top: 28px;
}
.content { min-width: 0; }
.rail {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(10, 17, 24, 0.9);
}
@media (min-width: 901px) {
  .rail {
    max-height: calc(100vh - 198px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}
.rail-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(14, 24, 34, 0.55);
  color: var(--text);
  margin-bottom: 10px;
}
.rail-profile:hover { background: rgba(34, 211, 238, 0.07); border-color: var(--border-light); }
.rail-profile .avatar-md { width: 46px; height: 46px; font-size: 15px; }
.rail-profile-text { display: grid; gap: 3px; min-width: 0; }
.rail-profile strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-profile small { color: var(--dim); font-size: 10px; overflow-wrap: anywhere; }
.rail-profile-meta { display: flex; align-items: center; gap: 7px; margin-top: 1px; }
.rail-tier { color: var(--accent-light); font-size: 9px; letter-spacing: 1.2px; }
.rail-label { color: var(--dim); font-size: 9px; letter-spacing: 1.8px; padding: 12px 8px 4px; }
.rail > a:not(.rail-profile) {
  display: block;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
}
.rail > a:not(.rail-profile):hover,
.rail > a:not(.rail-profile).active { color: var(--text); background: rgba(34, 211, 238, 0.1); }
.rail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding: 12px 8px 2px;
  font-size: 10px;
  letter-spacing: 1px;
}
.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 5px 9px;
  font: inherit;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
}
.avatar-md { width: 36px; height: 36px; font-size: 12px; }
.avatar-md.avatar-empty { display: flex; align-items: center; justify-content: center; color: var(--accent); border-radius: 50%; border: 1px solid var(--border-light); }
@media (max-width: 900px) {
  .is-app .shell { grid-template-columns: 1fr; }
  .rail { display: none; position: static; }
  .rail.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .top-nav { display: none; }
}

.admin-search { min-width: 300px; margin: 0; }
.inline-form.admin-search input { min-width: 220px; }
.table-wrap { overflow-x: auto; }
.actions-cell { min-width: 300px; }
.actions-cell form { margin: 0 4px 6px 0; }
.actions-cell select { width: auto; padding: 4px 6px; display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.check { display: flex !important; align-items: center; gap: 8px; }
.check input { width: auto; }
.admin-inline { margin-top: 8px; }
.admin-inline summary {
  cursor: pointer; color: var(--dim); font-size: 9px; letter-spacing: 1.5px;
  list-style: none;
}
.admin-inline summary::-webkit-details-marker { display: none; }
.admin-inline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.button.danger { border-color: rgba(255, 92, 92, 0.5); color: #ffb4b4; background: rgba(255, 92, 92, 0.08); }

/* --- Confirmation dialog and person cards ------------------------------ */
.person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin: 14px 0;
  background: rgba(8, 13, 18, 0.45);
}
.person-card[hidden] { display: none; }
.confirm-card [hidden] { display: none !important; }
.person-card > div { flex: 1; min-width: 0; }
.person-card .avatar-lg { width: 56px; height: 56px; }
.person-card > div > strong { display: block; font-size: 15px; }
.person-card p { margin: 1px 0 5px; font-size: 11px; }
.person-card .badge-row { margin-bottom: 0; }

.confirm-dialog {
  width: min(460px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
.confirm-dialog::backdrop {
  background: rgba(2, 6, 10, 0.74);
  backdrop-filter: blur(5px);
}
.confirm-card {
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(16, 29, 41, 0.99), rgba(12, 21, 30, 0.99));
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
}
.confirm-card h2 { margin: 4px 0 10px; font-size: 22px; }
.confirm-card #confirm-message { white-space: pre-line; }
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.confirm-actions .button { min-width: 96px; }

/* --- motion polish --- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sheen {
  0%, 100% { opacity: 0.55; transform: translate3d(0, 0, 0); }
  50% { opacity: 0.9; transform: translate3d(0, -6px, 0); }
}
.hero-copy > * { animation: rise 420ms ease both; }
.hero-copy > *:nth-child(2) { animation-delay: 40ms; }
.hero-copy > *:nth-child(3) { animation-delay: 80ms; }
.hero-copy > *:nth-child(4) { animation-delay: 120ms; }
.hero-panel { animation: rise 520ms ease both; }
.card { animation: rise 320ms ease both; }
.grid .card:nth-child(2) { animation-delay: 40ms; }
.grid .card:nth-child(3) { animation-delay: 80ms; }
.grid .card:nth-child(4) { animation-delay: 120ms; }
.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 20% -40% 20%;
  height: 120px;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.22), transparent);
  filter: blur(20px);
  animation: sheen 5s ease-in-out infinite;
  pointer-events: none;
}
.hero-panel { position: relative; overflow: hidden; }
.card { transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22); }
.button { transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(34, 211, 238, 0.14); }
.button:active { transform: translateY(0); }
a { transition: color 120ms ease; }
::selection { background: rgba(34, 211, 238, 0.35); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-panel, .card { animation: none; }
  .hero-panel::after { animation: none; }
}

.announcement {
  width: min(1120px, calc(100% - 48px));
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(15, 27, 38, 0.9));
  padding: 10px 14px;
  position: relative;
  z-index: 2;
}
.announcement strong { display: block; color: var(--accent-light); font-size: 12px; letter-spacing: 0.6px; }
.announcement span { color: var(--muted); font-size: 12px; }
.announcement > div { display: grid; gap: 2px; }

.menu-preview {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 26px;
  align-items: center;
  margin: 10px 0 26px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  background:
    radial-gradient(500px 260px at 90% 0%, rgba(34, 211, 238, 0.13), transparent 65%),
    rgba(8, 14, 20, 0.72);
}
.menu-preview h2 { font-size: 28px; }
.menu-frame {
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  background: #05080b;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.menu-frame:hover {
  transform: translateY(-3px) scale(1.004);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.55), 0 0 40px rgba(34, 211, 238, 0.1);
}
.menu-frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  background: #0b1117;
}
.menu-frame-bar span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #1c2e3a;
}
.menu-frame-bar span:first-child { background: rgba(255, 92, 92, 0.7); }
.menu-frame-bar span:nth-child(2) { background: rgba(251, 191, 36, 0.7); }
.menu-frame-bar span:nth-child(3) { background: rgba(74, 222, 128, 0.7); }
.menu-frame-bar strong {
  margin-left: 8px; color: var(--dim); font-size: 9px; letter-spacing: 1.8px;
}
.menu-frame img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
  .menu-preview { grid-template-columns: 1fr; }
}

/* --- accurate menu mockup --- */
.menu-preview { grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr); }
.menu-frame { max-width: 720px; width: 100%; justify-self: end; }
.mock-menu {
  font-size: 8.5px;
  line-height: 1.35;
  color: #f5f3ff;
  background: #0b0713;
  border-color: #2a2038;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.mock-menu button { font: inherit; color: inherit; }
.mock-top {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 9px;
  border-bottom: 1px solid #2a2038;
  background: #0e0918;
}
.mock-brand { color: #d8b4fe; font-weight: 600; letter-spacing: 0.6px; font-size: 10px; }
.mock-brand small { color: #8d7aa8; font-weight: 400; margin-left: 3px; font-size: 8px; }
.mock-search {
  border: 1px solid #2a2038;
  border-radius: 4px;
  padding: 3px 6px;
  color: #8d7aa8;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 4px;
}
.mock-search kbd { border: 1px solid #3a2d50; border-radius: 3px; padding: 0 3px; font-size: 7px; }
.mock-stats { margin-left: auto; color: #8d7aa8; font-size: 7px; white-space: nowrap; }
.mock-close { color: #b8a6d9; font-size: 14px; margin-left: 4px; }
.mock-tabs {
  display: flex;
  align-items: stretch;
  height: 26px;
  border-bottom: 1px solid #2a2038;
  background: #0d0916;
  padding: 0 6px;
  gap: 2px;
}
.mock-tab {
  border: 0;
  background: transparent;
  color: #8d7aa8;
  font-size: 7.5px;
  letter-spacing: 0.8px;
  padding: 0 7px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.mock-tab:hover { color: #d8b4fe; }
.mock-tab.active { color: #f5f3ff; border-bottom-color: #a78bfa; }
.mock-body { height: 340px; padding: 7px; overflow: hidden; }
.mock-panel { height: 100%; }
.mock-panel[data-mock-panel="home"] { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; }
.mock-card {
  border: 1px solid #2a2038;
  border-radius: 8px;
  background: linear-gradient(180deg, #151020, #110d1b);
  padding: 8px;
  overflow: hidden;
  min-width: 0;
}
.mock-card-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #8d7aa8;
  font-size: 7px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.mock-pill { border: 1px solid #3a2d50; border-radius: 99px; padding: 1px 6px; color: #d8b4fe; font-size: 6.5px; }
.mock-welcome h2 { margin: 2px 0 2px; font-size: 16px; color: #f5f3ff; font-weight: 600; }
.mock-date { color: #8d7aa8; font-size: 7.5px; margin: 0 0 4px; }
.mock-chips { display: flex; gap: 4px; margin-bottom: 4px; }
.mock-chips span { border: 1px solid #3a2d50; border-radius: 4px; padding: 1px 4px; font-size: 6.5px; color: #d8b4fe; }
.mock-days { display: flex; align-items: baseline; gap: 4px; }
.mock-days strong { font-size: 22px; letter-spacing: -0.5px; }
.mock-days span { color: #b8a6d9; font-size: 7.5px; }
.mock-bar { height: 3px; background: #2a2038; border-radius: 3px; margin: 5px 0 3px; overflow: hidden; }
.mock-bar i { display: block; height: 100%; width: 68%; background: linear-gradient(90deg, #7c3aed, #d8b4fe); }
.mock-row { display: flex; justify-content: space-between; gap: 6px; color: #8d7aa8; font-size: 7px; margin: 2px 0; }
.mock-actions { align-items: center; }
.mock-actions button { border: 1px solid #3a2d50; background: transparent; border-radius: 4px; padding: 2px 6px; font-size: 6.5px; color: #d8b4fe; }
.mock-metrics { display: flex; justify-content: space-between; gap: 5px; border-top: 1px solid #2a2038; margin-top: 5px; padding-top: 4px; }
.mock-metrics div { display: grid; gap: 1px; min-width: 0; }
.mock-metrics span { color: #6d6480; font-size: 6px; letter-spacing: 0.6px; }
.mock-metrics strong { font-size: 7px; color: #f5f3ff; font-weight: 500; white-space: nowrap; }
.mock-env { color: #6d6480; font-size: 6.5px; margin: 4px 0 0; }
.mock-card h3 { margin: 0 0 3px; font-size: 11px; font-weight: 500; }
.mock-sub { color: #8d7aa8; font-size: 6.8px; margin: 0 0 4px; }
.mock-setting { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid #231a30; padding: 3px 0; color: #b8a6d9; }
.mock-setting span { display: grid; gap: 0; font-size: 7px; letter-spacing: 0.4px; }
.mock-setting small { color: #6d6480; font-size: 6px; }
.mock-setting b { color: #f5f3ff; font-weight: 500; font-size: 6.8px; white-space: nowrap; }
.mock-seg { display: flex; gap: 2px; }
.mock-seg i, .mock-seg b { border: 1px solid #3a2d50; border-radius: 3px; padding: 1px 3px; font-style: normal; font-size: 6px; }
.mock-seg b { background: #2a1d44; color: #e9d5ff; }
.mock-list { display: grid; gap: 3px; }
.mock-list-row { display: flex; justify-content: space-between; gap: 6px; border-radius: 4px; padding: 3px 5px; color: #8d7aa8; font-size: 7px; }
.mock-list-row.active { background: #1d1430; color: #f5f3ff; }
.mock-list-row i, .mock-status-dot { width: 5px; height: 5px; border-radius: 50%; background: #a78bfa; display: inline-block; margin-right: 4px; }
.mock-selected { color: #6d6480; font-size: 6.5px; margin: 5px 0 4px; }
.mock-button-row { display: flex; gap: 3px; flex-wrap: wrap; }
.mock-button-row button { border: 1px solid #3a2d50; background: transparent; border-radius: 4px; padding: 2px 4px; font-size: 6px; color: #b8a6d9; }
.mock-button-row button.danger { color: #ff9b9b; border-color: #5a2634; }
.mock-changelog p { color: #b8a6d9; font-size: 6.8px; margin: 2px 0 3px; line-height: 1.35; }
.mock-log { display: flex; gap: 3px; align-items: center; margin-top: 2px; }
.mock-tag { border: 1px solid #3a2d50; border-radius: 3px; padding: 0 3px; font-size: 6px; color: #d8b4fe; }
.mock-log .mock-date { margin: 0 0 0 auto; font-size: 6px; }
.mock-build { display: flex; justify-content: space-between; color: #6d6480; font-size: 6px; border-top: 1px solid #2a2038; padding-top: 4px; margin-top: 4px; }
.mock-split { display: grid; grid-template-columns: 38% 62%; height: 100%; gap: 7px; }
.mock-rail { border-right: 1px solid #2a2038; padding-right: 7px; overflow: hidden; }
.mock-rail-title { color: #d8b4fe; font-size: 8px; letter-spacing: 1.2px; padding-bottom: 4px; }
.mock-rail-section { color: #6d6480; font-size: 6px; letter-spacing: 1px; margin: 6px 0 2px; }
.mock-mod { display: flex; justify-content: space-between; gap: 4px; padding: 3px 5px; border-radius: 4px; color: #b8a6d9; font-size: 7px; }
.mock-mod.active { background: #1d1430; color: #f5f3ff; }
.mock-mod b { color: #6d6480; font-size: 6px; }
.mock-mod.active b { color: #a78bfa; }
.mock-detail { padding: 2px 7px 2px 0; }
.mock-detail-head { display: flex; justify-content: space-between; color: #8d7aa8; font-size: 6.5px; letter-spacing: 0.8px; }
.mock-detail h3 { font-size: 15px; margin: 3px 0 3px; }
.mock-detail .mock-sub { margin-bottom: 7px; }
.mock-debug { height: 100%; padding: 14px; }
.mock-debug .mock-setting { padding: 6px 0; }
.mock-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  height: 22px;
  align-items: center;
  padding: 0 9px;
  border-top: 1px solid #2a2038;
  color: #8d7aa8;
  font-size: 6.5px;
  letter-spacing: 0.4px;
  background: #0e0918;
}
.mock-statusbar span:last-child { color: #d8b4fe; }
@media (max-width: 900px) {
  .menu-preview { grid-template-columns: 1fr; }
  .menu-frame { justify-self: stretch; max-width: none; }
  .mock-body { height: 380px; }
}

/* Menu preview layout correction: no overlap, no clipped cards. */
.menu-preview {
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}
.menu-frame {
  width: 100%;
  max-width: none;
  justify-self: stretch;
}
.menu-preview-copy { min-width: 0; }
.mock-body {
  height: auto;
  min-height: 430px;
}
.mock-panel[data-mock-panel="home"] {
  min-height: 430px;
  grid-template-rows: auto auto;
}
.mock-panel:not([data-mock-panel="home"]) { min-height: 340px; }
@media (max-width: 900px) {
  .menu-preview { grid-template-columns: 1fr; }
  .mock-body { min-height: 430px; }
}

/* Utility used across templates. */
.hidden { display: none !important; }

/* Keep the preview readable inside the logged-in content rail. */
.menu-preview { grid-template-columns: 1fr; }
.menu-preview-copy { max-width: 620px; }
.menu-frame { justify-self: stretch; }

.menu-preview h2 { font-size: 24px; margin-bottom: 4px; }
.menu-preview-copy p { font-size: 12px; margin-bottom: 0; }
.menu-preview { margin-bottom: 18px; }

.menu-expand { margin-top: 10px; justify-self: start; }
.mock-body { height: 360px; min-height: 0; overflow: hidden; }
.menu-frame.expanded .mock-body { height: auto; min-height: 430px; }
.menu-frame:not(.expanded) .mock-body {
  mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}

.menu-preview-copy { display: flex; justify-content: space-between; align-items: end; gap: 14px; max-width: none; }
.menu-preview-copy h2 { font-size: 20px; margin: 4px 0 0; }
.menu-expand { margin: 0; }
.mock-body { height: 260px; }
.menu-frame.expanded .mock-body { height: auto; min-height: 430px; }

/* --- Profiles, comments and tickets ------------------------------------- */

.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.badge.tier { color: var(--accent-light); }
.badge.staff { color: var(--accent-light); border-color: var(--accent-dark); background: rgba(14, 116, 144, 0.18); }

.profile-hero { display: grid; gap: 18px; margin-bottom: 18px; }
.profile-hero-main { display: flex; gap: 22px; align-items: flex-start; }
.profile-hero-copy { min-width: 0; }
.profile-hero-copy h2 { margin-top: 0; }
.profile-hero-copy .bio { max-height: none; }
.profile-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 220px at 8% 0%, rgba(34, 211, 238, 0.11), transparent 70%),
    linear-gradient(180deg, rgba(15, 27, 38, 0.96), rgba(14, 24, 34, 0.96));
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.profile-stats > div { display: grid; gap: 4px; min-width: 0; }
.profile-stats strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.profile-stats span { color: var(--dim); font-size: 9px; letter-spacing: 1.6px; }

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.profile-tabs a {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.2px;
}
.profile-tabs a:hover { color: var(--text); border-color: var(--border); }
.profile-tabs a.active {
  color: var(--accent-light);
  border-color: var(--accent-dark);
  background: rgba(34, 211, 238, 0.08);
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.profile-facts > div { display: grid; gap: 2px; min-width: 0; }
.profile-facts span { color: var(--dim); font-size: 9px; letter-spacing: 1.4px; }
.profile-facts strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }

.profile-activity { display: grid; gap: 9px; }
.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(8, 13, 18, 0.45);
  color: var(--text);
}
.activity-row:hover { border-color: var(--border-light); background: rgba(14, 24, 34, 0.75); color: var(--text); }
.activity-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.activity-main small { color: var(--muted); overflow-wrap: anywhere; }

.profile-listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.profile-listing {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 13, 18, 0.45);
  color: var(--text);
}
.profile-listing:hover { border-color: var(--border-light); color: var(--text); }
.profile-listing img { width: 100%; height: 110px; object-fit: cover; background: #101a23; }
.profile-listing-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 60%);
  font-size: 10px;
  letter-spacing: 1.6px;
}
.profile-listing-body { display: grid; gap: 3px; padding: 11px 12px; }
.profile-listing-body small { color: var(--muted); }
.profile-listing-body .muted { font-size: 10px; }

.member-mini-list { display: grid; gap: 7px; margin-top: 12px; }
.member-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 9px;
  color: var(--text);
}
.member-mini:hover { border-color: var(--border-light); color: var(--text); }
.member-mini > span:last-child { display: grid; gap: 1px; min-width: 0; }
.member-mini small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 4px 0 0; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.comment-list { display: grid; gap: 12px; margin-top: 18px; }
.comment {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(8, 13, 18, 0.45);
}
.comment-main { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.comment-body { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }

.ticket-list { display: grid; gap: 12px; }
.ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 120ms ease, background 120ms ease;
}
.ticket-row:hover { border-color: var(--border-light); background: rgba(14, 24, 34, 0.7); color: var(--text); }
.ticket-row h3 { margin: 4px 0 0; }
.ticket-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.ticket-meta > span { overflow-wrap: anywhere; }

.status-open { color: var(--ok); }
.status-closed { color: var(--dim); }

.ticket-thread { display: grid; gap: 12px; margin-bottom: 8px; }
.message {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(8, 13, 18, 0.45);
}
.message.staff { border-color: rgba(34, 211, 238, 0.35); background: rgba(14, 116, 144, 0.10); }
.message-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.message-body { margin: 8px 0 0; white-space: pre-line; overflow-wrap: anywhere; }

.filter-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-tabs a.active { border-color: var(--accent); color: var(--accent-light); background: rgba(34, 211, 238, 0.08); }

.plain-list { margin: 0 0 12px; padding-left: 18px; color: var(--muted); }
.plain-list li { margin-bottom: 6px; }
.empty { padding: 14px 0 4px; }

@media (max-width: 1100px) {
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .profile-hero-main { flex-direction: column; align-items: flex-start; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .profile-listing-grid { grid-template-columns: 1fr; }
  .activity-row { flex-wrap: wrap; }
  .ticket-row { flex-direction: column; align-items: flex-start; }
}

/* --- Store, community and support pages --------------------------------- */

.store-status { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.store-status h2 { margin-bottom: 4px; }

.plan-card { display: flex; flex-direction: column; gap: 6px; }
.plan-card.featured { border-color: rgba(34, 211, 238, 0.45); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 12px 40px rgba(0, 0, 0, 0.25); }
.plan-price { display: flex; align-items: baseline; gap: 8px; }
.plan-price strong { font-size: 30px; font-weight: 600; }
.plan-price span { color: var(--dim); font-size: 11px; letter-spacing: 1px; }
.plan-card .form { margin-top: auto; }

.forum-grid { margin-bottom: 18px; align-items: stretch; }
.forum-grid > .forum-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.forum-card { display: flex; flex-direction: column; gap: 10px; }
.forum-card .button { align-self: flex-start; margin-top: auto; }
.forum-card-meta { display: grid; gap: 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; overflow-wrap: anywhere; }
.forum-card-meta strong { color: var(--text); }

.thread-list { display: grid; gap: 12px; }
.thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 120ms ease, background 120ms ease;
}
.thread-row:hover { border-color: var(--border-light); background: rgba(14, 24, 34, 0.7); color: var(--text); }
.thread-row-main { min-width: 0; }
.thread-row h3 { margin: 4px 0 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; padding-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary::marker { color: var(--accent); }
.faq p { margin: 8px 0 0; color: var(--muted); }

@media (max-width: 760px) {
  .thread-row { flex-direction: column; align-items: flex-start; }
  .store-status { flex-direction: column; align-items: flex-start; }
}

/* --- Member dashboard and global handling ------------------------------- */

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--panel);
  color: var(--accent-light);
  font-size: 12px;
  transition: top 120ms ease;
}
.skip-link:focus { top: 12px; }

main:focus { outline: none; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.who-link { display: flex; align-items: center; gap: 10px; color: inherit; }
.who-link:hover { color: var(--accent-light); }

.dashboard-head { align-items: flex-start; }
.dashboard-who { margin-bottom: 0; }
.dashboard-who h1 { margin: 6px 0 4px; }
.dashboard-note { margin: -6px 0 18px; }

.dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.dashboard-tiles .card { display: flex; flex-direction: column; gap: 6px; }
.dashboard-tiles h2 { font-size: 18px; margin: 2px 0; overflow-wrap: anywhere; }
.dashboard-tiles .button { align-self: flex-start; margin-top: auto; }

.dashboard-grid { margin-bottom: 20px; align-items: stretch; }
.dashboard-grid > .card { display: flex; flex-direction: column; min-width: 0; }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.dashboard-downloads { display: flex; flex-direction: column; gap: 10px; }
.download-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.download-head h2 { margin-top: 0; }

.home-thread {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.home-thread:last-of-type { border-bottom: 0; }
.home-thread:hover { color: var(--accent-light); }

.home-entry { padding: 8px 0; border-bottom: 1px solid var(--border); }
.home-entry:last-of-type { border-bottom: 0; }

.quick-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

@media (max-width: 1000px) {
  .dashboard-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dashboard-tiles { grid-template-columns: 1fr; }
  .dashboard-head { gap: 12px; }
}

/* --- Responsive fit ----------------------------------------------------- */

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); padding: 24px 0 48px; }
  .top { padding: 0 16px; gap: 14px; }
  .card { padding: 18px; }
  .page-head h1 { font-size: 26px; }
  .row-card { flex-direction: column; align-items: flex-start; }
  .row-card > form, .row-card > .button { align-self: flex-start; }
  .avatar-xl { width: 88px; height: 88px; }
  .avatar-lg { width: 56px; height: 56px; }
  .status { padding: 0 16px; }
  .form > .button { width: 100%; }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 24px); padding: 18px 0 40px; }
  .card { padding: 16px; border-radius: 14px; }
  .page-head h1 { font-size: 24px; }
  .top { padding: 0 12px; gap: 10px; }
  .brand .version { display: none; }
  .head-actions { width: 100%; }
  .head-actions .button { flex: 1 1 auto; }
  .quick-actions-row .button { flex: 1 1 auto; }
}

/* --- Account overview --------------------------------------------------- */

.account-layout { display: grid; gap: 20px; margin-bottom: 20px; }
.account-profile { display: flex; flex-direction: column; }
.account-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
.account-tiles > .card { display: flex; flex-direction: column; min-width: 0; }
.account-tiles .card-foot { margin-top: auto; }

@media (max-width: 1280px) {
  .account-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-tiles > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .account-tiles { grid-template-columns: 1fr; }
  .account-tiles > .card:last-child:nth-child(odd) { grid-column: auto; }
}

/* --- Wallet and marketplace --------------------------------------------- */

.market-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.market-new summary { cursor: pointer; color: var(--accent-light); font-size: 10px; letter-spacing: 1.6px; }
.market-new .form { margin-top: 14px; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; margin-bottom: 20px; align-items: stretch; }
.market-card { display: flex; flex-direction: column; gap: 8px; }
.market-card.is-hidden { opacity: 0.7; border-style: dashed; }
.market-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.market-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.market-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .market-grid { grid-template-columns: 1fr; }
}

.rate-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.rate-form label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.rate-form select { width: auto; }

.market-new { margin-bottom: 0; }
.market-grid { margin-top: 32px; }
.market-card-body { display: flex; flex-direction: column; gap: 8px; color: inherit; min-width: 0; }
.market-card-body:hover { color: inherit; }
.market-card-body:hover h2 { color: var(--accent-light); }
.market-desc-full {
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 96ch;
  min-height: 6.5em;
  padding: 2px 0 8px;
  overflow-wrap: anywhere;
}
.market-desc-full .md p { margin-bottom: 0.85em; }
.market-desc-full .md h3, .market-desc-full .md h4 { margin-top: 1.1em; }

.market-own { margin-bottom: 24px; }

.market-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a1117;
}
.market-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.market-gallery figure { margin: 0; display: grid; gap: 8px; }
.market-gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.market-photo-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .market-gallery { grid-template-columns: 1fr 1fr; }
}

/* --- Markdown content ------------------------------------------------- */
.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 0.7em; }
.md h3, .md h4, .md h5 { margin: 1em 0 0.4em; line-height: 1.25; }
.md h3 { font-size: 1.25em; }
.md h4 { font-size: 1.1em; }
.md h5 { font-size: 1em; text-transform: uppercase; letter-spacing: 0.06em; }
.md ul, .md ol { margin: 0 0 0.7em; padding-left: 1.4em; }
.md li { margin: 0.2em 0; }
.md blockquote {
  margin: 0 0 0.7em;
  padding: 0.4em 0.9em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: rgba(34, 211, 238, 0.04);
  border-radius: 0 8px 8px 0;
}
.md code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}
.md pre.md-code {
  margin: 0 0 0.8em;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a1218;
}
.md pre.md-code code { padding: 0; background: none; font-size: 12.5px; line-height: 1.5; }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md img.md-image {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin: 0.5em 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.md-red { color: #f87171; }
.md-amber { color: #fbbf24; }
.md-green { color: #4ade80; }
.md-cyan { color: #22d3ee; }
.md-blue { color: #60a5fa; }
.md-violet { color: #c084fc; }
.md-muted { color: var(--muted); }

/* --- Markdown editor toolbar ------------------------------------------ */
.md-field { display: grid; gap: 6px; }
.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.06);
}
.md-tool {
  min-width: 30px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.md-tool:hover { border-color: var(--border); background: rgba(148, 163, 184, 0.12); }
.md-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.md-color {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 0 4px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.md-color select {
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0b141b;
  color: var(--text);
}
.md-field textarea { border-radius: 9px; }

/* --- Market detail split (description / keybinds) ---------------------- */
.market-detail-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(170px, 22%, 260px);
  gap: 18px;
  align-items: start;
  margin: 14px 0;
}
.market-detail-main { min-width: 0; }
.market-detail-side {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.05);
  position: sticky;
  top: 12px;
  max-height: 70vh;
  overflow: auto;
}
.market-detail-side .label { margin-bottom: 2px; }
.keybind-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.keybind-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 12.5px;
}
.keybind-list li:last-child { border-bottom: none; }
.keybind-list span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keybind-list kbd {
  flex: none;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #0b141b;
  color: var(--text);
}
@media (max-width: 900px) {
  .market-detail-split { grid-template-columns: minmax(0, 1fr); }
  .market-detail-side { position: static; max-height: none; }
}

/* Staff panels: shared chips, tabs and stat cards for /mod and /admin. */
.staff-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card h2 { font-size: 30px; margin: 2px 0 4px; line-height: 1.1; }
.staff-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.staff-tabs a {
  padding: 7px 12px; border: 1px solid transparent; border-radius: 6px;
  color: var(--muted); font-size: 11px; letter-spacing: 1.2px;
}
.staff-tabs a:hover { color: var(--text); border-color: var(--border); }
.staff-tabs a.active {
  color: var(--accent-light); border-color: var(--accent-dark);
  background: rgba(34, 211, 238, 0.08);
}
.badge.state-active { color: var(--ok); border-color: rgba(74, 222, 128, 0.45); }
.badge.state-watch { color: #fbbf24; border-color: rgba(251, 191, 36, 0.45); }
.badge.state-restricted { color: #fb923c; border-color: rgba(251, 146, 60, 0.5); }
.badge.state-frozen { color: #a5b4fc; border-color: rgba(165, 180, 252, 0.5); }
.badge.state-banned { color: #ffb4b4; border-color: rgba(255, 92, 92, 0.55); }
.badge.sev-note { color: var(--muted); }
.badge.sev-watch { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.badge.sev-flag { color: #fb923c; border-color: rgba(251, 146, 60, 0.45); }
.badge.sev-critical { color: #ffb4b4; border-color: rgba(255, 92, 92, 0.55); }
.staff-rules { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 7px; }
.staff-user { align-items: flex-start; }
.staff-user .badge-row { margin: 10px 0; }
.wrap { max-width: 360px; white-space: normal; word-break: break-word; }
@media (max-width: 900px) { .staff-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .staff-stats { grid-template-columns: 1fr; } .wrap { max-width: none; } }

/* --- Comment replies and votes ---------------------------------------- */
.comment-bar { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.vote:hover { border-color: var(--border-light); color: var(--text); }
.vote:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.vote.is-on { border-color: var(--accent); color: var(--accent); background: rgba(34, 211, 238, 0.1); }
.vote.down.is-on { border-color: var(--danger); color: var(--danger); background: rgba(255, 92, 92, 0.08); }
.vote.static { cursor: default; }
.comment-reply { margin-left: auto; }
.comment-reply summary {
  cursor: pointer;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  list-style: none;
}
.comment-reply summary::-webkit-details-marker { display: none; }
.comment-reply summary:hover { color: var(--text); }
.comment-reply[open] summary { color: var(--accent); }
.comment-reply form { margin-top: 8px; }
.comment-replies {
  flex: 1 0 100%;
  display: grid;
  gap: 10px;
  margin: 4px 0 0 14px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.comment.reply { background: rgba(148, 163, 184, 0.04); }
.comment.reply .comment-meta .pill { font-size: 9.5px; padding: 1px 6px; }
@media (max-width: 640px) {
  .comment-replies { margin-left: 4px; padding-left: 8px; }
}

/* --- 2.2 wide-screen scale pass ---------------------------------------
   The first pass was tuned against a ~1000px preview pane. In a real
   window that read as shrunken: the shell stopped at 1440px, body type
   sat at 14px, and every section owned its own vertical margin. This
   block makes the layout use the window, gives the type a readable
   floor, and lets one flow gap own the vertical rhythm. */

:root {
  --sheet: 1760px;
  --flow: 22px;
}

body { font-size: 16px; }

.shell { width: min(var(--sheet), calc(100% - 64px)); }

.is-app .shell {
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 30px;
}

/* One rhythm for the content column. Section margins are zeroed so the
   gap alone decides the distance between every block. */
.content { display: flex; flex-direction: column; gap: var(--flow); }
.content > * { margin-bottom: 0; }

/* Type scale floor */
h2 { font-size: 23px; }
h3 { font-size: 16.5px; }
.label, .eyebrow { font-size: 11px; }
.small, .muted.small { font-size: 12px; }
.lede { font-size: 17px; }
.top-nav a, .nav a { font-size: 11px; }
.top-status { font-size: 10.5px; }
.button { font-size: 13px; }
.button.small { font-size: 11.5px; }
.link { font-size: 10.5px; }
.table { font-size: 13px; }
.table th { font-size: 11px; }
.rail > a:not(.rail-profile) { font-size: 13.5px; }
.rail-profile strong { font-size: 14px; }
.rail-profile small { font-size: 11px; }
.rail-label, .rail-tier { font-size: 10px; }
.profile-facts strong { font-size: 14px; }
.staff-tabs a, .profile-tabs a { font-size: 11.5px; }

/* Tabs already sit in the content gap; their own bottom margin doubled it. */
.staff-tabs, .profile-tabs { margin-bottom: 0; }

/* A page head can carry a search box plus a dozen admin links. Let it wrap
   instead of pushing the dashboard sideways on a narrow window. */
.page-head { flex-wrap: wrap; }

/* Community facts are links: the whole cell is the target. */
.profile-facts a {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--text);
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
}
.profile-facts a:hover { background: rgba(34, 211, 238, 0.07); }
.profile-facts a span { color: var(--dim); }
.profile-facts strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Overlapping avatars for "members invited" and similar counts. */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack > * + * { margin-left: -8px; }
.avatar-xs {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--panel);
  background: #101a23;
  object-fit: cover;
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-more { background: var(--track); color: var(--muted); letter-spacing: 0; }

/* The shared .pill has a top margin for standalone use; inside a meta row it
   pushed the staff chip off the text baseline. */
.comment-meta .pill { margin-top: 0; }
.comment-bar .comment-reply { margin-left: 0; }
.comment-bar form.inline { margin-left: auto; }
.comment-replies .comment.reply { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }

/* Fluid card grids: cards take the columns the window can hold instead of
   forcing a fixed pair. Taller neighbours no longer leave a hole because
   rows stretch to the tallest card in the row. */
.grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: var(--flow);
  align-items: stretch;
}
.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.staff-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 132px;
  padding: 22px 24px;
}
.stat-card h2 { font-size: clamp(30px, 2.6vw, 42px); margin: 4px 0 6px; }
.stat-card .label { font-size: 11px; }

/* Admin accounts: the bulk toolbar belongs to the table it acts on. */
.bulk-search { margin: 0 0 12px; }
.bulk-search label { flex: 1; }
.bulk-bar {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 13, 18, 0.55);
}
.bulk-bar label { font-size: 11px; }
.bulk-bar select { width: auto; min-width: 170px; }

@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
  .staff-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}
.admin-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Legal pages: long-form prose inside one card. */
.legal { max-width: 980px; }
.legal h2 { margin-top: 28px; font-size: 19px; }
.legal h2:first-of-type { margin-top: 8px; }
.legal p, .legal li { color: var(--muted); }
.legal p { line-height: 1.65; }
.legal ul { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.legal strong { color: var(--text); }
.legal code { color: var(--accent-light); }
.legal-links { display: inline-flex; gap: 12px; }
.legal-links a { color: var(--dim); }
.legal-links a:hover { color: var(--accent-light); }

/* The dashboard is a 2x2 wall: downloads next to community, changelog next
   to invites. Letting auto-fit make three columns left the fourth card
   alone on a row, which read as a hole at desktop widths. */
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .dashboard-grid { grid-template-columns: 1fr; } }

.profile-actions { justify-content: flex-end; }
.equal-row { align-items: stretch; }
.profile-actions .head-actions { margin-left: auto; }

/* The ABOUT / COMMUNITY pair is a fixed two-card row: their content is short
   and different, and an uneven row read as a mistake. */
.profile-equal { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 760px) { .profile-equal { grid-template-columns: 1fr; } }

.notification-head .pill { margin-top: 0; }

.field-label { color: var(--muted); font-size: 12px; letter-spacing: 0.6px; }

.notif-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.9);
}
.notif-dot[hidden] { display: none; }

/* Badges sit over banners and photos, so they need their own dark plate. */
.profile-hero .badge,
.profile-hero .pill {
  background: rgba(6, 10, 15, 0.72);
  border-color: rgba(41, 66, 81, 0.9);
  backdrop-filter: blur(6px);
}

/* Banner sits inside the hero card, edge to edge. The bottom fades into the
   card, and the avatar overlaps it so the two read as one header. */
.profile-banner {
  position: relative;
  margin: -24px -24px 0;
  height: 170px;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.25), rgba(167, 139, 250, 0.2));
}
.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(14, 24, 34, 0) 46%,
    rgba(14, 24, 34, 0.72) 82%,
    #0e1822 100%
  );
}
.profile-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-hero.has-banner .profile-hero-main { margin-top: -58px; position: relative; z-index: 1; }
.profile-hero.has-banner .profile-hero-main .avatar-xl,
.profile-hero.has-banner .profile-hero-main .avatar-empty {
  box-shadow: 0 0 0 4px #0e1822, 0 14px 34px rgba(0, 0, 0, 0.45);
}
.profile-banner-preview { width: 100%; max-height: 96px; object-fit: cover; border: 1px solid var(--border); border-radius: 10px; }

.profile-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-name-row h2 { margin: 0; }
.profile-note {
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  color: var(--accent-light);
  font-size: 13.5px;
}
/* The hero bio is a paragraph under the name, not a quote block. */
.profile-hero-copy .bio { border-left: 0; padding-left: 0; }

/* Admin-gated name styles. Preset classes keep the CSP happy. */
.profile-name.tint-cyan { color: #67e8f9; }
.profile-name.tint-gold { color: #fbbf24; }
.profile-name.tint-rose { color: #fb7185; }
.profile-name.tint-violet { color: #a78bfa; }
.profile-name.animated {
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6, #22d3ee);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: nameflow 6s linear infinite;
}
@keyframes nameflow { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) {
  .profile-name.animated { animation: none; }
}

a.mention {
  color: var(--accent-light);
  background: rgba(34, 211, 238, 0.1);
  border-radius: 5px;
  padding: 0 3px;
}
a.mention:hover { color: var(--text); background: rgba(34, 211, 238, 0.2); }

.notification { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.notification.unread { border-color: var(--border-light); box-shadow: inset 3px 0 0 var(--accent); }
.notification-main { min-width: 0; }
.notification-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.notification h3 { margin: 0 0 4px; }
.notification h3 a { color: var(--text); }
.notification h3 a:hover { color: var(--accent-light); }
.notification p { margin: 0; font-size: 13.5px; }
.notify-prefs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.notify-pref { align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.notify-pref input { width: auto; margin-top: 2px; }
.notify-pref span { display: grid; gap: 2px; }
.notify-pref small { font-size: 12px; letter-spacing: 0; }

.thread-votes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.thread-votes .vote { min-width: 34px; height: 30px; font-size: 15px; font-weight: 600; }
.thread-score {
  min-width: 44px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.thread-score.is-pos { color: var(--ok); }
.thread-score.is-neg { color: var(--danger); }

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .grid, .admin-grid, .staff-stats { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}


/* Marketplace polish: covers keep a consistent frame and the price leads. */
.market-card { padding: 18px; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.market-card:hover { transform: translateY(-2px); border-color: var(--border-light); box-shadow: 0 16px 36px rgba(0,0,0,0.22); }
.market-cover { aspect-ratio: 16 / 9; height: auto; width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.market-price { font-size: 20px; color: var(--accent-light); letter-spacing: 0.4px; }
.market-card h2 { font-size: 20px; line-height: 1.25; }
.market-toolbar .filter-tabs .pill { cursor: pointer; padding: 6px 12px; }
.market-toolbar .filter-tabs .pill.active { color: var(--deep); background: var(--accent); border-color: var(--accent); }

/* Selects get a proper chevron instead of the platform arrow. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2367e8f9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px 8px;
}
select:hover { border-color: var(--border-light); }
select:disabled { color: var(--dim); background-image: none; }

.referral-card .codes { align-items: center; }
.referral-card .codes .mono { overflow-wrap: anywhere; }
