.safety-banner {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: .9rem;
}
.safety-banner.read-only {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.safety-banner.write-enabled {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.gateways-grid-v2 {
  display: grid;
  gap: 18px;
}

.gateway-v2-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 18px;
}

.gateway-v2-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.gateway-v2-header h4 {
  margin: 4px 0 6px;
  font-size: 1.25rem;
}
.gateway-summary {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.gateway-capabilities-v2,
.gateway-health {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.gateway-chip,
.gateway-ready-v2 {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .76rem;
  font-weight: 700;
}
.gateway-chip {
  background: #eff6ff;
  color: #1d4ed8;
}
.gateway-ready-v2.ready {
  background: #dcfce7;
  color: #166534;
}
.gateway-ready-v2.pending {
  background: #fef3c7;
  color: #92400e;
}

.gateway-v2-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 320px);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.switch-row,
.gateway-input-row,
.gateway-field-v2 {
  display: grid;
  gap: 7px;
}
.switch-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.switch-row span {
  display: grid;
  gap: 3px;
}
.switch-row small,
.gateway-field-v2 small {
  color: var(--muted);
  font-weight: 400;
}

.gateway-v2-environments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.gateway-environment-v2 {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 14px;
}
.gateway-environment-v2 h5 {
  margin: 0;
  font-size: 1rem;
}
.gateway-field-title {
  font-size: .86rem;
  font-weight: 700;
}
.gateway-field-v2 input,
.gateway-input-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}
.gateway-field-v2 input:focus,
.gateway-input-row select:focus {
  outline: 2px solid rgba(37, 99, 235, .15);
  border-color: var(--accent);
}
.gateway-field-v2 input:disabled,
.gateway-input-row select:disabled {
  background: #f1f5f9;
  color: #64748b;
}
.gateway-v2-actions {
  display: flex;
  justify-content: flex-end;
}
.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

@media (max-width: 900px) {
  .gateway-v2-header,
  .gateway-v2-controls,
  .gateway-v2-environments {
    grid-template-columns: 1fr;
  }
  .gateway-v2-header {
    display: grid;
  }
}
