  :root {
    --bg: #0f0818;
    --bg2: #883cf050;
    --surface: #23133a;
    --surface2: #1f1232;
    --border: #3a1c63;
    --cyan: #883CF0;
    --cyan-dim: #1f1232;
    --amber: #883CF0;
    --amber-dim: #1f1232;
    --red: #883CF0;
    --red-dim: #1f1232;
    --green: #883CF0;
    --green-dim: #1f1232;
    --text: #dee4ed;
    --text-dim: #d6d6d6;
    --text-bright: #e8f4ff;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  .mcp-training-guide {
    background: #191127;
    color: var(--text);
    position: relative;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    height: 100vh;
    overflow-y: auto;
  }

  /* ── NOISE OVERLAY ── */
  .mcp-training-guide::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
  }

  /* ── PROGRESS HEADER ── */
  #progress-header {
    position: sticky;
    top: 0; left: 0; right: 0;
    z-index: 1;
    background: #180f26;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
  }
  .header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 56px;
  }
  .module-badge {
    font-size: 10px;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .header-title {
    
    font-size: 13px;
    font-weight: 700;
    color: var(--text-bright);
    
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
  }
  .progress-label {
    
    font-size: 10px;
    color: var(--text-dim);
    white-space: nowrap;
  }
  #progress-bar-bg {
    width: 120px;
    height: 3px;
    background: var(--border);
    position: relative;
  }
  #progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px var(--cyan);
  }
  #progress-pct {
    
    font-size: 10px;
    color: var(--cyan);
    min-width: 28px;
  }

  /* ── MAIN LAYOUT ── */
  main {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 2rem 80px;
    position: relative;
  }

  /* ── HERO ── */
  .hero {
    text-align: center;
    padding: 4rem 0 3.5rem;
    position: relative;
  }
  .hero-eyebrow {
    
    font-size: 11px;
    
    color: var(--cyan);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
  }
  .hero-eyebrow::before, .hero-eyebrow::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--cyan);
    opacity: 0.4;
  }
  .hero h1 {
    
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.08;
    
    margin-bottom: 1.25rem;
  }
  .hero h1 em {
    font-style: normal;
    color: var(--cyan);
  }
  .hero-sub {
    font-size: 16px;
    color: var(--text-dim);
    max-width: 580px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
  }
  .hero-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
  }
  .meta-chip {
    
    font-size: 10px;
    color: var(--text-dim);
    
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .meta-chip span { color: var(--amber); }

  /* ── SECTION NAV ── */
  .section-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 4rem;
  }
  .nav-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
  }
  .nav-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--cyan);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s;
  }
  .nav-card:hover { border-color: var(--cyan); background: var(--surface2); }
  .nav-card:hover::before { transform: scaleX(1); }
  .nav-num {
    
    font-size: 10px;
    color: var(--text-dim);
    display: block;
    margin-bottom: 6px;
  }
  .nav-label {
    
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    display: block;
    line-height: 1.3;
  }
  .nav-card:hover .nav-label { color: var(--cyan); }

  /* ── SECTIONS ── */
  section { margin-bottom: 3.5rem; scroll-margin-top: 72px; }

  .section-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
  }
  .section-num {
    
    font-size: 11px;
    color: var(--cyan);
    background: var(--cyan-dim);
    border: 1px solid #3a1c63;
    padding: 4px 8px;
    flex-shrink: 0;
    margin-top: 4px;
  }
  .section-title {
    
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    color: var(--text-bright);
    
    line-height: 1.15;
  }
  .section-title small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    
    color: var(--text-dim);
    
    margin-top: 4px;
  }

  p { margin-bottom: 1rem; color: var(--text); }
  strong { color: var(--text-bright); font-weight: 600; }

  /* ── DIAGRAM ── */
  .diagram-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
  }
  .diagram-wrap::after {
    content: 'ARCHITECTURE OVERVIEW';
    position: absolute;
    top: 12px; right: 14px;
    
    font-size: 9px;
    color: var(--text-dim);
    
  }

  /* ── INFO CARDS ── */
  .card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 1.5rem 0;
  }
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: border-color 0.2s;
  }
  .card:hover { border-color: var(--border); }
  .card-icon {
    font-size: 20px;
    margin-bottom: 0.75rem;
    display: block;
  }
  .card-title {
    
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
  }
  .card p { font-size: 13px; margin: 0; }

  /* ── THREAT CARDS ── */
  .threat-list { display: flex; flex-direction: column; gap: 12px; margin: 1.5rem 0; }
  .threat-card {
    border-left: 3px solid var(--red);
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
  }
  .threat-card:hover { background: var(--surface2); }
  .threat-card.amber { border-left-color: var(--amber); }
  .threat-card.cyan { border-left-color: var(--cyan); }
  .threat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .threat-label {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .threat-badge {
    
    font-size: 9px;
    padding: 2px 7px;
    
  }
  .threat-badge.critical { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,63,94,0.3); }
  .threat-badge.high { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(255,183,3,0.3); }
  .threat-badge.medium { background: var(--cyan-dim); color: var(--cyan); border: 1px solid #3a1c63; }
  .threat-title {  font-size: 15px; font-weight: 700; color: var(--text-bright); }
  .threat-chevron {
    
    font-size: 11px;
    color: var(--text-dim);
    transition: transform 0.2s;
  }
  .threat-card.open .threat-chevron { transform: rotate(90deg); }
  .threat-body {
    display: none;
    padding-top: 1rem;
    font-size: 13.5px;
    color: var(--text);
  }
  .threat-card.open .threat-body { display: block; }
  .threat-body p { margin-bottom: 0.5rem; }
  .threat-scenario {
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    
    font-size: 12px;
    color: var(--amber);
    line-height: 1.6;
  }
  .threat-scenario::before {
    content: '⚠ SCENARIO: ';
    color: var(--text-dim);
  }

  /* ── PAM PRINCIPLES ── */
  .pam-grid { display: flex; flex-direction: column; gap: 12px; margin: 1.5rem 0; }
  .pam-card {
    background: var(--surface);
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 64px 1fr;
    overflow: hidden;
    transition: border-color 0.2s;
  }
  .pam-card:hover { border-color: #5e309d; }
  .pam-num-col {
    background: var(--bg2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    
    font-size: 22px;
    font-weight: 700;
    color: var(--cyan);
  }
  .pam-content { padding: 1.25rem 1.5rem; }
  .pam-title {  font-size: 15px; font-weight: 700; color: var(--text-bright); margin-bottom: 0.4rem; }
  .pam-desc { font-size: 13px; margin: 0 0 0.75rem; }
  .impl-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .impl-list li {
    
    font-size: 11px;
    color: var(--text-dim);
    padding-left: 14px;
    position: relative;
  }
  .impl-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--green);
  }

  /* ── CODE BLOCK ── */
  .code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
  }
  .code-block::before {
    content: attr(data-lang);
    position: absolute;
    top: 8px; right: 12px;
    
    font-size: 9px;
    color: var(--text-dim);
    
  }
  .code-block code {
    
    font-size: 12px;
    line-height: 1.8;
    color: var(--text);
    white-space: pre;
    display: block;
  }
  .code-block .kw { color: var(--cyan); }
  .code-block .str { color: var(--green); }
  .code-block .num { color: var(--amber); }
  .code-block .cm { color: var(--text-dim); font-style: italic; }
  .code-block .key { color: #c792ea; }

  /* ── CALLOUT ── */
  .callout {
    border: 1px solid;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    display: flex;
    gap: 0.75rem;
    font-size: 13.5px;
  }
  .callout.info { border-color: #3a1c63; background: var(--cyan-dim); color: var(--text); }
  .callout.warn { border-color: rgba(255,183,3,0.3); background: var(--amber-dim); }
  .callout.danger { border-color: rgba(255,63,94,0.3); background: var(--red-dim); }
  .callout-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
  .callout p { margin: 0; }

  /* ── CHECKLIST ── */
  .checklist { display: flex; flex-direction: column; gap: 8px; margin: 1.5rem 0; }
  .check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
  }
  .check-item:hover { background: var(--surface2); }
  .check-box {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.15s;
  }
  .check-item.checked .check-box {
    background: var(--green);
    border-color: var(--green);
    color: #000;
  }
  .check-text { font-size: 13.5px; }
  .check-item.checked .check-text { color: var(--text-dim); text-decoration: line-through; }

  /* ── QUIZ ── */
  #quiz-section { margin-top: 4rem; }
  .quiz-header {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg2) 100%);
    border: 1px solid var(--border);
    padding: 2rem;
    margin-bottom: 0;
    text-align: center;
  }
  .quiz-title {
    
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
  }
  .quiz-sub { font-size: 13px; color: var(--text-dim); }
  .quiz-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    padding: 2rem;
    display: none;
  }
  .quiz-card.active { display: block; }
  .quiz-q {
    
    font-size: 16px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1.25rem;
    line-height: 1.4;
  }
  .quiz-q .qnum {
    
    font-size: 10px;
    color: var(--cyan);
    display: block;
    margin-bottom: 6px;
  }
  .quiz-options { display: flex; flex-direction: column; gap: 8px; }
  .quiz-opt {
    padding: 12px 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text);
    text-align: left;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .quiz-opt:hover:not([disabled]) { border-color: var(--cyan); background: var(--cyan-dim); }
  .quiz-opt .opt-letter {
    
    font-size: 11px;
    color: var(--text-dim);
    flex-shrink: 0;
    width: 20px;
  }
  .quiz-opt.correct { border-color: #77b255;
    background: #77b25520;
    color: #60c090; }
  .quiz-opt.correct .opt-letter { color: #60c090; }
  .quiz-opt.wrong { border-color: #dc143c;
    background: #dc143c2b;
    color:#ff7a90; }
  .quiz-opt.wrong .opt-letter { color: #dc143c; }
  .quiz-feedback {
    margin-top: 1rem;
    padding: 12px 14px;
    font-size: 13px;
    display: none;
    border: 1px solid;
  }
  .quiz-feedback.show { display: block; }
  .quiz-feedback.correct { border-color: #77b255;
    background: #77b25520;
    color: #60c090; }
  .quiz-feedback.wrong { border-color: #dc143c;
    background: #dc143c2b;
    color:#ff7a90; }
  .quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
  }
  .quiz-progress-dots { display: flex; gap: 6px; }
  .q-dot {
    width: 8px; height: 8px;
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: all 0.2s;
  }
  .q-dot.answered { background: var(--cyan); border-color: var(--cyan); }
  .q-dot.correct { background: var(--green); border-color: var(--green); }
  .q-dot.wrong { background: var(--red); border-color: var(--red); }

  .btn {
    
    font-size: 11px;
    
    padding: 8px 18px;
    border: 1px solid;
    cursor: pointer;
    background: transparent;
    transition: all 0.15s;
  }
  .btn-cyan { border-color: var(--cyan); color: var(--cyan); }
  .btn-cyan:hover { background: var(--cyan); color: var(--bg); }
  .btn-green { border-color: var(--green); color: var(--green); }
  .btn-green:hover { background: var(--green); color: var(--bg); }
  .btn:disabled { opacity: 0.3; cursor: not-allowed; }

  /* ── RESULT ── */
  #quiz-result {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    padding: 3rem 2rem;
    text-align: center;
  }
  .result-score {
    
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
  }
  .result-label {
    
    font-size: 11px;
    
    color: var(--text-dim);
    margin-bottom: 1.5rem;
  }
  .result-msg { font-size: 15px; color: var(--text); max-width: 440px; margin: 0 auto 2rem; }
  .result-cert {
    display: inline-block;
    border: 1px solid var(--cyan);
    padding: 1rem 2rem;
    
    font-size: 11px;
    color: var(--cyan);
    
    margin-bottom: 1.5rem;
  }

  /* ── TABLE ── */
  .table-wrap { overflow-x: auto; margin: 1.5rem 0; }
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  th {
    
    font-size: 10px;
    
    color: var(--text-dim);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
  }
  td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
  }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: var(--surface); }
  .pill {
    display: inline-block;
    
    font-size: 9px;
    padding: 2px 7px;
    
    border-radius: 2px;
  }
  .pill-red { background: var(--red-dim); color: var(--red); }
  .pill-amber { background: var(--amber-dim); color: var(--amber); }
  .pill-green { background: var(--green-dim); color: var(--green); }
  .pill-cyan { background: var(--cyan-dim); color: var(--cyan); }

  /* ── FOOTER ── */
  footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    
    font-size: 10px;
    color: var(--text-dim);
    
  }

  /* ── ANIMATIONS ── */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes pulse-line {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
  }
  @keyframes flow {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
  }

  .fade-in { animation: fadeUp 0.5s ease both; }
  .fade-in:nth-child(2) { animation-delay: 0.1s; }
  .fade-in:nth-child(3) { animation-delay: 0.2s; }
  .fade-in:nth-child(4) { animation-delay: 0.3s; }

  .flow-line {
    animation: flow 1.2s linear infinite;
    stroke-dasharray: 6 18;
  }

  @media (max-width: 600px) {
    .card-grid { grid-template-columns: 1fr; }
    .section-nav { grid-template-columns: 1fr 1fr; }
    .pam-card { grid-template-columns: 48px 1fr; }
  }

  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: #873cf015; }
  ::-webkit-scrollbar-thumb { background: #873cf015; border-radius: 4px; }