:root {
  --bg-dark: #020617;
  --card-bg: rgba(15, 23, 42, 0.75);
  --card-hover: rgba(30, 41, 59, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --emerald: #10b981;
  --cyan: #06b6d4;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #8b5cf6;
  --gray: #64748b;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem 1rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Background Kinetic Canvas */
#matrixCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* CRT Scanlines Overlay */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 6px 100%;
}
.crt-overlay.active {
  display: block;
}

.container {
  max-width: 1720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Top Command Header */
header {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald);
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.brand-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.2rem;
}

.header-right-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.pulse-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.pulse-metric {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-toggle-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hud-toggle-btn:hover {
  border-color: var(--cyan);
  color: var(--text-main);
  background: rgba(6, 182, 212, 0.1);
}

.hud-toggle-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Master Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

.nav-tab {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border-color: var(--emerald);
  color: #fff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.tab-badge {
  background: rgba(2, 6, 23, 0.8);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Search & Filter Controls */
.controls-bar {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

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

.search-box svg {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--emerald);
  color: var(--emerald);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Grids & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.category-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.category-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  color: var(--text-muted);
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s, background 0.2s;
  position: relative;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.5);
  background: var(--card-hover);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 16px rgba(16, 185, 129, 0.15);
}

.card.is-favorite {
  border-color: rgba(245, 158, 11, 0.4);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.card-header-flex {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.card-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.card:hover .card-icon-container {
  transform: scale(1.08) rotate(1deg);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.traffic-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.traffic-pill.tier-high {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

.traffic-pill.tier-core {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.traffic-pill.tier-edge, .traffic-pill.tier-specialized {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.traffic-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.traffic-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #06b6d4, #10b981, #f59e0b, #f43f5e);
  transition: width 0.4s ease;
}

.tier-divider-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0.5rem 0.5rem 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tier-divider-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tier-divider-sub {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.card-title-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  transition: color 0.15s;
}

.card-title-link:hover .card-title {
  color: var(--emerald);
}

.card-domain {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  text-decoration: none;
  word-break: break-all;
}

.card-fav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.15s;
}

.card-fav-btn:hover {
  color: var(--amber);
  transform: scale(1.15);
}

.card.is-favorite .card-fav-btn {
  color: var(--amber);
}

.card-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.45;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-launch:hover {
  background: var(--emerald);
  color: #020617;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-skill-card-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-skill-card-copy:hover {
  background: var(--emerald);
  color: #020617;
}

.btn-skill-card-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-skill-card-dl:hover {
  background: var(--cyan);
  color: #020617;
}

.btn-slash-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-slash-prompt:hover {
  background: var(--violet);
  color: #fff;
}

.icon-btn {
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: var(--cyan);
}

/* ========================================================= */
/* JD's Cognitive Lake & Friction Telemetry Styles           */
/* ========================================================= */
.metrics-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.metrics-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.kpi-tile {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.kpi-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.section-box {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem;
  backdrop-filter: blur(16px);
}

.section-box-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-box-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.friction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.friction-card {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.2s, border-color 0.2s;
}

.friction-card:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 63, 94, 0.4);
}

.friction-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.severity-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
}

.severity-critical {
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.severity-high {
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.severity-medium {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.friction-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f1f5f9;
}

.friction-rule {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.4;
}

.friction-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
}

/* Prompt Leverage & Economy Grid */
.leverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.leverage-card {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.2s, border-color 0.2s;
}

.leverage-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.15);
}

.leverage-label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.leverage-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: -0.02em;
}

.leverage-sub {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: auto;
}

/* NVIDIA Nsight Systems AD107 GPU Grid */
.nsight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

.nsight-card {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.2s, border-color 0.2s;
}

.nsight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.18);
}

.nsight-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kernel-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speedup-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.nsight-kernel-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.nsight-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

.nsight-metrics-strip {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: auto;
}

/* Hardware & Compute */
.hardware-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.hw-card {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hw-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hw-val {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

/* App focus bar */
.app-focus-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.app-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.app-progress-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.app-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  border-radius: 4px;
}

/* Lake Grid */
.lake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.lake-card {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lake-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lake-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cyan);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.open { display: flex; }

.modal-content {
  background: #090d16;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
}

.skill-modal-content {
  max-width: 900px;
  width: 95%;
  max-height: 88vh;
  text-align: left;
  align-items: stretch;
  gap: 1rem;
  padding: 1.5rem;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.skill-meta-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.skill-chip-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  width: fit-content;
}

.skill-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.skill-modal-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.skill-modal-desc {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
}

.code-container {
  position: relative;
  flex: 1;
  min-height: 220px;
  max-height: 52vh;
  overflow: auto;
  background: #020617;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
}

.skill-code-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-footer-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-copy-skill {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.btn-copy-skill:hover {
  background: var(--emerald);
  color: #020617;
}

.btn-download-skill {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.btn-download-skill:hover {
  background: var(--cyan);
  color: #020617;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--emerald);
  color: var(--emerald);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  gap: 0.5rem;
  z-index: 10000;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
  .friction-grid { grid-template-columns: 1fr; }
  .lake-grid { grid-template-columns: 1fr; }
  .hardware-strip { grid-template-columns: 1fr; }
  .header-right-controls { width: 100%; justify-content: space-between; }
}
