:root {
  --bg: #091019;
  --panel: #0e1724;
  --panel-2: #111d2d;
  --border: #213247;
  --border-2: #31465f;
  --text: #e8f0ff;
  --muted: #91a2bc;
  --primary: #67f0a8;
  --primary-2: #37d985;
  --danger: #ff6f7c;
  --warn: #ffb85c;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --pixel-shadow: 4px 4px 0 rgba(18, 29, 45, 0.8);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #08111b 0%, #091019 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.app-shell { min-height: 100vh; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.section { padding: 32px 0 20px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(8, 16, 25, 0.72);
  border-bottom: 1px solid rgba(103, 240, 168, 0.08);
}

.brand-row {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.brand-mark {
  width: 18px;
  height: 18px;
  background: var(--primary);
  box-shadow: 4px 0 0 #1f513d, 0 4px 0 #1f513d, 4px 4px 0 #1f513d;
  border-radius: 2px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav a {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
}

.top-nav a.active,
.top-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px auto;
  transition: .2s ease;
}

.eyebrow {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 16px;
}

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: clamp(32px, 4vw, 58px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
}

h3 {
  font-size: 20px;
}

.lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.max-700 { max-width: 700px; }

.card {
  background: linear-gradient(180deg, rgba(15, 24, 38, 0.97), rgba(11, 18, 30, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-hero { padding: 36px; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 24px;
  align-items: stretch;
  padding-top: 42px;
}

.hero-console { padding: 22px; }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  font-weight: 700;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  cursor: pointer;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: #06220f;
  border-color: transparent;
  box-shadow: var(--pixel-shadow);
}

.btn-secondary {
  background: rgba(255,255,255,0.03);
  color: var(--text);
}

.btn-sm { padding: 10px 14px !important; }
.btn-block { width: 100%; }

.inline-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.inline-stats div {
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.inline-stats strong {
  display: block;
  font-size: 20px;
}

.inline-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a3b50;
}

.terminal-head span:first-child { background: #ff7d85; }
.terminal-head span:nth-child(2) { background: #ffc767; }
.terminal-head span:nth-child(3) { background: #5af2a0; }

.terminal-head p {
  color: var(--muted);
  font-size: 13px;
}

.console-grid,
.stack-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mini-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 14px;
}

.mini-panel label,
.stat-card span,
.card-topline span,
.price-tier {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.mini-panel strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
}

.mini-panel small,
.stat-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.mini-panel.success { border-color: rgba(103, 240, 168, 0.35); }
.mini-panel.danger { border-color: rgba(255, 111, 124, 0.35); }

.signal-rows {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.signal-rows.compact { margin-top: 0; }

.signal-rows div:first-child,
.signal-rows div:nth-child(3),
.signal-rows div:nth-child(5) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.progress {
  height: 12px;
  background: #09111c;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #b4ffd7);
}

.progress.amber i {
  background: linear-gradient(90deg, var(--warn), #ffd798);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 24px;
}

.section-head.center-head {
  justify-content: center;
  text-align: center;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card,
.pricing-card {
  padding: 24px;
}

.feature-card p,
.pricing-card p,
.auth-panel p,
.doc-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(103,240,168,0.08);
  border: 1px solid rgba(103,240,168,.24);
  margin-bottom: 16px;
  font-weight: 800;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.analytics-grid.three-up { grid-template-columns: repeat(3, 1fr); }
.analytics-grid.two-up { grid-template-columns: repeat(2, 1fr); }

.stat-card {
  padding: 22px;
  grid-column: span 4;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
}

.wide-card {
  grid-column: span 6;
  padding: 22px;
}

.chart-card {
  grid-column: 1 / -1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card-topline strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}

.badge-green {
  background: rgba(103,240,168,0.12);
  color: var(--primary);
  border-color: rgba(103,240,168,.25);
}

.badge-red {
  background: rgba(255,111,124,0.12);
  color: #ff98a0;
  border-color: rgba(255,111,124,.25);
}

.line-chart {
  margin-top: 22px;
  height: 200px;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(103,240,168,0.08), transparent),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.03) 1px, transparent 1px, transparent 38px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.03) 1px, transparent 1px, transparent 48px);
}

.line-chart.tall { height: 240px; }

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.line-chart polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.event-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.event-list div {
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.event-list span { color: var(--muted); }

.cta-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-layout {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.register-layout { grid-template-columns: 1.08fr .92fr; }
.centered-auth { padding-inline: 16px; }

.auth-panel { padding: 28px; }

.auth-brand { margin-bottom: 10px; }
.auth-brand.compact { margin-bottom: 0; }

.auth-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.auth-header h1,
.auth-header h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

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

.auth-form .full { grid-column: 1 / -1; }

.auth-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  background: #09121d;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus {
  border-color: rgba(103,240,168,.45);
  box-shadow: 0 0 0 4px rgba(103,240,168,.08);
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.form-row.between { justify-content: space-between; }

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.check-row input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--primary);
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--muted);
}

.auth-aside {
  background: linear-gradient(180deg, rgba(13, 26, 41, .96), rgba(11,18,30,.98));
}

.auth-bullets {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-bullets div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(103,240,168,.12);
}

.mt-20 { margin-top: 20px; }
.narrow { width: min(560px, 100%); }

.pricing-card h2 {
  font-size: 48px;
  margin-top: 12px;
}

.pricing-card ul {
  margin: 18px 0 20px;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.pricing-card.featured {
  border-color: rgba(103,240,168,.34);
  box-shadow: 0 0 0 1px rgba(103,240,168,.15), var(--shadow);
}

.compact-pricing .pricing-card h2 {
  font-size: 34px;
}

.component-stack { display: grid; gap: 20px; }
.component-title { margin-bottom: 12px; }

.showcase-row {
  padding: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.showcase-row.wrap { flex-wrap: wrap; }

.progress-card-stack { padding: 20px; }
.component-alerts { display: grid; gap: 12px; }

.alert-card { padding: 18px 20px; }
.alert-safe { border-color: rgba(103,240,168,.35); }
.alert-warn { border-color: rgba(255,184,92,.35); }
.alert-risk { border-color: rgba(255,111,124,.35); }

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

tbody tr:hover { background: rgba(255,255,255,.025); }

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 240px;
}

.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--value) * 1%), rgba(255,184,92,.9) 0 86%, rgba(255,111,124,.85) 0 100%);
  position: relative;
}

.donut::before {
  content: "72%";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
}

.legend-list {
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.legend-list div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.safe { background: var(--primary); }
.legend-dot.warn { background: var(--warn); }
.legend-dot.risk { background: var(--danger); }

.notice {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  line-height: 1.6;
  margin-top: 15px;
}

.notice + .notice { margin-top: 12px; }

.notice-success {
  border-color: rgba(103,240,168,.35);
  background: rgba(103,240,168,.08);
}

.notice-error {
  border-color: rgba(255,111,124,.35);
  background: rgba(255,111,124,.08);
}

.notice-warn {
  border-color: rgba(255,184,92,.35);
  background: rgba(255,184,92,.08);
}

.toast {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: auto;
  z-index: 200;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(17, 29, 45, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  line-height: 1.6;
  animation: toast-in-left .22s ease;
  text-align:center;
}

.toast-warn {
  border-color: rgba(255,184,92,.35);
  background: rgba(35, 24, 10, 0.96);
}

.toast-success {
  border-color: rgba(103,240,168,.35);
  background: rgba(10, 35, 24, 0.96);
}

.toast-error {
  border-color: rgba(255,111,124,.35);
  background: rgba(40, 14, 20, 0.96);
}

@keyframes toast-in-left {
  from {
    opacity: 0;
    transform: translateX(-10px) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

.field-stack { display: grid; gap: 8px; }

.help-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-shell { padding: 34px 0 50px; }
.doc-layout { display: grid; gap: 18px; }
.doc-card { padding: 24px; }

pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

code.inline {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 8px;
  color: var(--primary);
}

pre.doc-code {
  margin: 0;
  padding: 18px;
  overflow: auto;
  background: #09121d;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: #d7e4ff;
  line-height: 1.6;
  font-size: 13px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.doc-grid .doc-card.full { grid-column: 1 / -1; }

.list-clean {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

body.modal-open { overflow: hidden; }

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 10, 17, 0.72);
  backdrop-filter: blur(8px);
  z-index: 120;
}

.modal.open { display: flex; }

.modal-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 0;
}

.modal-simple { width: min(560px, 100%); }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h3 {
  margin: 6px 0 0;
  font-size: 26px;
  line-height: 1.1;
}

.modal-x {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.modal-x:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.modal-content-simple { padding: 22px; }

.settings-group h4 {
  margin: 0 0 14px;
  font-size: 18px;
}

.settings-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 22px 0;
}

.textarea-control {
  width: 100%;
  border: 1px solid var(--border);
  background: #09121d;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  resize: vertical;
  min-height: 140px;
  transition: border-color .2s ease, box-shadow .2s ease;
  font: inherit;
}

.api-key-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #09121d;
  color: var(--primary);
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.api-key-value {
  min-width: 0;
  flex: 1;
  word-break: break-all;
}

.api-key-copy {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.api-key-copy:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.api-key-copy:active {
  transform: translateY(0);
}

/* donut cards for analytics-grid */
.donut-card {
  padding: 22px;
}

.donut-card .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.donut-card .card-header small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.donut-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.donut-canvas-wrap {
  position: relative;
  height: 260px;
}

.donut-legend {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.donut-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.2;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
}

.donut-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.donut-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-count {
  opacity: .95;
  font-variant-numeric: tabular-nums;
}

.donut-legend-percent {
  min-width: 48px;
  text-align: right;
  opacity: .7;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1024px) {
  .hero,
  .auth-layout,
  .register-layout,
  .doc-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-card,
  .wide-card {
    grid-column: auto;
  }

  .feature-grid,
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  h1 { font-size: 34px; }
  h2 { font-size: 28px; }

  .container,
  .brand-row {
    width: min(100% - 24px, 1180px);
  }

  .section { padding-top: 24px; }

  .site-header { position: sticky; }
  .nav-toggle { display: inline-block; }

  .top-nav {
    position: absolute;
    top: 74px;
    left: 12px;
    right: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: rgba(11,18,30,.98);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    box-shadow: var(--shadow);
  }

  .top-nav.open { display: flex; }
  .top-nav a { width: 100%; }

  .inline-stats,
  .feature-grid,
  .pricing-grid,
  .analytics-grid.three-up,
  .analytics-grid.two-up,
  .console-grid,
  .auth-form.two-col {
    grid-template-columns: 1fr;
  }

  .analytics-grid { grid-template-columns: 1fr; }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-panel,
  .card-hero,
  .hero-console,
  .doc-card {
    padding: 22px;
  }

  .donut-wrap { flex-direction: column; }

  .donut-card-body {
    grid-template-columns: 1fr;
  }

.donut-canvas-wrap {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

  .toast {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: auto;
    min-width: 0;
    max-width: none;
  }

  .account-card-head {
    align-items: stretch;
    flex-direction: column;
  }
  
  .account-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-account-edit {
  margin-top: auto;
  align-self: center;

  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;

  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);

  border-radius: 10px;
  transition: all .18s ease;
}

.btn-account-edit:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border-color: var(--border-2);
}

  .modal {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-dialog,
  .modal-simple {
    width: 100%;
    max-height: calc(100vh - 16px);
  }

  .modal-header {
    padding: 18px 18px 14px;
  }

  .modal-content-simple {
    padding: 18px;
  }

  .modal-header h3 {
    font-size: 22px;
  }

  .api-key-box {
    align-items: stretch;
    flex-direction: column;
  }

  .api-key-copy {
    width: 100%;
  }
}

select {
  width: 100%;
  border: 1px solid var(--border);
  background: #09121d;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  appearance: none;
}

select:focus {
  border-color: rgba(103,240,168,.45);
  box-shadow: 0 0 0 4px rgba(103,240,168,.08);
}

.chart-tabs-card .chart-tabs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.chart-tabs-nav {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.chart-tab-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #91a2bc);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  transition: .2s ease;
}

.chart-tab-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.chart-tab-btn.active {
  color: #091019;
  background: var(--primary, #67f0a8);
  box-shadow: 0 8px 24px rgba(103,240,168,0.2);
}

.chart-tab-panel {
  width: 100%;
}

.chart-tab-panel canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-tabs-card .chart-tabs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.chart-tabs-nav {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.chart-tab-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #91a2bc);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  transition: .2s ease;
}

.chart-tab-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.chart-tab-btn.active {
  color: #091019;
  background: var(--primary, #67f0a8);
  box-shadow: 0 8px 24px rgba(103,240,168,0.2);
}

.chart-tab-panel {
  width: 100%;
}

.chart-tab-panel canvas {
  width: 100% !important;
  height: 100% !important;
}

.api-json-result {
  margin: 0;
  padding: 14px 16px;
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  border-radius: 14px;
  background: rgba(8, 14, 23, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.api-json-result .json-viewer {
  display: block;
  color: #d9e7ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.api-json-result .json-key {
  color: #8ab4ff;
}

.api-json-result .json-string {
  color: #67f0a8;
}

.api-json-result .json-number {
  color: #ffb85c;
}

.api-json-result .json-boolean {
  color: #ff6f7c;
  font-weight: 600;
}

.api-json-result .json-null {
  color: #91a2bc;
  font-style: italic;
}

.api-json-result .json-brace {
  color: rgba(232,240,255,0.88);
}

.modal-dialog {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0f1720; /* или твой фон модалки */
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-content-simple {
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}