:root {
  --font: "Inter", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --maxw: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

html[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f6f5;
  --surface-2: #efefed;
  --border: #e4e4e2;
  --border-strong: #c9c9c6;
  --text: #0a0a0a;
  --muted: #666666;
  --faint: #6a6a6a;
  --ok: #1a7f56;
  --ok-bg: #e8f3ee;
  --warn: #8a6116;
  --warn-bg: #f7f0e2;
  --err: #b3384a;
  --err-bg: #faecef;
  --code-bg: #0a0a0a;
  --code-ink: #f2f2f2;
}

html[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --border: #242424;
  --border-strong: #3d3d3d;
  --text: #fafafa;
  --muted: #a0a0a0;
  --faint: #8c8c8c;
  --ok: #4ade9d;
  --ok-bg: rgba(74, 222, 157, .12);
  --warn: #f0b24e;
  --warn-bg: rgba(240, 178, 78, .12);
  --err: #ff7285;
  --err-bg: rgba(255, 114, 133, .12);
  --code-bg: #141414;
  --code-ink: #f2f2f2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15.5px;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s var(--ease), color .3s var(--ease);
}

main {
  flex: 1 0 auto;
  width: 100%;
}

.page-narrow {
  max-width: 1000px;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(42px, 6vw, 72px);
}

h2 {
  font-size: clamp(30px, 4vw, 46px);
}

h3 {
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .92em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 450;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  margin-bottom: 26px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.header {
  position: sticky;
  top: 14px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  margin-top: 14px;
}

.maint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg) 70%, var(--warn-bg));
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  color: var(--warn);
  font-size: 13.5px;
  line-height: 1.35;
}

.maint-bar svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.maint-bar b {
  font-weight: 600;
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 12px 9px 22px;
  max-width: 100%;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  place-items: center;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts.gstatic.com/s/ibmplexsans-v23-600.ttf") format("truetype");
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.logo .wordmark {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.logo-mark {
  width: 30px;
  height: 26px;
  color: var(--text);
  display: grid;
  place-items: center;
  flex: none;
}

.logo-mark svg {
  display: block;
  width: 30px;
  height: 24px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 450;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all .2s var(--ease);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-links a.active {
  color: var(--text);
  background: var(--surface);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
}

@media (max-width: 960px) {
  .nav.is-auth .logo .wordmark { display: none; }
  .nav.is-auth { gap: 8px; padding-left: 14px; }
  .nav.is-auth .nav-right { gap: 5px; margin-left: 0; }
}

@media (max-width: 480px) {
  .nav.is-auth .btn-primary.btn-sm { padding: 8px 12px; font-size: 13px; }
  .nav.is-auth .lang-toggle { min-width: 34px; padding: 0 7px; }
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .2s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.lang-toggle {
  height: 36px;
  min-width: 40px;
  padding: 0 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 600 12px/1 var(--font);
  letter-spacing: .04em;
  display: grid;
  place-items: center;
  transition: all .2s var(--ease);
}

.lang-toggle:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--text);
}

html[data-theme="light"] .icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
  line-height: 1.2;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: .85;
}

.btn-accent {
  background: var(--text);
  color: var(--bg);
}

.btn-accent:hover {
  opacity: .85;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface);
}

.btn-danger {
  background: transparent;
  color: var(--err);
  border-color: transparent;
}

.btn-danger:hover {
  background: var(--err-bg);
}

.btn-sm {
  padding: 7px 15px;
  font-size: 13px;
}

.btn[disabled] {
  opacity: .35;
  cursor: not-allowed;
}

.hero {
  position: relative;
  padding: 130px 0 100px;
  overflow: hidden;
}

.hero-inner {
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: 22px;
}

.hero-sub {
  font-size: 17.5px;
  font-weight: 400;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin: 80px 0 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.marquee-track span {
  font-size: 14.5px;
  font-weight: 450;
  color: var(--faint);
  letter-spacing: .01em;
  white-space: nowrap;
  margin-right: 56px;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

section.block {
  padding: 100px 0;
}

.section-head {
  max-width: 620px;
  margin-bottom: 52px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .25s var(--ease);
}

.card:hover {
  border-color: var(--border-strong);
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  color: var(--muted);
  margin: 0;
  font-size: 14.5px;
  font-weight: 400;
}

.step-num {
  font-size: 12.5px;
  font-weight: 450;
  color: var(--faint);
  letter-spacing: .02em;
  margin-bottom: 16px;
  display: block;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.pager-info {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 54px;
  text-align: center;
}

.pager .btn[disabled] {
  opacity: .4;
  cursor: default;
}

.model-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  transition: border-color .2s var(--ease);
  cursor: pointer;
}

.model-chip:hover {
  border-color: var(--border-strong);
}

.model-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
  flex: none;
}

.model-chip b {
  font-size: 14px;
  font-weight: 550;
  display: block;
}

.model-chip .mono {
  color: var(--faint);
  font-size: 12.5px;
}

.model-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  transition: border-color .2s var(--ease);
}

.model-card:hover {
  border-color: var(--border-strong);
}

.model-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex: none;
}

.model-card-icon img {
  width: 18px;
  height: 18px;
}

.model-card-icon svg {
  width: 17px;
  height: 17px;
  color: var(--text);
}

html[data-theme="dark"] .vicon img[src$="ahmia.svg"],
html[data-theme="dark"] .vicon img[src$="openai.svg"],
html[data-theme="dark"] .vicon img[src$="moonshot.svg"],
html[data-theme="dark"] .vicon img[src$="grok.svg"],
html[data-theme="dark"] .console-model-brand img[src$="ahmia.svg"],
html[data-theme="dark"] .console-model-brand img[src$="openai.svg"],
html[data-theme="dark"] .console-model-brand img[src$="moonshot.svg"],
html[data-theme="dark"] .console-model-brand img[src$="grok.svg"],
html[data-theme="dark"] .model-card-icon img[src$="ahmia.svg"],
html[data-theme="dark"] .model-card-icon img[src$="openai.svg"],
html[data-theme="dark"] .model-card-icon img[src$="moonshot.svg"],
html[data-theme="dark"] .model-card-icon img[src$="grok.svg"] {
  filter: invert(1);
}

html[data-theme="dark"] .vicon img[src$="kimi.svg"],
html[data-theme="dark"] .console-model-brand img[src$="kimi.svg"],
html[data-theme="dark"] .model-card-icon img[src$="kimi.svg"] {
  background: #fafafa;
  border-radius: 4px;
  padding: 1px;
}

.model-card-body {
  flex: 1;
  min-width: 0;
}

.model-card-body b {
  font-size: 14px;
  font-weight: 550;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-card-body .mono {
  color: var(--faint);
  font-size: 12px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  transition: all .2s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.copied {
  color: #2ecc8f;
  border-color: transparent;
}

.user-status-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.user-status-row:first-child {
  border-top: none;
}

.user-status-row > .muted {
  min-width: 72px;
}

.user-status-val {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.limit-ico {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  margin-right: 3px;
  color: var(--faint);
}

.plans-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 2fr 40px;
  align-items: center;
  gap: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: border-color .25s var(--ease);
  position: relative;
}

.plan-row:hover {
  border-color: var(--border-strong);
}

.plan-row.highlight {
  border: 1.5px solid var(--text);
}

.plan-row.highlight::before {
  content: "популярный";
  position: absolute;
  top: -12px;
  left: 32px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border-radius: var(--radius-pill);
  padding: 4px 13px;
}

.plan-name {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.plan-name small {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.plan-price {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.plan-price .old {
  font-size: 14.5px;
  color: var(--faint);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 8px;
}

.plan-price small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
}

.plan-limits {
  display: flex;
  gap: 26px;
  justify-content: flex-end;
  text-align: right;
}

.plan-limit b {
  display: block;
  font-size: 15.5px;
  font-weight: 550;
}

.plan-limit span {
  font-size: 12px;
  color: var(--faint);
  font-weight: 400;
}

.plan-arrow {
  color: var(--faint);
  transition: all .2s var(--ease);
  text-align: center;
}

.plan-row:hover .plan-arrow {
  color: var(--text);
  transform: translateX(3px);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 36px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.metric b {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 10px;
  transition: border-color .2s var(--ease);
}

.faq details[open] {
  border-color: var(--border-strong);
}

.faq summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 15.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--faint);
  transition: transform .25s var(--ease);
  flex: none;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  color: var(--muted);
  margin: 14px 0 0;
  font-size: 14.5px;
  font-weight: 400;
}

.cta {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 84px 40px;
}

footer.footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 48px 0 60px;
  flex-shrink: 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.auth-wrap {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 40px 0;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
}

.auth-card h1 {
  font-size: 26px;
  margin-bottom: 6px;
}

.auth-card .sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
  font-weight: 400;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 450;
  color: var(--muted);
  margin-bottom: 7px;
}

.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s var(--ease);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--text);
}

.alert {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.alert-err {
  background: var(--err-bg);
  color: var(--err);
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.code-block {
  position: relative;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 14px;
  padding: 18px 20px;
  padding-right: 118px;
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  margin: 14px 0;
}

.code-block .code-pre {
  margin: 0;
  font: inherit;
  color: inherit;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-block .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .08);
  color: #d0d0d0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  cursor: pointer;
  opacity: 1;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.code-block .copy-btn:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.docs-toc {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-toc a {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 9px;
}

.docs-toc a:hover {
  color: var(--text);
  background: var(--surface);
}

.docs-body h2 {
  font-size: 27px;
  margin-top: 56px;
  padding-top: 8px;
  scroll-margin-top: 100px;
}

.docs-body h2:first-child {
  margin-top: 0;
}

.docs-body p {
  color: var(--muted);
  font-weight: 400;
}

table.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

table.table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.table tr:last-child td {
  border-bottom: none;
}

table.table tbody tr {
  transition: background .15s;
}

table.table tbody tr:hover {
  background: var(--surface);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 4px 11px;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-err {
  background: var(--err-bg);
  color: var(--err);
}

.badge-mute {
  background: var(--surface-2);
  color: var(--muted);
}

.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--text);
  border-radius: var(--radius-pill);
  transition: width .4s var(--ease);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.filter-bar button {
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 450;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: all .2s var(--ease);
}

.filter-bar button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-bar button.active {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 36px;
  align-items: start;
  padding: 40px 0 80px;
}

.admin-nav {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-nav .title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 12px;
  margin: 22px 0 6px;
}

.admin-nav .title:first-child {
  margin-top: 0;
}

.admin-nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 10px;
  transition: all .15s;
}

.admin-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.admin-nav a.active {
  color: var(--text);
  background: var(--surface);
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.admin-head h1 {
  font-size: 30px;
  margin: 0;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 18px;
  margin-bottom: 18px;
}

.inline-form {
  display: inline;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.key-reveal {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  margin: 12px 0;
}

.key-reveal .small {
  font-family: var(--font);
}

.fade-up {
  animation: fadeUp .5s var(--ease) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel {
    min-width: 0;
  }
  .plan-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .plan-limits {
    justify-content: flex-start;
    text-align: left;
  }
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-layout > * {
    min-width: 0;
  }
  .docs-toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
  }
  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-layout > * {
    min-width: 0;
  }
  .admin-nav {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 4px 2px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar {
    display: none;
  }
  .admin-nav .title {
    display: none;
  }
  .admin-nav a {
    white-space: nowrap;
    flex: none;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
  }
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .nav {
    gap: 10px;
    padding: 8px 14px;
  }
  .logo {
    min-width: 0;
  }
  .nav-right {
    margin-left: auto;
    gap: 6px;
  }
  .nav-toggle {
    display: inline-grid;
  }
  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .18s var(--ease), transform .18s var(--ease);
  }
  .nav.nav-open .nav-links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links a {
    padding: 11px 14px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .logo span:not(.logo-mark):not(.wordmark) {
    display: none;
  }
  .header {
    padding: 0 12px;
  }
  input, select, textarea {
    font-size: 16px !important;
  }
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
}

@media (max-width: 720px) {
  .btn {
    max-width: 100%;
    white-space: normal;
  }
  .admin-head {
    flex-wrap: wrap;
    gap: 12px;
  }
  .admin-head > div {
    flex-wrap: wrap;
  }
  .filter-bar {
    flex-wrap: wrap;
  }
  .log-filter-input {
    flex: 1 1 140px;
    min-width: 0;
  }
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

html.js .model-grid-pending {
  visibility: hidden;
}

.model-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  transition: border-color .2s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.model-tile:hover { border-color: var(--border-strong); }

.model-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.model-tile-vendor {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 450;
}

.model-tile .vicon,
.model-card .vicon { width: 20px; height: 20px; overflow: hidden; }

.model-tile .vicon img,
.model-card .vicon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.model-tile .vicon svg,
.model-card .vicon svg {
  width: 18px;
  height: 18px;
  color: var(--text);
}

.model-tile-icon-big {
  margin-bottom: 12px;
}

.model-tile .vicon,
.model-card .vicon { display: block; }

.model-tile-name {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-tile-id {
  color: var(--faint);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-tile-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.model-tile-id-row .mono {
  color: var(--faint);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-tile-vendor-bottom {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.model-tile-more {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  border-style: dashed;
}

.model-tile-more-count {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.model-tile-more-label {
  color: var(--faint);
  font-size: 13px;
}

.model-tile-more-link {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 10px;
}

.pricing-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  align-items: stretch;
  max-width: 1020px;
  margin: 0 auto;
}

.pricing-grid > .pricing-card {
  flex: 0 1 calc((100% - 28px) / 3);
  min-width: 0;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  transition: border-color .25s var(--ease);
}

.pricing-card:hover { border-color: var(--border-strong); }

.pricing-card.highlight { border: 1.5px solid var(--text); }

.pricing-name {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pricing-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin: 4px 0 22px;
  min-height: 40px;
}

.pricing-price {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.pricing-price .old {
  font-size: 15px;
  color: var(--faint);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 8px;
}

.pricing-period {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 24px;
}

.pricing-limits {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.pricing-limits li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.pricing-limits svg {
  width: 13px;
  height: 13px;
  color: var(--faint);
  flex: none;
  align-self: center;
}

.pricing-limits b {
  color: var(--text);
  font-weight: 550;
  font-size: 14.5px;
  min-width: 52px;
}

@media (max-width: 960px) {
  .model-grid { grid-template-columns: 1fr; }
  .pricing-grid > .pricing-card { flex-basis: 100%; }
}
.log-filter-input {
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .2s var(--ease);
  color-scheme: inherit;
}

.log-filter-input:focus { border-color: var(--text); }

.log-filter-input::placeholder { color: var(--faint); }
.btn-ico {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn .btn-ico:first-child { margin-left: -3px; }

.modal {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  padding: 26px;
  width: min(720px, calc(100vw - 40px));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.modal::backdrop {
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 19px;
}
.panel-equal {
  display: flex;
  flex-direction: column;
}

.panel-equal .btn,
.panel-equal form { margin-top: auto; }

.panel-equal form { display: block; }

.panel-equal > form[style*="flex"] { margin-top: auto; }.nowrap { white-space: nowrap; }

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.date-input {
  min-width: 128px;
}

@media (max-width: 720px) {
  .usage-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

.th-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.th-job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.th-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px 36px;
}

.th-hero-main,
.th-hero-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.th-big {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.th-progress {
  height: 10px;
  margin: 4px 0 2px;
}

.th-forecast {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.th-capacity {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.th-capacity > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.th-capacity b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.th-of {
  color: var(--faint);
  font-weight: 500;
}

.th-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.th-grid {
  margin-bottom: 20px;
}

.th-grid .panel {
  margin-bottom: 0;
}

.th-stack {
  display: flex;
  height: 14px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface-2);
  gap: 2px;
}

.th-stack i {
  display: block;
  height: 100%;
  min-width: 4px;
}

.seg-0 { background: var(--ok); }
.seg-1 { background: color-mix(in srgb, var(--ok) 50%, var(--warn)); }
.seg-2 { background: var(--warn); }
.seg-3 { background: color-mix(in srgb, var(--warn) 45%, var(--err)); }
.seg-full { background: var(--err); }
.seg-idle { background: var(--border-strong); }
.seg-none { background: var(--border); }

.th-legend,
.th-resets {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.th-legend li,
.th-resets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.th-legend li i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.th-legend li b,
.th-resets li b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.th-resets {
  margin-top: 0;
}

.th-note {
  color: var(--warn);
  margin-top: 14px;
}

.th-table-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.th-table-head h2 .muted {
  font-size: 14px;
  font-weight: 400;
  margin-left: 6px;
}

.th-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.th-filters .filter-bar {
  margin-bottom: 0;
}

.th-search {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  min-width: 240px;
}

.th-search:focus {
  outline: none;
  border-color: var(--border-strong);
}

.th-account {
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
}

.th-err {
  max-width: 220px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.th-usage {
  min-width: 110px;
}

.th-usage .progress {
  margin-bottom: 6px;
}

.th-usage .progress i {
  background: var(--ok);
}

.th-usage .progress.is-high i {
  background: var(--warn);
}

.th-usage .progress.is-full i {
  background: var(--err);
}

.th-table .row-actions {
  flex-wrap: nowrap;
}

.th-settings {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

.th-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin: 4px 0 12px;
  cursor: pointer;
}

.th-tabs {
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .th-hero,
  .th-grid,
  .th-capacity,
  .th-settings {
    grid-template-columns: minmax(0, 1fr);
  }
  .th-big {
    font-size: 32px;
  }
  .th-search {
    min-width: 0;
    width: 100%;
  }
}

.admin-layout > div {
  min-width: 0;
}

table.th-table th,
table.th-table td {
  padding-left: 7px;
  padding-right: 7px;
}

.th-table .btn-sm {
  padding: 6px 10px;
}

.th-table .row-actions {
  gap: 4px;
}

@media (max-width: 720px) {
  table.th-table,
  .th-table tbody {
    display: block;
    width: 100%;
  }
  .th-table thead {
    display: none;
  }
  .th-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 14px 2px;
    border-bottom: 1px solid var(--border);
  }
  .th-table tbody tr[hidden] {
    display: none;
  }
  table.th-table td {
    display: block;
    padding: 0;
    border: none;
    min-width: 0;
  }
  .th-table td:nth-child(1),
  .th-table td:nth-child(2) {
    grid-column: 1 / -1;
  }
  .th-table td:nth-child(2) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
  }
  .th-table td:nth-child(2) .th-err {
    margin-top: 0;
  }
  .th-table td:nth-child(3) {
    grid-column: 1 / -1;
  }
  .th-table td:nth-child(5) {
    text-align: right;
  }
  .th-table td.th-open {
    display: none;
  }
  .th-table td[colspan] {
    grid-column: 1 / -1;
  }
  .th-account {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .th-err {
    max-width: none;
  }
}

.th-clip {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-row {
  cursor: pointer;
}

.th-row:hover td,
.th-row:focus-visible td {
  background: var(--surface);
}

.th-row:focus-visible {
  outline: none;
}

.th-open {
  color: var(--faint);
  font-size: 20px;
  text-align: right;
  width: 24px;
}

.th-current {
  margin-top: 6px;
}

.th-acc-modal {
  width: min(560px, calc(100vw - 32px));
}

.th-detail-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.th-detail-head .th-account {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.th-dl {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0 0 18px;
  font-size: 14px;
}

.th-dl dt {
  color: var(--muted);
}

.th-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.th-errtext {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  color: var(--err);
  max-height: 160px;
  overflow: auto;
}

.th-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .th-clip {
    max-width: 100%;
  }
  .th-dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .th-dl dd {
    margin-bottom: 8px;
  }
}

.pager[hidden],
.pr-item[hidden] {
  display: none;
}

.pr-note {
  margin: -12px 0 18px;
  max-width: 720px;
}

.pr-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pr-filters .th-search {
  flex: 1 1 260px;
}

.pr-filters select {
  flex: 1 1 120px;
  min-width: 0;
}

.pr-list {
  display: flex;
  flex-direction: column;
}

.pr-item {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.pr-item:first-child {
  border-top: none;
  padding-top: 4px;
}

.pr-meta {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pr-model {
  flex-shrink: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}

.pr-user {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

a.pr-user {
  color: var(--accent);
}

.pr-time {
  margin-left: auto;
}

.pr-text {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  max-height: 180px;
  overflow: hidden;
}

.pr-text.is-open {
  max-height: none;
}

.pr-toggle {
  margin-top: 8px;
}

.pr-answer {
  margin-top: 12px;
}

.pr-answer .pr-text {
  background: transparent;
  border: 1px solid var(--border);
}

.pr-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.pr-retention {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-status-val.user-rpm {
  margin-left: 0;
  flex-wrap: wrap;
}

.user-rpm input.log-filter-input.user-ban-reason {
    width: 260px;
    max-width: 100%;
}

.user-rpm input.log-filter-input {
  width: 110px;
  flex: none;
}

.pr-retention label {
  white-space: nowrap;
}

.pr-retention input.log-filter-input {
  width: 90px;
  flex: none;
}

@media (max-width: 720px) {
  .pr-time {
    margin-left: 0;
    width: 100%;
  }
}

.th-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.th-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 0;
}

.th-stat b {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.th-stat .th-of {
  font-size: 15px;
  letter-spacing: 0;
}

.th-stat > span {
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-stat.is-warn b {
  color: var(--warn);
}

.th-stat.is-err b {
  color: var(--err);
}

.th-spread {
  margin: 14px 0 0;
}

.th-table-head {
  align-items: center;
  margin-bottom: 14px;
}

.th-table-head h2 {
  margin-bottom: 2px;
}

.th-table-head .th-search {
  min-width: 260px;
}

.th-chips button {
  font-size: 13px;
  padding: 6px 13px;
}

.th-resets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.th-resets-head h2 {
  margin-bottom: 0;
}

.th-resets-head .filter-bar {
  margin-bottom: 0;
  gap: 6px;
}

.th-resets-head .filter-bar button {
  font-size: 12.5px;
  padding: 4px 11px;
}

.th-resets-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 9px 14px;
  font: 500 13.5px var(--font);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.th-resets-more:hover {
  border-color: var(--border-strong);
}

.th-resets-more svg {
  width: 15px;
  height: 15px;
  transition: transform .2s var(--ease);
}

.th-resets-more:hover svg {
  transform: translateX(3px);
}

.th-rm {
  width: min(620px, calc(100vw - 32px));
}

.th-rm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.th-rm-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.th-rm-stats b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.th-rm-stats span {
  font-size: 12.5px;
  color: var(--muted);
}

.th-rm-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.th-rm-tools .filter-bar {
  margin-bottom: 0;
  gap: 6px;
}

.th-rm-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  max-height: min(56vh, 520px);
  overflow-y: auto;
}

.th-rm-day {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 2px 6px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.th-rm-day:first-child {
  padding-top: 2px;
}

.th-rm-day b {
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.th-rm-row {
  display: grid;
  grid-template-columns: 118px 104px minmax(40px, 1fr) 76px;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: 14px;
}

.th-rm-when {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.th-rm-when b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.th-rm-date {
  font-size: 12px;
  color: var(--muted);
}

.th-rm-list.by-date .th-rm-date {
  display: none;
}

.th-rm-until {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.th-rm-meter {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.th-rm-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--text);
  opacity: .75;
}

.th-rm-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.th-rm-count span {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .th-rm-stats b {
    font-size: 17px;
  }
  .th-rm-stats div {
    padding: 10px 11px;
  }
  .th-rm-row {
    grid-template-columns: minmax(0, 1fr) 64px;
    grid-template-areas: "when count" "meter meter";
    row-gap: 7px;
  }
  .th-rm-when { grid-area: when; }
  .th-rm-count { grid-area: count; }
  .th-rm-meter { grid-area: meter; }
  .th-rm-until { display: none; }
}

@media (max-width: 720px) {
  .th-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .th-stat {
    flex-direction: column;
    gap: 2px;
  }
  .th-table-head .th-search {
    min-width: 0;
    width: 100%;
  }
  .th-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -2px;
    padding-bottom: 4px;
  }
  .th-chips button {
    flex: none;
  }
}

[hidden] {
  display: none !important;
}

.us-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -12px 0 18px;
}

.us-links > span {
  margin-right: auto;
}

.us-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.us-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-width: 0;
}

.us-tile b {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.us-sub {
  margin: -10px 0 16px;
}

.us-window-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.us-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 2px;
  height: 180px;
  align-items: end;
  padding-top: 22px;
  border-bottom: 1px solid var(--border);
}

.us-col {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  cursor: default;
}

.us-col i {
  display: block;
  width: 70%;
  max-width: 28px;
  min-height: 2px;
  background: var(--ok);
  border-radius: 4px 4px 0 0;
}

.us-col i.is-zero {
  background: var(--border);
}

.us-col:hover i {
  filter: brightness(1.15);
}

.us-day {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.us-peak {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
}

.us-col[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.us-col:first-child[data-tip]:hover::after {
  left: 0;
  transform: none;
}

.us-col:last-child[data-tip]:hover::after {
  left: auto;
  right: 0;
  transform: none;
}

.us-chart + * {
  margin-top: 30px;
}

.panel:has(.us-chart) {
  padding-bottom: 40px;
}

.us-split {
  gap: 20px;
  margin-bottom: 20px;
}

.us-split .panel {
  margin-bottom: 0;
}

.us-models {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.us-model-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.us-model-head .mono {
  overflow-wrap: anywhere;
}

.us-model-head .small:last-child {
  white-space: nowrap;
  color: var(--muted);
}

.us-models .progress i {
  background: var(--ok);
}

.us-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}

.us-facts dt {
  color: var(--muted);
}

.us-facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.us-ips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.us-ip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 720px) {
  .us-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .us-chart {
    height: 140px;
  }
  .us-day {
    font-size: 10px;
  }
  .us-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.px-traffic {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px 36px;
}

.px-traffic-main,
.px-traffic-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.px-traffic .progress i {
  background: var(--ok);
}

.px-traffic .progress.is-high i {
  background: var(--warn);
}

.px-traffic .progress.is-full i {
  background: var(--err);
}

.px-reset {
  grid-column: 1 / -1;
}

.px-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.px-err {
  color: var(--err);
}

@media (max-width: 720px) {
  .px-traffic,
  .px-settings {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer-support {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.footer-support:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.footer-support svg,
.support-fab svg {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 50%;
  background: #2aabee;
  color: #fff;
}

.footer-support span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-size: 14px;
}

.footer-support small {
  color: var(--muted);
  font-size: 12px;
}

.support-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: gap .25s var(--ease), padding .25s var(--ease), border-color .2s var(--ease);
}

.support-fab svg {
  width: 40px;
  height: 40px;
  padding: 10px;
}

.support-fab span {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width .25s var(--ease);
}

.support-fab:hover,
.support-fab:focus-visible {
  gap: 10px;
  padding-right: 16px;
  border-color: var(--border-strong);
}

.support-fab:hover span,
.support-fab:focus-visible span {
  max-width: 120px;
}

body:has(.admin-layout) .support-fab {
  display: none;
}

@media (max-width: 720px) {
  .support-fab {
    right: 16px;
    bottom: 16px;
  }
  .support-fab svg {
    width: 36px;
    height: 36px;
    padding: 9px;
  }
}

.px-find {
  margin: 14px 0 6px;
}

.px-free-settings {
  margin-top: 12px;
}

.px-free-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.px-free-row input.log-filter-input {
  width: 90px;
  flex: none;
}

.support-fab.is-hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.support-fab {
  transition: gap .25s var(--ease), padding .25s var(--ease), border-color .2s var(--ease), opacity .25s var(--ease), transform .25s var(--ease);
}

.px-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.px-title h1 {
  margin: 0;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover {
  color: var(--text);
}

th.sortable::after {
  content: "";
  display: inline-block;
  width: 10px;
  margin-left: 4px;
  opacity: .35;
}

th.sortable.is-asc::after {
  content: "↑";
  opacity: 1;
}

th.sortable.is-desc::after {
  content: "↓";
  opacity: 1;
}

.code-users div {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  align-items: baseline;
}

.code-users a {
  overflow-wrap: anywhere;
}

/* rustvy brand and additions to the existing public pages. */
.logo .wordmark {
  display: inline;
}

.community-avatar {
  flex: none;
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.community-profile {
  display: block;
  margin-bottom: 24px;
  border-radius: 50%;
}

.plan-preview .metric {
  text-align: center;
  transition: border-color .2s var(--ease);
}

.plan-preview .metric:hover {
  border-color: var(--border-strong);
}

.plan-preview .metric b {
  margin: 10px 0 4px;
  font-size: 34px;
}

.metric-featured {
  border-color: var(--text);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.plan-preview .plan-badge {
  margin-left: 8px;
}

.plans-page {
  padding: 70px 24px 72px;
}

.plans-page .pricing-grid {
  max-width: none;
}

.pricing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
}

.pricing-heading .pricing-name {
  margin: 0;
}

.pricing-card .pricing-desc {
  min-height: 0;
  margin: 10px 0 26px;
}

.pricing-card .pricing-price {
  font-size: 42px;
  line-height: 1.15;
}

.pricing-card .pricing-limits {
  padding-top: 4px;
}

.pricing-card .btn {
  width: 100%;
}

.token-section {
  margin-top: 86px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 100px;
}

.token-section .section-head {
  margin-bottom: 32px;
}

.token-section h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.token-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.token-card h3 {
  margin-bottom: 4px;
  font-size: 24px;
}

.token-price {
  margin: 22px 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.03em;
}

.token-card .btn {
  width: 100%;
  padding-left: 12px;
  padding-right: 12px;
}

.purchase-note {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-wrap {
  padding: 48px 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--faint);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.telegram-login {
  width: 100%;
}

.auth-status,
.auth-purchase {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.auth-purchase {
  margin: -8px 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.docs-layout {
  grid-template-columns: 240px minmax(0, 1fr);
}

.docs-body {
  min-width: 0;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

@media (max-width: 960px) {
  .token-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 721px) and (max-width: 960px) {
  .plan-preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 80px;
  }
  .plans-page {
    padding-top: 50px;
  }
  .token-section {
    margin-top: 56px;
    padding-top: 36px;
  }
  .token-card {
    padding: 20px;
  }
  .auth-card {
    padding: 30px 24px;
  }
}

@media (max-width: 420px) {
  .token-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .logo .wordmark {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .fade-up { animation: none; }
}

.hero-title{font-size:clamp(40px,5vw,64px);line-height:1.03;letter-spacing:-.055em}
.hero-title span{display:block;font-size:clamp(30px,4.1vw,50px);margin-top:18px;line-height:1.12;letter-spacing:-.04em}
.hero .hero-sub{max-width:690px;text-wrap:pretty}
.hero-inner{max-width:960px}
.plan-intent{font-size:12px;color:var(--muted);margin:0 0 12px}
.pricing-card .pricing-desc{min-height:65px}
.token-secondary{margin-top:56px;padding-top:28px;color:var(--muted)}
.token-secondary summary{display:inline-flex;align-items:center;min-height:24px;cursor:pointer;width:fit-content;font-size:14px;color:var(--muted)}
.token-secondary-content{padding-top:28px}
.token-secondary .token-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-width:660px}
.token-secondary .token-card h3{font-size:21px}
@media(max-width:540px){.token-secondary .token-grid{grid-template-columns:1fr}.hero-title span{font-size:30px}.pricing-card .pricing-desc{min-height:0}}
.model-grid{gap:10px}
.model-tile{border-radius:10px;padding:14px 16px;gap:4px}
.model-tile-name{font-size:16px}
.model-tile-vendor-bottom{margin-top:10px;padding-top:9px;font-size:11.5px}
.model-tile-more-count{font-size:22px}
.model-tile-more-label{font-size:12px}
.model-tile-more-link{font-size:12.5px;margin-top:6px}
.pricing-grid{gap:10px;max-width:960px}
.pricing-card{border-radius:12px;padding:20px 20px}
.pricing-name{font-size:18px}
.pricing-desc{font-size:12.5px;margin:4px 0 14px}
.pricing-price{font-size:28px}
.pricing-period{font-size:11px}
.plan-intent{font-size:12px;margin-top:8px}
.pricing-limits li{font-size:12px;margin:5px 0}
.pricing-card .btn{margin-top:14px;min-height:34px;font-size:12.5px}
.token-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px}
.token-card{padding:18px 16px;border-radius:12px}
.token-card h3{font-size:17px}
.token-price{font-size:22px}
.token-secondary-content{padding-top:8px}
@media(min-width:961px){
  .plans-page .pricing-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));max-width:1200px;align-items:stretch}
  .plans-page .token-secondary .token-grid{grid-template-columns:repeat(5,minmax(0,1fr));max-width:none}
}

/* compact rustvy public interface */
body{font-size:15px}
.hero{padding:96px 0 64px}
.hero h1{margin-bottom:18px;font-size:clamp(40px,5.5vw,64px)}
.hero-title span{font-size:clamp(28px,3.8vw,44px);margin-top:14px}
.hero .hero-sub{font-size:16px;margin-bottom:28px}
.marquee{margin-top:56px;padding:16px 0}
section.block{padding:64px 0}
.section-head{margin-bottom:34px}
.section-head h2{font-size:clamp(28px,3.4vw,40px)}
.card{padding:20px;border-radius:16px}
.metrics{margin-top:26px;gap:10px}
.metric{padding:18px 20px;border-radius:16px}
.metric b{font-size:24px}
.cta{padding:56px 32px;border-radius:20px}
footer.footer{padding:36px 0 44px}
.plans-page{padding:52px 24px 56px}
.plans-page .section-head{margin-bottom:32px}
.plans-page .section-head h1{font-size:clamp(38px,4vw,48px)}
.plans-page .pricing-card{padding:18px;border-radius:14px}
.plans-page .pricing-card .pricing-desc{min-height:0;margin:6px 0 14px;font-size:12.5px}
.plans-page .pricing-card .pricing-price{font-size:32px}
.plans-page .pricing-period{margin:2px 0 14px}
.plans-page .plan-intent{margin:0 0 10px}
.plans-page .pricing-limits{gap:8px;margin-bottom:12px}
.plans-page .pricing-limits li{margin:0}
.plans-page .pricing-card .btn{margin-top:12px}
.plans-page .token-secondary{margin-top:40px;padding-top:24px}
.plans-page .token-card{padding:14px 14px;border-radius:10px}
.plans-page .token-card h3{font-size:16px}
.plans-page .token-price{font-size:20px}
@media(max-width:720px){
  .hero{padding:64px 0 48px}
  section.block{padding:48px 0}
  .section-head{margin-bottom:26px}
  .cta{padding:40px 20px}
  .plans-page{padding-top:40px}
  .plans-page .section-head h1{font-size:38px}
}
@media(max-width:540px){
  .hero-title span{font-size:28px}
  .hero .hero-sub{font-size:15px}
}

/* v41: монохромный акцент, карточки тарифов по референсу, тонкие скроллбары, юридические страницы */
html[data-theme="light"] {
  --accent: #0a0a0a;
  --accent-soft: rgba(10, 10, 10, .06);
  --accent-border: rgba(10, 10, 10, .4);
}
html[data-theme="dark"] {
  --accent: #fafafa;
  --accent-soft: rgba(250, 250, 250, .08);
  --accent-border: rgba(250, 250, 250, .45);
}
html { scrollbar-width: thin; scrollbar-color: var(--border-strong) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.plans-page .pricing-grid { gap: 12px; max-width: 1020px; }
.plans-page .pricing-card { padding: 16px; border-radius: 14px; }
.plans-page .pricing-card.highlight { border: 1px solid var(--text); }
.plans-page .pricing-name { font-size: 16px; font-weight: 500; }
.plans-page .pricing-card .pricing-desc { min-height: 0; margin: 4px 0 12px; font-size: 12px; }
.plans-page .pricing-card .pricing-price { font-size: 28px; font-weight: 450; letter-spacing: -.03em; line-height: 1.15; }
.plans-page .pricing-period { margin: 2px 0 10px; font-size: 11px; }
.plans-page .plan-intent { margin: 0 0 8px; font-size: 11.5px; }
.plans-page .pricing-limits { gap: 6px; margin-bottom: 12px; padding-top: 0; }
.plans-page .pricing-limits li { font-size: 12px; margin: 0; }
.plans-page .pricing-card .btn { margin-top: 10px; min-height: 32px; font-size: 12px; }

.legal { max-width: 760px; }
.legal h1 { font-size: 34px; margin-bottom: 6px; }
.legal .legal-date { margin: 0 0 10px; font-size: 12.5px; color: var(--faint); }
.legal h2 { margin: 30px 0 10px; font-size: 17px; font-weight: 550; letter-spacing: -.01em; }
.legal p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
