/* ==========================================================================
   EHGN Attack Paths — Page Styles
   ehgn.nl/attack-paths

   Depends on: main.css (provides header/nav, base resets, Inter + JetBrains Mono)
   Prefix: ap-  (attack-paths)
   Class naming: dash-separated (ap-card-title, ap-detail-body, ap-sw-step)
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS (Custom Properties)
   ========================================================================== */

:root {
  /* ---- Surfaces ---- */
  --ap-bg:             #070b14;
  --ap-card-bg:        #0d1321;
  --ap-elevated-bg:    #131a2b;
  --ap-surface-glass:  rgba(13, 19, 33, 0.92);

  /* ---- Borders ---- */
  --ap-border:         #1c2940;
  --ap-border-hover:   #2a3d5e;
  --ap-border-accent:  rgba(0, 255, 65, 0.2);

  /* ---- Text ---- */
  --ap-text-primary:   #e8eef5;
  --ap-text-secondary: #c8d6e5;
  --ap-text-muted:     #6b7f99;

  /* ---- Accent ---- */
  --ap-accent:         #00FF41;
  --ap-accent-dim:     rgba(0, 255, 65, 0.15);
  --ap-accent-glow:    rgba(0, 255, 65, 0.25);

  /* ---- Category Colors ---- */
  --ap-cat-recon:            #06b6d4;
  --ap-cat-scanning:         #3b82f6;
  --ap-cat-enumeration:      #8b5cf6;
  --ap-cat-initial-access:   #f59e0b;
  --ap-cat-exploitation:     #ef4444;
  --ap-cat-privesc:          #f97316;
  --ap-cat-lateral:          #10b981;
  --ap-cat-post-exploitation:#ec4899;
  --ap-cat-persistence:      #6366f1;
  --ap-cat-cloud:            #14b8a6;
  --ap-cat-evasion:          #a855f7;
  --ap-cat-c2:               #dc2626;
  --ap-cat-collection:       #ea580c;
  --ap-cat-goal:             #fbbf24;
  --ap-cat-webapp:           #ec4899;

  /* ---- Difficulty Colors ---- */
  --ap-diff-beginner:     #00FF41;
  --ap-diff-intermediate: #f59e0b;
  --ap-diff-advanced:     #ef4444;

  /* ---- Typography ---- */
  --ap-font-body:  inherit;
  --ap-font-mono:  'JetBrains Mono', monospace;

  /* ---- Spacing ---- */
  --ap-gutter:     1rem;
  --ap-radius-sm:  0.375rem;
  --ap-radius:     0.5rem;
  --ap-radius-lg:  0.75rem;
  --ap-radius-xl:  1rem;

  /* ---- Transitions ---- */
  --ap-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ap-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ---- Shadows ---- */
  --ap-shadow-card:     0 2px 8px rgba(0, 0, 0, 0.3);
  --ap-shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.4);
  --ap-shadow-glow:     0 0 20px rgba(0, 255, 65, 0.12);

  /* ---- Z-Index ---- */
  --ap-z-map:      1;
  --ap-z-controls: 10;
  --ap-z-panel:    30;
  --ap-z-overlay:  40;
  --ap-z-toast:    50;
}


/* ==========================================================================
   2. HERO SECTION
   ========================================================================== */

.ap-hero {
  padding: 2rem 0 1.5rem;
}

.ap-hero-content {
  text-align: center;
  margin-bottom: 1.5rem;
}

.ap-hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ap-text-primary);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .ap-hero-title { font-size: 2.5rem; }
}

.ap-hero-accent {
  color: var(--ap-accent);
  display: block;
}

.ap-hero-desc {
  font-size: 1rem;
  color: var(--ap-text-muted);
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto;
}


/* ==========================================================================
   3. TOOLBAR — Tabs + Search
   ========================================================================== */

.ap-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .ap-toolbar {
    flex-direction: row;
    align-items: center;
  }
}

/* ---- Tab Switcher ---- */
.ap-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  width: fit-content;
}

.ap-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: var(--ap-radius);
  color: var(--ap-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: color var(--ap-transition), background var(--ap-transition);
  white-space: nowrap;
  min-height: 44px;
}

.ap-tab:hover {
  color: var(--ap-text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.ap-tab-active {
  color: var(--ap-accent);
  background: var(--ap-accent-dim);
  font-weight: 600;
}

.ap-tab-active:hover {
  color: var(--ap-accent);
  background: var(--ap-accent-dim);
}

.ap-tab-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}


/* ==========================================================================
   4. SEARCH
   ========================================================================== */

.ap-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.ap-search {
  position: relative;
  display: flex;
  align-items: center;
}

.ap-search-icon {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: var(--ap-text-muted);
  pointer-events: none;
}

.ap-search-input {
  width: 100%;
  padding: 0.625rem 2.25rem 0.625rem 2.5rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  color: var(--ap-text-primary);
  font-size: 0.875rem;
  font-family: var(--ap-font-body);
  outline: none;
  transition: border-color var(--ap-transition), box-shadow var(--ap-transition);
  min-height: 44px;
}

.ap-search-input::placeholder {
  color: var(--ap-text-muted);
}

.ap-search-input:focus {
  border-color: rgba(0, 255, 65, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.08);
}

.ap-search-kbd {
  position: absolute;
  right: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ap-border);
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
  pointer-events: none;
}

.ap-search-clear {
  position: absolute;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: none;
  border: none;
  color: var(--ap-text-muted);
  cursor: pointer;
  border-radius: var(--ap-radius-sm);
  transition: color var(--ap-transition), background var(--ap-transition);
  padding: 0;
}

.ap-search-clear svg {
  width: 1rem;
  height: 1rem;
}

.ap-search-clear:hover {
  color: var(--ap-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ---- Search Results Dropdown ---- */
.ap-search-results {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  z-index: var(--ap-z-controls);
  background: var(--ap-elevated-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-elevated);
  max-height: 24rem;
  overflow-y: auto;
  padding: 0.25rem;
}

.ap-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  border-radius: var(--ap-radius-sm);
  color: var(--ap-text-secondary);
  font-size: 0.8125rem;
  font-family: var(--ap-font-body);
  cursor: pointer;
  text-align: left;
  transition: background var(--ap-transition), color var(--ap-transition);
  min-height: 40px;
}

.ap-search-result-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ap-text-primary);
}

.ap-search-result-cat {
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--ap-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  min-width: 3rem;
}

.ap-search-result-name {
  flex: 1;
  font-weight: 500;
}

.ap-search-result-mitre {
  font-size: 0.6875rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
  flex-shrink: 0;
}


/* ==========================================================================
   5. ACTIVE FILTERS BAR
   ========================================================================== */

.ap-active-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.ap-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ap-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ap-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: var(--ap-accent-dim);
  border: 1px solid rgba(0, 255, 65, 0.25);
  border-radius: 9999px;
  color: var(--ap-accent);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
}

.ap-filter-pill:hover {
  background: rgba(0, 255, 65, 0.2);
}

.ap-filter-pill-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.ap-filter-pill-x {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.ap-filter-clear {
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  color: var(--ap-text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--ap-transition);
}

.ap-filter-clear:hover {
  color: var(--ap-text-primary);
}


/* ==========================================================================
   6. FILTERS — Category, Difficulty, OS
   ========================================================================== */

.ap-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .ap-filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

.ap-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.ap-filter-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ap-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Category Pills ---- */
.ap-category-pills {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.ap-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.75rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: 9999px;
  color: var(--ap-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  white-space: nowrap;
  min-height: 36px;
  user-select: none;
}

.ap-cat-pill:hover {
  border-color: var(--ap-border-hover);
  color: var(--ap-text-primary);
  background: var(--ap-elevated-bg);
}

.ap-cat-pill-active {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
  background: var(--ap-accent-dim);
}

.ap-cat-pill-active:hover {
  border-color: var(--ap-accent);
  background: rgba(0, 255, 65, 0.2);
}

.ap-cat-pill-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.ap-cat-pill-count {
  font-size: 0.6875rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
  opacity: 0.7;
}

/* ---- Difficulty Pills ---- */
.ap-difficulty-pills {
  display: flex;
  gap: 0.375rem;
}

.ap-diff-pill {
  padding: 0.4375rem 0.75rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: 9999px;
  color: var(--ap-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  min-height: 36px;
}

.ap-diff-pill:hover {
  border-color: var(--ap-border-hover);
  color: var(--ap-text-secondary);
}

.ap-diff-pill-active {
  font-weight: 600;
}

.ap-diff-pill-beginner.ap-diff-pill-active {
  background: rgba(0, 255, 65, 0.1);
  border-color: rgba(0, 255, 65, 0.35);
  color: var(--ap-diff-beginner);
}

.ap-diff-pill-intermediate.ap-diff-pill-active {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--ap-diff-intermediate);
}

.ap-diff-pill-advanced.ap-diff-pill-active {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--ap-diff-advanced);
}

/* ---- OS Pills ---- */
.ap-os-pills {
  display: flex;
  gap: 0.375rem;
}

.ap-os-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.75rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: 9999px;
  color: var(--ap-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  min-height: 36px;
}

.ap-os-pill:hover {
  border-color: var(--ap-border-hover);
  color: var(--ap-text-secondary);
}

.ap-os-pill-active {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
  background: var(--ap-accent-dim);
}

.ap-os-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ---- Software / Platform Pills ---- */
.ap-software-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.ap-sw-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: 0.375rem;
  color: var(--ap-text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  white-space: nowrap;
  user-select: none;
  min-height: 28px;
}

.ap-sw-filter-pill:hover {
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--ap-text-secondary);
  background: rgba(6, 182, 212, 0.06);
}

.ap-sw-filter-pill-active {
  border-color: rgba(6, 182, 212, 0.5);
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  font-weight: 600;
}

.ap-sw-filter-pill-active:hover {
  border-color: rgba(6, 182, 212, 0.65);
  background: rgba(6, 182, 212, 0.18);
  color: #06b6d4;
}

.ap-sw-filter-count {
  font-size: 0.65rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
  opacity: 0.6;
  margin-left: 0.125rem;
}

.ap-sw-filter-pill-active .ap-sw-filter-count {
  color: #06b6d4;
  opacity: 0.7;
}


/* ==========================================================================
   7. RESULTS BAR + SORT
   ========================================================================== */

.ap-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ap-results-count {
  font-size: 0.8125rem;
  color: var(--ap-text-muted);
  font-family: var(--ap-font-mono);
}

.ap-sort {
  display: flex;
  align-items: center;
}

.ap-sort-select {
  padding: 0.375rem 0.75rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  color: var(--ap-text-secondary);
  font-size: 0.8125rem;
  font-family: var(--ap-font-body);
  outline: none;
  cursor: pointer;
  transition: border-color var(--ap-transition);
  min-height: 36px;
}

.ap-sort-select:focus {
  border-color: rgba(0, 255, 65, 0.4);
}

.ap-sort-select option {
  background: var(--ap-elevated-bg);
  color: var(--ap-text-primary);
}


/* ==========================================================================
   8. SVG OVERVIEW MAP
   ========================================================================== */

.ap-map-section {
  margin-bottom: 2rem;
}

.ap-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ap-text-primary);
  margin-bottom: 0.5rem;
}

.ap-section-desc {
  font-size: 0.875rem;
  color: var(--ap-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.ap-map-container {
  position: relative;
  width: 100%;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

.ap-map {
  display: block;
  width: 100%;
  min-width: 800px;
  height: auto;
}

.ap-map-node {
  cursor: pointer;
  transition: filter var(--ap-transition), opacity var(--ap-transition);
}

.ap-map-node:hover {
  filter: brightness(1.2);
}

.ap-map-node-active {
  filter: brightness(1.3) drop-shadow(0 0 8px currentColor);
}

.ap-map-node-bg {
  fill: var(--ap-card-bg);
  stroke: var(--ap-border);
  stroke-width: 1;
  transition: fill var(--ap-transition), stroke var(--ap-transition);
}

.ap-map-node:hover .ap-map-node-bg {
  fill: var(--ap-elevated-bg);
  stroke: var(--ap-border-hover);
}

.ap-map-node-active .ap-map-node-bg {
  stroke: var(--ap-accent);
  fill: rgba(0, 255, 65, 0.06);
}

.ap-map-node-label {
  font-size: 11px;
  font-family: var(--ap-font-mono);
  font-weight: 600;
  fill: var(--ap-text-primary);
  pointer-events: none;
}

.ap-map-node-count {
  font-size: 9px;
  font-family: var(--ap-font-mono);
  font-weight: 700;
  fill: var(--ap-text-muted);
  text-anchor: middle;
}

.ap-map-edges {
  stroke: var(--ap-border);
}

.ap-map-arrow {
  fill: var(--ap-border);
}

.ap-map-goals {
  opacity: 0.5;
}


/* ==========================================================================
   9. TECHNIQUE CARD GRID
   ========================================================================== */

.ap-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .ap-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .ap-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- Single Technique Card ---- */
.ap-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1rem 1.125rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  cursor: pointer;
  transition:
    transform var(--ap-transition),
    box-shadow var(--ap-transition),
    border-color var(--ap-transition);
}

.ap-card:hover {
  transform: translateY(-2px);
  border-color: var(--ap-border-hover);
  box-shadow: var(--ap-shadow-elevated), 0 0 24px rgba(0, 0, 0, 0.2);
}

.ap-card:active {
  transform: translateY(-1px);
}

.ap-card-border {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--ap-radius-lg) 0 0 var(--ap-radius-lg);
}

.ap-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ap-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ap-text-primary);
  line-height: 1.3;
}

.ap-card-meta {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  align-items: center;
}

.ap-card-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ap-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
}


/* ==========================================================================
   10. BADGES — Difficulty, Category, MITRE, OS
   ========================================================================== */

/* Difficulty badge */
.ap-difficulty {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--ap-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.ap-difficulty-lg {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
}

.ap-diff-beginner {
  color: var(--ap-diff-beginner);
  border-color: rgba(0, 255, 65, 0.35);
  background: rgba(0, 255, 65, 0.08);
}

.ap-diff-intermediate {
  color: var(--ap-diff-intermediate);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.ap-diff-advanced {
  color: var(--ap-diff-advanced);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

/* Category badge */
.ap-cat-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--ap-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ap-cat-badge-lg {
  font-size: 0.75rem;
  padding: 0.1875rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 9999px;
  background: transparent;
}

/* MITRE badge */
.ap-mitre-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.375rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--ap-font-mono);
  color: #60a5fa;
}

.ap-mitre-badge-lg {
  font-size: 0.75rem;
  padding: 0.1875rem 0.5rem;
}

/* OS badge */
.ap-os-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
  text-transform: capitalize;
}


/* ==========================================================================
   11. EMPTY STATE
   ========================================================================== */

.ap-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--ap-text-muted);
  text-align: center;
}

.ap-empty-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--ap-text-muted);
  opacity: 0.4;
  margin-bottom: 0.75rem;
}

.ap-empty-title {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--ap-text-secondary);
}

.ap-empty-desc {
  font-size: 0.8125rem;
  color: var(--ap-text-muted);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.ap-empty-reset {
  padding: 0.5rem 1rem;
  background: var(--ap-accent-dim);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: var(--ap-radius);
  color: var(--ap-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ap-transition);
}

.ap-empty-reset:hover {
  background: rgba(0, 255, 65, 0.2);
}


/* ==========================================================================
   12. TECHNIQUE DETAIL PANEL — Slide-in from right
   ========================================================================== */

.ap-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--ap-z-overlay);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.ap-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--ap-z-overlay) + 1);
  width: 100%;
  max-width: 100%;
  background: var(--ap-elevated-bg);
  border-left: 1px solid var(--ap-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 768px) {
  .ap-detail {
    width: 50%;
    max-width: 50%;
  }
}

@media (min-width: 1024px) {
  .ap-detail {
    width: 480px;
    max-width: 480px;
  }
}

.ap-detail-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--ap-border);
  flex-shrink: 0;
}

.ap-detail-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  color: var(--ap-text-muted);
  cursor: pointer;
  transition: all var(--ap-transition);
  float: right;
  margin-bottom: 0.5rem;
  padding: 0;
}

.ap-detail-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ap-text-primary);
  border-color: var(--ap-border-hover);
}

.ap-detail-close svg {
  width: 1rem;
  height: 1rem;
}

.ap-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  clear: both;
}

.ap-detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ap-text-primary);
  line-height: 1.3;
}

.ap-detail-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

/* Detail scrollable body */
.ap-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  overscroll-behavior: contain;
}

.ap-detail-body::-webkit-scrollbar {
  width: 4px;
}

.ap-detail-body::-webkit-scrollbar-track {
  background: transparent;
}

.ap-detail-body::-webkit-scrollbar-thumb {
  background: var(--ap-border);
  border-radius: 2px;
}

/* Sections */
.ap-detail-section {
  margin-bottom: 1.5rem;
}

.ap-detail-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ap-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.ap-detail-description {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ap-text-secondary);
}

/* MITRE link */
.ap-detail-mitre {
  margin-bottom: 0.5rem;
}

.ap-detail-mitre-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--ap-radius);
  color: #60a5fa;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: all var(--ap-transition);
}

.ap-detail-mitre-link:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

/* Tools */
.ap-detail-tools {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ap-detail-tool {
  margin-bottom: 0;
}

.ap-detail-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.ap-detail-tool-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ap-accent);
  font-family: var(--ap-font-mono);
}

/* Command block */
.ap-detail-cmd {
  position: relative;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  overflow: hidden;
  overflow-x: auto;
  transition: border-color var(--ap-transition);
}

.ap-detail-cmd:hover {
  border-color: rgba(0, 255, 65, 0.25);
}

.ap-detail-cmd code {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-family: var(--ap-font-mono);
  line-height: 1.6;
  color: var(--ap-text-primary);
  white-space: pre;
  tab-size: 4;
}

/* Copy button */
.ap-detail-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  color: var(--ap-text-muted);
  cursor: pointer;
  transition: all var(--ap-transition);
  padding: 0;
  flex-shrink: 0;
}

.ap-detail-copy:hover {
  background: rgba(0, 255, 65, 0.1);
  border-color: rgba(0, 255, 65, 0.3);
  color: var(--ap-accent);
}

.ap-detail-copy svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* References */
.ap-detail-refs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ap-detail-ref-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4375rem 0.625rem;
  border-radius: var(--ap-radius-sm);
  color: var(--ap-text-secondary);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: all 150ms ease;
}

.ap-detail-ref-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ap-accent);
}

/* Connected techniques */
.ap-detail-connected {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ap-detail-connected-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--ap-radius-sm);
  color: var(--ap-text-secondary);
  font-size: 0.8125rem;
  font-family: var(--ap-font-body);
  cursor: pointer;
  text-align: left;
  transition: all 150ms ease;
  width: 100%;
  min-height: 40px;
}

.ap-detail-connected-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ap-border);
  color: var(--ap-text-primary);
}

.ap-detail-connected-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.ap-detail-connected-name {
  flex: 1;
  font-weight: 500;
}

.ap-detail-connected-cat {
  font-size: 0.625rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: auto;
}


/* ==========================================================================
   13. VIEW WRAPPER
   ========================================================================== */

.ap-view {
  padding-bottom: 2rem;
}


/* ==========================================================================
   14. PATHFINDER
   ========================================================================== */

.ap-pathfinder {
  padding: 1rem 0;
}

/* Step sections */
.ap-pf-step {
  margin-bottom: 1.5rem;
}

.ap-pf-step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ap-pf-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--ap-accent-dim);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--ap-font-mono);
  color: var(--ap-accent);
  flex-shrink: 0;
}

.ap-pf-step-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ap-text-primary);
  margin: 0;
}

.ap-pf-optional {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ap-text-muted);
}

/* Goal cards */
.ap-pf-goals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .ap-pf-goals {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ap-pf-goal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  cursor: pointer;
  transition: all var(--ap-transition);
  text-align: center;
  min-height: 44px;
}

.ap-pf-goal-card:hover {
  border-color: var(--ap-border-hover);
  background: var(--ap-elevated-bg);
  transform: translateY(-2px);
  box-shadow: var(--ap-shadow-elevated);
}

.ap-pf-goal-active {
  border-color: var(--ap-cat-goal);
  background: rgba(251, 191, 36, 0.06);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.1);
}

.ap-pf-goal-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ap-radius-lg);
  padding: 0.5rem;
  opacity: 0.8;
  transition: opacity var(--ap-transition);
}

.ap-pf-goal-card:hover .ap-pf-goal-icon,
.ap-pf-goal-active .ap-pf-goal-icon {
  opacity: 1;
}

.ap-pf-goal-icon svg {
  width: 100%;
  height: 100%;
}

.ap-pf-goal-root  { color: var(--ap-diff-advanced); background: rgba(239, 68, 68, 0.1); }
.ap-pf-goal-da    { color: var(--ap-cat-goal); background: rgba(251, 191, 36, 0.1); }
.ap-pf-goal-nt    { color: #60a5fa; background: rgba(59, 130, 246, 0.1); }
.ap-pf-goal-cloud { color: var(--ap-cat-cloud); background: rgba(20, 184, 166, 0.1); }

.ap-pf-goal-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ap-text-primary);
  font-family: var(--ap-font-mono);
}

.ap-pf-goal-os {
  font-size: 0.75rem;
  color: var(--ap-text-muted);
}

/* Start options */
.ap-pf-start-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ap-pf-start-option {
  padding: 0.625rem 1rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  color: var(--ap-text-secondary);
  font-size: 0.875rem;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  min-height: 44px;
}

.ap-pf-start-option:hover {
  border-color: var(--ap-border-hover);
  background: var(--ap-elevated-bg);
}

.ap-pf-start-active {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
  background: var(--ap-accent-dim);
}

/* Action button */
.ap-pf-action {
  margin-bottom: 2rem;
}

/* Results */
.ap-pf-results {
  margin-top: 1rem;
}

.ap-pf-results-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ap-text-primary);
  margin-bottom: 1rem;
}

.ap-pf-path {
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.ap-pf-path-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.375rem;
}

.ap-pf-path-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ap-text-primary);
}

.ap-pf-path-diff {
  /* uses ap-diff-* classes for color */
}

.ap-pf-path-steps {
  font-size: 0.75rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
}

.ap-pf-path-desc {
  font-size: 0.8125rem;
  color: var(--ap-text-muted);
  margin-bottom: 1rem;
}

/* Path step sequence */
.ap-pf-steps {
  position: relative;
  padding-left: 1.25rem;
}

.ap-pf-step-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.375rem 0;
}

.ap-pf-step-connector {
  position: absolute;
  left: 0.4375rem;
  top: 1.5rem;
  bottom: -0.375rem;
  width: 2px;
  background: var(--ap-border);
}

.ap-pf-step-dot {
  position: relative;
  width: 0.9375rem;
  height: 0.9375rem;
  border: 2px solid var(--ap-border);
  border-radius: 50%;
  background: var(--ap-card-bg);
  flex-shrink: 0;
  margin-top: 0.125rem;
  z-index: 1;
}

.ap-pf-step-content {
  flex: 1;
  min-width: 0;
}

.ap-pf-step-name {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ap-text-primary);
  cursor: pointer;
  text-align: left;
  transition: color var(--ap-transition);
  font-family: var(--ap-font-body);
}

.ap-pf-step-name:hover {
  color: var(--ap-accent);
}

.ap-pf-step-cat {
  font-size: 0.6875rem;
  font-family: var(--ap-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Empty pathfinder */
.ap-pf-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ap-text-muted);
  font-size: 0.875rem;
}


/* ==========================================================================
   15. BUTTONS
   ========================================================================== */

.ap-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--ap-accent-dim);
  border: 1px solid rgba(0, 255, 65, 0.35);
  border-radius: var(--ap-radius);
  color: var(--ap-accent);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  min-height: 44px;
}

.ap-btn-primary:hover {
  background: rgba(0, 255, 65, 0.2);
  border-color: rgba(0, 255, 65, 0.5);
  box-shadow: var(--ap-shadow-glow);
}

.ap-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ap-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  color: var(--ap-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  min-height: 44px;
}

.ap-btn-secondary:hover {
  background: var(--ap-elevated-bg);
  border-color: var(--ap-border-hover);
  color: var(--ap-text-primary);
}

.ap-btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.ap-btn-primary svg,
.ap-btn-secondary svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}


/* ==========================================================================
   16. SCENARIO GRID (selection view)
   ========================================================================== */

.ap-scenario-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .ap-scenario-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .ap-scenario-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ap-scenario-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  cursor: pointer;
  transition: all var(--ap-transition);
  text-align: left;
  width: 100%;
}

.ap-scenario-card:hover {
  transform: translateY(-2px);
  border-color: var(--ap-border-hover);
  box-shadow: var(--ap-shadow-elevated);
}

.ap-scenario-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.ap-scenario-icon svg {
  width: 100%;
  height: 100%;
}

.ap-scenario-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ap-text-primary);
  margin-bottom: 0.375rem;
}

.ap-scenario-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ap-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
  flex: 1;
}

.ap-scenario-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.ap-scenario-diff {
  /* inherits from ap-diff-* */
}

.ap-scenario-steps {
  font-size: 0.75rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
}


/* ==========================================================================
   17. SCENARIO WALKER (active scenario)
   ========================================================================== */

.ap-scenario-walker {
  padding: 0;
}

.ap-sw-header {
  margin-bottom: 1.5rem;
}

.ap-sw-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0;
  background: none;
  border: none;
  color: var(--ap-text-muted);
  font-size: 0.8125rem;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: color var(--ap-transition);
  margin-bottom: 0.75rem;
}

.ap-sw-back:hover {
  color: var(--ap-accent);
}

.ap-sw-back svg {
  width: 1rem;
  height: 1rem;
}

.ap-sw-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ap-text-primary);
  margin-bottom: 0.5rem;
}

.ap-sw-desc {
  font-size: 0.875rem;
  color: var(--ap-text-muted);
  line-height: 1.6;
}

/* Progress bar */
.ap-sw-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--ap-card-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
}

.ap-sw-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--ap-border);
  border-radius: 2px;
  overflow: hidden;
}

.ap-sw-progress-fill {
  height: 100%;
  background: var(--ap-accent);
  border-radius: 2px;
  transition: width var(--ap-transition-slow);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.ap-sw-progress-text {
  font-size: 0.75rem;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
  white-space: nowrap;
}

/* Timeline */
.ap-sw-timeline {
  position: relative;
}

/* Single step */
.ap-sw-step {
  position: relative;
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.ap-sw-step:last-child {
  padding-bottom: 0;
}

/* Step indicator column */
.ap-sw-step-indicator {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 2rem;
}

.ap-sw-step-line {
  position: absolute;
  top: 2rem;
  bottom: -0.5rem;
  left: 50%;
  width: 2px;
  background: var(--ap-border);
  transform: translateX(-50%);
}

.ap-sw-step-done .ap-sw-step-line {
  background: var(--ap-accent);
}

.ap-sw-step-dot {
  position: relative;
  width: 1.875rem;
  height: 1.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ap-card-bg);
  border: 2px solid var(--ap-border);
  border-radius: 50%;
  z-index: 1;
  transition: all var(--ap-transition);
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--ap-font-mono);
  color: var(--ap-text-muted);
}

.ap-sw-check {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--ap-accent);
}

/* Step states */
.ap-sw-step-done .ap-sw-step-dot {
  border-color: var(--ap-accent);
  background: var(--ap-accent-dim);
}

.ap-sw-step-active .ap-sw-step-dot {
  border-color: var(--ap-accent);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.25);
  animation: ap-dot-pulse 2s ease-in-out infinite;
}

.ap-sw-step-locked .ap-sw-step-dot {
  opacity: 0.4;
}

.ap-sw-step-locked .ap-sw-step-content {
  opacity: 0.4;
}

@keyframes ap-dot-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(0, 255, 65, 0.15); }
  50% { box-shadow: 0 0 16px rgba(0, 255, 65, 0.35); }
}

/* Step content */
.ap-sw-step-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.ap-sw-step-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ap-text-primary);
  margin-bottom: 0.25rem;
}

.ap-sw-step-active .ap-sw-step-title {
  color: var(--ap-accent);
}

.ap-sw-step-body {
  margin-top: 0.75rem;
  padding: 1rem;
  background: var(--ap-card-bg);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: var(--ap-radius-lg);
}

.ap-sw-narrative {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ap-text-secondary);
  margin-bottom: 0.75rem;
}

/* Technique reference link */
.ap-sw-technique {
  margin-bottom: 0.75rem;
}

.ap-sw-technique-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(0, 255, 65, 0.06);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: var(--ap-radius);
  color: var(--ap-accent);
  font-size: 0.8125rem;
  font-family: var(--ap-font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ap-transition);
}

.ap-sw-technique-link:hover {
  background: rgba(0, 255, 65, 0.12);
  border-color: rgba(0, 255, 65, 0.3);
}

.ap-sw-technique-link svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

/* Decisions */
.ap-sw-decisions {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: var(--ap-radius);
}

.ap-sw-decisions-prompt {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ap-text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.ap-sw-decision-options {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.ap-sw-decision-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  color: var(--ap-text-secondary);
  font-size: 0.875rem;
  font-family: var(--ap-font-body);
  cursor: pointer;
  transition: all var(--ap-transition);
  text-align: left;
  width: 100%;
  min-height: 44px;
}

.ap-sw-decision-btn:hover {
  background: var(--ap-accent-dim);
  border-color: rgba(0, 255, 65, 0.3);
  color: var(--ap-text-primary);
}

.ap-sw-decision-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--ap-transition), transform var(--ap-transition);
}

.ap-sw-decision-btn:hover svg {
  opacity: 1;
  transform: translateX(2px);
}

/* Navigation */
.ap-sw-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.ap-sw-complete {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--ap-accent);
  font-size: 0.875rem;
  font-weight: 600;
}

.ap-sw-complete svg {
  width: 1.25rem;
  height: 1.25rem;
}


/* ==========================================================================
   18. MISC — External icon, Spinner, View transitions
   ========================================================================== */

.ap-external-icon {
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.5;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

.ap-spin {
  animation: ap-spin-anim 0.7s linear infinite;
}

@keyframes ap-spin-anim {
  to { transform: rotate(360deg); }
}


/* ==========================================================================
   19. TOAST NOTIFICATIONS
   ========================================================================== */

.ap-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: var(--ap-z-toast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--ap-surface-glass);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 255, 65, 0.25);
  border-radius: var(--ap-radius);
  color: var(--ap-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.ap-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}


/* ==========================================================================
   20. FOCUS / ACCESSIBILITY
   ========================================================================== */

*:focus-visible {
  outline: 2px solid var(--ap-accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   21. RESPONSIVE
   ========================================================================== */

@media (max-width: 767px) {
  .ap-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ap-tabs::-webkit-scrollbar { display: none; }

  .ap-tab {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  .ap-search-wrapper {
    max-width: 100%;
  }

  .ap-filters {
    flex-direction: column;
  }

  .ap-category-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .ap-category-pills::-webkit-scrollbar { display: none; }

  .ap-software-pills {
    flex-wrap: wrap;
    max-height: 6rem;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .ap-card-grid {
    grid-template-columns: 1fr;
  }

  .ap-detail {
    width: 100%;
    max-width: 100%;
    border-left: none;
  }

  .ap-pf-goals {
    grid-template-columns: 1fr;
  }

  .ap-map-container {
    border-radius: var(--ap-radius);
  }

  .ap-toast {
    left: var(--ap-gutter);
    right: var(--ap-gutter);
    transform: translateX(0) translateY(20px);
  }

  .ap-toast--visible {
    transform: translateX(0) translateY(0);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ap-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ap-pf-goals {
    grid-template-columns: repeat(2, 1fr);
  }

  .ap-detail {
    width: 50%;
  }
}


/* ==========================================================================
   22. ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes ap-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ap-node-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px currentColor); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 16px currentColor); transform: scale(1.06); }
}

@keyframes ap-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ==========================================================================
   23. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ap-card:hover,
  .ap-pf-goal-card:hover,
  .ap-scenario-card:hover {
    transform: none;
  }
}


/* ==========================================================================
   24. PRINT
   ========================================================================== */

@media print {
  .ap-detail,
  .ap-detail-overlay,
  .ap-toast,
  .ap-tabs,
  .ap-toolbar,
  .ap-filters,
  .ap-map-section {
    display: none;
  }

  .ap-card {
    border: 1px solid #ccc;
    background: #fff;
    break-inside: avoid;
    box-shadow: none;
    color: #1a1a1a;
  }

  .ap-detail-cmd code {
    color: #1a1a1a;
  }
}
