/* ============================================================
   DelkaAI Developer Console — Global Stylesheet
   Dark, professional, Anthropic-console-inspired
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #0a0b0e;
  --surface:      #141519;
  --surface2:     #1c1e24;
  --border:       #2a2d38;
  --text:         #e8eaf0;
  --muted:        #6b7280;
  --accent:       #7c3aed;
  --accent-light: #a78bfa;
  --green:        #10b981;
  --red:          #ef4444;
  --yellow:       #f59e0b;
  --blue:         #3b82f6;
  --sidebar-w:    240px;
  --radius:       8px;
  --radius-sm:    5px;
  --shadow:       0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --transition:   0.18s ease;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: var(--text); }

img { max-width: 100%; display: block; }

/* ── Layout ────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 16px 20px 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.active {
  color: var(--accent-light);
  background: rgba(124, 58, 237, 0.1);
  border-left-color: var(--accent);
}

.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-footer a {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  transition: color var(--transition);
}

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

/* ── Main Content ──────────────────────────────────────────── */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  padding: 32px 36px;
  max-width: 100%;
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-header-left h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-header-left p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.page-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 22px;
}

/* ── Stat Grid ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card .stat-delta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.stat-card .stat-delta.up   { color: var(--green); }
.stat-card .stat-delta.down { color: var(--red); }

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon.purple { background: rgba(124,58,237,.15); color: var(--accent-light); }
.stat-icon.green  { background: rgba(16,185,129,.12); color: var(--green); }
.stat-icon.blue   { background: rgba(59,130,246,.12); color: var(--blue); }
.stat-icon.yellow { background: rgba(245,158,11,.12); color: var(--yellow); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table thead {
  background: var(--surface2);
}

table.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

table.data-table tbody tr:hover { background: var(--surface2); }
table.data-table tbody tr:last-child { border-bottom: none; }

table.data-table tbody td {
  padding: 12px 14px;
  color: var(--text);
  vertical-align: middle;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-success { background: rgba(16,185,129,.15); color: var(--green); }
.badge-warning { background: rgba(245,158,11,.15);  color: var(--yellow); }
.badge-error   { background: rgba(239,68,68,.15);   color: var(--red); }
.badge-neutral { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.badge-accent  { background: rgba(124,58,237,.15); color: var(--accent-light); }
.badge-blue    { background: rgba(59,130,246,.15); color: var(--blue); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity var(--transition), background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn:hover { opacity: 0.85; text-decoration: none; }
.btn:active { opacity: 0.95; transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,.35);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); background: var(--surface2); }

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group label .optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 9px 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

input::placeholder,
textarea::placeholder { color: var(--muted); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea { resize: vertical; min-height: 90px; }

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-check label {
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}

/* Input group (for password toggle) */
.input-group {
  position: relative;
}

.input-group input { padding-right: 42px; }

.input-group .toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  display: flex;
  align-items: center;
}

.input-group .toggle-pw:hover { color: var(--text); }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  margin-bottom: 20px;
  font-size: 13px;
}

.alert-info    { background: rgba(59,130,246,.1);  border-color: var(--blue);   color: #93c5fd; }
.alert-success { background: rgba(16,185,129,.1);  border-color: var(--green);  color: #6ee7b7; }
.alert-error   { background: rgba(239,68,68,.1);   border-color: var(--red);    color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.1);  border-color: var(--yellow); color: #fcd34d; }

/* ── Misc utilities ────────────────────────────────────────── */
.mono {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
}

.text-muted  { color: var(--muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-accent { color: var(--accent-light); }

.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.flex-1       { flex: 1; }

/* ── Tag ───────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── API Key display ───────────────────────────────────────── */
.key-value {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.key-value code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  color: var(--accent-light);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
  font-family: inherit;
}

.copy-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── New key result box ────────────────────────────────────── */
.new-key-box {
  background: rgba(16,185,129,.06);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 24px;
}

.new-key-box h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 14px;
}

.new-key-box .key-row {
  margin-bottom: 12px;
}

.new-key-box .key-row label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 5px;
  display: block;
}

/* ── Login page ────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 32px rgba(0,0,0,.5);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.login-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.login-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Landing / Public pages ────────────────────────────────── */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.topnav-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

.topnav-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topnav-actions { display: flex; gap: 10px; align-items: center; }

.hero {
  text-align: center;
  padding: 90px 24px 60px;
  max-width: 760px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.25);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-title span { color: var(--accent-light); }

.hero-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

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

.features-section {
  padding: 40px 40px 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.features-section h2 {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 40px;
  letter-spacing: -0.03em;
}

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: border-color var(--transition), transform var(--transition);
}

.feature-card:hover {
  border-color: rgba(124,58,237,.35);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(124,58,237,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 20px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ── Code blocks ───────────────────────────────────────────── */
.code-block {
  background: #0d0e11;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #e2e8f0;
  overflow-x: auto;
  margin: 8px 0;
}

.code-block .c-method  { color: #a78bfa; font-weight: 600; }
.code-block .c-url     { color: #6ee7b7; }
.code-block .c-key     { color: #93c5fd; }
.code-block .c-str     { color: #fcd34d; }
.code-block .c-comment { color: #6b7280; font-style: italic; }

/* ── Docs page ─────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  gap: 0;
}

.docs-nav {
  width: 200px;
  min-width: 200px;
  position: sticky;
  top: 0;
  height: fit-content;
}

.docs-nav a {
  display: block;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.docs-nav a:hover { color: var(--text); }
.docs-nav a.active { color: var(--accent-light); background: rgba(124,58,237,.1); }

.docs-content { flex: 1; min-width: 0; }

.endpoint-block {
  margin-bottom: 28px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.method-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
}

.method-get    { background: rgba(16,185,129,.15); color: var(--green); }
.method-post   { background: rgba(59,130,246,.15);  color: var(--blue); }
.method-delete { background: rgba(239,68,68,.15);   color: var(--red); }

/* ── Playground ────────────────────────────────────────────── */
.playground-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.response-area {
  background: #0d0e11;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #e2e8f0;
  min-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
}

/* ── DelkaAI animated logo ──────────────────────────────────── */
.delka-logo-svg { overflow: visible; display: block; }

.delka-anim-orbit {
  animation: delka-orbit 2.4s cubic-bezier(0.4,0,0.2,1) infinite;
  transform-origin: 60px 60px;
}
.delka-anim-breathe {
  animation: delka-breathe 2.4s ease-in-out infinite;
  transform-origin: 60px 60px;
}
.delka-anim-haze1 {
  animation: delka-haze 2.4s ease-in-out infinite;
  transform-origin: 60px 60px;
}
.delka-anim-haze2 {
  animation: delka-haze 2.4s ease-in-out .35s infinite;
  transform-origin: 60px 60px;
}
.delka-anim-arc {
  stroke-dasharray: 230;
  stroke-dashoffset: 230;
  animation: delka-arc 2.4s cubic-bezier(0.4,0,0.6,1) infinite;
}
.delka-anim-spine {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: delka-spine 2.4s ease-in-out infinite;
}
.delka-anim-connector {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: delka-connector 2.4s ease-in-out .15s infinite;
}

@keyframes delka-orbit {
  0%   { transform: rotate(0deg)   translateX(34px) scale(.5); opacity: .2; }
  25%  { transform: rotate(90deg)  translateX(34px) scale(1);  opacity: 1;  }
  50%  { transform: rotate(180deg) translateX(34px) scale(.5); opacity: .2; }
  75%  { transform: rotate(270deg) translateX(34px) scale(1);  opacity: 1;  }
  100% { transform: rotate(360deg) translateX(34px) scale(.5); opacity: .2; }
}
@keyframes delka-breathe {
  0%,100% { transform: scale(1);   opacity: 1;   }
  50%     { transform: scale(1.4); opacity: .65; }
}
@keyframes delka-haze {
  0%,100% { transform: scale(1); opacity: .28; }
  50%     { transform: scale(2); opacity: 0;   }
}
@keyframes delka-arc {
  0%   { stroke-dashoffset: 230; opacity: 0; }
  12%  {                          opacity: 1; }
  72%  { stroke-dashoffset: 0;   opacity: 1; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}
@keyframes delka-spine {
  0%   { stroke-dashoffset: 100; opacity: 0; }
  18%  {                          opacity: 1; }
  68%  { stroke-dashoffset: 0;   opacity: 1; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}
@keyframes delka-connector {
  0%   { stroke-dashoffset: 30; opacity: 0; }
  20%  {                         opacity: 1; }
  68%  { stroke-dashoffset: 0;  opacity: 1; }
  100% { stroke-dashoffset: 0;  opacity: 0; }
}

/* ── Mobile hamburger + sidebar overlay ─────────────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--surface2); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-grid         { grid-template-columns: 1fr 1fr; }
  .features-grid     { grid-template-columns: 1fr 1fr; }
  .playground-layout { grid-template-columns: 1fr; }
  .form-row          { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }
  .sidebar.open { transform: translateX(0); }

  .content {
    margin-left: 0;
    padding: 20px 16px;
    padding-top: 64px;
  }

  .hero-title    { font-size: 32px; }
  .features-grid { grid-template-columns: 1fr; }
  .topnav        { padding: 0 16px; }

  /* Chat page on tablet */
  .chat-page { padding: 0 16px; }
  .chat-row > div { max-width: 84%; }

  /* Support panel: stretch to screen width on mobile */
  #support-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
  }
}

@media (max-width: 480px) {
  .stat-grid  { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }

  /* Chat page on phone */
  .chat-page { padding: 0 10px; }
  .chat-row > div { max-width: 90%; }
  .chat-page-header h1 { font-size: 17px; }

  /* Support panel */
  #support-chat-panel {
    right: 8px;
    left: 8px;
    bottom: 78px;
    max-height: 60vh;
  }
  #support-chat-btn {
    bottom: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
  }
}
