/* Onyx: dark, minimal. State colours match the Discord bot (discord/src/ui/constants.js). */
:root {
  --bg: #0a0a0c;
  --surface: #131317;
  --surface-2: #1a1a20;
  --border: #26262e;
  --text: #ececf1;
  --muted: #9a9aa8;
  --accent: #8b7cf6;
  --accent-strong: #a597ff;
  --focus: #c4baff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.6 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}
a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--focus);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.2;
  margin: 0.4rem 0 0.6rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.15rem;
  margin: 0 0 0.8rem;
}
h3 {
  font-size: 1rem;
  margin: 1.2rem 0 0.4rem;
  color: var(--muted);
  font-weight: 600;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
.break {
  word-break: break-all;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.86rem;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}

/* Layout */
.site-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.9);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 5;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  font-size: 1.1rem;
}
.brand-mark {
  display: block;
}
.hero-logo {
  display: block;
  margin-bottom: 1.2rem;
}
.main-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  align-items: center;
}
.main-nav a:not(.button) {
  color: var(--muted);
  text-decoration: none;
}
.main-nav a[aria-current='page'],
.main-nav a:not(.button):hover {
  color: var(--text);
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.8rem 1.5rem 3rem;
}
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
}
.site-footer a {
  color: var(--muted);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  margin: 0;
}
.grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin: 1.2rem 0;
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid .card {
  margin: 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  margin: 1.2rem 0;
}
.card-accent {
  border-color: #3b3366;
  box-shadow: inset 3px 0 0 var(--accent);
}
.row-card {
  border-top: 1px solid var(--border);
  padding: 0.9rem 0;
}
.row-card:first-of-type {
  border-top: 0;
}
.row-card p {
  margin: 0.2rem 0;
}

/* Hero */
.hero {
  padding: 2.5rem 0 1.5rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0.4rem 0 1rem;
}
.lead {
  color: var(--muted);
  max-width: 62ch;
  font-size: 1.08rem;
}

/* Buttons and forms */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 9px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  font: inherit;
  font-weight: 550;
}
.button:hover {
  border-color: #3a3a46;
  color: var(--text);
}
.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0b0d;
}
.button-primary:hover {
  background: var(--accent-strong);
  color: #0b0b0d;
}
.button-success {
  background: #14361f;
  border-color: #1f6b3a;
  color: #bff3cf;
}
.button-danger {
  background: #3a1515;
  border-color: #7a2626;
  color: #ffd0d0;
}
.button-secondary {
  background: var(--surface-2);
}
.link-button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.link-button:hover {
  color: var(--text);
}
.inline-form {
  display: inline;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
  margin: 0.6rem 0;
}
.action-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 220px;
  flex: 1 1 260px;
  max-width: 520px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.inline-grow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.inline-grow input:not([type='checkbox']) {
  flex: 1 1 260px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.93rem;
}
label.check,
label.radio {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: #0e0e12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
}
textarea {
  resize: vertical;
}
fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
legend {
  color: var(--muted);
  padding: 0 0.3rem;
  font-size: 0.9rem;
}
.warning {
  background: #2a1a08;
  border: 1px solid #6b4513;
  color: #ffe2b8;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin: 0;
}

/* Data */
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.2rem;
  margin: 0;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.table th,
.table td {
  text-align: left;
  padding: 0.6rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}
.table tr.stuck td {
  background: #241a08;
}
.clip {
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
}
.stat-label {
  color: var(--muted);
  font-size: 0.88rem;
}
.chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chips li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.9rem;
}
.details {
  background: #0e0e12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  font-size: 0.82rem;
  overflow: auto;
  max-height: 12rem;
}
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin-bottom: 1rem;
}
.subnav a {
  color: var(--muted);
  text-decoration: none;
}
.subnav a[aria-current='page'] {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}

/* Deal */
.deposit {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.deposit img {
  background: #fff;
  border-radius: 10px;
  padding: 6px;
}
.address {
  font-size: 1rem;
  background: #0e0e12;
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--border);
}
.timeline li {
  padding: 0.35rem 0 0.35rem 1rem;
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0.85rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-right: 0.5rem;
}
.statement {
  border-left: 3px solid var(--border);
  padding-left: 0.9rem;
  margin: 0.8rem 0;
}
blockquote {
  margin: 0;
  border-left: 3px solid var(--accent);
  padding: 0.3rem 0.9rem;
  color: var(--text);
}
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.steps p {
  color: var(--muted);
  margin: 0;
}
.formula {
  font-size: 1.1rem;
  background: #0e0e12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
}
.checklist {
  padding-left: 1.2rem;
}
.profile {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}
.avatar {
  border-radius: 50%;
}

/* Badges, states, flash */
.badge {
  font-size: 0.75rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge-admin {
  color: var(--accent-strong);
  border-color: #3b3366;
  background: rgba(139, 124, 246, 0.12);
  font-weight: 600;
  vertical-align: middle;
}
h1 .badge {
  font-size: 0.85rem;
}
.badge-testnet {
  color: #f5c26b;
  border-color: #5a4720;
}
.state {
  font-size: 0.82rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #222229;
  border: 1px solid transparent;
  white-space: nowrap;
}
.state-draft {
  color: #9ca3af;
}
.state-awaiting-acceptance {
  color: #b3a8ff;
  border-color: #3b3366;
}
.state-accepted {
  color: #a78bfa;
  border-color: #3d2a6b;
}
.state-awaiting-deposit {
  color: #fbbf24;
  border-color: #5a4720;
}
.state-underfunded {
  color: #fb923c;
  border-color: #5c3417;
}
.state-funded {
  color: #60a5fa;
  border-color: #1e3a5f;
}
.state-item-delivered {
  color: #22d3ee;
  border-color: #164e57;
}
.state-release-pending {
  color: #2dd4bf;
  border-color: #134e48;
}
.state-released {
  color: #34d399;
  border-color: #14533d;
}
.state-completed {
  color: #4ade80;
  border-color: #14532d;
}
.state-disputed {
  color: #f87171;
  border-color: #6b1f1f;
}
.state-refund-pending {
  color: #facc15;
  border-color: #5a4d10;
}
.state-refunded {
  color: #a3e635;
  border-color: #3f5a12;
}
.state-cancelled,
.state-expired {
  color: #9ca3af;
}
.flash {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.flash-success {
  background: #0f2a18;
  border-color: #1f6b3a;
  color: #c6f6d5;
}
.flash-error {
  background: #2e1111;
  border-color: #7a2626;
  color: #ffd6d6;
}
.flash-info {
  background: #17142b;
  border-color: #3b3366;
}
.alert-critical {
  box-shadow: inset 3px 0 0 var(--danger);
  padding-left: 0.8rem;
}
.alert-warning {
  box-shadow: inset 3px 0 0 var(--warning);
  padding-left: 0.8rem;
}

/* Legal templates */
.legal {
  max-width: 75ch;
}
.legal h2 {
  margin-top: 1.8rem;
}
.template-warning {
  background: #2a1a08;
  border: 1px solid #6b4513;
  color: #ffe2b8;
  padding: 0.8rem 1rem;
  border-radius: 10px;
}
mark {
  background: #4a3a10;
  color: #ffe9a8;
  padding: 0 0.25rem;
  border-radius: 4px;
}

@media (max-width: 640px) {
  main {
    padding: 1.2rem 1rem 2rem;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .kv dd {
    margin-bottom: 0.5rem;
  }
  .table {
    display: block;
    overflow-x: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    transition: none !important;
  }
}

/* Reviews and profiles */
.stars {
  color: #fbbf24;
  letter-spacing: 0.08em;
}
.rating {
  margin: 0.3rem 0;
}
/* Banners: always a 3:1 frame (recommended 1500 × 500), any image is cropped to it from the centre.
   On the profile it spans the card edge to edge and fades into the card at the bottom. */
.banner {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  background: var(--surface-2);
}
.profile-head {
  overflow: hidden;
}
.profile-head .banner {
  width: calc(100% + 3rem);
  max-width: none;
  margin: -1.3rem -1.5rem 0;
  border-radius: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.profile-head .profile {
  flex-wrap: wrap;
}
.profile-head.has-banner .profile {
  position: relative;
  margin-top: -3.5rem;
}
@media (max-width: 600px) {
  .profile-head.has-banner .profile {
    margin-top: -1.5rem;
  }
}
.profile-head.has-banner .avatar {
  border: 4px solid var(--surface);
  background: var(--surface);
}
.profile-head .profile .button {
  margin-left: auto;
}
.bio {
  margin: 1rem 0 0;
}
.review {
  border-top: 1px solid var(--border);
  padding: 0.9rem 0;
}
.review p {
  margin: 0.3rem 0;
}
.reply {
  margin: 0.5rem 0 0 1rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--accent);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.8rem;
}
.filters input {
  flex: 1 1 220px;
}
.filters label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}
.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}
.star-input {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.8rem;
}
details.card summary {
  cursor: pointer;
  color: var(--muted);
}
.permission-group {
  display: grid;
  gap: 0.35rem;
}
.badge-verified {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.12);
}
.badge-blacklisted {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.12);
}

/* ==============================================================================================
   Theme v2: Geist type, depth, motion. Layered over the base styles above (same class names).
   ============================================================================================== */
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/static/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #09090d;
  --surface: #111117;
  --surface-2: #17171f;
  --surface-3: #1e1e28;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #ededf3;
  --muted: #9a9aab;
  --faint: #6b6b7c;
  --accent-soft: rgba(139, 124, 246, 0.14);
  --accent-line: rgba(139, 124, 246, 0.38);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -28px rgba(8, 6, 28, 0.9);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 60px -26px rgba(30, 20, 90, 0.75);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --z-header: 20;
  --z-menu: 30;
  --z-grain: 40;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(139, 124, 246, 0.13), transparent 62%),
    radial-gradient(760px 460px at -12% 6%, rgba(92, 78, 210, 0.08), transparent 60%), var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
/* Fine grain so large dark areas do not look flat. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection {
  background: rgba(139, 124, 246, 0.35);
}
h1,
h2,
h3 {
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
h2 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
p,
li {
  text-wrap: pretty;
}
strong {
  font-weight: 600;
}
a {
  transition: color 160ms var(--ease);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}
.mono,
code,
.kv dd,
.table td,
.stat-value,
.timeline time {
  font-variant-numeric: tabular-nums;
}

/* Header */
.site-header {
  padding: 0.75rem max(1.5rem, calc((100vw - 1180px) / 2));
  background: rgba(9, 9, 13, 0.72);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
}
.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand-mark {
  filter: drop-shadow(0 4px 14px rgba(139, 124, 246, 0.45));
}
.main-nav {
  gap: 0.25rem;
}
.main-nav > a:not(.button),
.menu > summary {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition:
    color 160ms var(--ease),
    background 160ms var(--ease);
}
.main-nav > a:not(.button):hover,
.menu > summary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.main-nav > a[aria-current='page'],
.menu > summary[aria-current='page'] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--border);
}
.menu {
  position: relative;
}
.menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  user-select: none;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu > summary::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms var(--ease);
  opacity: 0.7;
}
.menu[open] > summary::after {
  transform: translateY(1px) rotate(-135deg);
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 13rem;
  display: flex;
  flex-direction: column;
  padding: 0.4rem;
  background: rgba(20, 20, 28, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.75);
  z-index: var(--z-menu);
  animation: menu-in 160ms var(--ease);
}
.menu-panel a,
.menu-panel .link-button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
}
.menu-panel a:hover,
.menu-panel .link-button:hover,
.menu-panel a[aria-current='page'] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.menu-panel form {
  display: block;
  border-top: 1px solid var(--border);
  margin-top: 0.3rem;
  padding-top: 0.3rem;
}
.menu-panel .badge {
  margin: 0.2rem 0.3rem 0.3rem 0.7rem;
}
.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.nav-avatar-empty {
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.nav-name {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

/* Page frame */
main {
  max-width: 1180px;
  width: 100%;
  padding: 2.4rem 1.5rem 4rem;
  flex: 1 0 auto;
}
.site-footer {
  max-width: 1180px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding: 2.2rem 1.5rem 2.6rem;
  border-top: 1px solid var(--border);
}
.footer-brand {
  max-width: 46ch;
}
.footer-brand p {
  margin: 0.6rem 0 0;
  line-height: 1.6;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  align-items: flex-start;
}
.footer-links a {
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--text);
}

/* Surfaces */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008) 40%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem 1.55rem;
}
.card-accent {
  border-color: var(--accent-line);
  box-shadow:
    inset 3px 0 0 var(--accent),
    var(--shadow);
}
.grid {
  gap: 1rem;
}
.callout {
  border-color: rgba(245, 158, 11, 0.22);
  background: radial-gradient(500px 160px at 0% 0%, rgba(245, 158, 11, 0.07), transparent 70%), var(--surface);
}

/* Buttons */
.button {
  border-radius: var(--radius-sm);
  font-weight: 560;
  padding: 0.58rem 1.1rem;
  background: var(--surface-2);
  border-color: var(--border-strong);
  transition:
    transform 160ms var(--ease),
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    color 160ms var(--ease);
}
.button:hover {
  transform: translateY(-1px);
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.2);
}
.button:active {
  transform: translateY(0) scale(0.98);
}
.button-primary {
  color: #0c0a1a;
  border-color: transparent;
  background: linear-gradient(180deg, #a092ff, #8572f3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 10px 26px -12px rgba(139, 124, 246, 0.75);
}
.button-primary:hover {
  color: #0c0a1a;
  border-color: transparent;
  background: linear-gradient(180deg, #ada1ff, #9180f7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 14px 32px -12px rgba(139, 124, 246, 0.85);
}
.button-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bdf5d0;
}
.button-success:hover {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.55);
}
.button-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ffd2d2;
}
.button-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
}
.button-ghost {
  background: transparent;
  border-color: var(--border-strong);
}
.button-lg {
  padding: 0.75rem 1.35rem;
  font-size: 1rem;
  border-radius: 12px;
}
.text-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 560;
}
.text-link:hover {
  color: var(--focus);
}
.link-button {
  transition: color 160ms var(--ease);
}

/* Forms */
input,
select,
textarea {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.75rem;
  transition:
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    background 160ms var(--ease);
}
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: rgba(255, 255, 255, 0.035);
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}
fieldset {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
}

/* Data */
.table {
  border-collapse: separate;
  border-spacing: 0;
}
.table th {
  font-weight: 560;
  font-size: 0.8rem;
  color: var(--faint);
  letter-spacing: 0.01em;
  border-bottom-color: var(--border-strong);
}
.table td {
  border-bottom-color: var(--border);
  transition: background 120ms var(--ease);
}
.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.022);
}
.kv {
  gap: 0.55rem 1.4rem;
}
.kv dt {
  color: var(--faint);
}
.stat {
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--surface);
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 1.9rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.badge {
  border-radius: 6px;
  font-weight: 560;
  letter-spacing: 0.01em;
  border-color: var(--border-strong);
}
.state {
  border-radius: 7px;
  font-weight: 560;
  background: rgba(255, 255, 255, 0.04);
}
.subnav {
  gap: 0.25rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.subnav a {
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.subnav a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-bottom: 0;
}
.flash {
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.avatar {
  border-radius: 22%;
}

/* Landing */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: center;
  padding: 3.5rem 0 3rem;
}
.hero-split h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
  margin: 1rem 0 1.2rem;
}
.accent-text {
  background: linear-gradient(100deg, #c7beff, #8b7cf6 55%, #6f5df0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-split .lead {
  font-size: 1.12rem;
  max-width: 54ch;
  line-height: 1.7;
}
.hero-split .actions {
  margin-top: 1.6rem;
  gap: 0.7rem;
}
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.eyebrow-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15);
}
.trust-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  padding: 0;
  margin: 1.8rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.trust-row li::before {
  content: '';
  display: inline-block;
  width: 0.55rem;
  height: 0.3rem;
  margin-right: 0.5rem;
  border-left: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: translateY(-3px) rotate(-45deg);
}
.hero-visual {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
}
.hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 124, 246, 0.32), rgba(139, 124, 246, 0.06) 45%, transparent 70%);
  filter: blur(10px);
}
.hero-mark {
  position: absolute;
  top: -0.5rem;
  right: 1.5rem;
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 18px 40px rgba(139, 124, 246, 0.55));
  transform: rotate(8deg);
}
.mock-deal {
  position: relative;
  width: min(100%, 360px);
  padding: 1.2rem 1.3rem 1.3rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)), rgba(17, 17, 23, 0.82);
  border: 1px solid var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 40px 80px -30px rgba(20, 12, 70, 0.9);
  backdrop-filter: blur(10px);
  transform: rotate(-2deg);
}
.mock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}
.mock-title {
  font-size: 1.15rem;
  font-weight: 620;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 0.9rem;
}
.mock-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.88rem;
}
.mock-steps li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-left: 1.4rem;
  position: relative;
  color: var(--faint);
}
.mock-steps li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.42rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
}
.mock-steps li.done {
  color: var(--text);
}
.mock-steps li.done::before {
  border-color: #4ade80;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}
.mock-steps li.now {
  color: var(--text);
}
.mock-steps li.now::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s var(--ease) infinite;
}
.mock-bar {
  margin-top: 1.1rem;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.mock-bar span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ade80, var(--accent));
}
.bento {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}
.bento .card {
  margin: 0;
  transition:
    transform 220ms var(--ease),
    box-shadow 220ms var(--ease),
    border-color 220ms var(--ease);
}
.bento .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.bento-main {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  padding: 1.8rem 1.9rem 2rem;
  background: radial-gradient(420px 220px at 100% 0%, rgba(139, 124, 246, 0.12), transparent 70%), var(--surface);
}
.bento-main h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0.3rem 0 0.8rem;
  max-width: 18ch;
}
.bento-main .muted {
  max-width: 52ch;
}
.bento-kicker {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 560;
  color: var(--accent-strong);
}
.bento-number {
  font-size: 2.1rem;
  font-weight: 680;
  letter-spacing: -0.04em;
  margin: 0.35rem 0 0.4rem;
  font-variant-numeric: tabular-nums;
}
.bento-number span {
  color: var(--faint);
  font-weight: 400;
}
.flow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 1.6rem;
}
.flow-node {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
  font-weight: 560;
  white-space: nowrap;
}
.flow-node-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: 0 10px 30px -12px rgba(139, 124, 246, 0.6);
}
.flow-line {
  flex: 1;
  height: 1px;
  min-width: 1.2rem;
  background: repeating-linear-gradient(90deg, var(--accent-line) 0 6px, transparent 6px 11px);
}

/* Motion: content rises in once; off when the system asks for less motion. */
@media (prefers-reduced-motion: no-preference) {
  main > * {
    animation: rise 520ms var(--ease) both;
  }
  main > *:nth-child(2) {
    animation-delay: 60ms;
  }
  main > *:nth-child(3) {
    animation-delay: 120ms;
  }
  main > *:nth-child(4) {
    animation-delay: 180ms;
  }
  main > *:nth-child(n + 5) {
    animation-delay: 220ms;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(139, 124, 246, 0.05);
  }
}

/* Small screens */
@media (max-width: 860px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2rem;
  }
  .hero-visual {
    min-height: 300px;
  }
  .bento {
    grid-template-columns: 1fr;
  }
  .bento-main {
    grid-row: auto;
  }
  .nav-name {
    display: none;
  }
}
@media (max-width: 560px) {
  .site-header {
    padding-inline: 1rem;
  }
  main {
    padding-inline: 1rem;
  }
  .card {
    padding: 1.15rem 1.15rem 1.3rem;
  }
  .flow {
    flex-wrap: wrap;
  }
  .hero-mark {
    width: 72px;
    height: 72px;
    right: 0.5rem;
  }
}

/* Theme v2: fixes after review */
html,
body {
  overflow-x: clip; /* decorative glows never widen the page on phones */
}
.hero-split {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
}
.hero-split h1 {
  font-size: clamp(2.4rem, 5.2vw, 4rem);
}
.hero-glow {
  width: min(420px, 100%);
  height: min(420px, 100vw);
}
.stack > .button,
.stack > button {
  align-self: flex-start;
}
@media (max-width: 560px) {
  .main-nav .button {
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
  }
  .mock-deal {
    transform: none;
  }
}
@media (max-width: 860px) {
  .hero-split {
    grid-template-columns: 1fr;
  }
}

/* Theme v2: layout fixes and finishing touches */
.site-header,
main,
.site-footer {
  min-width: 0; /* flex children of <body>: never wider than the screen */
}
@media (max-width: 860px) {
  .hero-split,
  .bento {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .flow-line {
    min-width: 0.6rem;
  }
  .table-wrap {
    overflow-x: auto;
  }
}
/* Expandable sections (Edit, filters): a real control instead of a bare triangle. */
details:not(.menu) > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  font-weight: 560;
  transition:
    background 160ms var(--ease),
    border-color 160ms var(--ease);
}
details:not(.menu) > summary::-webkit-details-marker {
  display: none;
}
details:not(.menu) > summary::before {
  content: '';
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms var(--ease);
}
details:not(.menu)[open] > summary::before {
  transform: rotate(45deg);
}
details:not(.menu) > summary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}
details:not(.menu)[open] > summary {
  margin-bottom: 0.9rem;
}
/* Tables inside cards breathe like the rest of the card. */
.table-wrap {
  padding: 0.4rem 0.6rem;
}
.table-wrap .table td,
.table-wrap .table th {
  padding-inline: 0.9rem;
}
.table-wrap .table tbody tr:last-child td {
  border-bottom: 0;
}
/* Empty states */
.empty-state {
  max-width: 640px;
  padding: 2rem 2rem 2.1rem;
  background: radial-gradient(360px 180px at 0% 0%, rgba(139, 124, 246, 0.12), transparent 70%), var(--surface);
}
.empty-state img {
  filter: drop-shadow(0 10px 26px rgba(139, 124, 246, 0.5));
}
.empty-state h2 {
  font-size: 1.35rem;
  margin: 1rem 0 0.3rem;
}
.empty-steps {
  margin: 1.1rem 0 1.3rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}
.empty-steps li::marker {
  color: var(--accent-strong);
  font-weight: 600;
}

/* Error pages */
.error-page {
  max-width: 560px;
  margin: 3rem auto;
  padding: 2.2rem 2.2rem 2.4rem;
  background: radial-gradient(320px 160px at 0% 0%, rgba(139, 124, 246, 0.12), transparent 70%), var(--surface);
}
.error-page img {
  filter: drop-shadow(0 10px 26px rgba(139, 124, 246, 0.5));
}
.error-code {
  margin: 1rem 0 0;
  color: var(--faint);
  letter-spacing: 0.08em;
}
.error-page h1 {
  margin-top: 0.2rem;
}
.error-page pre {
  white-space: pre-wrap;
  font-size: 0.8rem;
}

/* Badges sit on the middle of the text line, next to names and headings. */
.badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1.35;
}
/* Verified: a round blue check right after the name. */
.verified-mark {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  min-width: 16px;
  min-height: 16px;
  margin-left: 0.15em;
  vertical-align: -0.12em;
  border-radius: 50%;
}
h1 .verified-mark {
  width: 0.62em;
  height: 0.62em;
  vertical-align: 0.02em;
}

/* Admin: server rules editor and Discord-like preview. */
.rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .rules-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.rule-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.6rem;
}
.rule-item {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.rule-item p {
  margin: 0.35rem 0;
}
.rule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.rule-tools {
  display: flex;
  gap: 0.25rem;
}
.button-sm {
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  min-height: 0;
}
.button-sm:disabled {
  opacity: 0.35;
  cursor: default;
}
.discord-embed {
  background: #2b2d31;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 0.75rem 1rem 0.85rem;
  color: #dbdee1;
  font-size: 0.92rem;
  line-height: 1.4;
}
.discord-embed p {
  margin: 0;
}
.discord-embed-title {
  font-weight: 700;
  color: #f2f3f5;
  font-size: 1rem;
  margin-bottom: 0.4rem !important;
}
.discord-embed-field {
  margin-top: 0.6rem;
}
.discord-embed-name {
  font-weight: 650;
  color: #f2f3f5;
  margin-bottom: 0.1rem !important;
}
.discord-embed-footer {
  margin-top: 0.7rem !important;
  font-size: 0.78rem;
  color: #b5bac1;
}
.rules-layout .card {
  margin: 0;
}
.rules-layout > .stack {
  gap: 1rem;
}
input[type='color'] {
  width: 3.5rem;
  height: 2.4rem;
  padding: 0.2rem;
  cursor: pointer;
}
input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type='color']::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}
