  :root {
    --bg: #0d0f14;
    --bg2: #13161e;
    --bg3: #1a1e28;
    --card: #1e2230;
    --border: rgba(255,255,255,0.07);
    --accent: #f5a623;
    --accent2: #38e8c0;
    --accent3: #e05c6a;
    --text: #e8eaf0;
    --muted: #7a7f94;
    --code-bg: #111318;
    --code-text: #38e8c0;
    --tag-bg: rgba(245,166,35,0.12);
    --tag-text: #f5a623;
    --nav-h: 60px;
  }
  [data-theme="light"] {
    --bg: #f4f5f8;
    --bg2: #ffffff;
    --bg3: #eceef4;
    --card: #ffffff;
    --border: rgba(0,0,0,0.09);
    --accent: #d4860e;
    --accent2: #0e9a7c;
    --accent3: #c0404e;
    --text: #1a1d26;
    --muted: #7a7f94;
    --code-bg: #1a1d26;
    --code-text: #38e8c0;
    --tag-bg: rgba(212,134,14,0.1);
    --tag-text: #b8720c;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; font-size: 15px; }
  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.7;
  }

  /* ── NAV ── */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
  }
  .nav-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem; font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
    letter-spacing: 0em;
    text-decoration: none;
  }
  .nav-brand span { color: var(--text); }
  .nav-links {
    display: flex; gap: 0.25rem;
    overflow-x: auto;
    flex: 1;
    list-style: none;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    display: block;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem; font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
  }
  .nav-links a:hover { color: var(--text); background: var(--bg3); }
  .nav-links a.active { color: var(--accent); background: var(--tag-bg); }
  .nav-actions { display: flex; gap: 0.5rem; align-items: center; }
  .btn-icon {
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--muted); cursor: pointer;
    border-radius: 8px; padding: 0.35rem 0.6rem;
    font-size: 0.8rem; display: flex; align-items: center; gap: 0.35rem;
    transition: color 0.15s, background 0.15s;
  }
  .btn-icon:hover { color: var(--text); background: var(--border); }
  .btn-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

  /* ── SEARCH BAR ── */
  .search-wrap {
    position: sticky; top: var(--nav-h); z-index: 90;
    background: var(--bg);
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  .search-inner {
    max-width: 860px; margin: 0 auto;
    position: relative;
  }
  .search-inner svg {
    position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 2;
  }
  #search {
    width: 100%; padding: 0.55rem 1rem 0.55rem 2.25rem;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text);
    font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
    outline: none; transition: border-color 0.2s;
  }
  #search:focus { border-color: var(--accent); }
  #search::placeholder { color: var(--muted); }
  .search-hint { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 0.72rem; color: var(--muted); }

  /* ── LAYOUT ── */
  .main { padding-top: calc(var(--nav-h) + 0px); }
  .container { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

  /* ── HERO ── */
  .hero {
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
  }
  .hero-badge {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent2);
    background: rgba(56,232,192,0.1);
    border: 1px solid rgba(56,232,192,0.2);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin-bottom: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.6rem;
  }
  .hero h1 em { font-style: normal; color: var(--accent); }
  .hero p { color: var(--muted); font-size: 0.95rem; max-width: 520px; }
  .hero-stats {
    display: flex; gap: 1.5rem; margin-top: 1.5rem; flex-wrap: wrap;
  }
  .stat { display: flex; flex-direction: column; }
  .stat-val { font-family: 'Outfit', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--accent); }
  .stat-label { font-size: 0.75rem; color: var(--muted); }

  /* ── SECTIONS ── */
  .section { margin-bottom: 2.5rem; }
  .section-header {
    display: flex; align-items: flex-start; gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .section-num {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem; font-weight: 700;
    color: var(--accent);
    background: var(--tag-bg);
    border: 1px solid rgba(245,166,35,0.2);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
  }
  .section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem; font-weight: 800;
    letter-spacing: -0.01em;
  }
  .section-context {
    font-size: 0.78rem; color: var(--muted);
    font-family: 'Space Mono', monospace;
    margin-bottom: 0.9rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg3);
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
    display: inline-block;
  }

  /* ── CARDS ── */
  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin-bottom: 0.65rem;
    transition: border-color 0.2s;
    position: relative;
  }
  .card:hover { border-color: rgba(255,255,255,0.15); }
  .card-title {
    font-size: 0.88rem; font-weight: 600; margin-bottom: 0.35rem;
  }
  .card-desc { font-size: 0.83rem; color: var(--muted); margin-bottom: 0.5rem; line-height: 1.5; }

  /* ── CODE BLOCKS ── */
  .cmd-block {
    display: flex; align-items: stretch;
    background: var(--code-bg);
    border: 1px solid rgba(56,232,192,0.12);
    border-radius: 7px;
    overflow: hidden;
    margin: 0.4rem 0;
  }
  .cmd-prefix {
    padding: 0.45rem 0.6rem;
    background: rgba(56,232,192,0.06);
    color: var(--muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    border-right: 1px solid rgba(56,232,192,0.1);
    display: flex; align-items: center;
    user-select: none;
    white-space: nowrap;
  }
  .cmd-text {
    flex: 1;
    padding: 0.45rem 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--code-text);
    overflow-x: auto;
    white-space: pre;
    scrollbar-width: thin;
    line-height: 1.5;
  }
  .cmd-copy {
    padding: 0 0.65rem;
    background: none; border: none; cursor: pointer;
    color: var(--muted); display: flex; align-items: center;
    transition: color 0.15s;
    flex-shrink: 0;
  }
  .cmd-copy:hover { color: var(--accent2); }
  .cmd-copy svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
  .cmd-copy.copied { color: var(--accent2); }

  /* ── MULTI COMMAND GROUPS ── */
  .cmd-group {
    background: var(--code-bg);
    border: 1px solid rgba(56,232,192,0.12);
    border-radius: 7px;
    overflow: hidden;
    margin: 0.4rem 0;
  }
  .cmd-group .cmd-row {
    display: flex; align-items: center;
    border-bottom: 1px solid rgba(56,232,192,0.06);
    padding: 0.38rem 0.7rem;
  }
  .cmd-group .cmd-row:last-child { border-bottom: none; }
  .cmd-group .cmd-row code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    color: var(--code-text);
    flex: 1;
  }
  .cmd-group .cmd-row .cmd-copy {
    margin-left: auto;
  }

  /* ── DEVICE CARDS ── */
  .devices-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
  .device-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.15rem;
  }
  .device-label {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--muted);
    margin-bottom: 0.4rem;
  }
  .device-name {
    font-family: 'Syne', sans-serif;
    font-size: 1.05rem; font-weight: 800;
    margin-bottom: 0.25rem;
  }
  .device-name.switch { color: var(--accent2); }
  .device-name.router { color: var(--accent); }
  .device-detail { font-size: 0.78rem; color: var(--muted); }
  .device-layer {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.68rem; font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
  }
  .layer2 { background: rgba(56,232,192,0.1); color: var(--accent2); border: 1px solid rgba(56,232,192,0.2); }
  .layer3 { background: rgba(245,166,35,0.1); color: var(--accent); border: 1px solid rgba(245,166,35,0.2); }
  .layer-r { background: rgba(224,92,106,0.1); color: var(--accent3); border: 1px solid rgba(224,92,106,0.2); }

  /* ── ROUTE TABLE ── */
  .route-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
  .route-table th {
    text-align: left; padding: 0.5rem 0.75rem;
    font-family: 'Space Mono', monospace; font-size: 0.7rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); border-bottom: 1px solid var(--border);
  }
  .route-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
  .route-table tr:last-child td { border-bottom: none; }
  .route-table tr:hover td { background: var(--bg3); }
  .route-code {
    font-family: 'Space Mono', monospace; font-size: 0.85rem; font-weight: 700;
    background: var(--tag-bg); color: var(--accent);
    padding: 0.15rem 0.45rem; border-radius: 4px;
  }
  .route-code.teal { background: rgba(56,232,192,0.1); color: var(--accent2); }
  .route-code.red { background: rgba(224,92,106,0.1); color: var(--accent3); }
  .route-code.muted { background: var(--bg3); color: var(--muted); }

  /* ── INTER-VLAN CARDS ── */
  .method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
  .method-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 1rem 1.15rem;
    position: relative; overflow: hidden;
  }
  .method-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  }
  .method-card.legacy::before { background: var(--accent3); }
  .method-card.ros::before { background: var(--accent); }
  .method-card.l3::before { background: var(--accent2); }
  .method-tag {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem; border-radius: 20px; display: inline-block; margin-bottom: 0.6rem;
  }
  .method-tag.legacy { background: rgba(224,92,106,0.1); color: var(--accent3); }
  .method-tag.ros { background: rgba(245,166,35,0.1); color: var(--accent); }
  .method-tag.l3 { background: rgba(56,232,192,0.1); color: var(--accent2); }
  .method-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.35rem; }
  .method-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.5; margin-bottom: 0.6rem; }

  /* ── SSH STEPS ── */
  .steps { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
  .step {
    display: flex; gap: 0.75rem; align-items: flex-start;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 9px; padding: 0.7rem 0.9rem;
  }
  .step-num {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--tag-bg); color: var(--accent);
    font-family: 'Space Mono', monospace; font-size: 0.7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 0.05rem;
    border: 1px solid rgba(245,166,35,0.25);
  }
  .step-body { flex: 1; min-width: 0; }
  .step-text { font-size: 0.83rem; margin-bottom: 0.35rem; }

  /* ── FLOATING ROUTE ── */
  .float-route {
    display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0.4rem 0;
  }
  .route-type {
    flex: 1; min-width: 200px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 9px; padding: 0.75rem 0.9rem;
  }
  .route-type-label { font-size: 0.72rem; font-weight: 600; color: var(--muted); margin-bottom: 0.3rem; }

  /* ── SEARCH HIGHLIGHT ── */
  mark { background: rgba(245,166,35,0.25); color: var(--accent); border-radius: 2px; padding: 0 1px; }

  /* ── NO RESULTS ── */
  .no-results {
    text-align: center; padding: 3rem 1rem;
    color: var(--muted); font-size: 0.9rem;
    display: none;
  }
  .no-results.visible { display: block; }

  /* ── TOAST ── */
  .toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
    background: var(--card); border: 1px solid var(--accent2);
    color: var(--accent2); font-family: 'Space Mono', monospace;
    font-size: 0.75rem; padding: 0.55rem 1rem; border-radius: 8px;
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
  }
  .toast.show { opacity: 1; transform: translateY(0); }

  /* ── FOOTER ── */
  footer {
    text-align: center; padding: 2rem;
    font-size: 0.75rem; color: var(--muted);
    border-top: 1px solid var(--border);
    font-family: 'Space Mono', monospace;
  }

  /* ── RESPONSIVE ── */
  @media (max-width: 600px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 1.8rem; }
    .method-grid, .devices-grid { grid-template-columns: 1fr; }
    .route-table { font-size: 0.78rem; }
    .route-table th, .route-table td { padding: 0.4rem 0.5rem; }
    .search-hint { display: none; }
  }
  @media (max-width: 860px) {
    .nav-links a { font-size: 0.72rem; padding: 0.3rem 0.5rem; }
  }

  /* ── HIDDEN (search filter) ── */
  .section.hidden, .card.hidden, .step.hidden { display: none; }