* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #07080f;
  --bg2: #0c0e1a;
  --surface: rgba(24, 27, 42, 0.72);
  --surface2: rgba(38, 42, 64, 0.55);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef0fb;
  --text-dim: #9aa0bd;
  --text-faint: #6a7090;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --success: #2dd4a7;
  --warn: #fbbf24;
  --danger: #fb7185;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", Roboto, sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, #14172a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  padding: 0 28px 60px;
  position: relative;
  overflow-x: hidden;
}

.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-orbs span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
}
.bg-orbs span:nth-child(1) { width: 380px; height: 380px; background: #7c5cff; top: -80px; right: 10%; }
.bg-orbs span:nth-child(2) { width: 300px; height: 300px; background: #22d3ee; bottom: 10%; left: -60px; opacity: 0.2; }
.bg-orbs span:nth-child(3) { width: 260px; height: 260px; background: #2dd4a7; top: 40%; right: -60px; opacity: 0.15; }

.topbar, .layout, .ground-truth, .foot { position: relative; z-index: 1; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 4px 20px; max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; font-size: 24px; color: #fff;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.4);
}
h1 { font-size: 22px; letter-spacing: -0.5px; }
.tag { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }
.pill {
  font-size: 12.5px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
}
.pill.online { color: var(--success); border-color: rgba(45, 212, 167, 0.4); }

.layout {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start;
}
.layout > * { min-width: 0; }
@media (max-width: 880px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.form-card h2 { font-size: 16px; margin-bottom: 18px; }
.dim { color: var(--text-faint); font-weight: 400; font-size: 13px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; }
.field .hint { color: var(--text-faint); font-style: normal; font-size: 11.5px; }

select, input[type="range"] {
  width: 100%; font-family: inherit;
}
select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; font-size: 14px; outline: none;
}
select:focus { border-color: var(--accent); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  margin-top: 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-dim);
  transition: all 0.15s; user-select: none;
}
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #fff; }

.privacy-controls strong { color: var(--accent2); }

.toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); margin: 6px 0 18px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.primary {
  width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), #5b3fd6);
  box-shadow: 0 10px 26px rgba(124, 92, 255, 0.4);
  transition: transform 0.12s, filter 0.12s;
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: 0.6; cursor: wait; }

.muted { color: var(--text-faint); }
.small { font-size: 11.5px; }
.muted.small { margin-top: 10px; line-height: 1.5; }

.results { display: flex; flex-direction: column; gap: 18px; }

.disclosure { padding: 18px 20px; }
.disclosure h3 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.disclosure .geo { font-size: 12.5px; color: var(--text-dim); margin-bottom: 14px; }
.disclosure code { background: rgba(0,0,0,0.35); padding: 2px 7px; border-radius: 6px; color: var(--accent2); font-size: 12px; }
.disc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .disc-cols { grid-template-columns: 1fr; } }
.disc-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.disc-col.hide h4 { color: var(--danger); }
.disc-col.share h4 { color: var(--success); }
.disc-col ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.disc-col li { font-size: 12.5px; color: var(--text-dim); padding-left: 18px; position: relative; line-height: 1.4; }
.disc-col.hide li::before { content: "✕"; position: absolute; left: 0; color: var(--danger); }
.disc-col.share li::before { content: "✓"; position: absolute; left: 0; color: var(--success); }

.match-grid { display: flex; flex-direction: column; gap: 14px; }
.empty {
  text-align: center; color: var(--text-faint); padding: 60px 20px;
  border: 1px dashed var(--border); border-radius: 16px; background: var(--surface);
}

.match {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; display: grid; gap: 12px; min-width: 0;
  animation: rise 0.32s ease both;
}
.match > * { min-width: 0; }
.pseudo { min-width: 0; }
.pseudo > div { min-width: 0; }
.pseudo .name { overflow-wrap: anywhere; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.match-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pseudo { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #2a2f4a, #1a1d2e);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-size: 17px;
}
.pseudo .name { font-size: 14.5px; font-weight: 600; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.pseudo .sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.rep { font-size: 12px; color: var(--warn); white-space: nowrap; }

.match-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
  font-size: 11.5px; padding: 5px 10px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim);
}
.badge.cat { color: var(--accent2); border-color: rgba(34, 211, 238, 0.35); }
.badge.dist { color: var(--success); border-color: rgba(45, 212, 167, 0.3); }
.badge.skill { color: #c9b8ff; }

.score-row { display: flex; align-items: center; gap: 10px; }
.score-bar { flex: 1; height: 7px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.score-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.score-val { font-size: 12.5px; color: var(--text-dim); width: 42px; text-align: right; }

.keyline { font-size: 11.5px; color: var(--text-faint); display: flex; flex-wrap: wrap; align-items: center; gap: 7px; border-top: 1px solid var(--border); padding-top: 11px; min-width: 0; }
.keyline code { background: rgba(0,0,0,0.35); padding: 2px 7px; border-radius: 6px; font-size: 11px; word-break: break-all; min-width: 0; }
.keyline .lock { color: var(--success); }
.keyline .warnk { color: var(--warn); }

.ground-truth { max-width: 1180px; margin: 22px auto 0; padding: 0; overflow: hidden; }
.gt-header {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; align-items: center; gap: 14px; padding: 18px 22px; font-size: 14px;
}
.gt-header .dim { flex: 1; }
.chevron { transition: transform 0.2s; color: var(--text-dim); }
.gt-header.open .chevron { transform: rotate(180deg); }
.gt-body { padding: 0 22px 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gt-body table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.gt-body th, .gt-body td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.gt-body th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.gt-body td { color: var(--text-dim); font-family: ui-monospace, Menlo, monospace; }
.gt-body td.real { color: var(--danger); }

.foot { max-width: 1180px; margin: 30px auto 0; text-align: center; color: var(--text-faint); font-size: 12px; }

.hidden { display: none; }

@media (max-width: 560px) {
  body { padding: 0 14px 48px; }
  .topbar { flex-wrap: wrap; gap: 12px; padding: 18px 0 16px; }
  .brand { min-width: 0; flex: 1 1 auto; }
  .brand > div { min-width: 0; }
  .pill { margin-left: auto; flex: none; }
  h1 { font-size: 20px; }
  .tag { font-size: 12px; }
  .card { padding: 18px 16px; }
  .gt-header { flex-wrap: wrap; padding: 16px; }
  .gt-header .dim { flex: 1 1 100%; order: 3; }
  .gt-body { padding: 0 16px 18px; }
  .gt-body table { min-width: 460px; }
  .gt-body th, .gt-body td { white-space: nowrap; }
  /* Long pseudonym + reputation stars no longer share one row: the rating
     drops to its own line so the stars never overflow the card edge. */
  .match { padding: 16px 14px; }
  .match-top { flex-wrap: wrap; gap: 4px 10px; }
  .pseudo { flex: 1 1 100%; }
  .rep { white-space: normal; font-size: 11.5px; padding-left: 51px; }
}

/* ── Auto-quote band (C5 · TON-2064) ───────────────────────────────────── */
.quote { padding: 16px 18px; }
.quote h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.quote .src {
  font-size: 11px; font-weight: 500; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
}
.quote-band {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.quote-band .qmin, .quote-band .qmax {
  font-size: 18px; font-weight: 700; color: #fff; white-space: nowrap;
}
.quote-band .qbar {
  position: relative; flex: 1; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
}
.quote-band .qmid {
  position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent2); border: 2px solid #fff;
}
.quote-bd { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

/* ── Escrow + Ghost Slashing (C4 · TON-2063) ───────────────────────────── */
.escrow { padding: 16px 18px; }
.escrow h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.escrow-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.escrow-field {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
}
.escrow-field span { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.escrow-field b { font-size: 14px; color: #fff; }
.escrow-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.settle-btn {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 12px; color: var(--text); cursor: pointer; font-size: 13px; transition: background .15s;
}
.settle-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.settle-result {
  padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6;
}
.settle-result.good { background: rgba(45,212,167,.12); border: 1px solid rgba(45,212,167,.3); color: #6ee7b7; }
.settle-result.bad  { background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.25); color: #fca5a5; }

/* ── Staged Location Reveal (C1 · TON-2060) ────────────────────────────── */
.location { padding: 16px 18px; }
.location h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.loc-stepper { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.loc-step { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-faint); }
.loc-step .dot { filter: grayscale(1); opacity: .5; }
.loc-step.active { color: #fff; font-weight: 700; }
.loc-step.active .dot { filter: none; opacity: 1; }
.loc-step.done { color: var(--text-dim); }
.loc-step.done .dot { filter: none; opacity: .85; }
.loc-arrow { color: var(--text-faint); font-size: 13px; }
.loc-reveal {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
}
.loc-reveal.precise { border-color: var(--accent2); box-shadow: 0 0 0 1px rgba(34,211,238,.25); }
.loc-gran { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.loc-value { font-size: 17px; font-weight: 700; color: #fff; }
.loc-ttl { font-size: 12px; color: var(--accent2); margin-top: 4px; }
.loc-geo, .loc-geo-result { margin: 8px 0; font-size: 13px; }
.loc-geo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loc-geo input[type=range] { flex: 1; min-width: 100px; }
.loc-geo-result.ok { color: #6ee7b7; }
.loc-geo-result.no { color: #fca5a5; }
.loc-btn {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 14px; color: var(--text); cursor: pointer; font-size: 13px; margin-right: 6px;
}
.loc-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.loc-note { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; margin-top: 10px; }

/* ── Proxy Contact Channel (C2 · TON-2061) ─────────────────────────────── */
.contact { padding: 16px 18px; }
.contact h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.contact-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 8px; margin-bottom: 10px; }
.contact-field { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.contact-field span { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.contact-field b { font-size: 13px; color: #fff; word-break: break-all; }
.contact-note { font-size: 12px; color: var(--accent2); margin-bottom: 10px; }
.contact-compose { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.contact-compose input {
  flex: 1; min-width: 200px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 10px; color: var(--text); font-size: 13px;
}
.contact-log { max-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.contact-entry { font-size: 12.5px; padding: 6px 10px; background: var(--surface2); border-radius: 6px; border: 1px solid var(--border); }
.contact-entry .hash { color: var(--text-faint); font-family: monospace; }
.contact-entry.closed { color: #fca5a5; border-color: rgba(239,68,68,.3); }
.contact-entry.err { color: #fca5a5; }
