  :root {
    --bg: #23133a;
    --surface: #23133a;
    --surface2: #2b1f3d;
    --border: #3a1c63;
    --accent: #883CF0;
    --accent2: #883CF0;
    --accent3: #883CF0;
    --danger: #ff4d6d;
    --text: #f3f5f8;
    --text-muted: #d6d6d6;
    --text-dim: #d6d6d6;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  .api-key-training-guide {
    background: var(--bg);
    color: var(--text);
    
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
  }

    /* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #873cf015; }
::-webkit-scrollbar-thumb { background: #873cf015; border-radius: 3px; }

  /* ─── SIDEBAR NAV ─── */
  .sidebar {
    position: sticky;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    background:#180f26;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow-y: auto;
  }

  .sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
  }

  .logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #000;
    
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
  }

  .sidebar-logo h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
  }
  .sidebar-logo p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    
  }

  .nav-section-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 20px 20px 8px;
    
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
  }

  .nav-item:hover {
    color: var(--text);
    background: #23133a9f;
    border-left-color: var(--border);
  }

  .nav-item.active {
    color: var(--accent);
    background: #23133a;
    border-left-color: var(--accent);
  }

  .nav-item .nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }

  .nav-item .step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: all 0.2s;
  }

  .nav-item.active .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 700;
  }

  .nav-item.completed .step-num {
    background: var(--accent2);
    border-color: var(--accent2);
    color: #000;
  }

  .progress-bar-wrap {
    margin: 20px;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 16px;
  }

  .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .progress-track {
    height: 4px;
    background:#282035;
    border-radius: 2px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
  }

  /* ─── MAIN CONTENT ─── */
  .main {
    /* margin-left: 260px; */
    flex: 1;
    position: relative;
    z-index: 1;
    height: 100vh;
    overflow-y: auto;
    background-color: #191127;
  }

  .topbar {
    position: sticky;
    top: 0;
    background: #191127;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
  }

  .topbar-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
  }

  .topbar-breadcrumb span { color: var(--accent); }

  .topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-transform: uppercase;
  }

  .btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
  }
  .btn-ghost:hover { color: var(--text); border-color: var(--border); }

  .btn-primary {
    background: var(--accent);
    color: #000;
  }
  .btn-primary:hover { background: #883cf0e0; transform: translateY(-1px); }

  /* ─── SECTIONS ─── */
  .section {
    display: none;
    padding: 48px 40px;
    /* max-width: 900px; */
    animation: fadeIn 0.3s ease;
  }

  .section.active { display: block; }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .section-eyebrow {
    
    font-size: 10px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text);
  }

  .section-title em {
    font-style: normal;
    color: var(--accent);
  }

  .section-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 680px;
    margin-bottom: 36px;
  }

  /* ─── CARDS ─── */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
  }

  .card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .card-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
  }

  /* ─── STEP CARDS ─── */
  .step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color 0.2s;
  }

  .step-card:hover { border-color: var(--accent); }

  .step-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
  }

  .step-number {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #23133a;
    border: 1px solid #5e309d;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .step-header-text { flex: 1; }
  .step-header-text h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
  .step-header-text p { font-size: 12px; color: var(--text-muted); }

  .step-toggle {
    color: var(--text-dim);
    font-size: 18px;
    transition: transform 0.3s;
    margin-top: 4px;
  }

  .step-card.open .step-toggle { transform: rotate(180deg); }

  .step-body {
    display: none;
    padding: 0 24px 24px;
    border-top: 1px solid var(--border);
  }

  .step-card.open .step-body { display: block; }

  /* ─── CODE BLOCK ─── */
  .code-block {
    background: #080b10;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 20px;
    
    font-size: 12px;
    color: #a8c5ff;
    margin: 16px 0;
    position: relative;
    overflow-x: auto;
    line-height: 1.6;
  }

  .code-block .comment { color: var(--text-dim); }
  .code-block .key { color: var(--accent); }
  .code-block .val { color: var(--accent2); }
  .code-block .str { color: #ff9d6e; }

  .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 10px;
    
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .copy-btn:hover { color: var(--accent); border-color: var(--accent); }
  .copy-btn.copied { color: var(--accent2); border-color: var(--accent2); }

  /* ─── INFO BOXES ─── */
  .info-box {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 6px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
  }

  .info-box.warning {
    background: rgba(245,166,35,0.08);
    border: 1px solid rgba(245,166,35,0.25);
    color: #e0b060;
  }

  .info-box.tip {
    background: rgba(46,204,142,0.08);
    border: 1px solid rgba(46,204,142,0.25);
    color: #60c090;
  }

  .info-box.danger {
    background: rgba(255,77,109,0.08);
    border: 1px solid rgba(255,77,109,0.25);
    color: #ff7a90;
  }

  .info-box .icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

  /* ─── FIELD TEMPLATE DEMO ─── */
  .template-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
  }

  .field-item {
    background: #080b10;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
  }

  .field-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
  }

  .field-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
  }

  .field-type {
    display: inline-block;
    font-size: 10px;
    
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--accent3);
    padding: 2px 7px;
    border-radius: 3px;
  }

  .field-type.required::after {
    content: ' *';
    color: var(--danger);
  }

  /* ─── QUIZ ─── */
  .quiz-wrap { margin-top: 12px; }

  .quiz-q {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.4;
  }

  .quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: #883cf050;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
    line-height: 1.5;
  }

  .quiz-option:hover:not(.disabled) {
    border-color: var(--accent3);
    color: var(--text);
    background: #3a1c6350;
  }

  .quiz-option .opt-key {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--border);
    color: var(--text-dim);
    
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
  }

  .quiz-option.correct {
    border-color: #77b255;
    background: #77b25520;
    color: #60c090;
  }
  .quiz-option.correct .opt-key { background: #77b255; color: #fff; }

  .quiz-option.wrong {
    border-color: #dc143c;
    background: rgba(255,77,109,0.08);
    color: #ff7a90;
  }
  .quiz-option.wrong .opt-key { background: #dc143c; color: #fff; }

  .quiz-feedback {
    display: none;
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
  }

  .quiz-feedback.show { display: block; }
  .quiz-feedback.correct-fb { background: rgba(46,204,142,0.08); border: 1px solid rgba(46,204,142,0.25); color: #60c090; }
  .quiz-feedback.wrong-fb { background: rgba(255,77,109,0.08); border: 1px solid rgba(255,77,109,0.25); color: #ff7a90; }

  /* ─── CHECKLIST ─── */
  .checklist { list-style: none; margin: 16px 0; }

  .checklist li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
  }
  .checklist li:last-child { border-bottom: none; }

  .check-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 1px;
  }

  .check-box.checked {
    background: var(--accent2);
    border-color: var(--accent2);
    color: #000;
    font-size: 12px;
  }

  /* ─── TAGS ─── */
  .tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

  .tag {
    font-size: 11px;
    
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
  }

  .tag-amber { background: rgba(245,166,35,0.15); color: var(--accent); border: 1px solid rgba(245,166,35,0.3); }
  .tag-green { background: rgba(46,204,142,0.12); color: var(--accent2); border: 1px solid rgba(46,204,142,0.3); }
  .tag-blue { background: rgba(74,158,255,0.12); color: var(--accent3); border: 1px solid rgba(74,158,255,0.3); }
  .tag-red { background: rgba(255,77,109,0.12); color: var(--danger); border: 1px solid rgba(255,77,109,0.3); }

  /* ─── SECTION NAV BUTTONS ─── */
  .section-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  /* ─── INTRO HERO ─── */
  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
  }

  .hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s;
  }

  .hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
  }

  .hero-card.c1::before { background: var(--accent); }
  .hero-card.c2::before { background: var(--accent2); }
  .hero-card.c3::before { background: var(--accent3); }

  .hero-card:hover { transform: translateY(-3px); border-color: #5e309d; }

  .hero-icon { font-size: 28px; margin-bottom: 12px; }
  .hero-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
  .hero-card p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

  /* ─── COMPLETION SCREEN ─── */
  .completion-screen {
    text-align: center;
    padding: 60px 40px;
  }

  .completion-badge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #883CF0, #1f1232d1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 32px;
    box-shadow: 0 0 60px #be52e50f;
    animation: pulse 2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 40px rgba(196, 35, 245, 0.3); }
    50% { box-shadow: 0 0 80px rgba(154, 35, 245, 0.5); }
  }

  .completion-screen h2 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
  .completion-screen p { font-size: 15px; color: var(--text-muted); max-width: 500px; margin: 0 auto 32px; line-height: 1.7; }

  .cert-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
  }

  .cert-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(245,166,35,0.04), rgba(46,204,142,0.04));
  }

  .cert-label {
    
    font-size: 9px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
  }

  .cert-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
  }

  .cert-sub { font-size: 13px; color: var(--text-muted); }

  .cert-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
  }

  .cert-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    
    color: var(--text-dim);
  }

  .step-body p { margin-top: 16px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
  .step-body ul { margin: 12px 0 0 16px; }
  .step-body ul li { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 4px; }

  .highlight { color: var(--accent); font-weight: 600; }
  .highlight-green { color: var(--accent2); font-weight: 600; }
  .highlight-blue { color: var(--accent3); font-weight: 600; }

  @media (max-width: 768px) {
    .topbar{
      flex-direction: column;
      height: auto;
      gap:10px;
    }
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .hero-grid { grid-template-columns: 1fr; }
    .template-fields { grid-template-columns: 1fr; }
    .section { padding: 32px 20px; }
  }