:root {
  --bg: #050505;
  --panel: rgba(255,255,255,.055);
  --panel-2: rgba(255,255,255,.085);
  --text: #f2f2ee;
  --muted: #9d9d95;
  --line: rgba(255,255,255,.12);
  --line-2: rgba(255,255,255,.2);
  --accent: #b3ffb2;
  --good: #7ef0a7;
  --bad: #ff8c8c;
  --warn: #ffd36e;
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.13), transparent 22%),
    radial-gradient(circle at 80% 0%, rgba(255,255,255,.08), transparent 28%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 82px),
    #050505;
}

a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.25); }
a:hover { border-bottom-color: rgba(255,255,255,.8); }
button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  color: #080808;
  background: var(--accent);
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease, border-color .16s ease, background .16s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--line);
}
button.small { padding: 9px 12px; font-size: 12px; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); font-size: 12px; display: block; margin-bottom: 3px; }

.shell { max-width: 1380px; margin: 0 auto; padding: 22px 18px 36px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; border: 0; font-weight: 900; letter-spacing: -.02em; font-size: 19px; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--text); box-shadow: inset 0 0 0 7px var(--bg), 0 0 35px rgba(255,255,255,.18); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.hero { display: flex; justify-content: space-between; gap: 24px; padding: clamp(24px, 4vw, 44px); margin-bottom: 16px; overflow: hidden; position: relative; }
.hero:after { content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -180px; top: -170px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 900; margin-bottom: 12px; }
h1 { max-width: 740px; margin: 0; font-size: clamp(38px, 6vw, 76px); line-height: .88; letter-spacing: -.07em; }
.sub { max-width: 680px; color: var(--muted); line-height: 1.65; margin: 18px 0 0; }
.mini-panel { min-width: 280px; align-self: stretch; background: rgba(0,0,0,.26); border: 1px solid var(--line); border-radius: 20px; padding: 16px; z-index: 1; }
.mini-row { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.mini-row:last-child { border-bottom: 0; }
.mini-row span { color: var(--muted); }
.mini-row strong { text-align: right; overflow-wrap: anywhere; }

.status { margin: 0 0 16px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); }
.status.success { border-color: rgba(126,240,167,.32); color: var(--good); }
.status.error { border-color: rgba(255,140,140,.38); color: var(--bad); }
.status.warn { border-color: rgba(255,211,110,.35); color: var(--warn); }

.layout { display: grid; grid-template-columns: minmax(280px, 390px) 1fr; gap: 16px; align-items: start; }
.renderer-card, .token-card { padding: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.04em; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.pill { white-space: nowrap; display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; padding: 6px 10px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 800; }

.renderer-list { display: grid; gap: 10px; }
.renderer-item { width: 100%; text-align: left; border-radius: 18px; border: 1px solid var(--line); padding: 14px; background: rgba(255,255,255,.045); color: var(--text); cursor: pointer; }
.renderer-item:hover { border-color: var(--line-2); }
.renderer-item.selected { border-color: rgba(244,241,223,.7); background: rgba(244,241,223,.11); }
.renderer-item.disabled { opacity: .55; cursor: not-allowed; }
.renderer-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.renderer-name { font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.renderer-id { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.renderer-meta { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.renderer-meta span { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 7px; }
.renderer-meta .selectable { color: var(--good); border-color: rgba(126,240,167,.28); }
.renderer-meta .not-selectable { color: var(--bad); border-color: rgba(255,140,140,.3); }

.token-head { align-items: center; }
.token-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.selection-strip { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; background: rgba(0,0,0,.24); border: 1px solid var(--line); border-radius: 20px; padding: 12px; margin-bottom: 14px; }
.selection-strip strong { overflow-wrap: anywhere; }
.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.empty-state { color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; padding: 18px; min-height: 90px; display: grid; place-items: center; text-align: center; }
.token { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: rgba(255,255,255,.045); }
.token.selected { border-color: rgba(244,241,223,.75); box-shadow: 0 0 0 1px rgba(244,241,223,.22) inset; }
.token-preview { height: 190px; background: #0b0b0b; display: grid; place-items: center; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.token-preview img { max-width: 85%; max-height: 85%; object-fit: contain; display: block; }
.token-preview .placeholder { color: rgba(255,255,255,.28); font-weight: 900; font-size: 44px; letter-spacing: -.08em; }
.token-body { padding: 13px; }
.token-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.token-title strong { font-size: 16px; }
.token-renderer { color: var(--muted); font-size: 12px; line-height: 1.45; min-height: 34px; }
.token-renderer-label {
  color: var(--muted);
  font-size: 12px;
}

.token-renderer-name {
  color: #fff;
  font-weight: 700;
  margin: 3px 0 2px;
}

.token-preview {
  cursor: pointer;
}
.token-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.token-actions button { width: 100%; }

footer { color: var(--muted); display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 22px; font-size: 12px; }
.dot { width: 4px; height: 4px; background: var(--muted); border-radius: 50%; opacity: .65; }

@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
  .mini-panel { width: 100%; }
  .selection-strip { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { padding: 14px 10px 30px; }
  .topbar { align-items: flex-start; }
  .top-actions { width: 100%; }
  .top-actions button { flex: 1; padding-left: 12px; padding-right: 12px; }
  .section-head { flex-direction: column; }
  .token-tools { justify-content: flex-start; }
  .token-grid { grid-template-columns: 1fr; }
}
.renderer-item {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  border-color: color-mix(in srgb, var(--renderer-color), var(--line) 65%);
}

.renderer-bg {
  position: absolute;
  inset: 0;
  background-image: var(--renderer-bg);
  background-size: cover;
  background-position: center;
  opacity: .42;
  filter: saturate(1.2) contrast(1.05);
  pointer-events: none;
}

.renderer-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.82), rgba(0,0,0,.38));
  pointer-events: none;
}

.renderer-content {
  position: relative;
  z-index: 2;
}

.renderer-name {
  color: var(--renderer-color);
}

.renderer-item.selected {
  box-shadow: 0 0 0 1px var(--renderer-color), 0 0 24px color-mix(in srgb, var(--renderer-color), transparent 70%);
}

.token-renderer-label {
  color: var(--muted);
  font-size: 12px;
}

.token-renderer-name {
  color: var(--active-renderer-color);
  font-weight: 800;
  margin: 3px 0 2px;
}

.token-preview {
  cursor: pointer;
}