.server-app {
  background:
    radial-gradient(circle at 70% 0%, rgba(var(--blue-rgb), 0.06), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.active-menu {
  background: var(--blue-soft);
  color: var(--blue-deep) !important;
  font-weight: 800;
}

.server-top-actions {
  gap: 12px;
}

.server-tabbar {
  gap: 8px;
  padding: 0 16px;
}

.server-tabbar .tab {
  height: 38px;
  padding: 0 13px;
  background: transparent;
  color: #64748b;
  font-weight: 700;
}

.server-tabbar .active-tab {
  background: #f1f5fb;
  color: var(--blue-ink);
}

.server-page {
  min-height: calc(100vh - 131px);
  padding: clamp(24px, 2.6vw, 34px) clamp(18px, 2.7vw, 40px) 72px;
}

.server-shell {
  max-width: 1500px;
  margin: 0 auto;
}

.server-heading {
  margin-bottom: 20px;
}

.server-heading h1 {
  margin: 0;
  color: #0f172a;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 900;
}

.server-heading p {
  margin: 8px 0 0;
  color: #64748b;
}

.server-card,
.form-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.server-card {
  overflow: hidden;
}

.server-toolbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf1f6;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.toolbar-left,
.toolbar-right,
.footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  flex-wrap: nowrap;
}

.toolbar-right {
  justify-self: end;
}

.primary-action,
.secondary-action {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
  box-sizing: border-box;
}

.toolbar-left .primary-action,
.toolbar-left .secondary-action {
  min-width: 118px;
}

.primary-action {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(var(--blue-rgb), 0.17);
}

.secondary-action {
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--blue-ink);
}

.small-action {
  height: 34px;
  padding: 0 12px;
}

.primary-action svg,
.secondary-action svg,
.icon-square svg,
.table-search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.table-search {
  width: 260px;
  max-width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
}

.table-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
}

.icon-square {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
}

.server-table-wrap {
  overflow: auto;
}

.server-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

.server-table th,
.server-table td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  white-space: nowrap;
}

.server-table th {
  background: #f6f9fd;
  color: #64748b;
  font-weight: 900;
}

.server-table td {
  color: #24344d;
}

.server-table tbody tr:hover {
  background: #f8fbff;
}

.platform-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.type-badge,
.mode-badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.type-badge.real {
  background: #dbeafe;
  color: var(--blue-deep);
}

.type-badge.demo {
  background: #e2e8f0;
  color: #475569;
}

.mode-badge {
  background: #ecfdf5;
  color: #047857;
}

.mode-badge.single {
  background: #f1f5f9;
  color: #475569;
}

.status-chip {
  background: #e2e8f0;
  color: #64748b;
}

.status-chip.ok {
  background: #dcfce7;
  color: #15803d;
}

.switch {
  position: relative;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  width: 46px;
  height: 26px;
  display: block;
  border-radius: 999px;
  background: #d9dee7;
  transition: background 0.15s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease;
}

.switch input:checked + span {
  background: #1478f2;
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.row-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 136px;
}

.row-action-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #fff;
  color: var(--blue-ink);
  font-weight: 850;
}

.row-action-btn.primary {
  background: #eff6ff;
}

.row-action-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 8;
  min-width: 128px;
  display: none;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.row-actions.open .more-menu {
  display: grid;
}

.more-menu button {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  font-weight: 800;
  text-align: left;
}

.more-menu button:hover {
  background: #f1f5fb;
  color: var(--blue-ink);
}

.more-menu button.danger {
  color: #dc2626;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  color: #64748b;
}

.table-footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-weight: 800;
}

.page-size select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
}

.pager {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.pager button {
  min-width: 38px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--border);
  background: #fff;
  color: #64748b;
  font-weight: 800;
}

.pager button:last-child {
  border-right: 0;
}

.pager button.active {
  background: var(--blue);
  color: #fff;
}

.pager button:disabled {
  color: #cbd5e1;
  background: #f8fafc;
}

.server-drawer[hidden] {
  display: none;
}

.quick-create-shell {
  max-width: 1360px;
}

.quick-create-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.back-link {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--blue-ink);
  font-weight: 850;
  text-decoration: none;
}

.back-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.quick-create-panel.drawer-panel {
  width: 100%;
  max-height: none;
  position: static;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.quick-create-panel .drawer-body {
  overflow: visible;
  padding: 0;
}

.quick-create-form-stack {
  min-width: 0;
}

.quick-create-panel .quick-wizard-rail {
  top: 16px;
}

.quick-create-panel .form-card {
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.quick-create-actions {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 28px;
}

.quick-create-actions .form-message {
  min-height: 40px;
  padding-right: 0;
}

.quick-create-actions .footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-create-actions .secondary-action,
.quick-create-actions .primary-action {
  min-width: 88px;
  height: 40px;
  padding: 0 16px;
}

.quick-create-actions button[hidden] {
  display: none !important;
}

.server-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.drawer-panel {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fbff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.drawer-panel.is-quick-mode {
  width: min(1280px, calc(100vw - 48px));
}

.quick-create-panel.drawer-panel.is-quick-mode {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.drawer-header,
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #fff;
}

.drawer-header {
  border-bottom: 1px solid #edf1f6;
}

.drawer-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
}

.drawer-header p {
  margin: 5px 0 0;
  color: #64748b;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 20px;
}

.drawer-footer {
  min-height: 72px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-top: 1px solid #edf1f6;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.05);
}

.drawer-footer .footer-actions {
  display: grid;
  grid-template-columns: 92px 132px 168px;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.drawer-footer .secondary-action,
.drawer-footer .primary-action {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
}

.drawer-panel.is-quick-mode .drawer-footer .footer-actions {
  grid-template-columns: 92px 92px 132px 168px;
}

.drawer-panel.is-quick-mode .drawer-body {
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

.quick-wizard-rail[hidden],
.drawer-footer button[hidden] {
  display: none !important;
}

.quick-wizard-rail {
  position: sticky;
  top: 0;
  display: grid;
  gap: 10px;
  align-self: start;
  padding: 16px;
  border: 1px solid #e6edf7;
  border-radius: 16px;
  background: #eef5ff;
}

.quick-wizard-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 10px;
}

.quick-wizard-title strong {
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
}

.quick-wizard-title span {
  min-width: 48px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 950;
}

.quick-step-item {
  min-height: 78px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
}

.quick-step-item span {
  width: 34px;
  height: 34px;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  border: 1px solid #c7d7ee;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  font-weight: 950;
}

.quick-step-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-weight: 950;
}

.quick-step-item em {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.quick-step-item.is-active {
  border-color: #bfdbfe;
  background: #fff;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.11);
}

.quick-step-item.is-active span {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue-ink);
}

.quick-step-item.is-complete span {
  border-color: #86efac;
  background: #dcfce7;
  color: #15803d;
}

.quick-step-hidden {
  display: none !important;
}

.risk-dialog[hidden] {
  display: none;
}

.risk-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.risk-dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.risk-dialog-panel {
  position: relative;
  width: min(540px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid #fecaca;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.26);
}

.risk-step {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}

.risk-dialog-panel h2 {
  margin: 14px 0 8px;
  color: #0f172a;
  font-size: 22px;
  font-weight: 950;
}

.risk-dialog-panel p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
  font-weight: 760;
}

.manager-change-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 0;
}

.manager-change-pair div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.manager-change-pair dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.manager-change-pair dd {
  min-width: 0;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
}

.risk-impact-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 14px 16px 14px 30px;
  border: 1px solid #fee2e2;
  border-radius: 12px;
  background: #fff7f7;
  color: #991b1b;
  font-weight: 850;
}

.risk-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.risk-dialog-actions button {
  min-width: 128px;
}

.danger-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: #dc2626;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.22);
}

.danger-action:hover {
  background: #b91c1c;
}

.form-card {
  padding: 22px;
}

.form-section-title {
  margin-bottom: 18px;
}

.form-section-title h3 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.form-section-title p {
  margin: 7px 0 0;
  color: #64748b;
}

.inline-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.server-form-grid,
.dc-grid,
.health-grid {
  display: grid;
  gap: 16px;
}

.server-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.connection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.connection-sections {
  display: grid;
  gap: 18px;
}

.connection-panel {
  display: grid;
  gap: 14px;
}

.connection-panel + .connection-panel {
  padding-top: 18px;
  border-top: 1px solid #edf1f6;
}

.mini-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.mini-section-title strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.mini-section-title span {
  max-width: 520px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.connection-main-grid,
.connection-strategy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.health-grid {
  grid-template-columns: minmax(160px, 0.55fr) repeat(2, minmax(0, 1fr));
}

.account-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demo-account-settings {
  max-width: 700px;
}

.demo-settings-stack {
  display: grid;
  gap: 26px;
}

.demo-toggle-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.demo-toggle-block strong {
  display: block;
  color: #0f172a;
  font-size: 17px;
  font-weight: 950;
}

.demo-toggle-block span {
  display: block;
  margin-top: 8px;
  color: #94a3b8;
  line-height: 1.5;
  font-weight: 760;
}

.demo-switch.switch-button {
  width: 58px;
  height: 34px;
  margin-bottom: 1px;
}

.demo-switch.switch-button span {
  width: 28px;
  height: 28px;
}

.demo-switch.switch-button.is-on {
  background: #4ade80;
}

.demo-switch.switch-button.is-on span {
  transform: translateX(24px);
}

.demo-default-panel {
  display: grid;
  gap: 16px;
}

.demo-default-title {
  display: grid;
  gap: 8px;
}

.demo-default-title span {
  max-width: none;
  text-align: left;
  font-size: 13px;
}

.demo-default-grid {
  display: grid;
  gap: 16px;
}

.demo-default-grid .field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.demo-default-grid .field select {
  height: 54px;
  color: #64748b;
  font-size: 15px;
}

.field {
  display: block;
  min-width: 0;
}

.field > span {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-weight: 850;
}

.required > span::before {
  content: "*";
  color: #ef4444;
  margin-right: 2px;
}

.field input,
.field select,
.input-with-unit {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.04);
}

.field input,
.field select {
  padding: 0 14px;
  outline: 0;
}

.field input::placeholder {
  color: #94a3b8;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-unit input {
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.input-with-unit em {
  flex: 0 0 auto;
  padding-right: 14px;
  color: #94a3b8;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.field-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.is-hidden {
  display: none !important;
}

.segmented,
.mode-switch,
.check-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  min-height: 48px;
  padding: 5px;
  border-radius: 12px;
  background: #f1f5f9;
}

.segmented label,
.mode-switch label {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  color: #475569;
  font-weight: 850;
}

.segmented input,
.mode-switch input {
  display: none;
}

.segmented label:has(input:checked),
.mode-switch label:has(input:checked) {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(var(--blue-rgb), 0.14);
}

.mode-switch {
  justify-content: flex-end;
}

.subsection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #edf1f6;
}

.subsection-bar strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
  font-size: 16px;
}

.subsection-bar span {
  color: #64748b;
  font-size: 12px;
}

.dc-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.empty-state,
.health-empty {
  min-height: 92px;
  display: grid;
  place-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 20px;
  border: 1px dashed #c7d7ee;
  border-radius: 12px;
  background: #f8fbff;
  color: #64748b;
  text-align: center;
}

.empty-state strong {
  color: #0f172a;
  font-size: 16px;
}

.empty-state span,
.health-empty {
  font-size: 13px;
}

.dc-node {
  border: 1px solid #e6edf7;
  border-radius: 13px;
  background: #fbfdff;
  padding: 16px;
}

.dc-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.dc-node-head strong {
  color: var(--blue-deep);
}

.dc-grid {
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 1.35fr) minmax(110px, 0.72fr) 92px 92px 160px;
}

.drawer-panel.is-quick-mode .dc-node {
  padding: 14px;
  overflow: hidden;
}

.drawer-panel.is-quick-mode .dc-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.drawer-panel.is-quick-mode .dc-grid > .field:nth-child(4),
.drawer-panel.is-quick-mode .dc-status-field {
  grid-column: span 1;
}

.drawer-panel.is-quick-mode .dc-grid > .field:nth-child(3),
.drawer-panel.is-quick-mode .dc-test-field {
  grid-column: span 2;
}

.drawer-panel.is-quick-mode .dc-grid > .field:nth-child(1),
.drawer-panel.is-quick-mode .dc-grid > .wide-field {
  grid-column: span 3;
}

.drawer-panel.is-quick-mode .dc-test-field {
  min-width: 0;
}

.drawer-panel.is-quick-mode .dc-test-row {
  height: auto;
  min-height: 48px;
  flex-wrap: wrap;
}

.dc-status-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.dc-status-field > span {
  white-space: nowrap;
}

.switch-button {
  width: 52px;
  height: 30px;
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #d9dee7;
  box-sizing: border-box;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease;
}

.switch-button span {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transform: translateX(0);
  transition: transform 0.15s ease;
  pointer-events: none;
}

.switch-button.is-on {
  background: #1478f2;
}

.switch-button.is-on span {
  transform: translateX(22px);
}

.switch-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.dc-test-field {
  min-width: 150px;
}

.dc-test-row {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-state {
  min-width: 62px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.test-state.pending {
  background: #f1f5f9;
  color: #64748b;
}

.test-state.testing {
  background: #eff6ff;
  color: var(--blue-ink);
}

.test-state.success {
  background: #dcfce7;
  color: #15803d;
}

.test-state.error {
  background: #fee2e2;
  color: #dc2626;
}

.wide-field {
  min-width: 0;
}

.remove-text {
  padding: 0;
  border: 0;
  background: transparent;
  color: #dc2626;
  font-weight: 900;
}

.remove-text:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.check-field {
  padding: 14px;
  border: 1px solid #edf1f6;
  border-radius: 12px;
  background: #fbfdff;
}

.health-card .inline-title {
  align-items: center;
}

.optional-mark {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  vertical-align: middle;
}

.health-grid {
  align-items: stretch;
}

.health-grid .field {
  min-height: 100%;
}

.health-grid .input-with-unit,
.health-grid .check-field {
  min-height: 56px;
}

.health-empty {
  min-height: 64px;
  margin-top: 0;
  place-content: start;
  text-align: left;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #334155;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.platform-note {
  margin-top: 12px;
  color: #64748b;
  font-size: 12px;
}

.form-message {
  min-height: 20px;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding-right: 12px;
  color: #dc2626;
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  max-width: 340px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .server-toolbar,
  .inline-title {
    flex-direction: column;
    align-items: stretch;
  }

  .server-toolbar {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .footer-actions {
    justify-content: flex-start;
  }

  .server-form-grid,
  .connection-grid,
  .account-settings-grid,
  .health-grid,
  .dc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-panel.is-quick-mode .drawer-body {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .server-page {
    padding: 24px 14px 42px;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .table-search {
    flex: 1 1 180px;
  }

  .server-drawer {
    padding: 0;
  }

  .drawer-panel {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .server-form-grid,
  .connection-grid,
  .account-settings-grid,
  .health-grid,
  .dc-grid {
    grid-template-columns: 1fr;
  }

  .drawer-panel.is-quick-mode .drawer-body {
    grid-template-columns: 1fr;
  }

  .drawer-panel.is-quick-mode .dc-grid {
    grid-template-columns: 1fr;
  }

  .drawer-panel.is-quick-mode .dc-grid > .field,
  .drawer-panel.is-quick-mode .dc-status-field,
  .drawer-panel.is-quick-mode .dc-test-field {
    grid-column: auto;
  }

  .quick-wizard-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-wizard-title {
    grid-column: 1 / -1;
  }

  .quick-step-item {
    min-height: 70px;
  }

  .subsection-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-action,
  .secondary-action,
  .icon-square {
    min-width: 0;
  }

  .drawer-footer {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .drawer-footer .footer-actions {
    grid-template-columns: 1fr 1fr 1.35fr;
    justify-content: stretch;
  }

  .drawer-panel.is-quick-mode .drawer-footer .footer-actions {
    grid-template-columns: 1fr 1fr;
  }

  .manager-change-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .server-heading h1 {
    font-size: 26px;
  }

  .server-toolbar,
  .drawer-header,
  .drawer-body,
  .drawer-footer,
  .form-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .toolbar-left button,
  .footer-actions button {
    width: 100%;
  }

  .drawer-footer .footer-actions {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-footer .primary-action {
    grid-column: 1 / -1;
  }

  .quick-wizard-rail {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .quick-step-item {
    min-height: 60px;
  }

  .risk-dialog-panel {
    padding: 20px;
  }

  .risk-dialog-actions {
    flex-direction: column-reverse;
  }

  .risk-dialog-actions button {
    width: 100%;
  }
}
