/* ========================================================
   RESIDENTIAL STUDIO - AGENCY-TIER UI
   ======================================================== */

.residential-studio-page {
  padding-bottom: 80px;
}

/* Success Banner */
.nx-studio-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 28px;
}

.nx-banner-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #10b981;
  color: #022318;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  font-size: 1rem;
  flex-shrink: 0;
}

.nx-banner-content strong {
  display: block;
  font-size: 0.95rem;
  color: #34d399;
  margin-bottom: 2px;
}

.nx-banner-content p {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.4;
}

.nx-banner-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}

/* Header */
.nx-studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.nx-studio-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #10b981;
  margin-bottom: 6px;
}

.nx-studio-header h1 {
  font-size: 1.85rem;
  font-weight: 850;
  color: #f8fafc;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.nx-studio-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nx-buy-traffic-btn {
  background: #10b981 !important;
  color: #022318 !important;
  font-weight: 750 !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
}

.nx-buy-traffic-btn:hover {
  background: #34d399 !important;
  transform: translateY(-1px);
}

/* KPI Cards */
.nx-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.nx-kpi-card {
  padding: 18px 20px;
  background: rgba(18, 24, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

.nx-kpi-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.nx-kpi-value {
  font-size: 1.7rem;
  font-weight: 850;
  color: #f8fafc;
  line-height: 1.1;
  margin-bottom: 4px;
}

.nx-mono-val {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.nx-kpi-value small {
  font-size: 0.85rem;
  font-weight: 600;
  color: #10b981;
}

.nx-kpi-subtext {
  font-size: 0.74rem;
  color: #94a3b8;
}

/* Empty Quota Card */
.nx-empty-quota-card {
  padding: 28px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.3);
  margin-bottom: 28px;
  text-align: center;
}

.nx-empty-quota-content h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #34d399;
  margin: 0 0 8px 0;
}

.nx-empty-quota-content p {
  color: #94a3b8;
  max-width: 580px;
  margin: 0 auto 16px auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Studio Workspace Grid */
.nx-studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-bottom: 36px;
}

.nx-studio-card {
  background: rgba(15, 20, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 24px;
  backdrop-filter: blur(12px);
}

.nx-card-section-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.nx-card-section-head p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 20px 0;
}

/* Generator Form Fields */
.nx-gen-field {
  margin-bottom: 20px;
}

.nx-gen-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 750;
  color: #cbd5e1;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

/* Protocol Toggle */
.nx-proto-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nx-proto-option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nx-proto-option input {
  position: absolute;
  opacity: 0;
}

.nx-proto-option.is-active {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
}

.nx-proto-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 3px;
}

.nx-proto-option.is-active .nx-proto-title {
  color: #34d399;
}

.nx-proto-desc {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}

/* Session Mode Toggle */
.nx-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nx-mode-option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nx-mode-option input {
  position: absolute;
  opacity: 0;
}

.nx-mode-option.is-active {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
}

.nx-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.nx-mode-header strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f8fafc;
}

.nx-mode-option.is-active .nx-mode-header strong {
  color: #34d399;
}

.nx-mode-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  text-transform: uppercase;
}

.nx-mode-desc {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}

/* Duration Presets */
.nx-duration-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nx-dur-btn {
  flex: 1 1 calc(25% - 8px);
  min-width: 58px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nx-dur-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
}

.nx-dur-btn.is-active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #34d399;
}

/* Country Search & Select */
.nx-country-search-wrapper {
  margin-bottom: 8px;
}

.nx-country-search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.nx-country-search-input:focus {
  border-color: #10b981;
}

.nx-select-country,
.nx-gen-field select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 0.86rem;
  outline: none;
  cursor: pointer;
}

.nx-select-country:focus,
.nx-gen-field select:focus {
  border-color: #10b981;
}

.nx-country-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.nx-country-quick-pills button {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nx-country-quick-pills button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
}

.nx-country-quick-pills button.is-active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #34d399;
}

/* Count Presets */
.nx-count-presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.nx-count-presets button {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.nx-count-presets button.is-active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #34d399;
}

/* Submit Button */
.nx-generate-submit-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 13px 18px 13px 22px !important;
  border-radius: 12px !important;
  background: #10b981 !important;
  color: #022c22 !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  border: none !important;
  cursor: pointer !important;
  margin-top: 14px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nx-generate-submit-btn:hover {
  background: #34d399 !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35) !important;
  transform: translateY(-1px) !important;
}

.nx-generate-submit-btn:active {
  transform: translateY(0) scale(0.99) !important;
}

.nx-generate-submit-btn .nx-btn-arrow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.12) !important;
  color: #022c22 !important;
  font-size: 0.95rem !important;
  font-weight: 850 !important;
  transition: transform 0.2s ease !important;
}

.nx-generate-submit-btn:hover .nx-btn-arrow {
  transform: translateX(2px) !important;
}

/* Terminal Panel */
.nx-terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.nx-code-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #34d399;
}

.nx-terminal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nx-term-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 34px !important;
  padding: 6px 13px !important;
  font-size: 0.78rem !important;
  font-weight: 650 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.nx-term-btn svg {
  flex-shrink: 0;
}

.nx-copy-all-btn {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
  color: #080d16 !important;
  border: 1px solid rgba(52, 211, 153, 0.4) !important;
  font-weight: 750 !important;
  box-shadow: 0 2px 10px -2px rgba(16, 185, 129, 0.35) !important;
}

.nx-copy-all-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.5) !important;
}

.nx-terminal-box {
  border-radius: 12px;
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
  margin-bottom: 20px;
}

.nx-terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nx-term-dots {
  display: flex;
  gap: 6px;
}

.nx-term-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.nx-term-dots span:nth-child(1) { background: #ef4444; }
.nx-term-dots span:nth-child(2) { background: #f59e0b; }
.nx-term-dots span:nth-child(3) { background: #10b981; }

.nx-term-title {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
}

.nx-term-count {
  font-size: 0.7rem;
  color: #10b981;
  font-weight: 750;
  font-family: 'JetBrains Mono', monospace;
}

.nx-terminal-textarea {
  width: 100%;
  height: 240px;
  padding: 14px;
  background: transparent;
  border: none;
  color: #a7f3d0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  white-space: pre;
}

/* Integration Guide */
.nx-setup-guide {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nx-guide-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #f8fafc;
  margin-bottom: 10px;
}

.nx-guide-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.6;
}

.nx-guide-list li {
  margin-bottom: 6px;
}

.nx-guide-list code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Proxy Table Section */
.nx-studio-section {
  margin-top: 10px;
}

.nx-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.nx-table-header h2 {
  font-size: 1.25rem;
  font-weight: 850;
  color: #f8fafc;
  margin: 0 0 4px 0;
}

.nx-table-header p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.nx-table-container {
  overflow-x: auto;
  border-radius: 14px;
  background: rgba(15, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.nx-proxy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.nx-proxy-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748b;
  text-transform: uppercase;
}

.nx-proxy-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

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

.nx-empty-row {
  text-align: center;
  padding: 32px 16px !important;
  color: #64748b !important;
}

.nx-mono-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #f8fafc;
}

.nx-tag-cell {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  text-transform: uppercase;
}

.nx-action-copy-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nx-action-copy-btn:hover {
  background: #10b981;
  color: #022318;
  border-color: #10b981;
}

.nx-table-status-active {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
}

/* ========================================================
   LIGHT THEME OVERRIDES
   ======================================================== */

:root[data-theme="light"] .nx-studio-header h1 {
  color: #0f172a;
}

:root[data-theme="light"] .nx-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .nx-kpi-value {
  color: #0f172a;
}

:root[data-theme="light"] .nx-studio-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .nx-card-section-head h2 {
  color: #0f172a;
}

:root[data-theme="light"] .nx-gen-field label {
  color: #334155;
}

:root[data-theme="light"] .nx-proto-option {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

:root[data-theme="light"] .nx-proto-title {
  color: #0f172a;
}

:root[data-theme="light"] .nx-mode-option {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

:root[data-theme="light"] .nx-mode-header strong {
  color: #0f172a;
}

:root[data-theme="light"] .nx-dur-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

:root[data-theme="light"] .nx-country-search-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

:root[data-theme="light"] .nx-select-country,
:root[data-theme="light"] .nx-gen-field select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

:root[data-theme="light"] .nx-country-quick-pills button {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}

:root[data-theme="light"] .nx-count-presets button {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}

:root[data-theme="light"] .nx-terminal-box {
  background: #0f172a;
  border: 1px solid #1e293b;
}

:root[data-theme="light"] .nx-setup-guide {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

:root[data-theme="light"] .nx-guide-title {
  color: #0f172a;
}

:root[data-theme="light"] .nx-table-header h2 {
  color: #0f172a;
}

:root[data-theme="light"] .nx-table-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

:root[data-theme="light"] .nx-proxy-table th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
}

:root[data-theme="light"] .nx-proxy-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

:root[data-theme="light"] .nx-mono-cell {
  color: #0f172a;
}

/* Routing Guide Helper Box */
.nx-routing-guide-box {
  margin-top: 20px;
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.85rem;
}

.nx-routing-guide-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #38bdf8;
  font-weight: 750;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.nx-routing-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

.nx-routing-item strong {
  display: block;
  color: #e2e8f0;
  font-size: 0.84rem;
  margin-bottom: 4px;
}

.nx-routing-item p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.81rem;
  line-height: 1.45;
}

.nx-routing-item code,
.nx-routing-tip code {
  background: rgba(255, 255, 255, 0.08);
  color: #34d399;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.78rem;
}

.nx-routing-tip {
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.81rem;
  line-height: 1.4;
}

:root[data-theme="light"] .nx-routing-guide-box {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .nx-routing-guide-title {
  color: #0284c7;
}

:root[data-theme="light"] .nx-routing-item strong {
  color: #0f172a;
}

:root[data-theme="light"] .nx-routing-item p {
  color: #475569;
}

:root[data-theme="light"] .nx-routing-item code,
:root[data-theme="light"] .nx-routing-tip code {
  background: #e2e8f0;
  color: #059669;
}

:root[data-theme="light"] .nx-routing-tip {
  border-top-color: #e2e8f0;
  color: #334155;
}

/* Comprehensive Responsive & UX Polish */
@media (max-width: 1080px) {
  .nx-studio-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .nx-studio-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .nx-studio-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .nx-studio-header-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .nx-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .nx-routing-guide-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .residential-studio-page {
    padding-inline: 14px !important;
    padding-bottom: 60px;
  }
  .nx-studio-header h1 {
    font-size: 1.5rem;
  }
  .nx-studio-card {
    padding: 18px 16px;
    border-radius: 16px;
  }
  .nx-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .nx-kpi-card {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .nx-kpi-value {
    font-size: 1.35rem;
  }
  .nx-kpi-label {
    font-size: 0.65rem;
  }
  .nx-kpi-subtext {
    font-size: 0.68rem;
  }
  .nx-proto-toggle,
  .nx-mode-toggle {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .nx-duration-presets {
    flex-wrap: wrap;
    gap: 6px;
  }
  .nx-dur-btn {
    min-width: calc(33.33% - 5px);
    padding: 9px 8px;
    font-size: 0.78rem;
  }
  .nx-country-quick-pills {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nx-country-quick-pills::-webkit-scrollbar {
    display: none;
  }
  .nx-country-quick-pills button {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.76rem;
    min-height: 32px;
  }
  .nx-count-presets {
    flex-wrap: wrap;
    gap: 6px;
  }
  .nx-count-presets button {
    flex: 1 1 calc(25% - 6px);
    min-height: 34px;
  }
  .nx-terminal-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .nx-terminal-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1.1fr 1.35fr !important;
    gap: 8px !important;
  }
  .nx-terminal-actions .nx-term-btn,
  .nx-terminal-actions button {
    width: 100% !important;
    height: 36px !important;
    padding: 6px 4px !important;
    font-size: 0.74rem !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
  .nx-terminal-output {
    height: 180px;
    font-size: 0.76rem;
  }
  .nx-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .nx-table-header button {
    width: 100%;
    justify-content: center;
  }
  .nx-table-container {
    border-radius: 12px;
  }
  .nx-proxy-table th,
  .nx-proxy-table td {
    padding: 10px 12px;
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .nx-kpi-grid {
    grid-template-columns: 1fr;
  }
  .nx-studio-header-actions {
    grid-template-columns: 1fr;
  }
}
