.nsn-widget {
  margin: 1.5rem 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.nsn-header-desc {
  font-size: 0.92rem;
  color: var(--lca-widget-ink, #1e293b);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* ── Mode Switcher ── */
.nsn-mode-switcher {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: #f1f5f9;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.nsn-mode-btn {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  text-align: center;
}

.nsn-btn-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  transition: color 0.15s ease;
}

.nsn-btn-sub {
  font-size: 0.74rem;
  font-weight: 500;
  color: #64748b;
  transition: color 0.15s ease;
}

.nsn-mode-btn:hover {
  background: rgba(255, 255, 255, 0.6);
}

.nsn-mode-btn:hover .nsn-btn-title {
  color: #0f172a;
}

.nsn-mode-btn.active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nsn-mode-btn.active .nsn-btn-title {
  color: #1d4ed8;
}

.nsn-mode-btn.active .nsn-btn-sub {
  color: #2563eb;
}

@media (max-width: 600px) {
  .nsn-mode-switcher {
    flex-direction: column;
  }
}

/* ── Main Layout ── */
.nsn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 840px) {
  .nsn-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Left Controls Panel ── */
.nsn-controls {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nsn-mode-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nsn-separator {
  height: 1px;
  background: #e2e8f0;
  margin: 0.2rem 0;
}

.nsn-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nsn-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
}

.nsn-group-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.nsn-val-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nsn-slider {
  width: 100%;
  accent-color: #2563eb;
  cursor: pointer;
}

.nsn-hint {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.35;
  min-height: 2.2rem;
  display: flex;
  align-items: flex-start;
}

.nsn-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nsn-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nsn-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.nsn-pill.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.nsn-pill.pill-warning.active {
  background: #d97706;
  border-color: #b45309;
}

.nsn-pill.pill-danger.active {
  background: #dc2626;
  border-color: #b91c1c;
}

/* ── Right Results Panel ── */
.nsn-results-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.nsn-scorecards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (max-width: 500px) {
  .nsn-scorecards {
    grid-template-columns: 1fr;
  }
}

.nsn-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  min-height: 106px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.nsn-card-sub {
  border-top: 3.5px solid #64748b;
}

.nsn-card-total {
  border-top: 3.5px solid #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.nsn-card-recruited {
  border-top: 3.5px solid #10b981;
}

.nsn-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.nsn-card-total .nsn-card-label {
  color: #1d4ed8;
}

.nsn-card-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin: 0.15rem 0;
}

.nsn-card-total .nsn-card-num {
  color: #1d4ed8;
  font-size: 1.45rem;
}

.nsn-card-recruited .nsn-card-num {
  color: #059669;
  font-size: 1.35rem;
}

.nsn-card-unit {
  font-size: 0.72rem;
  color: #64748b;
  min-height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

/* ── Cheat Alerts ── */
.nsn-cheat-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #991b1b;
}

.nsn-cheat-alert.cheat-warning {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: #d97706;
  color: #92400e;
}

/* ── Plot Card ── */
.nsn-plot-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.nsn-plot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nsn-plot-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
}

.nsn-ratio-pill {
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

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

/* ── Pedagogy Card ── */
.nsn-pedago-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #1e293b;
  min-height: 72px;
}
