:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  /* Dark Obsidian Architectural Showcase Theme */
  --bg-app: #060a12;
  --bg-surface: #0c1322;
  --bg-card: #10192b;
  --bg-card-hover: #152138;
  --bg-elevated: #18253d;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --grid-dot: rgba(148, 163, 184, 0.13);

  --text-primary: #f1f5ff;
  --text-secondary: #9fb0cc;
  --text-muted: #697c99;

  --c-lan: #38bdf8;
  --c-pt: #14b8a6;
  --c-core: #6366f1;
  --c-router: #818cf8;
  --c-proxy: #f59e0b;
  --c-chain: #c084fc;
  --c-us: #f43f5e;
  --c-direct: #10b981;
  --c-standby: #64748b;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.36);
  --shadow-float: 0 14px 36px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg-app: #f2f5fb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafd;
  --bg-elevated: #ebf1fa;
  --border-subtle: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.22);
  --grid-dot: rgba(15, 23, 42, 0.11);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --c-lan: #0284c7;
  --c-pt: #0d9488;
  --c-core: #4f46e5;
  --c-router: #6366f1;
  --c-proxy: #d97706;
  --c-chain: #9333ea;
  --c-us: #e11d48;
  --c-direct: #059669;
  --c-standby: #64748b;

  --shadow-card: 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 10px 28px rgba(15, 23, 42, 0.1);
}

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

html, body {
  height: 100%;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header */
.topbar {
  height: 58px;
  padding: 0 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.24), rgba(20, 184, 166, 0.18));
  border: 1px solid rgba(99, 102, 241, 0.42);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 540px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.status-live {
  background: rgba(16, 185, 129, 0.14);
  color: var(--c-direct);
  border: 1px solid rgba(16, 185, 129, 0.34);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Segmented Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 15px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

/* Action Buttons */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.icon-btn.btn-accent {
  border-color: rgba(99, 102, 241, 0.48);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(56, 189, 248, 0.14));
  color: var(--text-primary);
}

.icon-btn.btn-accent:hover {
  border-color: var(--c-core);
  filter: brightness(1.12);
}

.icon-btn.icon-only {
  width: 32px;
  padding: 0;
  justify-content: center;
}

.icon-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Tab Views */
.tab-view {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.tab-view.active {
  display: flex;
}

/* Scenario Showcase Bar */
.scenario-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.scenario-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bar-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
}

.scenario-btn {
  height: 29px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.8px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.scenario-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.scenario-btn.active {
  background: var(--c-core);
  border-color: var(--c-core);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
}

.scenario-btn.sc-teal.active { background: var(--c-pt); border-color: var(--c-pt); box-shadow: 0 0 14px rgba(20, 184, 166, 0.35); }
.scenario-btn.sc-amber.active { background: var(--c-proxy); border-color: var(--c-proxy); color: #0b101d; box-shadow: 0 0 14px rgba(245, 158, 11, 0.35); }
.scenario-btn.sc-rose.active { background: var(--c-us); border-color: var(--c-us); box-shadow: 0 0 14px rgba(244, 63, 94, 0.35); }
.scenario-btn.sc-violet.active { background: var(--c-chain); border-color: var(--c-chain); color: #0b101d; box-shadow: 0 0 14px rgba(192, 132, 252, 0.38); }
.scenario-btn.sc-emerald.active { background: var(--c-direct); border-color: var(--c-direct); color: #06140f; box-shadow: 0 0 14px rgba(16, 185, 129, 0.35); }

.trace-form {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 260px;
  max-width: 340px;
  flex: 1;
}

.trace-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.trace-icon {
  position: absolute;
  left: 9px;
  color: var(--text-muted);
  pointer-events: none;
}

#traceInput {
  width: 100%;
  height: 29px;
  padding: 0 24px 0 28px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  outline: none;
}

#traceInput:focus {
  border-color: var(--c-core);
}

.trace-clear {
  position: absolute;
  right: 5px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.btn-primary {
  height: 29px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: var(--c-core);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 11.8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* Scenario Explanation Banner */
.scenario-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 18px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.14), rgba(20, 184, 166, 0.08));
  border-bottom: 1px solid rgba(99, 102, 241, 0.34);
  font-size: 12px;
  flex-wrap: wrap;
}

.trace-path-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
}

.trace-hop {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 11.2px;
}

.trace-arrow {
  color: var(--text-muted);
  font-weight: 700;
}

.scenario-note {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Topology Workspace */
.topology-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.canvas-container {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-app);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: grab;
  user-select: none;
}

.canvas-container.dragging {
  cursor: grabbing;
}

.topology-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* SVG Styles */
.swimlane-bg {
  fill: var(--bg-surface);
  fill-opacity: 0.38;
  stroke: var(--border-subtle);
  stroke-width: 1;
}

.swimlane-title {
  fill: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.topo-edge {
  fill: none;
  stroke-linecap: round;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.topo-edge.dimmed {
  opacity: 0.08 !important;
}

.topo-edge.highlighted {
  opacity: 1 !important;
  stroke-width: 3 !important;
}

.topo-edge.traced {
  opacity: 1 !important;
  stroke-width: 3.6 !important;
  filter: drop-shadow(0 0 6px currentColor);
}

.flow-dash {
  stroke-dasharray: 6 10;
  animation: flowMove 1.4s linear infinite;
}

.flow-dash-fast {
  stroke-dasharray: 8 8;
  animation: flowMove 0.72s linear infinite;
}

@keyframes flowMove {
  from { stroke-dashoffset: 32; }
  to { stroke-dashoffset: 0; }
}

.topo-node {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.topo-node.dimmed {
  opacity: 0.2;
}

.topo-node .node-box {
  fill: var(--bg-card);
  stroke: var(--border-subtle);
  stroke-width: 1.2;
  transition: stroke 0.16s ease, stroke-width 0.16s ease, fill 0.16s ease;
}

.topo-node:hover .node-box {
  fill: var(--bg-card-hover);
  stroke: var(--border-strong);
  stroke-width: 1.6;
}

.topo-node.selected .node-box,
.topo-node.traced .node-box {
  stroke-width: 2.2;
}

.node-title {
  fill: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 650;
}

.node-sub {
  fill: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.node-muted {
  fill: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.node-pill-text {
  font-family: var(--font-mono);
  font-size: 9.8px;
  font-weight: 650;
}

/* Floating Legend & Zoom Controls */
.canvas-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 13px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-float);
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.sw-lan { background: var(--c-lan); }
.sw-pt { background: var(--c-pt); }
.sw-core { background: var(--c-core); }
.sw-proxy { background: var(--c-proxy); }
.sw-chain { background: var(--c-chain); }
.sw-us { background: var(--c-us); }
.sw-direct { background: var(--c-direct); }

.canvas-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-float);
}

.ctrl-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ctrl-btn:hover {
  background: var(--bg-elevated);
}

.zoom-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 42px;
  text-align: center;
}

/* Right Inspector */
.inspector {
  width: 344px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.inspector-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.inspector-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.inspector-title {
  font-size: 15.5px;
  font-weight: 700;
  margin-top: 2px;
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--c-lan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.text-btn:hover {
  text-decoration: underline;
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.ins-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
}

.ins-card.hero-teal {
  border-color: rgba(20, 184, 166, 0.38);
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.1), var(--bg-card));
}

.ins-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
}

.kv-key {
  color: var(--text-muted);
  flex-shrink: 0;
}

.kv-val {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: right;
  word-break: break-word;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.metric-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 10px;
}

.metric-label {
  font-size: 10.5px;
  color: var(--text-muted);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.tag-amber { color: var(--c-proxy); border-color: rgba(245, 158, 11, 0.36); background: rgba(245, 158, 11, 0.11); }
.tag-rose { color: var(--c-us); border-color: rgba(244, 63, 94, 0.36); background: rgba(244, 63, 94, 0.11); }
.tag-emerald { color: var(--c-direct); border-color: rgba(16, 185, 129, 0.36); background: rgba(16, 185, 129, 0.11); }
.tag-teal { color: var(--c-pt); border-color: rgba(20, 184, 166, 0.38); background: rgba(20, 184, 166, 0.12); }
.tag-violet { color: var(--c-chain); border-color: rgba(192, 132, 252, 0.38); background: rgba(192, 132, 252, 0.12); }
.tag-sky { color: var(--c-lan); border-color: rgba(56, 189, 248, 0.36); background: rgba(56, 189, 248, 0.11); }
.tag-indigo { color: var(--c-core); border-color: rgba(99, 102, 241, 0.38); background: rgba(99, 102, 241, 0.12); }

.ins-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ins-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}

.ins-list-item.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.ins-list-item.clickable:hover {
  border-color: var(--c-core);
}

/* Sub-pages (Arsenal & Architecture Tabs) */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 46px;
}

.dashboard-grid {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-banner {
  border-radius: 14px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(20, 184, 166, 0.12) 55%, rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.32);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-banner h1 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.hero-banner p {
  margin-top: 6px;
  color: var(--text-secondary);
  max-width: 720px;
  font-size: 13px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 15px 17px;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.kpi-val {
  font-size: 22px;
  font-weight: 750;
  font-family: var(--font-mono);
  margin-top: 4px;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.panel-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 18px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Chained Relay Visual Diagram */
.chain-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(192, 132, 252, 0.36);
  flex-wrap: wrap;
}

.chain-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chain-box {
  padding: 8px 13px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
}

.chain-box strong {
  display: block;
  font-size: 13px;
}

.chain-box span {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.chain-connector {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-chain);
  font-weight: 700;
}

/* Dual-Path NAS Comparison Cards */
.dual-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.path-card {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
}

.path-card.pt-card {
  border-color: rgba(20, 184, 166, 0.42);
}

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

.path-card h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.path-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.mono {
  font-family: var(--font-mono);
}

.rtt-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.rtt-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-app);
  overflow: hidden;
}

.rtt-fill {
  height: 100%;
  border-radius: 999px;
}

.rtt-good { color: var(--c-direct); }
.rtt-mid { color: var(--c-proxy); }
.rtt-slow { color: var(--c-us); }
.rtt-fill.rtt-good { background: var(--c-direct); }
.rtt-fill.rtt-mid { background: var(--c-proxy); }
.rtt-fill.rtt-slow { background: var(--c-us); }

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.module-card {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 650;
  font-size: 12px;
}

.module-desc {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 12.5px;
  box-shadow: var(--shadow-float);
  z-index: 100;
}

.skeleton-box {
  padding: 18px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .inspector {
    width: 302px;
  }
  .brand-sub {
    display: none;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 0 12px;
    gap: 10px;
  }
  .topbar-actions .icon-btn:not(.icon-only) span {
    display: none;
  }
  .topbar-actions .icon-btn:not(.icon-only) {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  .nav-tab {
    padding: 5px 10px;
    font-size: 12px;
  }
}

@media (max-width: 860px) {
  .topbar {
    height: auto;
    padding: 8px 12px;
    flex-wrap: wrap;
  }
  .topology-workspace {
    flex-direction: column;
  }
  .inspector {
    width: 100%;
    height: 36vh;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
  .panel-grid-2 {
    grid-template-columns: 1fr;
  }
}
