:root {
  --bg: #0b0a0c;
  --panel: #131217;
  --panel-2: #191821;
  --line: #26242e;
  --ink: #eceaf0;
  --dim: #8f8a9c;
  --dimmer: #5d5869;
  --red: #ff2d3d;
  --red-soft: #ff2d3d1a;
  --green: #35d07f;
  --amber: #ffb020;
  --blue: #5b8dff;
  --r: 12px;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── chrome ─────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #0b0a0ccc;
  backdrop-filter: blur(12px);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
}
/* The wordmark IS the pun: LEFT, sitting on red. No separate name text. */
.logo {
  background: var(--red);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 9px 13px 8px;
  border-radius: 3px;
}
.whoami {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.whoami label {
  color: var(--dimmer);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 10px;
}
select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}
.credits {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--dim);
}
.credits b {
  color: var(--ink);
}

nav {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--line);
}
nav button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  padding: 9px 14px 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
nav button:hover {
  color: var(--ink);
}
nav button.on {
  color: var(--ink);
  border-bottom-color: var(--red);
}
.badge {
  background: var(--red);
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 17px;
  text-align: center;
}
.badge:empty {
  display: none;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px;
}
.tab {
  display: none;
}
.tab.on {
  display: block;
}

/* ── browse: the four content types ─────────────────────────────────── */
.seg {
  display: inline-flex;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
}
.seg button {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  color: var(--dim);
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.seg button:hover {
  color: var(--ink);
}
.seg button.on {
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #33303d;
}
.seg button.on:not(.seg-beacon) {
  box-shadow: inset 0 0 0 1px #4a2630;
}
/* Beacons wears the blue it wears everywhere else — a different kind of thing. */
.seg-beacon.on {
  box-shadow: inset 0 0 0 1px #35405c !important;
  color: #a5c0ff;
}
.seg-n {
  font-size: 11px;
  color: var(--dimmer);
  font-variant-numeric: tabular-nums;
}
.seg button.on .seg-n {
  color: var(--dim);
}
.seg-blurb {
  color: var(--dimmer);
  font-size: 13px;
  margin: 14px 0 18px;
}

/* ── browse ─────────────────────────────────────────────────────────── */
.vertical-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 16px;
}
.vertical-head h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.vertical-head .v-blurb {
  font-size: 12.5px;
  color: var(--dimmer);
}
.vertical-head .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}

.key {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, transform 0.15s;
}
.key:hover {
  border-color: #3a3746;
  transform: translateY(-1px);
}
.key-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.av {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}
.av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  display: block;
}
.av:has(img) {
  padding: 0;
  overflow: hidden;
}
img.mini {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
  vertical-align: -5px;
}
.key-id {
  flex: 1;
  min-width: 0;
}
.key-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
/* Expertise keys read differently on purpose: the knowledge is the headline and the
   person is a ghost. Dashed avatar + muted "Anonymous" line, but the card itself is
   NOT dimmed — the whole point is that the expertise is on full display. */
.anon .av {
  border-style: dashed;
  border-color: #3d3947;
  color: var(--dimmer);
}
.anon-tag {
  color: var(--dimmer);
  font-style: italic;
}
.tick {
  color: var(--blue);
  font-size: 12px;
}
.key-exp {
  color: var(--dim);
  font-size: 13px;
  margin-top: 1px;
}
.price {
  text-align: right;
  flex-shrink: 0;
}
.price b {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.price span {
  color: var(--dimmer);
  font-size: 11px;
  display: block;
  margin-top: -2px;
}
.bio {
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.55;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tag {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}
.signals {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--dim);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.signals b {
  color: var(--ink);
  font-weight: 600;
}
.sig-none {
  color: var(--dimmer);
}
.rate-good b {
  color: var(--green);
}
.rate-mid b {
  color: var(--amber);
}
.rate-bad b {
  color: var(--red);
}
/* Offline is a normal state, not a failure. Muted, not struck out — "come back later",
   never "you were rejected". */
.key.offline {
  opacity: 0.6;
}
.key.offline:hover {
  opacity: 0.85;
}
.close-btn {
  padding: 7px 13px !important;
  font-size: 13px;
  white-space: nowrap;
}
.fine {
  color: var(--dimmer);
  font-size: 11.5px;
  line-height: 1.5;
}
.field.accepting.off label.toggle span {
  color: var(--amber);
}
.signals {
  flex-wrap: wrap;
  row-gap: 6px;
}
.new-flag {
  color: var(--amber);
  font-size: 11px;
  background: #ffb0201a;
  border: 1px solid #ffb02033;
  padding: 2px 7px;
  border-radius: 20px;
}

/* A key the crowd distrusts should look distrusted. It never stops being anonymous. */
.flagged {
  color: var(--red);
  font-size: 11px;
  background: #ff2d3d14;
  border: 1px solid #ff2d3d33;
  padding: 2px 7px;
  border-radius: 20px;
}
.key.suppressed {
  opacity: 0.55;
  border-style: dashed;
}
.key.suppressed:hover {
  opacity: 1;
}
.key-foot {
  display: flex;
  gap: 8px;
}
.key-foot .act {
  flex: 1;
}
.flag-btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--dimmer);
  border-radius: 9px;
  padding: 10px 13px;
  cursor: pointer;
}
.flag-btn:hover {
  color: var(--red);
  border-color: #5e2530;
}

/* ── prospects / beacons ────────────────────────────────────────────────
   A prospect is NOT a listing and must never look like one. No price, no rating, no
   response rate — because there is no relationship to describe. Dashed border, ribbon
   on the face of it, and a blue accent that appears nowhere else in the product. If a
   user can mistake this for "you can message this person", we are lying to them. */
.prospect {
  position: relative;
  background: linear-gradient(180deg, #12141c, var(--panel));
  border: 1px dashed #35405c;
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prospect:hover {
  border-color: var(--blue);
}
.p-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  background: #5b8dff1f;
  color: #a5c0ff;
  border-left: 1px dashed #35405c;
  border-bottom: 1px dashed #35405c;
  border-radius: 0 var(--r) 0 var(--r);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 10px;
}
.ghost-av {
  border-style: dashed;
  border-color: #35405c;
  filter: grayscale(0.4);
}
.pot {
  display: flex;
  gap: 24px;
  padding-top: 12px;
  border-top: 1px dashed #2b3348;
}
.pot-fig b {
  font-size: 21px;
  letter-spacing: -0.02em;
  color: #a5c0ff;
}
.pot-fig span {
  display: block;
  font-size: 10px;
  color: var(--dimmer);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.beacon-note {
  font-size: 12px;
  color: var(--dimmer);
  line-height: 1.5;
}
button.act.beacon {
  background: #2b3a63;
  color: #cfdcff;
}
button.act.beacon:hover {
  background: #35487a;
}
button.act.beacon:disabled {
  background: var(--panel-2);
  color: var(--dimmer);
}

/* The second axis of trust: what WE checked, as opposed to what the crowd says.
   Deliberately a different colour from every rating on the page — it is a different
   kind of claim, made by us, and it should never blur into crowd sentiment. */
.checked {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: #5b8dff0d;
  border: 1px solid #5b8dff26;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #a5c0ff;
  line-height: 1.45;
}
.checked b {
  color: #cfdcff;
  font-weight: 600;
}
.checked-tick {
  color: var(--blue);
  flex-shrink: 0;
  font-size: 12px;
  margin-top: 1px;
}
.checked-how {
  display: block;
  color: var(--dimmer);
  font-size: 11.5px;
  margin-top: 3px;
}
.checked.in-modal {
  margin-bottom: 14px;
}

/* ── buttons ────────────────────────────────────────────────────────── */
button.act {
  background: var(--red);
  border: 0;
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
}
button.act:hover {
  filter: brightness(1.12);
}
button.act:disabled {
  background: var(--panel-2);
  color: var(--dimmer);
  cursor: not-allowed;
}
button.sec {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
}
button.sec:hover {
  border-color: #46424f;
}
button.ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
button.ghost:hover {
  color: var(--ink);
}

/* ── inbox ──────────────────────────────────────────────────────────── */
.threads {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thread-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.thread-item:hover {
  border-color: #3a3746;
}
.thread-item.on {
  border-color: var(--red);
  background: #17131a;
}
.thread-item .t-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.thread-item .t-name {
  font-weight: 600;
  font-size: 14px;
}
.thread-item .t-prev {
  color: var(--dimmer);
  font-size: 12px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dimmer);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.p-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.state-banner {
  padding: 13px 18px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.state-banner .s-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.s-awaiting_reply {
  background: #ffb0200f;
  color: #ffcf7a;
}
.s-awaiting_reply .s-dot {
  background: var(--amber);
}
.s-awaiting_confirmation {
  background: #5b8dff0f;
  color: #a5c0ff;
}
.s-awaiting_confirmation .s-dot {
  background: var(--blue);
}
.s-open {
  background: #35d07f0f;
  color: #86e8b6;
}
.s-open .s-dot {
  background: var(--green);
}
.s-disputed {
  background: #ff2d3d12;
  color: #ff9aa3;
}
.s-disputed .s-dot {
  background: var(--red);
}
.s-refunded,
.s-closed {
  background: var(--panel-2);
  color: var(--dim);
}
.s-refunded .s-dot,
.s-closed .s-dot {
  background: var(--dimmer);
}
.countdown {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  font-size: 12px;
}

.msgs {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 46vh;
  overflow-y: auto;
}
.msg {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.msg.them {
  background: var(--panel-2);
  border: 1px solid var(--line);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.msg.mine {
  background: #2a1a20;
  border: 1px solid #4a2630;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.msg .meta {
  font-size: 10px;
  color: var(--dimmer);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.msg.cold {
  border-left: 2px solid var(--red);
}
.free-note {
  text-align: center;
  color: var(--dimmer);
  font-size: 11px;
  padding: 4px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.composer input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
}
.composer input:focus {
  outline: 0;
  border-color: #4a4655;
}

.decision {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #5b8dff08;
}
.decision p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--dim);
}
.decision .row {
  display: flex;
  gap: 8px;
}

.stars {
  display: flex;
  gap: 3px;
}
.star {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 17px;
  padding: 1px;
  filter: grayscale(1) opacity(0.35);
}
.star.on {
  filter: none;
}
.star:hover {
  filter: none;
}

.empty {
  color: var(--dimmer);
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
}

/* ── my key ─────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--dimmer);
  margin-bottom: 7px;
}
.field input[type='number'],
.field input[type='range'] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  width: 140px;
}
.hint {
  font-size: 12px;
  color: var(--dimmer);
  margin-top: 7px;
}
.toggle {
  display: flex !important;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 14px !important;
  color: var(--ink) !important;
  margin: 0 !important;
}
.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
  cursor: pointer;
}
.toggle input:disabled {
  cursor: not-allowed;
}
.hint.warn {
  color: var(--amber);
}
.stat-row {
  display: flex;
  gap: 26px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}
.stat b {
  display: block;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.stat span {
  font-size: 11px;
  color: var(--dimmer);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── clock ──────────────────────────────────────────────────────────── */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #100f13f2;
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 20;
}
.clock-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--dim);
}
.clock-label b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.clock-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}
.travel {
  display: flex;
  gap: 6px;
}
.travel button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.travel button:hover {
  color: var(--ink);
  border-color: #46424f;
}
#reset {
  margin-left: 6px;
  color: var(--dimmer);
}

/* ── modal ──────────────────────────────────────────────────────────── */
#modal {
  position: fixed;
  inset: 0;
  background: #05040788;
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
#modal.hidden,
#toast.hidden {
  display: none;
}
#modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
}
.m-head {
  padding: 20px 22px 0;
}
.m-body {
  padding: 18px 22px;
}
.m-body textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 120px;
  resize: vertical;
}
.m-body textarea:focus {
  outline: 0;
  border-color: #4a4655;
}
.escrow-note {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.6;
  margin-top: 14px;
}
.escrow-note b {
  color: var(--ink);
}
.m-foot {
  padding: 0 22px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

#toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 11px 18px;
  border-radius: 10px;
  z-index: 60;
  font-size: 13.5px;
}
#toast.err {
  border-color: #5e2530;
  background: #2a1418;
  color: #ffb3ba;
}

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