:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #283548;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-soft: rgba(20, 184, 166, 0.14);
  --danger: #f87171;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 14px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-height: 54px; padding: 8px 0; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.08rem; color: var(--text); letter-spacing: -0.02em;
}
.brand-badge {
  background: var(--accent); color: #042f2e; font-family: var(--mono);
  font-size: 0.78rem; font-weight: 800; padding: 2px 7px; border-radius: 6px;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
}
.nav-links a {
  color: var(--muted); font-size: 0.84rem; font-weight: 600;
  padding: 5px 8px; border-radius: 7px; white-space: nowrap;
}
.nav-links a.active, .nav-links a:hover {
  color: var(--text); background: var(--surface-2); text-decoration: none;
}

.hero { padding: 18px 0 12px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.35rem, 3.8vw, 1.95rem); line-height: 1.22; letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 0.96rem; }
.byline { font-size: 0.84rem; color: var(--muted); margin-top: 6px; }

.playground {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-bottom: 24px;
}
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.lang-select-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-select {
  appearance: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--accent); border-radius: 9px; padding: 8px 12px;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.mode-badge {
  font-size: 0.74rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.action-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 700; font-size: 0.86rem; padding: 8px 12px;
  border-radius: 9px; cursor: pointer; display: inline-block;
}
.btn:hover { background: #243247; text-decoration: none; }
.btn-run { background: var(--accent); color: #042f2e; border-color: var(--accent); padding: 8px 16px; }
.btn-run:hover { background: var(--accent-hover); color: #ffffff; }

.examples-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.examples-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.ex-pill {
  appearance: none; border: 1px solid var(--border); background: transparent;
  color: var(--text); font-size: 0.8rem; padding: 5px 10px; border-radius: 999px;
  white-space: nowrap; cursor: pointer;
}
.ex-pill:hover { border-color: var(--accent); color: var(--accent); }

.symbol-bar {
  display: flex; gap: 6px; padding: 8px 10px; background: #0f172a;
  border-bottom: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.sym-btn {
  appearance: none; min-width: 38px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-family: var(--mono); font-size: 0.92rem; font-weight: 700; border-radius: 8px;
  cursor: pointer; flex-shrink: 0;
}
.sym-btn:active { background: var(--accent); color: #042f2e; }

.workspace { display: grid; grid-template-columns: 1fr; }
@media (min-width: 820px) { .workspace { grid-template-columns: 1.15fr 0.85fr; } }
.editor-pane { border-bottom: 1px solid var(--border); }
@media (min-width: 820px) { .editor-pane { border-bottom: 0; border-right: 1px solid var(--border); } }

.code-editor {
  width: 100%; min-height: 250px; padding: 14px; background: #090f1d; color: #e2e8f0;
  border: 0; outline: none; resize: vertical; font-family: var(--mono);
  font-size: 16px; line-height: 1.5; tab-size: 4;
}
.stdin-wrap { border-top: 1px solid var(--border); background: #0c1324; padding: 8px 12px; }
.stdin-wrap summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.stdin-input {
  width: 100%; margin-top: 6px; min-height: 54px; padding: 8px 10px;
  background: #070b14; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--mono); font-size: 16px;
}

.output-pane { display: flex; flex-direction: column; background: #070b14; min-height: 210px; }
.output-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 0.8rem; font-weight: 700; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.status-pill {
  font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--accent);
}
.output-box {
  margin: 0; padding: 12px; font-family: var(--mono); font-size: 0.9rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; color: #d1fae5; overflow-x: auto; flex: 1;
}
.output-box.error { color: var(--danger); }
.html-preview { width: 100%; min-height: 230px; border: 0; background: #ffffff; flex: 1; }

.sql-table-wrap { padding: 10px 12px; overflow-x: auto; }
.sql-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.84rem; }
.sql-table th, .sql-table td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.sql-table th { background: var(--surface-2); color: var(--accent); }

.content-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; margin-bottom: 20px;
}
.content-section h2 { margin-top: 0; font-size: 1.22rem; }
.content-section h3 { font-size: 1.04rem; margin-bottom: 6px; }
.content-section p { color: var(--muted); }
.content-section strong { color: var(--text); }

.sample-box {
  background: #090f1d; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 0.86rem; overflow-x: auto; color: #e2e8f0;
}

.cmp-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.92rem; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; }
.cmp-table th { background: var(--surface-2); color: var(--text); }
.cmp-table td { color: var(--muted); }

.preview-figure {
  margin: 14px 0 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: #090f1d;
}
.preview-figure img { display: block; width: 100%; height: auto; }
.preview-figure figcaption { padding: 8px 12px; font-size: 0.82rem; color: var(--muted); }

.proof-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.proof-list li { margin-bottom: 7px; }
.proof-list strong { color: var(--text); }

.cta-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 22px;
}
.cta-box p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
.lang-card {
  display: flex; flex-direction: column; gap: 3px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; color: var(--text);
}
.lang-card:hover { border-color: var(--accent); text-decoration: none; }
.lang-card strong { font-size: 0.98rem; }
.lang-card span { font-size: 0.78rem; color: var(--muted); }

.faq-item { border-top: 1px solid var(--border); padding: 12px 0; }
.faq-item:first-of-type { border-top: 0; padding-top: 4px; }
.faq-item h3 { margin: 0 0 4px; font-size: 1rem; }
.faq-item p { margin: 0; color: var(--muted); font-size: 0.93rem; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0 28px; color: var(--muted); font-size: 0.88rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
