*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117; --surface: #1a1d27; --surface-2: #21253a; --border: #2a2d3e;
  --accent: #6366f1; --accent-light: #818cf8; --green: #22c55e; --yellow: #eab308;
  --red: #ef4444; --cyan: #06b6d4; --text: #e2e8f0; --text-2: #94a3b8; --muted: #64748b;
  --radius: 10px; --radius-sm: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  line-height: 1.6; padding-bottom: 80px;
}

/* Nav */
.demo-nav {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.demo-nav .back {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  font-weight: 500; color: var(--muted); text-decoration: none;
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: color .15s, border-color .15s;
}
.demo-nav .back:hover { color: var(--text); border-color: #475569; }
.demo-nav .nav-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.demo-nav .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-light);
  background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.25);
  border-radius: 100px; padding: 3px 10px;
}

/* Container */
.demo-container { max-width: 900px; margin: 0 auto; padding: 36px 24px; }

/* Hero */
.demo-hero { margin-bottom: 32px; }
.demo-hero h1 {
  font-size: clamp(22px, 4vw, 34px); font-weight: 800; letter-spacing: -.02em;
  line-height: 1.2; margin-bottom: 8px; color: #f1f5f9;
}
.demo-hero p { font-size: 15px; color: var(--muted); }

/* Section */
.section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
}
.section + .section { margin-top: 0; }
.section h2 {
  font-size: 11px; font-weight: 700; color: var(--accent-light);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px;
}
.section h3 { font-size: 15px; font-weight: 600; color: #f1f5f9; margin-bottom: 10px; }
.section p { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.section p + p { margin-top: 8px; }

/* Tip */
.tip {
  display: flex; gap: 12px;
  background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius); padding: 14px 18px;
  font-size: 14px; color: var(--text-2); margin-bottom: 14px;
}
.tip strong { color: var(--text); }

/* Steps (ordered) */
.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.steps li {
  counter-increment: step; display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; color: var(--text-2);
}
.steps li::before {
  content: counter(step); min-width: 22px; height: 22px; flex-shrink: 0;
  background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.3);
  color: var(--accent-light); border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-top: 1px;
}

/* Bullet list */
.bullets { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.bullets li { font-size: 14px; color: var(--text-2); }
.bullets li::before { content: '→'; color: var(--accent-light); font-weight: 700; flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  font-weight: 600; padding: 9px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
  text-decoration: none; white-space: nowrap; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); }
.btn-secondary { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover { color: var(--text); border-color: #475569; background: rgba(255,255,255,.04); }
.btn-green { background: rgba(34,197,94,.12); color: var(--green); border-color: rgba(34,197,94,.3); }
.btn-green:hover { background: rgba(34,197,94,.22); }
.btn-red { background: rgba(239,68,68,.12); color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-red:hover { background: rgba(239,68,68,.22); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Code */
code {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace; font-size: .85em;
  background: rgba(255,255,255,.08); border-radius: 4px; padding: 2px 6px; color: var(--accent-light);
}

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; text-align: center;
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--accent-light); line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; padding: 10px 14px; background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
}
td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* Progress */
.progress-wrap { width: 100%; height: 6px; background: rgba(255,255,255,.06); border-radius: 100px; overflow: hidden; margin: 12px 0; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 100px; transition: width .3s; width: 0%; }

/* Tag */
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px; border: 1px solid; }
.tag-green { color: var(--green); border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.1); }
.tag-red { color: var(--red); border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.1); }
.tag-yellow { color: var(--yellow); border-color: rgba(234,179,8,.3); background: rgba(234,179,8,.1); }
.tag-cyan { color: var(--cyan); border-color: rgba(6,182,212,.3); background: rgba(6,182,212,.1); }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; padding: 8px 16px; border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; font-size: 13px; font-weight: 600; transition: all .15s; font-family: inherit; }
.tab.active { background: var(--accent); color: #fff; }
.tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.05); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Form */
select, input[type="range"] {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13px; cursor: pointer;
  outline: none; font-family: inherit;
}
select:focus { border-color: var(--accent); }
label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.form-row label { min-width: 120px; }

/* Two col */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 640px) {
  .demo-container { padding: 24px 16px; }
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs { flex-wrap: wrap; }
  .tab { flex: none; }
}
