:root {
  color-scheme: dark;
  --gold: #c9a36a;
  --gold2: #f3e2bf;
  --bg: #080809;
  --panel: #101012;
  --card: #161618;
  --muted: rgba(235, 235, 245, 0.68);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f5f7;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 520px) minmax(140px, 1fr);
  align-items: center;
  gap: 12px 16px;
  padding: 10px 20px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 9, 0.92);
  backdrop-filter: blur(12px);
}
.top .brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top img { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; }
.brand { font-weight: 750; letter-spacing: -0.3px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.top nav {
  justify-self: end;
  display: flex; flex-wrap: wrap; justify-content: flex-end;
  gap: 12px; font-size: 13px; font-weight: 600;
}
.top nav a.on { color: var(--gold2); }
.top-simple { grid-template-columns: 1fr auto; }
.top-simple .search-wrap { display: none; }
.search-wrap {
  justify-self: center;
  width: 100%;
  max-width: 520px;
  position: relative;
}
.search-wrap input {
  width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: #141416; color: var(--text); padding: 0 14px 0 36px;
  font: 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.search-wrap input:focus { outline: 1px solid var(--gold); border-color: var(--gold); }
.search-wrap::before {
  content: ""; position: absolute; left: 12px; top: 12px; width: 14px; height: 14px;
  border: 2px solid #888; border-radius: 50%; pointer-events: none;
}
.search-wrap::after {
  content: ""; position: absolute; left: 24px; top: 24px; width: 7px; height: 2px;
  background: #888; transform: rotate(45deg); pointer-events: none;
}
.search-meta { font-size: 12px; color: var(--muted); padding: 4px 2px 0; min-height: 18px; }
.keywords {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 20px 12px; border-bottom: 1px solid var(--line);
  background: #0c0c0e;
}
.kw {
  border: 1px solid var(--line); background: #161618; color: var(--gold2);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 650;
  cursor: pointer; font-family: inherit;
}
.kw:hover, .kw.on { border-color: var(--gold); background: #2a2318; color: var(--gold); }
.doc-sec { scroll-margin-top: 120px; }
.doc-sec.hidden { display: none; }
.doc-sec.flash {
  outline: 1px solid var(--gold); outline-offset: 8px; border-radius: 12px;
  animation: flash 1.2s ease;
}
@keyframes flash { from { background: rgba(201,163,106,.12); } to { background: transparent; } }
mark.hit { background: #5a4a22; color: var(--gold2); border-radius: 3px; padding: 0 2px; }
.sig { font-size: 13px; color: var(--gold2); background: #161618; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0 12px; overflow-x: auto; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; }
.tag.pop { background: #3a2a12; color: var(--gold); }
.tag.quiet { background: #1a2a22; color: #8fd4aa; }
.wrap { display: grid; grid-template-columns: 220px 1fr; max-width: 1180px; margin: 0 auto; }
aside {
  position: sticky; top: 108px; align-self: start;
  height: calc(100vh - 108px); overflow: auto;
  padding: 22px 16px 40px 20px;
  border-right: 1px solid var(--line);
}
aside a { display: block; color: var(--muted); padding: 6px 0; font-size: 13px; }
aside a:hover, aside a.on { color: var(--gold2); text-decoration: none; }
aside .g { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: #777; margin: 16px 0 6px; font-weight: 700; }
main { padding: 28px 28px 80px; min-width: 0; }
h1 { font-size: 36px; letter-spacing: -0.7px; margin: 0 0 8px; }
h2 { font-size: 22px; margin: 40px 0 10px; padding-top: 8px; }
h3 { font-size: 16px; margin: 22px 0 8px; }
p, li { color: var(--muted); }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 999px; background: #2a2318; color: var(--gold);
}
code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
code { background: #1c1c1e; padding: 2px 6px; border-radius: 6px; color: var(--gold2); }
pre {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; overflow: auto; color: #e8e8ed; position: relative;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0 20px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #aaa; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.ok, .warn {
  border-radius: 12px; padding: 12px 14px; margin: 14px 0;
}
.ok { border: 1px solid #1e4a32; background: #0e1a14; color: #b6e2c8; }
.warn { border: 1px solid #5a3a12; background: #1a140c; color: #f3e2bf; }
.page-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 18px;
}
.page-tabs button {
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #161618; color: var(--muted);
  font-weight: 700; cursor: pointer; font-family: inherit; font-size: 13px;
}
.page-tabs button.on { background: #2a2318; color: var(--gold); border-color: var(--gold); }
.pane[hidden] { display: none !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.btn {
  display: inline-flex; align-items: center; height: 42px; padding: 0 16px;
  border-radius: 12px; font-weight: 700; border: 0; cursor: pointer; text-decoration: none;
}
.btn.gold { background: linear-gradient(180deg, #f3e2bf, #c9a36a); color: #1a140c; }
.btn.ghost { background: #1c1c1e; color: #f5f5f7; border: 1px solid var(--line); }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.copy-box {
  white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow: auto;
  user-select: text;
}
.pg {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0 28px;
}
.pg-status {
  font-size: 13px; color: var(--gold2); margin: 0 0 12px; word-break: break-all;
}
.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.pg-grid .btn { width: 100%; justify-content: center; height: 44px; }
.pg label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.pg input, .pg textarea {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  background: #101012; color: var(--text); padding: 10px 12px;
  font: 14px/1.4 ui-monospace, Menlo, monospace;
}
.pg textarea { min-height: 88px; resize: vertical; }
.pg-out {
  margin: 14px 0 0; max-height: 36vh; overflow: auto; font-size: 12px;
  white-space: pre-wrap; word-break: break-word;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0 20px; }
.table-wrap table { margin: 0; min-width: 520px; }
@media (max-width: 900px) {
  .top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px 8px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .top .brand-wrap { width: 100%; }
  .top nav {
    justify-self: stretch;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
  }
  .top nav a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: #161618;
    border: 1px solid var(--line);
    text-decoration: none;
    white-space: nowrap;
  }
  .top nav a.on { background: #2a2318; border-color: var(--gold); }
  .search-wrap { max-width: 100%; width: 100%; }
  .keywords {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px 10px;
  }
  .kw { flex: 0 0 auto; }
  .wrap { grid-template-columns: 1fr; }
  aside { display: none; }
  main {
    padding: 16px 14px 88px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; margin-top: 28px; }
  pre, .sig { font-size: 12px; padding: 12px; }
  .doc-sec { scroll-margin-top: 168px; }
  .hero-actions .btn { min-height: 44px; }
  .pg-grid { grid-template-columns: 1fr 1fr; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 420px) {
  .brand small { display: none; }
  .pg-grid { grid-template-columns: 1fr; }
}
.tok-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 96px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.tok-sources {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0 8px;
}
.tok-sources a {
  border: 1px solid var(--line);
  background: #161618;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  color: var(--gold2);
}
.tok-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tok-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 12px 0 32px;
}
.tok-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
}
.tok-head { display: flex; align-items: center; gap: 10px; }
.tok-head div { flex: 1; min-width: 0; }
.tok-head b { display: block; letter-spacing: -0.2px; }
.tok-head small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok-logo {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover;
  background: #1c1c1e; flex-shrink: 0;
}
.tok-letter {
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--gold);
}
.tok-id { font-size: 11px; color: #777; margin: 8px 0 10px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tok-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tok-actions .btn { width: 100%; justify-content: center; height: 40px; font-size: 12px; }
@media (max-width: 900px) {
  .tok-page { padding-top: 16px; }
}
