:root {
  --bg: #070c16;
  --bg-raise: #10192b;
  --card: rgba(16, 27, 46, .9);
  --ink: #e8eefc;
  --muted: #93a1ba;
  --line: rgba(156, 184, 230, .16);
  --blue: #4c8dff;
  --blue-2: #8eb6ff;
  --ok: #3ddc97;
  --bad: #ff6b6b;
  --warn: #f0c36a;
  --shadow: 0 24px 60px rgba(0, 0, 0, .35);
  --radius: 18px;
  --sans: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(76, 141, 255, .28), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(56, 189, 248, .12), transparent 55%),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.skip {
  position: absolute; left: 12px; top: -40px; background: var(--blue); color: #04101f; padding: 8px 12px; border-radius: 999px; z-index: 50;
}
.skip:focus { top: 12px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.maint-banner {
  display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 10px 22px; background: #3a2a08; color: #ffe7ad; border-bottom: 1px solid rgba(240, 195, 106, .4);
}
.maint-banner a { color: #fff; font-weight: 700; }
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); background: rgba(7, 12, 22, .82); border-bottom: 1px solid var(--line); }
.top-inner, .page, .foot-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.top-inner { min-height: 72px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: -.03em; font-size: 18px; }
.brand img { height: 34px; width: auto; }
.mark {
  width: 34px; height: 34px; display: grid; place-items: center; color: #04101f;
  background: linear-gradient(160deg, #9ec2ff, var(--blue) 45%, #1d4ed8);
  border-radius: 11px; box-shadow: 0 8px 20px rgba(76, 141, 255, .35);
}
.mark svg { width: 22px; height: 22px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a, .chip {
  text-decoration: none; color: var(--muted); padding: 7px 11px; border-radius: 999px; font-size: 14px; font-weight: 650;
}
.nav a:hover, .chip:hover { color: var(--ink); }
.nav a.is-active { background: var(--blue); color: #04101f; }
.top-side { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-raise); }
.nav-toggle i { display: block; height: 2px; margin: 5px 10px; background: var(--ink); }
.btn, button.btn, .copy {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid transparent; text-decoration: none; font-weight: 700; cursor: pointer; background: transparent; color: var(--ink);
}
.btn-primary { background: linear-gradient(180deg, #6ea2ff, var(--blue)); color: #04101f; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); background: rgba(255,255,255,.03); }
.btn-danger { border-color: rgba(255,107,107,.45); color: #ffd0d0; }
.page { padding: 28px 0 64px; position: relative; z-index: 1; }
.hero { display: grid; grid-template-columns: 1.4fr .7fr; gap: 22px; align-items: stretch; margin-bottom: 22px; }
.hero-copy h1, .section-head h1, .error-panel h1, .docs h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -.045em; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 18px; max-width: 62ch; }
.kicker { color: var(--blue-2); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; margin: 0 0 8px; }
.search-bar, .tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
input, select, textarea {
  background: #0c1526; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 42px; outline: none; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(76,141,255,.2); }
.search-bar input, .tools input[type="search"] { flex: 1; min-width: 180px; width: auto; }
.tools select { width: auto; min-width: 160px; flex: none; }
.search-bar .btn, .tools .btn { width: auto; flex: none; }
.hero-links, .chips, .range { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: rgba(76,141,255,.08); }
.hero-panel, .card, .stats article {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-panel { padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; background:
  linear-gradient(180deg, rgba(76,141,255,.18), rgba(16,27,46,.92)); }
.hero-panel strong { font-size: 56px; letter-spacing: -.05em; line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 28px; }
.stats article { padding: 16px 18px; }
.stats strong { display: block; font-size: 28px; letter-spacing: -.04em; }
.stats span, .muted, .result-count { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { padding: 16px 18px; }
.cat { text-decoration: none; display: block; min-height: 140px; transition: transform .18s ease, border-color .18s ease; }
.cat:hover { transform: translateY(-3px); border-color: rgba(76,141,255,.55); }
.cat strong { display: block; font-size: 32px; margin: 8px 0; }
.bot-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; text-decoration: none; }
.bot-card img, .who img, .avatar-xl, .user-menu img, .menu-id img { border-radius: 12px; object-fit: cover; }
.bot-card img, .who img { width: 42px; height: 42px; }
.avatar-xl { width: 84px; height: 84px; }
.pill { display: inline-flex; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(240,195,106,.15); color: var(--warn); font-style: normal; font-size: 12px; }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; flex-wrap: wrap; }
.owners { margin-top: 28px; padding: 22px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(76,141,255,.12), transparent 50%), var(--bg-raise); }
.steps { display: grid; gap: 10px; padding: 0; margin: 16px 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.steps li::before { counter-increment: step; content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #04101f; font-weight: 800; }
.steps strong, .steps span { display: block; }
.steps span { color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(8,14,26,.72); }
table.catalog { width: 100%; border-collapse: collapse; min-width: 760px; }
table.catalog th, table.catalog td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.catalog th a { color: var(--muted); text-decoration: none; }
table.catalog th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.who { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.who small, .sid, .menu-id span { display: block; color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions a { color: var(--blue-2); font-weight: 700; text-decoration: none; }
.sync { width: 12px; height: 12px; border-radius: 50%; display: inline-block; position: relative; }
.sync.is-ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(61,220,151,.15); }
.sync.is-bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(255,107,107,.14); }
.sync-line { display: flex; align-items: center; gap: 8px; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: #0b1220; color: var(--ink); border: 1px solid var(--line); padding: 6px 8px; border-radius: 8px;
  width: max-content; max-width: 240px; z-index: 5; font-size: 12px; white-space: normal;
}
.empty, .error-panel { padding: 28px; border: 1px dashed var(--line); border-radius: 18px; background: rgba(255,255,255,.02); }
.empty h3, .error-panel h1 { margin-top: 0; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.pager a { color: var(--blue-2); font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.bot-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.set-list { display: grid; gap: 6px; margin-top: 10px; }
.set-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.note, .flash, .warn { border-radius: 12px; padding: 12px 14px; }
.note { background: rgba(76,141,255,.08); }
.flash { background: rgba(61,220,151,.12); border: 1px solid rgba(61,220,151,.3); }
.warn { background: rgba(255,107,107,.1); }
.ticks { padding-left: 18px; }
.narrow { max-width: 640px; }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field span, legend { font-weight: 700; }
.toggles, .switch { display: flex; align-items: center; gap: 10px; }
.toggles { flex-wrap: wrap; }
.switch em { font-style: normal; }
.switch input { position: absolute; opacity: 0; }
.track { width: 44px; height: 26px; border-radius: 999px; background: #243044; position: relative; flex: none; border: 1px solid var(--line); }
.track::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #d5def0; top: 2px; left: 2px; transition: transform .16s ease; }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); background: white; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(76,141,255,.35); }
.split { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.inline { display: inline-flex; margin-right: 8px; }
.user-menu, .lang-menu { position: relative; }
.user-menu summary, .lang-menu summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); cursor: pointer;
}
.user-menu summary::-webkit-details-marker, .lang-menu summary::-webkit-details-marker { display: none; }
.user-menu img { width: 32px; height: 32px; }
.user-menu summary strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-card {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; background: #10192b;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); z-index: 30; display: grid; gap: 4px;
}
.lang-menu:not([open]) > .menu-card, .user-menu:not([open]) > .menu-card { display: none; }
.menu-card a, .menu-card button { text-align: left; background: transparent; border: 0; color: var(--ink); padding: 8px 10px; border-radius: 10px; text-decoration: none; cursor: pointer; }
.menu-card a:hover, .menu-card button:hover, .menu-card a.is-active { background: rgba(76,141,255,.14); }
.menu-id { display: flex; gap: 8px; align-items: center; padding: 8px; }
.menu-id img { width: 36px; height: 36px; }
.flag { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }
.docs .code, .key-once pre { position: relative; }
pre { background: #070d18; border-radius: 14px; padding: 14px; overflow: auto; border: 1px solid var(--line); }
.copy { position: absolute; right: 8px; top: 8px; background: #18243a; }
.admin { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.side { display: grid; align-content: start; gap: 6px; }
.side a { text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.side a:hover { background: rgba(76,141,255,.12); }
.range a { text-decoration: none; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.range a.is-active { background: var(--blue); color: #04101f; }
.bars { height: 120px; display: flex; align-items: end; gap: 4px; }
.bars div { flex: 1; height: 100%; display: flex; align-items: end; }
.bars span { display: block; width: 100%; background: linear-gradient(180deg, var(--blue-2), var(--blue)); border-radius: 6px 6px 0 0; min-height: 2px; }
.foot { border-top: 1px solid var(--line); position: relative; z-index: 1; }
.foot-inner { display: flex; justify-content: space-between; gap: 18px; padding: 22px 0 32px; }
.foot nav { display: flex; gap: 14px; }
.foot a { color: var(--muted); text-decoration: none; }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.more { margin-top: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
fieldset[data-cat][disabled] { display: none; }
.skeleton { background: linear-gradient(90deg, #152033, #22314c, #152033); background-size: 200% 100%; animation: shine 1.1s linear infinite; border-radius: 10px; min-height: 18px; }
@keyframes shine { to { background-position: -200% 0; } }
@media (max-width: 980px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #0c1424; border-bottom: 1px solid var(--line); padding: 10px 16px 16px; flex-direction: column; }
  .nav.is-open { display: flex; }
  .hero, .stats, .grid-2, .admin, .split { grid-template-columns: 1fr; }
  .top-inner { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  table.catalog { min-width: 0; }
  table.catalog thead { display: none; }
  table.catalog, table.catalog tbody, table.catalog tr, table.catalog td { display: block; width: 100%; }
  table.catalog tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.catalog td { border: 0; display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; }
  table.catalog td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
  .empty-row { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
