/* =============================================================
   AnyTokens / FunPay Gateway — Liquid Glass (Жидкое стекло)
   Палитра согласована с WebGL-шейдером:
   Глубокий сапфировый обсидиан, арктический циан и электрик-лазурь.
   Никакого фиолетового / сиреневого.
   ============================================================= */

:root {
  /* Палитра из WebGL-шейдера (waveColor1, waveColor2, waveColor3) */
  --bg: #070a10;
  --panel: rgba(11, 17, 28, 0.72);
  --panel-2: rgba(16, 25, 42, 0.62);
  --panel-glass: rgba(255, 255, 255, 0.04);
  --line: rgba(56, 189, 248, 0.12);
  --line-2: rgba(56, 189, 248, 0.24);
  --line-glow: rgba(14, 165, 233, 0.4);
  --txt: #f0f4f9;
  --dim: #94a3b8;
  --dim-2: #64748b;
  
  /* Акцентный цвет шейдера: арктический циан & сапфировый лазурит */
  --acc: #0ea5e9;
  --acc-h: #38bdf8;
  --acc-grad: linear-gradient(135deg, #0284c7 0%, #0ea5e9 60%, #06b6d4 100%);
  --acc-glow: rgba(14, 165, 233, 0.35);
  
  --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  --ok: #10b981;
  --ok-glow: rgba(16, 185, 129, 0.4);
  --warn: #f59e0b;
  --crit: #ef4444;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.public-page { font-family: var(--ui-font, system-ui, sans-serif); }
.public-page > .top, .public-page > .wrap { zoom: var(--element-scale, 1); }
.public-page button, .public-page select { font-family: inherit; }
.public-page :where(h1, h2, h3, p, li, .stat, .key-head) { overflow-wrap: break-word; }
.public-page .wrap > *, .public-page .key-row > input { min-width: 0; }
.language-switch {
  display: flex; gap: 3px; padding: 4px; flex-shrink: 0; border-radius: 11px;
  background: rgba(10, 25, 43, .75); border: 1px solid var(--line-2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .15); backdrop-filter: blur(14px);
}
.language-switch button {
  border: 0; border-radius: 7px; padding: 7px 11px; background: transparent; color: var(--dim);
  font-size: .75rem; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s;
}
.language-switch button:hover { color: white; background: rgba(56, 189, 248, .1); }
.language-switch button[aria-pressed="true"] { background: #087cb2; color: white; box-shadow: 0 2px 12px rgba(14, 165, 233, .25); }
.public-page :where(button, a, select, input, summary):focus-visible { outline: 2px solid #67d5ff; outline-offset: 3px; }

/* The tab stays at the left edge while its panel slides into view. */
.appearance-panel {
  position: fixed; z-index: 50; left: 0; top: 50%; width: min(304px, calc(100vw - 48px));
  transform: translate(-100%, -50%); transition: transform .4s cubic-bezier(.22, 1, .36, 1);
  filter: drop-shadow(8px 10px 24px rgba(0, 0, 0, .28));
}
.appearance-panel[data-open="true"] { transform: translate(0, -50%); }
.appearance-body {
  padding: 22px; max-height: min(760px, 85dvh); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(11, 21, 35, .97); border: 1px solid #263c54; border-left: 0; border-radius: 0 16px 16px 0;
  scrollbar-width: thin; scrollbar-color: #2b526c transparent;
}
.appearance-heading { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 700; }
.appearance-heading i { color: #6bd6ff; }
.appearance-heading h2 { font-size: inherit; }
.appearance-intro { margin-top: 5px; color: var(--dim); font-size: .75rem; }
.appearance-backgrounds { border: 0; padding: 0; margin: 22px 0; min-width: 0; }
.appearance-backgrounds legend { margin-bottom: 10px; font-size: .8125rem; font-weight: 600; }
.background-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.background-options button {
  padding: 5px 5px 8px; border-radius: 10px; border: 1px solid #2c4057; background: #142135;
  color: var(--txt); cursor: pointer; transition: border-color .2s, background .2s, transform .2s;
  display: grid; gap: 4px; font-size: .6875rem; line-height: 1.3;
}
.background-options button:hover { transform: translateY(-2px); border-color: #5abfdf; }
.background-options button[aria-pressed="true"] { border-color: #5dccf1; background: #163a52; box-shadow: 0 0 0 1px #5dccf1; }
.background-options small { font-size: .625rem; color: #a1b5ca; }
.background-preview { height: 44px; width: 100%; border-radius: 6px; display: block; overflow: hidden; }
.background-preview.waves { background: radial-gradient(ellipse at 15% 85%, #4a74ac, transparent 60%), linear-gradient(145deg, #122337, #325987, #102037); }
.background-preview.aurora { background: radial-gradient(ellipse at 75% 20%, #51d3c699, transparent 55%), repeating-linear-gradient(145deg, #072435, #135a72 8%, #0a2742 20%); }
.background-preview.flat { background: #070a10; border: 1px solid #2a394b; }
.appearance-field { display: grid; gap: 10px; margin: 18px 0; font-size: .8125rem; }
.appearance-field > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.appearance-field output { font-family: var(--mono); font-size: .6875rem; color: #80d8ff; background: #132e42; padding: 3px 6px; border-radius: 5px; }
.appearance-field input[type="range"] { width: 100%; accent-color: #38bdf8; cursor: pointer; min-height: 22px; }
.appearance-field select { width: 100%; min-width: 0; padding: 10px; font: inherit; background: #142135; border-color: #2c4057; }
.appearance-check { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; font-size: .8125rem; cursor: pointer; }
.appearance-check input { appearance: none; flex-shrink: 0; width: 32px; height: 18px; border: 1px solid #405b75; background: #203248; border-radius: 20px; cursor: pointer; transition: background .2s, border-color .2s; }
.appearance-check input::before { content: ''; display: block; width: 12px; height: 12px; margin: 2px; border-radius: 50%; background: #b6c5d8; transition: transform .2s, background .2s; }
.appearance-check input:checked { background: #087ba8; border-color: #38bdf8; }
.appearance-check input:checked::before { transform: translateX(13px); background: #fff; }
.appearance-reset { width: 100%; margin-top: 15px; padding: 10px; border: 1px solid #324a63; border-radius: 8px; background: #142135; color: #dce9f6; cursor: pointer; font-size: .75rem; transition: background .2s, border-color .2s; }
.appearance-reset:hover { background: #1d334b; border-color: #5abfdf; }
.appearance-note { font-size: .625rem; color: #8c9fb6; text-align: center; margin-top: 10px; }
.appearance-tab {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%); width: 30px; min-height: 94px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: #12283e; color: #8fcde9; border: 1px solid #325372; border-left: 0; border-radius: 0 8px 8px 0;
  font-size: .6875rem; cursor: pointer; transition: background .2s, color .2s, width .2s;
}
.appearance-tab span { writing-mode: vertical-rl; }
.appearance-tab:hover, .appearance-panel[data-open="true"] .appearance-tab { background: #164362; color: #e0f6ff; }
.appearance-panel[data-open="true"] .appearance-tab i { transform: rotate(90deg); }
.appearance-tab i { transition: transform .3s; }

.public-page.solid-cards { --panel: #0c1422; --panel-2: #121e30; }
.solid-cards :where(.card, .quota-card, .stat, .usage-guide, .activity-scroll, .language-switch, .code-block, .model, .btn, input, .badge) {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.solid-cards :where(.language-switch, .model, .code-block, .btn-ghost, .btn:not(.btn-primary), input[type="text"], input[type="password"], .badge) { background-color: #101f32; }
.public-page a { transition: color .2s; }
.public-page a:hover { color: #b1eaff; }
.public-page .model { transition: transform .25s, border-color .25s, background .25s; }
.public-page .model:hover { transform: translateY(-3px); border-color: #4aa6c8; }
.public-page .integration summary { transition: color .2s, padding .2s; }
.public-page .integration summary:hover { color: #8bddff; padding-left: 3px; }
.public-page details[open] > :not(summary) { animation: details-in .3s ease both; }
.public-page .anim-in { animation: rise .4s ease both; }
.public-page .motion-ready { opacity: 0; transform: translateY(14px); transition: opacity .55s, transform .55s, border-color .25s, box-shadow .25s; }
.public-page .motion-ready.in-view { opacity: 1; transform: none; }
#shader-bg { transition: opacity .45s; }
body[data-shader="off"] #shader-bg { opacity: 0; }
.public-page.shader-unavailable:not([data-shader="off"]) { background: radial-gradient(ellipse at 20% 15%, #18344e, #070a10 75%); }
@keyframes details-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .public-page .top { padding-left: 30px; padding-right: 14px; gap: 8px; }
  .public-page .wrap { padding-left: 30px; padding-right: 14px; }
  .public-page .card { padding: 18px 15px; }
  .public-page .logo-dim { display: none; }
  .public-page .buy-row { flex-wrap: wrap; }
  .public-page .key-row { gap: 7px; }
  .public-page .stats { gap: 8px; }
  .public-page .stat { padding: 12px 10px; }
  .appearance-body { padding: 18px; max-height: 82dvh; }
  .appearance-tab { width: 26px; min-height: 92px; }
}
@media (hover: none) { .appearance-tab { min-height: 100px; } }
[data-motion="off"] { scroll-behavior: auto; }
.motion-off *, .motion-off *::before, .motion-off *::after { animation: none !important; transition: none !important; }
.motion-off .motion-ready { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) { scroll-behavior: auto; }
  html:not([data-motion="on"]) .public-page *, html:not([data-motion="on"]) .public-page *::before, html:not([data-motion="on"]) .public-page *::after { animation: none !important; transition: none !important; }
}
.admin-login { width:100%; max-width:480px; margin:40px auto; }
.login-form { display:grid; gap:12px; margin-top:24px; }
.login-form label { font-size:0.8125rem; font-weight:600; }
.login-form input { width:100%; min-width:0; min-height:48px; }
.login-form .btn { min-height:48px; margin-top:8px; justify-content:center; }
#admin-otp-input, #mfa-code { font:1.375rem var(--mono); letter-spacing:.3em; width:100%; }
#mfa-panel { width:calc(100% - 32px); }
#mfa-panel input, #mfa-panel button { display:block; width:100%; margin-top:12px; min-height:44px; }
#mfa-panel p, #mfa-panel h3 { margin:14px 0; }
#mfa-secret { overflow-wrap:anywhere; }
.model-editor { display:grid; gap:12px; margin-top:20px; }
.model-editor-row { display:grid; grid-template-columns:1.1fr 1fr 1.5fr .65fr auto; gap:12px; align-items:end; padding:16px; border:1px solid var(--line); border-radius:12px; }
.model-editor-row label { display:grid; gap:8px; font-size:0.75rem; min-width:0; }
.model-editor-row input { width:100%; min-width:0; }
.editor-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:20px; }
#models-status { margin-top:12px; }
.integration { border-top:1px solid var(--line); padding:18px 0; }
.integration summary { cursor:pointer; font-weight:600; display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.integration summary span { font-size:0.75rem; color:var(--dim); font-weight:400; }
.integration p, .integration ol { margin-top:12px; line-height:1.65; }
.integration ol { padding-left:24px; }
.integration pre { margin-top:14px; padding:16px; border:1px solid var(--line); border-radius:10px; white-space:pre-wrap; overflow-wrap:anywhere; font:0.75rem/1.6 var(--mono); }
.integration code, .model .mono { overflow-wrap:anywhere; }
@media(max-width:800px) {
  .model-editor-row { grid-template-columns:1fr 1fr; }
  body.widescreen .top { flex-wrap:wrap; gap:12px; padding:20px 16px 0; max-width:100%; }
  body.widescreen .wrap { padding:20px 16px 40px; max-width:100%; }
  .admin-login { margin:20px auto; }
}
@media(max-width:480px) { .model-editor-row { grid-template-columns:1fr; } .editor-actions .btn { width:100%; } }
html { scroll-behavior: smooth; font-size: calc(1rem * var(--text-scale, 1)); }

body {
  background: var(--bg);
  color: var(--txt);
  font: 0.9375rem/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */
.top {
  max-width: 880px; margin: 0 auto; padding: 22px 20px 0;
  display: flex; align-items: center; justify-content: space-between;
  transition: max-width .2s ease;
}
.wrap { 
  max-width: 880px; margin: 0 auto; padding: 30px 20px 56px; 
  display: flex; flex-direction: column; gap: 18px; 
  transition: max-width .2s ease;
}

/* Широкий полноэкранный режим для панели управления */
body.widescreen .top, .top.wrap-wide { max-width: 96vw; padding: 22px 32px 0; }
body.widescreen .wrap, .wrap.wrap-wide { max-width: 96vw; padding: 24px 32px 64px; }
@media (min-width: 1920px) {
  body.widescreen .top, .top.wrap-wide { max-width: 1800px; }
  body.widescreen .wrap, .wrap.wrap-wide { max-width: 1800px; }
}

.logo {
  font-weight: 700; letter-spacing: .01em; font-size: 1rem;
  display: flex; align-items: center; gap: 10px; color: var(--txt);
  text-decoration: none;
  transition: opacity .2s;
}
.logo:hover { opacity: .9; }
.logo-mark {
  width: 13px; height: 13px; display: inline-block;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  clip-path: polygon(0 50%, 25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}
.logo-dim { color: var(--dim-2); font-weight: 500; }

/* ---------- СТАТУСНЫЙ ИНДИКАТОР: ЖИДКОЕ СТЕКЛО + РАДАР ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.78125rem; font-weight: 600;
  color: #f1f5f9; border-radius: 30px; padding: 6px 14px;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transition: all .25s ease;
}
.status-pill:hover {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.status-pill.bad {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Радарный пульсирующий индикатор */
.dot-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
}
.dot-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.8;
  animation: radar-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.status-pill.bad .dot-ring {
  background: var(--crit);
}

.status-pill .dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981, 0 0 3px #fff;
  animation: dot-glow 2s ease-in-out infinite alternate;
}
.status-pill.bad .dot {
  background: var(--crit);
  box-shadow: 0 0 10px var(--crit);
}

@keyframes radar-ping {
  0% { transform: scale(1); opacity: 0.8; }
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

@keyframes dot-glow {
  0% { filter: brightness(0.9); }
  100% { filter: brightness(1.3); transform: scale(1.1); }
}

/* ---------- HERO ---------- */
.hero { padding: 22px 0 6px; }
.hero h1 { font-size: clamp(1.75rem, calc(4.8vw * var(--text-scale, 1)), 2.625rem); font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.hero h1 .grad {
  background: linear-gradient(135deg, #ffffff 40%, #7dd3fc 75%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sub { color: var(--dim); margin-top: 10px; font-size: 0.9375rem; }
.showcase-link { margin-top: 14px; }
.showcase-link a {
  color: var(--acc-h); font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  transition: transform .2s ease, color .2s ease;
}
.showcase-link a:hover { color: #bae6fd; transform: translateX(3px); }

/* ---------- КАРТОЧКИ: САПФИРОВОЕ ЖИДКОЕ СТЕКЛО ---------- */
.card {
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.card:hover {
  border-color: var(--line-2);
  box-shadow: 0 20px 48px 0 rgba(0, 0, 0, 0.55), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}
.reveal { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- ПОЛЯ ВВОДА: ТЕМНЫЙ САПФИР ---------- */
.label {
  display: flex; gap: 7px; align-items: center; font-size: 0.71875rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 10px;
  font-weight: 600;
}
.key-row { display: flex; gap: 10px; }

input[type="password"], input[type="text"], input[type="number"], select, textarea {
  flex: 1;
  background: rgba(7, 12, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 10px; color: var(--txt);
  padding: 12px 15px; font: 0.875rem var(--mono);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #0ea5e9;
  background: rgba(10, 16, 28, 0.9);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ---------- КНОПКИ: СТЕКЛО В ЦВЕТАХ ШЕЙДЕРА ---------- */
.btn {
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(14, 165, 233, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  border-radius: 10px; padding: 11px 18px; font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  text-decoration: none;
}
.btn:hover {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.38);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.22);
}
.btn:active { transform: translateY(0); filter: brightness(0.95); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }

/* Главная люминесцентная кнопка (Cyan-Sapphire) */
.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 60%, #06b6d4 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  box-shadow: 0 6px 22px rgba(14, 165, 233, 0.4), inset 0 1px 1.5px rgba(255, 255, 255, 0.5);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #0ea5e9 100%);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.7);
  filter: brightness(1.08);
}

.btn-block { width: 100%; margin-top: 14px; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
}
.btn-sm { padding: 7px 13px; font-size: 0.78125rem; border-radius: 8px; }

/* ---------- ОШИБКИ И УВЕДОМЛЕНИЯ ---------- */
.error {
  margin-top: 12px; padding: 12px 15px; border-radius: 10px; font-size: 0.84375rem;
  background: rgba(239, 68, 68, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
}
.hidden { display: none !important; }

/* ---------- РЕЗУЛЬТАТ И БЕЙДЖИ ---------- */
.key-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mono { font-family: var(--mono); font-size: 0.875rem; color: #cbd5e1; }
.label-val { color: var(--txt); font-weight: 600; }

.badge {
  font-size: 0.71875rem; padding: 4px 10px; border-radius: 8px; letter-spacing: .03em;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.18); color: var(--dim);
}
.badge-ok { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }
.badge-crit { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #f87171; }

.sec-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: .09em; color: var(--dim);
  margin: 18px 0 12px; font-weight: 700;
}
.sec-title i { color: var(--acc); }

.bar { height: 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #0284c7, #38bdf8); transition: width .5s ease; }
.bar.warn i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar.crit i { background: linear-gradient(90deg, #ef4444, #f87171); }

.quota-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px; padding: 15px 18px; margin-bottom: 14px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.quota-card .big { font-size: 1.4375rem; font-weight: 800; font-family: var(--mono); color: #fff; }
.quota-card .dim { color: var(--dim); font-size: 0.78125rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cache-status { margin: 0 0 12px; color: var(--txt); font-size: .875rem; line-height: 1.6; }
.stat {
  background: var(--panel-2);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  transition: transform .2s ease, border-color .2s ease;
}
.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat .t { font-size: 0.6875rem; color: var(--dim); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat .v { font-size: 1.125rem; font-weight: 700; font-family: var(--mono); margin-top: 5px; color: #fff; }

/* Usage explanation and key activity. */
.usage-guide { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); margin-bottom: 16px; overflow: hidden; }
.usage-guide summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 17px; cursor: pointer; list-style: none; color: #e0f2fe; font-size: 0.875rem; font-weight: 600; }
.usage-guide summary::-webkit-details-marker { display: none; }
.usage-guide summary:hover { background: rgba(56, 189, 248, .06); }
.usage-guide summary:focus-visible, .activity-scroll:focus-visible { outline: 2px solid var(--acc); outline-offset: -3px; }
.usage-guide summary i { flex-shrink: 0; color: var(--acc); transition: transform .2s; }
.usage-guide[open] summary { border-bottom: 1px solid var(--line); }
.usage-guide[open] summary i { transform: rotate(180deg); }
.usage-guide-body { padding: 4px 17px 17px; color: var(--dim); font-size: 0.8125rem; line-height: 1.75; }
.usage-guide-body h3 { margin: 17px 0 9px; color: var(--txt); font-size: 0.875rem; }
.usage-guide-body p { margin: 8px 0; }
.token-formula { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.token-formula p { margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.token-formula strong { display: block; margin-bottom: 4px; color: #7dd3fc; }
.token-formula span { display: block; }
.usage-guide-body .formula-example { margin-top: 12px; color: #d3e1f1; }
.usage-guide-body .usage-guide-note { font-size: 0.75rem; color: var(--dim); }
.token-tips { padding-left: 22px; margin: 8px 0 0; }
.token-tips li + li { margin-top: 9px; }
.token-tips strong { color: #dce8f5; font-weight: 600; }
.recent-activity { margin-top: 20px; }
.recent-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.recent-heading h3 { font-size: 0.875rem; margin: 0; color: var(--txt); }
.activity-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.activity-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.75rem; }
.activity-table th { padding: 12px; color: var(--dim); text-align: left; font-weight: 600; border-bottom: 1px solid var(--line); background: rgba(56, 189, 248, .04); }
.activity-table th span { display: block; font-weight: 400; }
.activity-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.activity-table tr:last-child td { border-bottom: 0; }
.activity-table tbody tr:hover { background: rgba(56, 189, 248, .03); }
.activity-table th:nth-child(n+3), .activity-number, .activity-charge { text-align: right; }
.activity-time, .activity-number, .activity-charge { font-family: var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.activity-model { min-width: 112px; max-width: 220px; overflow-wrap: anywhere; }
.activity-date { display: block; color: var(--dim); font-size: 0.625rem; margin-top: 4px; }
.activity-charge { color: #e0f2fe; font-weight: 600; }
.activity-cache { display: block; color: #5ee2b0; font: 0.625rem/1.5 system-ui, sans-serif; margin-top: 4px; white-space: normal; }
.activity-table .activity-empty { text-align: center; padding: 24px 16px; white-space: normal; }
.activity-empty strong { display: block; color: var(--txt); font-size: 0.8125rem; }
.activity-empty span { display: block; margin-top: 6px; color: var(--dim); font-size: 0.75rem; }
.activity-note { margin: 9px 0 0; color: var(--dim); font-size: 0.6875rem; line-height: 1.6; }
@media (max-width: 560px) {
  .token-formula { grid-template-columns: minmax(0, 1fr); }
  .usage-guide summary { padding: 13px; font-size: 0.8125rem; }
  .usage-guide-body { padding: 2px 13px 13px; }
  .recent-heading { align-items: flex-start; }
  .activity-scroll:has(.activity-empty) .activity-table { min-width: 0; }
  .activity-scroll:has(.activity-empty) .activity-table thead { display: none; }
}

/* ---------- КОД ---------- */
.muted { color: var(--dim); font-size: 0.875rem; }
.small { font-size: 0.78125rem; }
.code-block {
  background: rgba(6, 10, 18, 0.82);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 12px; margin-top: 14px; overflow: hidden;
}
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  font-size: 0.71875rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600;
}
.code-block code { display: block; padding: 13px 15px; font: 0.78125rem/1.65 var(--mono); color: #cbd5e1; word-break: break-all; }

/* CLI setup: full-width terminals share one responsive grid. */
.setup-title { margin: 0 0 10px; font-size: clamp(1.3125rem, calc(4vw * var(--text-scale, 1)), 1.75rem); line-height: 1.25; letter-spacing: -.025em; }
.setup-intro { margin: 0 0 22px; line-height: 1.7; }
.terminal-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: 100%; }
.terminal-card { min-width: 0; overflow: hidden; border: 1px solid #253447; border-radius: 14px; background: #090f19; box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.035); }
.terminal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #1c293b; background: #101a28; }
.terminal-platform { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: #e2e8f0; font-size: 0.8125rem; font-weight: 600; }
.terminal-platform > i { color: #6ac9ef; }
.terminal-platform > span { color: #8a9bb1; font: 0.6875rem var(--mono); }
.terminal-copy { flex-shrink: 0; display: inline-flex; gap: 7px; align-items: center; padding: 8px 11px; border: 1px solid #34475e; border-radius: 8px; background: #18273a; color: #dceaf6; font: 0.75rem/1.25 system-ui, sans-serif; cursor: pointer; }
.terminal-copy:hover { background: #243a51; border-color: #55a9ca; }
.terminal-copy:focus-visible { outline: 2px solid #67cfff; outline-offset: 3px; }
.terminal-card pre { margin: 0; padding: 20px; color: #c5e7f7; font: 0.8125rem/1.8 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.setup-features { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; color: #a4b6ca; font-size: 0.75rem; }
.setup-features span { display: inline-flex; align-items: center; gap: 6px; }
.setup-features i { color: #5dcaa5; }
.catalog-note { margin: 18px 0 0; color: var(--dim); font-size: 0.75rem; line-height: 1.7; }
@media (max-width: 480px) {
  .terminal-head { padding: 12px; gap: 8px; }
  .terminal-platform { max-width: 52%; gap: 5px 7px; }
  .terminal-platform > span { flex-basis: 100%; padding-left: 21px; }
  .terminal-card pre { padding: 16px; font-size: 0.75rem; }
}

/* ---------- МОДЕЛИ (ШОУКЕЙС) ---------- */
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.model {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  background: var(--panel-2);
  backdrop-filter: blur(14px);
  transition: all .2s ease;
}
.model:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(22, 35, 58, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.model .name { font-weight: 600; font-size: 0.9375rem; line-height: 1.4; display: flex; gap: 8px; align-items: center; justify-content: space-between; color: #fff; }
.model .name i { color: var(--acc); font-size: 0.75rem; }
.model .name .model-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.3px;
  margin-left: auto;
}
.model .meta { color: var(--dim-2); font-size: 0.71875rem; font-family: var(--mono); margin-top: 5px; }
.model .model-rate { margin-top: 12px; color: #a6d5e8; }

/* ---------- САППОРТ ---------- */
.support-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.support .sec-title { margin-top: 0; }
.buy-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.foot { text-align: center; color: var(--dim-2); font-size: 0.78125rem; padding-top: 10px; }

/* ---------- АДМИНКА: ТАБЛИЦЫ, ВКЛАДКИ, ФОРМЫ ---------- */
.admin-table-wrap {
  width: 100%; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px; margin-top: 16px;
  background: rgba(10, 16, 28, 0.65);
  backdrop-filter: blur(16px);
}
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.84375rem; }
.admin-table th {
  background: rgba(14, 165, 233, 0.05);
  padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--dim);
  font-size: 0.71875rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
}
.admin-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(56, 189, 248, 0.03); }

.nav-tabs {
  display: flex; gap: 8px; border-bottom: 1px solid var(--line);
  padding-bottom: 10px; margin-bottom: 18px; flex-wrap: wrap;
}
.nav-tab {
  background: rgba(14, 165, 233, 0.04);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.12);
  color: var(--dim); padding: 9px 16px; border-radius: 10px; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: all .2s ease;
}
.nav-tab:hover { color: #fff; border-color: rgba(56, 189, 248, 0.3); background: rgba(14, 165, 233, 0.1); }
.nav-tab.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(6, 182, 212, 0.3) 100%);
  border-color: rgba(6, 182, 212, 0.55);
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  color: #fff;
}

.modal-bg {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 999; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: rgba(13, 20, 34, 0.92);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 18px; width: 100%; max-width: 660px; padding: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* ФИНАНСОВЫЕ КАРТОЧКИ: ИЗУМРУД И САПФИР */
.financial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.fin-card {
  background: var(--panel-2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  position: relative; transition: all .25s ease;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.fin-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.fin-card.highlight {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, var(--panel-2) 100%);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.fin-card .fin-title { font-size: 0.71875rem; color: var(--dim); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.fin-card .fin-val { font-size: 1.5rem; font-weight: 800; font-family: var(--mono); margin-top: 6px; color: #fff; }
.fin-card .fin-val.green { color: #34d399; text-shadow: 0 0 14px rgba(52, 211, 153, 0.4); }
.fin-card .fin-val.accent { color: #38bdf8; text-shadow: 0 0 14px rgba(56, 189, 248, 0.4); }
.fin-card .fin-sub { font-size: 0.71875rem; color: var(--dim-2); margin-top: 5px; }

.badge-profit {
  background: rgba(16, 185, 129, 0.16); color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700; font-family: var(--mono); border-radius: 8px;
  padding: 4px 10px; font-size: 0.78125rem; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}
.badge-cost {
  background: rgba(239, 68, 68, 0.12); color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
  font-family: var(--mono); border-radius: 8px; padding: 4px 10px; font-size: 0.71875rem;
}
.badge-bonus {
  background: rgba(14, 165, 233, 0.16); color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 8px;
  padding: 4px 10px; font-size: 0.75rem; font-weight: 600;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.2);
}

@media (max-width: 560px) {
  .card { padding: 18px; }
  .support-row, .buy-row { flex-direction: column; align-items: stretch; }
}

