:root {
    --surface: #23133a;
    --surface2: #1f1232;
    --border: #3a1c63;
    --accent: #883CF0;
    --accent2: #cb51f5;
    --accent3: #dd92f5;
    --text: #e2e8f0;
    --text-muted: #d3dadb;
    --text-dim: #d3dadb;
    --warn: #fbbf24;
    --danger: #f87171;
    --success: #4ade80;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  .pcs-agent-training-guide {
    background: #191127;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    height: 100vh;
    overflow-y: scroll;
  }

  /* GRID BACKGROUND */
  .pcs-agent-training-guide::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
  }

  /* LAYOUT */
  .layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
  }

  /* SIDEBAR */
  .sidebar {
    width: 280px;
    min-width: 280px;
    background: #180f26;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  .sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #291a3e;
    border: 1px solid #3a1c63;
    color: var(--accent);
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 2px;
    margin-bottom: 14px;
    text-transform: uppercase;
  }

  .sidebar-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }

  .sidebar-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
  }

  .sidebar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
  }

  .progress-bar {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
  }

  .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .progress-track {
    height: 3px;
    background: #282035;
    border-radius: 2px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #684895);
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
  }

  .nav-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-section-label {
    font-size: 9px;
    color: var(--text-muted);
    padding: 0 24px 8px;
    text-transform: uppercase;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 24px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dim);
    font-size: 13px;
    border-left: 2px solid transparent;
    position: relative;
  }

  .nav-item:hover {
    background: #23133a9f;
    color: var(--text);
  }

  .nav-item.active {
    background: #23133a;
    color: var(--accent);
    border-left-color: var(--accent);
  }

  .nav-item.completed .nav-dot {
    background: var(--success);
    border-color: var(--success);
  }

  .nav-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    flex-shrink: 0;
    transition: all 0.3s;
  }

  .nav-item.active .nav-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px #be52e50f;
  }

  .nav-num {
    font-size: 10px;
    color: var(--text-muted);
    min-width: 18px;
  }

  .sidebar-footer {
    margin-top: auto;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
  }

  /* MAIN CONTENT */
  .main {
    /* margin-left: 280px; */
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;
  }

  /* TOP BAR */
  .topbar {
    background: #180f26;
    border-bottom: 1px solid var(--border);
    padding: 14px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .breadcrumb {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .breadcrumb span { color: var(--accent); }

  .topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .btn {
    font-size: 11px;
    padding: 7px 16px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
  }

  .btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
  }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

  .btn-primary {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
  }
  .btn-primary:hover { background: #883cf050; }

  /* CONTENT AREA */
  .content {
    padding: 48px;
    max-width: 900px;
  }

  .section { display: none; animation: fadeIn 0.4s ease; }
  .section.active { display: block; }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* SECTION HEADER */
  .section-eyebrow {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 10px;
  }

  .section-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 16px;
  }

  .section-intro {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 680px;
    margin-bottom: 40px;
    border-left: 2px solid var(--accent);
    padding-left: 18px;
  }

  /* STEP CARDS */
  .step-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.2s;
  }

  .step-card:hover { border-color: #5e309d; }

  .step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    cursor: pointer;
    user-select: none;
    background: #1f1232;
  }

  .step-number {
    font-size: 11px;
    color: var(--accent);
    background: #291a3e;
    border: 1px solid #3a1c63;
    padding: 4px 10px;
    border-radius: 2px;
    min-width: fit-content;
  }

  .step-title-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
  }

  .step-status {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 2px;
    text-transform: uppercase;
  }

  .status-required { background: rgba(248,113,113,0.15); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
  .status-optional { background: rgba(251,191,36,0.1); color: var(--warn); border: 1px solid rgba(251,191,36,0.2); }
  .status-done { background: rgba(74,222,128,0.1); color: var(--success); border: 1px solid rgba(74,222,128,0.2); }

  .chevron {
    color: var(--text-muted);
    transition: transform 0.3s;
    font-size: 16px;
  }

  .step-card.open .chevron { transform: rotate(180deg); }

  .step-body {
    display: none;
    padding: 0 22px 22px;
    border-top: 1px solid var(--border);
  }

  .step-card.open .step-body { display: block; }

  .step-description {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.7;
    padding: 16px 0 14px;
  }

  /* CODE BLOCKS */
  .code-block {
    background: #0f0818;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 14px 0;
    overflow: hidden;
  }

  .code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #883cf0e0;
    border-bottom: 1px solid var(--border);
  }

  .code-lang {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  .copy-btn {
    font-size: 10px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .copy-btn:hover { border-color: #fff; color:#fff; }
  .copy-btn.copied { border-color: var(--success); color: var(--success); }

  .code-content {
    padding: 16px 18px;
    font-size: 12px;
    line-height: 1.8;
    color: #e6e8ed;
    overflow-x: auto;
    white-space: pre;
  }

  .code-content .cmd { color: #00d4ff; }
  .code-content .comment { color: #4a5568; }
  .code-content .value { color: #fbbf24; }
  .code-content .path { color: #a78bfa; }
  .code-content .ok { color: #4ade80; }
  .code-content .flag { color: #f97316; }

  /* CALLOUTS */
  .callout {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 4px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
  }

  .callout-info { background: #1f1232; border: 1px solid #5e309d; }
  .callout-warn { background: rgba(251,191,36,0.07); border: 1px solid rgba(251,191,36,0.2); }
  .callout-danger { background: rgba(248,113,113,0.07); border: 1px solid rgba(248,113,113,0.2); }
  .callout-success { background: #1f1232; border: 1px solid #5e309d; }

  .callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
  .callout-info .callout-text { color: #dee9ec; }
  .callout-warn .callout-text { color: #e9e7e0; }
  .callout-danger .callout-text { color: #f0e6e6; }
  .callout-success .callout-text { color: #dee7e1; }

  /* TABLES */
  table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 12px;
  }

  th {
    background: #883cf050;
    color: var(--accent);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #3a1c63;
    font-size: 10px;
    text-transform: uppercase;
  }

  td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    vertical-align: top;
  }

  tr:last-child td { border-bottom: none; }
  tr:hover td { background: #23133a; }

  td.mono { color: var(--accent2); }
  td.desc { color: var(--text-dim); }

  /* CHECKLIST */
  .checklist {
    list-style: none;
    margin: 14px 0;
  }

  .checklist li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #3a1c63;
    font-size: 13px;
    color: var(--text-dim);
  }

  .checklist li:last-child { border-bottom: none; }

  .check-box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 1px;
    font-size: 11px;
    color: transparent;
  }

  .check-box.checked {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
  }

  .checklist li.done { text-decoration: line-through; color: var(--text-muted); }

  /* TEST SCENARIOS */
  .test-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 22px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
  }

  .test-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 100%;
  }

  .test-card.pass::before { background: var(--success); }
  .test-card.warn::before { background: var(--warn); }
  .test-card.fail::before { background: var(--danger); }

  .test-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .test-id {
    font-size: 10px;
    color: var(--text-muted);
  }

  .test-badge {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 2px;
    text-transform: uppercase;
  }

  .badge-pass { background: rgba(74,222,128,0.12); color: var(--success); border: 1px solid rgba(74,222,128,0.25); }
  .badge-warn { background: rgba(251,191,36,0.1); color: var(--warn); border: 1px solid rgba(251,191,36,0.2); }
  .badge-fail { background: rgba(248,113,113,0.1); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }

  .test-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
  }

  .test-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; }

  .test-steps {
    list-style: none;
    counter-reset: step-counter;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .test-steps li {
    counter-increment: step-counter;
    font-size: 12px;
    color: var(--text-dim);
    padding-left: 28px;
    position: relative;
    line-height: 1.6;
  }

  .test-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    font-size: 10px;
    color: var(--accent);
    background: #1f1232;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 1px;
  }

  /* VALIDATION STATUS GRID */
  .validation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 20px 0;
  }

  .val-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
  }

  .val-card:hover { border-color: #5e309d; transform: translateY(-2px); }

  .val-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
  }

  .val-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }

  .val-status {
    font-size: 10px;
    color: var(--text-muted);
  }

  .val-card.passing { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.04); }
  .val-card.passing .val-status { color: var(--success); }

  /* SECTION NAV FOOTER */
  .section-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  .section-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface2);
    color: var(--text-dim);
    font-size: 12px;
    transition: all 0.2s;
    text-decoration: none;
  }

  .section-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
  .section-nav-btn.primary { background: #883CF0; border-color: #3a1c63; color: #fff; }
  .section-nav-btn.primary:hover { background: #883cf0e0; }

  h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  p { margin-bottom: 12px; color: var(--text-dim); font-size: 13px; line-height: 1.7; }

  /* RESPONSIVE */
  @media (max-width: 767px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .content { padding: 24px; }
    .validation-grid { grid-template-columns: 1fr; }
    .topbar{
          flex-direction: column;
    gap: 10px;
    padding: 10px;
    height: auto;
    }
  }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #873cf015; }
::-webkit-scrollbar-thumb { background: #873cf015; border-radius: 3px; }