:root {
  --bg: #07090f;
  --bg-2: #10141d;
  --card: #141a24;
  --ink: #f2f5fb;
  --muted: #8b97a8;
  --line: #243044;
  --sky: #4da3ff;
  --mint: #5ee1b2;
  --mint-dim: rgba(94, 225, 178, 0.16);
  --sky-dim: rgba(77, 163, 255, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: Figtree, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(77, 163, 255, 0.16), transparent 55%),
    radial-gradient(700px 380px at 110% 0%, rgba(94, 225, 178, 0.1), transparent 50%),
    var(--bg);
}

.shell { max-width: 760px; margin: 0 auto; padding: 28px 18px 96px; }

.mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #1c2433, #121821);
  border: 1px solid var(--line);
  color: var(--mint);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 500;
}
h1 {
  font-family: "Bricolage Grotesque", Georgia, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0;
}
.tag { margin: 0; color: var(--muted); font-size: 13px; }
.chip {
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer, .feed {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 22px 20px;
}
.composer { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); }
.composer-copy h2 {
  font-family: "Bricolage Grotesque", Georgia, sans-serif;
  font-size: 22px;
  margin: 0 0 6px;
}
.composer-copy p { margin: 0; color: var(--muted); max-width: 42em; }

.social-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 10px;
  align-items: end;
  margin-top: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; min-width: 110px; }
.field.grow { flex: 1; }
input, select {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  width: 100%;
}
input:focus, select:focus {
  outline: 0;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-dim);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  padding-bottom: 11px;
  font-size: 13px;
}
.check input { width: auto; accent-color: var(--mint); }

.lookback { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.lookback-dates {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}
.lookback-dates .field { flex: 1; }
.lookback-arrow {
  color: var(--muted);
  padding-bottom: 12px;
  font-size: 12px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  white-space: nowrap;
}
.thumb-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
.thumb-key::before {
  content: "";
  width: 10px;
  height: 10px;
  box-sizing: border-box;
}
.thumb-key.until { color: var(--mint); }
.thumb-key.until::before {
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--mint-dim);
}
.thumb-key.since { color: var(--sky); }
.thumb-key.since::before {
  border: 2px solid var(--sky);
  border-radius: 50%;
  background: transparent;
}

.range { position: relative; height: 32px; }
.range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
}
.range input[type="range"] {
  position: absolute;
  left: 0;
  top: 6px;
  width: 100%;
  margin: 0;
  pointer-events: none;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
}
.range input.range-until { z-index: 4; }
.range input.range-since { z-index: 3; }
.range input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  cursor: pointer;
  border: 0;
}
.range input.range-until::-webkit-slider-thumb {
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--mint-dim);
  border: 2px solid #0b1018;
}
.range input.range-until::-moz-range-thumb {
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--mint-dim);
  border: 2px solid #0b1018;
}
.range input.range-since::-webkit-slider-thumb {
  background: transparent;
  border-radius: 50%;
  border: 2px solid var(--sky);
  box-shadow: inset 0 0 0 3px var(--card), 0 0 0 3px var(--sky-dim);
}
.range input.range-since::-moz-range-thumb {
  background: var(--card);
  border-radius: 50%;
  border: 2px solid var(--sky);
  box-shadow: 0 0 0 3px var(--sky-dim);
}
.range input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 4px; }
.range input[type="range"]::-moz-range-track { background: transparent; height: 4px; }

.lookback-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.lookback-caption { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.lookback-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lookback-presets button {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  width: auto;
}
.lookback-presets button:hover { border-color: var(--sky); }
.lookback-presets button.on {
  background: var(--sky-dim);
  color: var(--sky);
  border-color: var(--sky);
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  background: var(--ink);
  color: #0b1018;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cta:hover { filter: brightness(1.06); }
.cta:disabled { opacity: 0.38; cursor: not-allowed; filter: none; }
.x-logo { width: 14px; height: 14px; }

.feed { margin-top: 16px; }
.feed h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", Georgia, sans-serif;
  font-size: 18px;
}
.catalog-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.pick-list { display: grid; gap: 8px; margin-top: 14px; }
.pick {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  grid-template-areas:
    "avatar name mcap"
    "avatar meta meta";
  gap: 2px 12px;
  width: 100%;
  text-align: left;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
}
.pick:hover { border-color: #3a4b64; }
.pick.on {
  border-color: var(--mint);
  background: linear-gradient(180deg, rgba(94, 225, 178, 0.08), var(--bg));
}
.pick-avatar {
  grid-area: avatar;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1b2433;
  color: var(--sky);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  align-self: center;
}
.pick-name {
  grid-area: name;
  font-weight: 600;
  font-size: 16px;
}
.pick-mcap { grid-area: mcap; color: var(--mint); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; align-self: center; }
.pick-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 12px;
}

.admin-shell { max-width: 1080px; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
}
.stat b {
  display: block;
  font-family: "Bricolage Grotesque", Georgia, sans-serif;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat span { color: var(--muted); font-size: 12px; }
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.admin-toolbar .field { min-width: 160px; }
.admin-toolbar .grow { flex: 1; }
.ghost {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  cursor: pointer;
  width: auto;
}
.ghost:hover { border-color: var(--sky); }
.top-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.top-row button {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  width: auto;
}
.top-row button:hover, .top-row button.on {
  border-color: var(--mint);
  background: var(--mint-dim);
  color: var(--mint);
}
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ledger th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
}
.ledger td {
  padding: 12px 10px;
  border-bottom: 1px solid #1b2433;
  vertical-align: top;
}
.ledger .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; }
.ledger .muted { color: var(--muted); }
.ledger .query { color: var(--muted); word-break: break-word; max-width: 28em; }
.gate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px;
  max-width: 420px;
}
.gate h2 { margin: 0 0 8px; font-family: "Bricolage Grotesque", Georgia, sans-serif; }
.gate p { margin: 0 0 16px; color: var(--muted); }
.hidden { display: none; }
.empty { color: var(--muted); padding: 18px 4px; }

@media (max-width: 720px) {
  .social-form { display: grid; grid-template-columns: 1fr; }
  .mast { align-items: start; flex-direction: column; }
  .chip { max-width: 100%; }
  .lookback-arrow { display: none; }
  .admin-stats { grid-template-columns: 1fr; }
  .ledger { display: block; overflow-x: auto; }
}
