﻿:root {
  --panel-sidebar: #fff;
  --panel-canvas: #f4f6f8;
  --panel-card: #fff;
  --panel-elevated: #fff;
  --panel-border: #e8ecf0;
  --panel-text: #1f2937;
  --panel-muted: #6b7280;
  --panel-hover: #f8fafc;
  --panel-active: #f1f5f9;
  --panel-input: #fff;
  --shadow-card: 0 1px 2px #1018280a, 0 1px 3px #1018280f;
  --shadow-pop: 0 12px 32px #1018281f;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: #e0f2fe;
  --ok: #059669;
  --ok-soft: #d1fae5;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --err: #dc2626;
  --err-soft: #fee2e2;
}

.dark {
  color-scheme: dark;
  --panel-sidebar: #0b0e14;
  --panel-canvas: #12141c;
  --panel-card: #161b22;
  --panel-elevated: #1c2230;
  --panel-border: #2a3140;
  --panel-text: #e8edf2;
  --panel-muted: #94a3b8;
  --panel-hover: #1c2230;
  --panel-active: #232a38;
  --panel-input: #121820;
  --shadow-card: 0 1px 2px #00000059, 0 4px 12px #00000040;
  --shadow-pop: 0 16px 40px #0000008c;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-soft: #0c4a6e;
  --ok: #34d399;
  --ok-soft: #064e3b;
  --warn: #fbbf24;
  --warn-soft: #78350f;
  --err: #f87171;
  --err-soft: #7f1d1d;
}

* { box-sizing: border-box; border: 0 solid; margin: 0; padding: 0; }

html { height: 100%; line-height: 1.5; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--panel-canvas);
  color: var(--panel-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main, section { display: block; }

a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); }
a.link:hover { color: var(--accent-hover); }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; }

h1, h2, h3, h4 { font-weight: 600; }
small { font-size: 80%; }

main { flex: 1; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.muted { color: var(--panel-muted); }
.small { font-size: 12px; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-text { display: inline-flex; align-items: center; gap: 8px; }
.icon-text svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--panel-border);
  background: var(--panel-elevated);
  color: var(--panel-text);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--panel-hover); border-color: var(--panel-border); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ok { color: var(--ok); border-color: var(--ok); }
.btn-ok:hover { background: var(--ok-soft); }

.btn-primary, .btn-ok {
  position: relative;
  overflow: hidden;
}
.btn-primary::after, .btn-ok::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .25), transparent);
  transform: skewX(-20deg);
  animation: btn-shine 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-shine {
  0%, 72% { left: -70%; }
  100% { left: 140%; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary::after, .btn-ok::after { animation: none; display: none; }
}
.btn-warn { color: var(--warn); border-color: var(--warn); }
.btn-warn:hover { background: var(--warn-soft); }
.btn-danger { color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 10px 18px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-muted { background: var(--panel-active); color: var(--panel-muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.input, select.input {
  width: 100%;
  background: var(--panel-input);
  border: 1px solid var(--panel-border);
  color: var(--panel-text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--panel-muted); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field > span { font-size: 12px; font-weight: 500; color: var(--panel-muted); }
.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card {
  background: var(--panel-card);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  animation: card-in .45s cubic-bezier(.22,1,.36,1) backwards;
}

.card h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }
.card .card-sub { color: var(--panel-muted); font-size: 12px; margin: -8px 0 12px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: 6px; background: var(--panel-card); border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px 18px; }
.stat .label { display: flex; align-items: center; gap: 6px; color: var(--panel-muted); font-size: 12px; font-weight: 500; }
.stat .label svg { width: 14px; height: 14px; flex-shrink: 0; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .hint { color: var(--panel-muted); font-size: 12px; line-height: 1.3; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-weight: 500; color: var(--panel-muted); font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--panel-border); white-space: nowrap; }
table.tbl th .th-in { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
table.tbl th .th-in svg { width: 14px; height: 14px; flex-shrink: 0; }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--panel-border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .1s; }
table.tbl tbody tr:hover { background: var(--panel-hover); }

.empty { padding: 28px; text-align: center; color: var(--panel-muted); font-size: 13px; }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: 9px 14px; font-size: 13px; align-items: center; }
.kv .k { color: var(--panel-muted); }

.section-title { font-size: 15px; font-weight: 600; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title svg { width: 15px; height: 15px; color: var(--panel-muted); }

.alert { padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-err { background: var(--err-soft); color: var(--err); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

.mono-block { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--panel-canvas); border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px 10px; word-break: break-all; }

.switch { position: relative; display: inline-flex; height: 22px; width: 40px; align-items: center; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--panel-input); cursor: pointer; transition: background .15s, border-color .15s; padding: 0; flex-shrink: 0; }
.switch .knob { position: absolute; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--panel-muted); transition: left .15s, background .15s; }
.switch.on { background: var(--ok); border-color: var(--ok); }
.switch.on .knob { left: 20px; background: #fff; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.switch-row > span:first-child { display: flex; flex-direction: column; gap: 4px; }

.card { animation: card-in .45s cubic-bezier(.22,1,.36,1) backwards; }
.grid > .card:nth-child(1) { animation-delay: 30ms; }
.grid > .card:nth-child(2) { animation-delay: 70ms; }
.grid > .card:nth-child(3) { animation-delay: 110ms; }
.grid > .card:nth-child(4) { animation-delay: 150ms; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none !important; } }

.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--panel-canvas); }
.bg-fx canvas { width: 100%; height: 100%; display: block; }

.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 420px; pointer-events: none; }
.toast-in { animation: toast-in .45s cubic-bezier(.22,1,.36,1) both; }
.toast { pointer-events: auto; background: var(--panel-elevated); border: 1px solid var(--panel-border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow-pop); font-size: 13px; color: var(--panel-text); line-height: 1.4; word-break: break-word; animation: toast-in .45s cubic-bezier(.22,1,.36,1) both; }
@keyframes toast-slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.toast { animation-name: toast-slide; }
.toast-ok { border-left-color: var(--ok); }
.toast-err { border-left-color: var(--err); }
.toast-out { animation: toast-out .35s ease both !important; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-24px); } }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--panel-sidebar) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}
.site-nav-inner { display: flex; align-items: center; gap: 22px; height: 54px; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.site-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.site-brand svg { width: 24px; height: 24px; flex-shrink: 0; }
.site-links { display: flex; gap: 18px; margin-left: 6px; }
.site-links a { color: var(--panel-muted); font-size: 13px; font-weight: 500; transition: color .15s; }
.site-links a:hover { color: var(--panel-text); }
.site-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.site-footer { border-top: 1px solid var(--panel-border); padding: 22px 0; margin-top: 46px; }
.site-footer .site-nav-inner { height: auto; }
.site-foot-note { margin-left: auto; color: var(--panel-muted); font-size: 12px; }

.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 44px; align-items: center; }
.hero-copy h1 { font-size: 40px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; margin: 16px 0 14px; }
.hero-sub { color: var(--panel-muted); font-size: 15px; max-width: 470px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; gap: 3px; }
.hero-stat .value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.hero-stat .label { font-size: 12px; color: var(--panel-muted); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.feature-icon svg { width: 18px; height: 18px; }
.feature-card p { color: var(--panel-muted); font-size: 13px; margin-top: 8px; }

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.model-card { display: flex; flex-direction: column; gap: 6px; background: var(--panel-card); border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px 18px; }
.model-name { font-size: 13px; font-weight: 600; }
.model-price { color: var(--panel-muted); font-size: 12px; }
.model-price .mono { color: var(--panel-text); font-weight: 600; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 34px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.step p { color: var(--panel-muted); font-size: 13px; margin-top: 6px; }

.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--panel-card); border: 1px solid var(--panel-border); border-radius: 14px; box-shadow: var(--shadow-card); padding: 24px 28px; }

.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.page-sub { color: var(--panel-muted); font-size: 13px; margin-top: 4px; }

.login-wrap { min-height: 72vh; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.login-card { width: 380px; background: var(--panel-card); border: 1px solid var(--panel-border); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 26px; }
.login-card h1 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.login-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 0 0 16px; }
.login-card .brand svg { width: 32px; height: 32px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-swap { margin-top: 16px; text-align: center; font-size: 13px; }
.code-input { font-size: 22px; letter-spacing: 8px; text-align: center; font-weight: 700; }
.resend-btn { background: none; border: 0; cursor: pointer; font-size: inherit; font-family: inherit; color: var(--accent); padding: 0; }

.layout { display: flex; min-height: 100vh; align-items: stretch; }
.app-side { flex-shrink: 0; width: 232px; background: var(--panel-sidebar); border-right: 1px solid var(--panel-border); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.app-side .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 6px 10px 16px; }
.app-side .brand svg { width: 28px; height: 28px; flex-shrink: 0; }
.nav-group { font-size: 11px; font-weight: 600; color: var(--panel-muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--panel-muted); font-weight: 500; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--panel-hover); color: var(--panel-text); }
.nav-item.active { background: var(--panel-active); color: var(--panel-text); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.app-side .spacer { flex: 1; }
.app-side-footer { padding: 12px 10px 2px; font-size: 12px; color: var(--panel-muted); border-top: 1px solid var(--panel-border); display: flex; flex-direction: column; gap: 10px; }
.theme-toggle { background: none; border: 1px solid var(--panel-border); color: var(--panel-muted); border-radius: 8px; padding: 4px 8px; cursor: pointer; display: inline-flex; align-items: center; }
.theme-toggle:hover { color: var(--panel-text); background: var(--panel-hover); }
.theme-toggle svg { width: 14px; height: 14px; }
.app-content { flex: 1; min-width: 0; padding: 26px 30px 56px; }
.app-content > .card { margin-bottom: 18px; }
.app-content > .grid { margin-bottom: 18px; }
.app-content > .section-title { margin: 10px 0 14px; }

.app-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.wallet-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.key-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.key-value { flex: 1; min-width: 220px; padding: 9px 12px; border-radius: 8px; background: var(--panel-input); border: 1px solid var(--panel-border); overflow-x: auto; white-space: nowrap; }

.tg-link-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 10px; }
.link-code { padding: 10px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px dashed var(--accent); color: var(--accent); font-size: 18px; font-weight: 700; letter-spacing: 4px; }

.code-block { background: var(--panel-canvas); border: 1px solid var(--panel-border); border-radius: 8px; padding: 12px 14px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 10px 0; font-family: ui-monospace, Menlo, Consolas, monospace; }

.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 14px; }
.topup-form, .promo-form { display: flex; flex-direction: column; gap: 12px; }
.promo-form { flex-direction: row; }
.promo-form .input { flex: 1; }
.topup-status { margin-top: 10px; min-height: 16px; }

.donut { width: 138px; height: 138px; flex-shrink: 0; }
.donut-big { fill: var(--panel-text); font-size: 14px; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; }
.donut-sub { fill: var(--panel-muted); font-size: 9px; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; min-width: 170px; flex: 1; }
.donut-leg { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-leg .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-leg .mono { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut circle.seg { transition: stroke-width .18s ease, opacity .18s ease; cursor: pointer; }
.donut circle.seg:hover { stroke-width: 13; opacity: .9; }
.donut g.donut-segs { transform-origin: 60px 60px; animation: donut-spin .9s cubic-bezier(.22,1,.36,1) both; }
@keyframes donut-spin { from { transform: rotate(-200deg) scale(.55); opacity: 0; } to { transform: rotate(0) scale(1); opacity: 1; } }
.donut-hover .donut-big { fill: var(--accent); }

.chart { width: 100%; height: 150px; display: block; }
.chart .bar { fill: var(--accent); opacity: .75; transition: opacity .15s; }
.chart .bar:hover { opacity: 1; }
.chart .bar-cost { fill: #22c55e; }
.chart-wrap { position: relative; }
.chart-labels { display: flex; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--panel-muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.chart rect.bar { transform-box: fill-box; transform-origin: bottom center; animation: bar-grow .8s cubic-bezier(.22,1,.36,1) both; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart rect.bar:hover { opacity: 1; filter: brightness(1.3); }

.status-model { padding: 12px 16px; border-bottom: 1px solid var(--panel-border); }
.status-model:last-child { border-bottom: 0; }
.status-model-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.status-model-head .mono { font-weight: 600; }
.mp-matrix-line { display: flex; align-items: center; gap: 10px; margin: 3px 0; }
.mp-matrix-tag { width: 34px; font-size: 11px; color: var(--panel-muted); font-weight: 600; text-align: right; flex-shrink: 0; }
.mp-matrix-bars-row { display: flex; gap: 3px; flex: 1; }
.mp-matrix-pill { height: 12px; border-radius: 4px; flex: 1; min-width: 5px; background: var(--panel-active); }
.mp-matrix-pill.is-green { background: var(--ok); }
.mp-matrix-pill.is-yellow { background: var(--warn); }
.mp-matrix-pill.is-red { background: var(--err); }
.mp-matrix-pill.is-gray { background: var(--panel-active); border: 1px solid var(--panel-border); }
.mp-matrix-num { font-size: 12px; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; width: 64px; text-align: right; flex-shrink: 0; }
.mp-matrix-num.is-green { color: var(--ok); }
.mp-matrix-num.is-yellow { color: var(--warn); }
.mp-matrix-num.is-red { color: var(--err); }
.mp-matrix-num.is-muted { color: var(--panel-muted); }
.mp-matrix-bars { flex: 1; min-width: 0; }
.mp-matrix-scale { display: flex; justify-content: space-between; font-size: 9px; color: var(--panel-muted); margin-top: 2px; }
.status-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--panel-card); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 14px; font-size: 12px; margin-bottom: 18px; }
.status-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.status-legend .dot.is-green { background: var(--ok); }
.status-legend .dot.is-yellow { background: var(--warn); }
.status-legend .dot.is-red { background: var(--err); }
.status-legend .dot.is-gray { background: var(--panel-active); border: 1px solid var(--panel-border); }

.modal-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(9, 12, 18, 0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal-card { width: 100%; max-width: 420px; background: var(--panel-card); border: 1px solid var(--panel-border); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 22px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }

.tg-phone { background: radial-gradient(circle at 20% 10%, rgba(126,231,255,.14), transparent 45%), radial-gradient(circle at 80% 90%, rgba(126,231,255,.1), transparent 40%), linear-gradient(160deg, #0e2a47, #1d3d5c 55%, #122b44); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-pop); }
.tg-head { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.28); padding: 10px 14px; margin-bottom: 16px; backdrop-filter: blur(4px); }
.tg-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #0ea5e9); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.tg-avatar svg { width: 18px; height: 18px; }
.tg-name { color: #fff; font-weight: 600; font-size: 14px; }
.tg-sub { color: #9fb8cc; font-size: 11px; }
.tg-chat { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 16px 18px; min-height: 300px; justify-content: flex-end; }
.tg-bubble { background: #2b5278; color: #fff; border-radius: 12px 12px 12px 4px; padding: 9px 13px; max-width: 85%; font-size: 13px; line-height: 1.45; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tg-bubble.out { background: var(--accent); border-radius: 12px 12px 4px 12px; align-self: flex-end; }
.tg-bubble.ok { background: #2b6e5a; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-copy h1 { font-size: 32px; }
  .feature-grid, .model-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .layout { flex-direction: column; }
  .app-side { width: 100%; height: auto; position: static; }
  .app-content { padding: 18px 16px 40px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .site-links { display: none; }
}

@media (max-width: 700px) {
  .hero { padding: 40px 0; }
  .feature-grid, .model-grid, .steps, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
  .app-side-footer { display: none; }
  .site-actions .btn-ghost { display: none; }
  .kv { grid-template-columns: 130px 1fr; }
}
