:root {
  --bg: #eef3fb;
  --bg-deep: #050b14;
  --bg-deep-2: #081321;
  --bg-deep-3: #0d1d33;
  --surface: #ffffff;
  --surface-alt: #f6f9ff;
  --surface-muted: #edf3ff;
  --border: #d9e3f2;
  --border-strong: #bccadd;
  --text: #081120;
  --text-soft: #14233c;
  --muted: #62718a;
  --muted-strong: #8ca0bf;
  --sidebar: #06101d;
  --sidebar-soft: #0b182a;
  --sidebar-border: rgba(130, 156, 196, 0.16);
  --primary: #2f6bff;
  --primary-strong: #1557ff;
  --primary-soft: #e7efff;
  --primary-border: #b6cafc;
  --primary-glow: rgba(47, 107, 255, 0.28);
  --accent: #6ac7ff;
  --danger: #e04f4f;
  --danger-bg: #fff0f0;
  --danger-border: #ffc7c7;
  --warning: #a06700;
  --warning-bg: #fff6dd;
  --warning-border: #f6dc8a;
  --success: #0f8f5a;
  --success-bg: #eafcf3;
  --success-border: #b5f0d1;
  --shadow: 0 18px 48px rgba(8, 17, 32, 0.08);
  --shadow-strong: 0 28px 72px rgba(8, 17, 32, 0.14);
  --shadow-primary: 0 22px 48px rgba(47, 107, 255, 0.24);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  background:
    radial-gradient(circle at top right, rgba(106, 199, 255, 0.12), transparent 24%),
    radial-gradient(circle at top left, rgba(47, 107, 255, 0.10), transparent 28%),
    var(--bg);
  color: var(--text);
}

body {
  line-height: 1.45;
}

.page-loader {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(6, 16, 29, 0.92);
  color: #f8fbff;
  border: 1px solid rgba(130, 156, 196, 0.18);
  box-shadow: var(--shadow-strong);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

html.js-booting .page-loader,
body.is-page-loading .page-loader {
  opacity: 1;
  pointer-events: none;
  transform: translateY(0);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: var(--primary-soft);
  color: #17357c;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(47, 107, 255, 0.08);
}

.public-layout {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(106, 199, 255, 0.18), transparent 22%),
    radial-gradient(circle at top right, rgba(47, 107, 255, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-deep-2) 44%, #eef3fb 44%, #eef3fb 100%);
}

.public-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 18px;
}

.auth-card {
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(217, 227, 242, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
  padding: 30px;
  backdrop-filter: blur(12px);
}

.auth-brand,
.sidebar-brand {
  display: grid;
  gap: 12px;
}

.auth-brand {
  margin-bottom: 24px;
}

.sidebar-brand {
  margin-bottom: 34px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.brand-logo img {
  height: 36px;
  width: auto;
}

.brand-logo--sidebar {
  overflow: hidden;
  border-radius: 8px;
  background: #020804;
}

.brand-logo--sidebar img {
  height: 34px;
}

.brand-meta {
  display: grid;
  gap: 4px;
}

.brand-context {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.sidebar .brand-context {
  color: var(--accent);
}

.sidebar .brand-subtitle {
  color: #90a4c3;
}

.card,
.stat-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(217, 227, 242, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
}

.card-head {
  margin-bottom: 18px;
}

.card-head--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.card-head-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.08), rgba(106, 199, 255, 0.12));
  border: 1px solid rgba(47, 107, 255, 0.16);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.card-head h1,
.card-head h2,
.page-head h1 {
  margin: 0 0 6px;
  color: var(--text);
}

.card-head h1,
.page-head h1 {
  font-size: 30px;
  line-height: 1.1;
}

.card-head h2 {
  font-size: 22px;
}

.card-head p,
.page-head p,
.stat-card small,
.inline-note,
.muted,
.toolbar-note {
  color: var(--muted);
}

.page-kicker,
.search-cta-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.page-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.page-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.page-breadcrumbs a:hover {
  text-decoration: underline;
}

.page-head--spotlight {
  align-items: stretch;
  padding: 28px;
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at top right, rgba(106, 199, 255, 0.22), transparent 35%),
    linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-deep-2) 56%, var(--bg-deep-3) 100%);
  border: 1px solid rgba(130, 156, 196, 0.16);
  box-shadow: var(--shadow-strong);
  color: #f8fbff;
}

.page-head--spotlight h1,
.page-head--spotlight p,
.page-head--spotlight .page-head-copy {
  color: inherit;
}

.page-head-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  max-width: 760px;
}

.page-head--spotlight p {
  color: #d1def3;
}

.search-cta-shell {
  min-width: 340px;
  max-width: 460px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(130, 156, 196, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.search-cta-copy {
  display: grid;
  gap: 10px;
}

.search-cta-copy strong {
  font-size: 18px;
  line-height: 1.3;
}

.search-cta-note {
  color: #d1def3;
  font-size: 13px;
}

.search-cta-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.search-cta-shell .inline-form {
  gap: 0;
}

.search-cta-shell .inline-field {
  min-width: 0;
}

.search-cta-shell label span {
  color: #d7e5fb;
}

.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.form-grid {
  display: grid;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 14px 15px;
  font: inherit;
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

textarea {
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(47, 107, 255, 0.54);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.14);
}

.search-cta-shell select {
  background: rgba(255, 255, 255, 0.96);
}

input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #9ab1d1;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(8, 17, 32, 0.04);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

input[type="radio"] {
  border-radius: 999px;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: #628ce9;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 6.2L4.6 8.8L10 3.4' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

input[type="radio"]:checked {
  background-image: radial-gradient(circle at center, white 0 28%, transparent 33%), linear-gradient(var(--primary), var(--primary));
  background-size: cover;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn.is-loading {
  position: relative;
  opacity: 0.92;
}

.btn.is-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  display: inline-block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 5v5h-5'/%3E%3Cpath d='M4 19v-5h5'/%3E%3Cpath d='M20 10a8 8 0 0 0-14.13-3.36L4 10'/%3E%3Cpath d='M4 14a8 8 0 0 0 14.13 3.36L20 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  animation: spin 0.9s linear infinite;
}

.btn-secondary.is-loading::after,
.btn-warning.is-loading::after,
.btn-danger.is-loading::after {
  filter: invert(13%) sepia(23%) saturate(1145%) hue-rotate(180deg) brightness(92%) contrast(92%);
}

.btn-primary {
  background: linear-gradient(180deg, #3d79ff 0%, var(--primary) 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(47, 107, 255, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #2f6bff 0%, var(--primary-strong) 100%);
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #f8fbff;
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background: #ffe8e8;
}

.btn-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}

.btn-warning:hover {
  background: #fff0c8;
}

.btn-cta {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #67c4ff 0%, #2f6bff 52%, #1448e0 100%);
  color: white;
  box-shadow: 0 18px 40px rgba(47, 107, 255, 0.34);
}

.btn-cta:hover {
  box-shadow: 0 22px 46px rgba(47, 107, 255, 0.40);
}

.btn-cta-search {
  min-width: 180px;
  justify-self: stretch;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 12px;
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  font-size: 14px;
}

.form-links a {
  color: var(--primary);
  font-weight: 600;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 14px;
}

.flash-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #147446;
}

.flash-error {
  background: #fff1f1;
  border-color: #ffcaca;
  color: #a52d2d;
}

.flash-warning {
  background: #fff8e5;
  border-color: #f6dc8a;
  color: #8f5d00;
}

.private-layout .app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(106, 199, 255, 0.14), transparent 26%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-soft) 100%);
  color: #e5efff;
  padding: 30px 22px;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  position: relative;
  display: block;
  padding: 13px 15px 13px 18px;
  border-radius: 14px;
  color: #c5d5ee;
  border: 1px solid transparent;
}

.sidebar-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(130, 156, 196, 0.14);
  color: #fff;
}

.sidebar-nav a.active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-nav a.active::before {
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
}

.sidebar-divider {
  height: 1px;
  margin: 8px 0 4px;
  background: rgba(148, 163, 184, 0.14);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.impersonation-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  color: #7b4f00;
  padding: 14px 24px;
}

.impersonation-banner span {
  display: block;
  font-size: 13px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(217, 227, 242, 0.84);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title span {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.topbar-title small {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions form {
  margin: 0;
}

.page-content {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.stats-grid,
.card-grid,
.card-grid-2 {
  display: grid;
  gap: 18px;
}

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

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

.stat-card {
  padding: 20px;
  display: grid;
  gap: 8px;
}

.stat-card strong {
  font-size: 20px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 18px;
}

.meta-grid .full {
  grid-column: 1 / -1;
}

.meta-grid dt {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.meta-grid dd {
  margin: 0;
  font-weight: 700;
}

.inline-form,
.button-row,
.toolbar,
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-form--search {
  width: 100%;
}

.inline-field {
  min-width: 280px;
}

.inline-field--compact {
  min-width: 0;
  width: 100%;
}

.toolbar {
  margin-bottom: 18px;
}

.toolbar--split {
  justify-content: space-between;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar-note {
  font-size: 13px;
}

.selection-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.05), rgba(106, 199, 255, 0.08));
  border: 1px solid rgba(47, 107, 255, 0.14);
  border-radius: 16px;
  color: #1d4ed8;
}

.selection-summary strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(217, 227, 242, 0.94);
  border-radius: 16px;
  background: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(217, 227, 242, 0.84);
  vertical-align: top;
}

.data-table thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  transition: background-color 0.14s ease;
}

.data-table tbody tr:hover {
  background: #fbfdff;
}

.data-table tbody tr.is-selected {
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.06), rgba(106, 199, 255, 0.09));
}

.checkbox-col {
  width: 52px;
  min-width: 52px;
  text-align: center;
}

.checkbox-col input {
  margin-inline: auto;
}

.tags-cell {
  vertical-align: middle;
}

.tags-cell-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid rgba(55, 48, 163, 0.08);
  color: #4338ca;
  font-size: 12px;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: lowercase;
  border: 1px solid transparent;
}

.status-running,
.status-available,
.status-active,
.status-valid,
.status-success,
.status-in-use,
.status-attached {
  background: var(--success-bg);
  color: #147446;
  border-color: var(--success-border);
}

.status-stopped,
.status-stop,
.status-pending_email_verification,
.status-pending,
.status-partial,
.status-warning,
.status-creating,
.status-detaching,
.status-modifying {
  background: #fff8e5;
  color: #8f5d00;
  border-color: #f6dc8a;
}

.status-terminated,
.status-blocked,
.status-invalid,
.status-error,
.status-denied,
.status-deleted {
  background: #fff1f1;
  color: #a52d2d;
  border-color: #ffcaca;
}

.status-neutral,
.status-unknown,
.status-down,
.status-user,
.status-admin {
  background: var(--primary-soft);
  color: #1d4ed8;
  border-color: rgba(47, 107, 255, 0.18);
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.empty-state.compact {
  padding: 20px;
}

.inline-warning {
  margin-bottom: 14px;
  padding: 13px 14px;
  background: #fff7e7;
  border: 1px solid #f6dc8a;
  border-radius: 14px;
  color: #8f5d00;
}


.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal {
  border: none;
  padding: 0;
  border-radius: 22px;
  box-shadow: 0 40px 80px rgba(8, 17, 32, 0.25);
  width: min(560px, calc(100vw - 32px));
  background: #fff;
}

.modal::backdrop {
  background: rgba(8, 17, 32, 0.54);
}

.modal-shell {
  margin: 0;
  padding: 0;
}

.modal-head,
.modal-actions {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-head {
  border-bottom: 1px solid var(--border);
}

.modal-head--search {
  background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-deep-2) 60%, var(--bg-deep-3) 100%);
  color: #f8fbff;
  border-bottom-color: rgba(130, 156, 196, 0.18);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.modal-head--search .icon-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(130, 156, 196, 0.18);
  color: white;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.trade-wizard-stepper {
  font-size: 13px;
  color: var(--muted);
}

.trade-wizard-step {
  display: grid;
  gap: 10px;
}

.trade-wizard-step h4 {
  margin: 0;
}

.trade-wizard-step label {
  display: grid;
  gap: 6px;
}

.trade-wizard-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.trade-wizard-plan ul,
.trade-wizard-timeline {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.trade-wizard-timeline li {
  display: flex;
  align-items: center;
  gap: 8px;
}



.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(47, 107, 255, 0.035);
}

.clickable-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.table-link {
  color: inherit;
  font-weight: 700;
}

.table-link:hover {
  color: var(--primary-strong);
}

.stats-grid--details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-sections {
  align-items: start;
}

.detail-grid {
  display: grid;
  gap: 18px;
}

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

.notice-box {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}

.notice-box strong {
  color: var(--text);
}

.mini-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,249,255,0.95));
}

.mini-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.mini-card-head strong {
  font-size: 17px;
}

.mini-card-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.meta-grid--detail dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-grid--compact {
  margin-bottom: 0;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-subsection {
  display: grid;
  gap: 10px;
}

.form-split {
  display: grid;
  gap: 14px;
}

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

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

.form-split--2 {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.compact-form {
  gap: 14px;
}

.form-actions-inline {
  display: flex;
  align-items: end;
  height: 100%;
}

.button-row--space-between {
  justify-content: space-between;
}

.action-stack--danger {
  justify-content: flex-start;
}

.ip-list {
  display: grid;
  gap: 10px;
}

.ip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.ip-row strong {
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.toggle-field span {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
}

.toggle-field--inline {
  justify-content: flex-start;
}

.skeleton-box {
  display: inline-flex;
  width: 100%;
  min-height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(217, 227, 242, 0.72), rgba(255, 255, 255, 0.9), rgba(217, 227, 242, 0.72));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
}

.skeleton-box--checkbox {
  width: 18px;
  min-height: 18px;
  border-radius: 6px;
}

.skeleton-box--code {
  max-width: 158px;
}

.skeleton-box--text {
  max-width: 180px;
}

.skeleton-box--wide {
  max-width: 260px;
}

.skeleton-box--badge {
  max-width: 84px;
}

.skeleton-box--chips {
  max-width: 220px;
}

.skeleton-box--heading {
  max-width: 220px;
  min-height: 22px;
}

.table-skeleton-row td {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* HFTControl public authentication pages — [HFT.*] master-brand experience. */
.auth-layout {
  --auth-bg: #020804;
  --auth-bg-soft: #04110a;
  --auth-surface: rgba(3, 15, 8, 0.92);
  --auth-surface-strong: rgba(2, 10, 5, 0.98);
  --auth-border: rgba(75, 220, 111, 0.32);
  --auth-border-strong: rgba(82, 245, 124, 0.58);
  --auth-text: #effff3;
  --auth-muted: #9bbda4;
  --auth-muted-strong: #c0d7c5;
  --auth-primary: #39e75f;
  --auth-primary-strong: #61f779;
  --auth-primary-soft: rgba(57, 231, 95, 0.10);
  --auth-danger: #ff6e79;
  --auth-warning: #ffd166;
  min-height: 100vh;
  color: var(--auth-text);
  background:
    radial-gradient(ellipse 76% 58% at 50% 47%, rgba(57, 231, 95, 0.105) 0%, rgba(18, 87, 38, 0.055) 42%, transparent 72%),
    linear-gradient(180deg, #010503 0%, var(--auth-bg) 58%, #010302 100%);
  overflow-x: hidden;
}

.auth-layout .public-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 24px;
  padding: 44px 20px 28px;
}

.auth-layout .auth-card {
  width: min(620px, 100%);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  color: var(--auth-text);
  background:
    linear-gradient(180deg, rgba(5, 21, 11, 0.92), rgba(2, 10, 5, 0.97)),
    radial-gradient(circle at 50% 0%, rgba(61, 239, 101, 0.08), transparent 38%);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.58),
    inset 0 1px rgba(226, 255, 235, 0.04),
    0 0 0 1px rgba(17, 64, 29, 0.28),
    0 0 50px rgba(27, 204, 66, 0.06);
  backdrop-filter: blur(16px);
  isolation: isolate;
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0 0 28px;
  text-align: center;
}

.auth-brand__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(330px, 78vw);
  border-radius: 12px;
  outline: none;
}

.auth-brand__link:focus-visible {
  box-shadow: 0 0 0 3px rgba(57, 231, 95, 0.30);
}

.auth-brand__logo {
  width: min(310px, 100%);
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.auth-brand__context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #77c58a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-content {
  display: grid;
  gap: 22px;
}

.auth-heading {
  display: grid;
  gap: 8px;
}

.auth-eyebrow {
  color: var(--auth-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-heading h1 {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.auth-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--auth-muted);
  font-size: 16px;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field > label,
.auth-field__label-row label {
  color: var(--auth-muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.auth-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-field__label-row a {
  color: var(--auth-primary);
  font-size: 13px;
  font-weight: 700;
}

.auth-field small {
  color: #72937a;
  font-size: 12px;
  line-height: 1.45;
}

.auth-input {
  --auth-input-icon-inset: 18px;
  --auth-input-icon-size: 20px;
  --auth-input-icon-gap: 26px;
  --auth-input-leading-space: 64px;
  --auth-input-password-trailing-space: 58px;
  position: relative;
  display: grid;
  align-items: center;
}

.auth-layout .auth-input > input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: 54px;
  padding-block: 0;
  padding-inline-start: var(--auth-input-leading-space);
  padding-inline-end: 18px;
  border: 1px solid rgba(79, 167, 98, 0.42);
  border-radius: 11px;
  outline: none;
  color: var(--auth-text);
  background: linear-gradient(180deg, rgba(16, 24, 19, 0.96), rgba(9, 17, 12, 0.96));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-layout .auth-input--password > input:not([type="checkbox"]):not([type="radio"]) {
  padding-inline-end: var(--auth-input-password-trailing-space);
}

.auth-layout .auth-input > input:not([type="checkbox"]):not([type="radio"])::placeholder {
  color: #6f7e73;
}

.auth-layout .auth-input > input:not([type="checkbox"]):not([type="radio"]):hover {
  border-color: rgba(76, 214, 107, 0.58);
}

.auth-layout .auth-input > input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(57, 231, 95, 0.13), 0 0 24px rgba(36, 226, 77, 0.08);
}

.auth-input__icon {
  position: absolute;
  top: 50%;
  inset-inline-start: var(--auth-input-icon-inset);
  z-index: 1;
  width: var(--auth-input-icon-size);
  height: var(--auth-input-icon-size);
  transform: translateY(-50%);
  fill: none;
  stroke: #91aa97;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #a5b8aa;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible,
.auth-password-toggle[aria-pressed="true"] {
  color: var(--auth-primary);
  background: rgba(57, 231, 95, 0.08);
  outline: none;
}

.auth-password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-submit.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  margin-top: 2px;
  border: 1px solid rgba(110, 255, 139, 0.50);
  border-radius: 11px;
  color: #001d08;
  background: linear-gradient(180deg, #52ef72, #2edc55);
  box-shadow: 0 16px 34px rgba(22, 206, 62, 0.16), inset 0 1px rgba(255, 255, 255, 0.28);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-submit.btn:hover {
  color: #001605;
  background: linear-gradient(180deg, #69f786, #38e75e);
  box-shadow: 0 18px 40px rgba(22, 206, 62, 0.22), inset 0 1px rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.auth-submit.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(57, 231, 95, 0.18), 0 18px 40px rgba(22, 206, 62, 0.22);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #718b78;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 137, 103, 0.38));
}

.auth-divider::after {
  background: linear-gradient(90deg, rgba(94, 137, 103, 0.38), transparent);
}

.auth-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  text-align: center;
}

.auth-secondary-actions--stacked {
  flex-direction: column;
}

.auth-secondary-link,
.auth-tertiary-link {
  font-size: 14px;
  font-weight: 700;
}

.auth-secondary-link {
  color: var(--auth-primary);
}

.auth-tertiary-link {
  color: var(--auth-muted-strong);
}

.auth-secondary-link:hover,
.auth-tertiary-link:hover,
.auth-field__label-row a:hover {
  color: var(--auth-primary-strong);
}

.auth-privacy-note {
  margin: -4px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(76, 169, 96, 0.24);
  border-radius: 10px;
  color: #7f9d86;
  background: rgba(57, 231, 95, 0.035);
  font-size: 12px;
  line-height: 1.5;
}

.auth-status-panel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(57, 231, 95, 0.28);
  border-radius: 12px;
  background: rgba(57, 231, 95, 0.06);
}

.auth-status-panel__icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #001b07;
  background: var(--auth-primary);
  font-weight: 900;
}

.auth-status-panel strong {
  color: var(--auth-text);
}

.auth-status-panel p {
  margin: 4px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-layout .flash-stack {
  margin: 0 0 20px;
}

.auth-layout .flash {
  border-radius: 11px;
  color: var(--auth-text);
  background: rgba(11, 26, 15, 0.94);
}

.auth-layout .flash-success {
  border-color: rgba(57, 231, 95, 0.36);
  color: #a5f7b6;
  background: rgba(23, 115, 44, 0.16);
}

.auth-layout .flash-error {
  border-color: rgba(255, 110, 121, 0.42);
  color: #ffc2c7;
  background: rgba(140, 29, 39, 0.18);
}

.auth-layout .flash-warning {
  border-color: rgba(255, 209, 102, 0.40);
  color: #ffe5a8;
  background: rgba(119, 87, 15, 0.18);
}

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #69816f;
  font-size: 12px;
  text-align: center;
}

.auth-footer a {
  color: #83ae8d;
}

.auth-footer a:hover {
  color: var(--auth-primary);
}

.auth-ambient {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

.auth-ambient::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: min(1240px, 100vw);
  height: min(720px, 66vw);
  max-height: 78vh;
  border-radius: 50%;
  opacity: 0.86;
  background: radial-gradient(ellipse at center, rgba(57, 231, 95, 0.14) 0%, rgba(18, 100, 43, 0.065) 36%, transparent 72%);
  filter: blur(28px);
  transform: translate(-50%, -50%);
}

.auth-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(1, 5, 3, 0.16) 66%, rgba(1, 3, 2, 0.72) 100%),
    linear-gradient(180deg, rgba(1, 5, 3, 0.22), transparent 18%, transparent 80%, rgba(1, 3, 2, 0.46));
}

.auth-ambient__world-map {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: clamp(980px, 92vw, 1600px);
  max-width: none;
  height: auto;
  opacity: 0.22;
  transform: translate(-50%, -50%);
  transform-origin: center;
  filter: brightness(0.94) saturate(0.90) drop-shadow(0 0 24px rgba(57, 231, 95, 0.20));
  mix-blend-mode: screen;
  user-select: none;
}

@media (max-width: 900px) {
  .auth-ambient::before {
    width: 1080px;
    height: 620px;
    opacity: 0.70;
  }

  .auth-ambient__world-map {
    width: max(1040px, 145vw);
    opacity: 0.15;
  }

  .auth-layout .public-shell {
    padding-top: 28px;
  }
}

@media (max-width: 620px) {
  .auth-ambient::before {
    top: 42%;
    width: 920px;
    height: 560px;
    opacity: 0.62;
  }

  .auth-ambient__world-map {
    top: 42%;
    width: 1040px;
    opacity: 0.12;
  }

  .auth-layout .public-shell {
    align-items: start;
    padding: 18px 12px 22px;
  }

  .auth-layout .auth-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .auth-brand {
    margin-bottom: 22px;
  }

  .auth-brand__context {
    display: none;
  }

  .auth-heading h1 {
    font-size: 30px;
  }

  .auth-heading p {
    font-size: 14px;
  }

  .auth-field__label-row {
    align-items: baseline;
  }

  .auth-footer {
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-layout *,
  .auth-layout *::before,
  .auth-layout *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.lazy-card,
.lazy-leaf {
  overflow: hidden;
}

.lazy-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.heading-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.refresh-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(47, 107, 255, 0.18);
  background: rgba(47, 107, 255, 0.08);
  color: var(--primary-strong);
}

.refresh-indicator svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.refresh-indicator.is-active svg {
  animation: spin 0.9s linear infinite;
}

.card-subnote {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.card-subnote.is-warning {
  color: #8f5d00;
}

.inline-action-form {
  display: inline-flex;
  align-items: center;
}

.button-row--api-actions {
  margin-top: 16px;
}

.inline-action-form--api-check {
  gap: 10px;
}

.validation-scope-box {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.scope-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(47, 107, 255, 0.16);
  background: rgba(47, 107, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.check-pill input[type="checkbox"] {
  accent-color: var(--primary);
}

.refresh-indicator--idle-hidden {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.refresh-indicator--idle-hidden.is-active {
  opacity: 1;
}

#api-key-check-note.is-warning {
  color: #8f5d00;
}

.guidance-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
}

.guidance-list--ordered {
  padding-left: 22px;
}

.api-guidance-grid {
  margin-bottom: 18px;
}

.details-card {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,249,255,0.95));
  overflow: hidden;
}

.details-card summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  font-weight: 800;
  color: var(--text);
}

.details-card summary::-webkit-details-marker {
  display: none;
}

.details-card summary::after {
  content: '+';
  float: right;
  color: var(--primary-strong);
}

.details-card[open] summary::after {
  content: '−';
}

.details-card pre {
  margin: 0;
  padding: 0 18px 18px;
  overflow: auto;
}

.details-card code {
  display: block;
  min-width: min-content;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(47, 107, 255, 0.10);
  background: #0b1526;
  color: #d7e5fb;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (max-width: 1260px) {
  .page-head--spotlight {
    flex-direction: column;
  }

  .search-cta-shell {
    max-width: none;
  }
}

@media (max-width: 1180px) {
  .stats-grid,
  .card-grid,
  .card-grid-2,
  .detail-grid--2 {
    grid-template-columns: 1fr 1fr;
  }

  .form-split--4,
  .form-split--3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .private-layout .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding-bottom: 18px;
  }

  .stats-grid,
  .card-grid,
  .card-grid-2,
  .meta-grid,
  .detail-grid--2,
  .form-split--4,
  .form-split--3,
  .form-split--2 {
    grid-template-columns: 1fr;
  }

  .page-head,
  .page-head-actions,
  .topbar,
  .impersonation-banner,
  .card-head--split,
  .toolbar--split {
    flex-direction: column;
    align-items: stretch;
  }

  .search-cta-controls {
    grid-template-columns: 1fr;
  }

  .btn-cta-search {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .auth-card,
  .card,
  .page-head--spotlight {
    padding: 20px;
  }

  .page-loader {
    top: 12px;
    right: 12px;
    min-height: 44px;
    padding: 0 12px;
  }

  .page-content,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sidebar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 12px;
  }
}

.details-body {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.notice-box.compact {
  margin-bottom: 0;
}

.compact-list {
  margin-bottom: 0;
}

.resource-tree-shell {
  display: grid;
  gap: 20px;
}

.resource-tree-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.resource-card {
  display: grid;
  gap: 16px;
}

.resource-leaf-grid {
  display: grid;
  gap: 18px;
}

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

.resource-leaf,
.resource-branch {
  border-color: rgba(47, 107, 255, 0.10);
}

.resource-branch-list {
  display: grid;
  gap: 16px;
}

.resource-inline-help {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .resource-leaf-grid--2,
  .detail-grid--2,
  .stats-grid--details,
  .form-split--4,
  .form-split--3 {
    grid-template-columns: 1fr;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.action-stack--tight {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.is-disabled {
  pointer-events: none;
  opacity: 0.52;
}


.sidebar-backdrop {
  display: none;
}

.sidebar-group {
  display: grid;
  gap: 8px;
}

.sidebar-group + .sidebar-group {
  margin-top: 14px;
}

.sidebar-group-label {
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #87a2c7;
}

.sidebar-group--admin .sidebar-group-label {
  color: var(--accent);
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(47, 107, 255, 0.12);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(8, 17, 32, 0.08);
}

.topbar-nav-toggle svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-stack-gap {
  display: grid;
  gap: 18px;
}

.settings-grid {
  display: grid;
  gap: 24px;
}

.settings-form {
  gap: 18px;
}

.settings-repeater {
  display: grid;
  gap: 14px;
}

.settings-repeater--stack {
  gap: 18px;
}

.settings-row {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(217, 227, 242, 0.88);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.settings-row--exchange {
  grid-template-columns: 1fr 1.15fr 1.45fr;
}

.settings-stack-card {
  display: grid;
  gap: 16px;
}

.settings-stack-card .form-grid {
  gap: 16px;
}

.inline-warning a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 960px) {
  .private-layout .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: rgba(5, 11, 20, 0.54);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    min-height: 100vh;
    z-index: 42;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    box-shadow: 0 24px 64px rgba(5, 11, 20, 0.28);
    padding-top: 26px;
    padding-bottom: 28px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .topbar-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .topbar {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .topbar-title span {
    font-size: 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions .btn,
  .topbar-actions form {
    flex: 1 1 auto;
  }

  .topbar-actions form .btn {
    width: 100%;
  }

  .page-content {
    padding-top: 22px;
  }

  .settings-row--exchange {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-head--spotlight,
  .card,
  .stat-card,
  .mini-card {
    border-radius: 16px;
  }

  .page-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sidebar {
    width: min(92vw, 320px);
    padding-left: 16px;
    padding-right: 16px;
  }

  .button-row,
  .toolbar-group,
  .chip-list {
    flex-wrap: wrap;
  }

  .button-row > .btn,
  .button-row > form,
  .toolbar-group > .btn,
  .toolbar-group > form {
    width: 100%;
  }

  .button-row > form .btn,
  .toolbar-group > form .btn {
    width: 100%;
  }

  .page-head-copy p,
  .card-head p,
  .mini-card-subtitle {
    max-width: none;
  }

  .table-wrap {
    margin-left: -4px;
    margin-right: -4px;
  }

  .data-table {
    min-width: 720px;
  }
}

/* Clean P7: EC2 launch modal layout refinements. */
.form-split--instance-basics {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px);
  align-items: end;
}

.form-split--2-even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.form-split--ami-ssh label {
  min-width: 0;
}

.launch-footprint-grid {
  display: grid;
  grid-template-columns: 120px 120px minmax(150px, 1fr);
  gap: 14px;
  align-items: start;
}

.compact-number-field input[type="number"] {
  min-width: 0;
  text-align: left;
}

.compact-number-field .field-note,
.range-field .field-note {
  display: block;
  margin-top: 6px;
}


.range-field-control {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px auto;
  gap: 12px;
  align-items: center;
}

.range-field-control input[type="range"] {
  width: 100%;
  appearance: auto;
  padding: 0;
  box-shadow: none;
}

.range-field-control output {
  min-width: 72px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.desired-event-log {
  margin-top: 10px;
}

.desired-event-log summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 12px;
}

.desired-event-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.desired-event-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}

.desired-event-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.desired-event-item pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  background: #0b1526;
  color: #d7e5fb;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .form-split--instance-basics,
  .form-split--2-even,
  .launch-footprint-grid,
  .range-field-control {
    grid-template-columns: 1fr;
  }
}

.range-field-control input[type="range"] {
  border: none;
  background: transparent;
}

/* Clean P8: EC2 create-only modal and adaptive AWS logs. */
#create-ec2-modal {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

#create-ec2-modal .modal-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
}

.launch-footprint-grid {
  grid-template-columns: 120px 120px 132px;
}


.data-table--desired-state {
  min-width: 1080px;
}

.desired-event-log-row td {
  padding: 0 14px 18px;
  background: #f8fbff;
}

.desired-event-log-row:hover {
  background: #f8fbff !important;
}

.desired-log-anchor {
  display: inline-block;
  margin-top: 6px;
  font-weight: 800;
  font-size: 12px;
}

.desired-event-log {
  margin-top: 0;
  width: 100%;
}

.desired-event-list {
  grid-template-columns: minmax(0, 1fr);
}

.desired-event-item {
  max-width: 100%;
}

.desired-event-message,
.error-cell {
  overflow-wrap: anywhere;
}

.desired-event-item pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (min-width: 1180px) {
  #create-ec2-modal {
    width: min(740px, calc(100vw - 64px));
  }

  .desired-event-item pre {
    max-height: 420px;
    font-size: 12px;
  }
}

@media (max-width: 760px) {
  #create-ec2-modal {
    width: min(100vw - 12px, 680px);
    max-height: calc(100vh - 12px);
  }

  #create-ec2-modal .modal-head,
  #create-ec2-modal .modal-body,
  #create-ec2-modal .modal-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  #create-ec2-modal .modal-actions {
    justify-content: stretch;
  }

  #create-ec2-modal .modal-actions .btn {
    flex: 1 1 auto;
  }

  .launch-footprint-grid {
    grid-template-columns: 1fr 1fr;
  }


  .range-field-control {
    grid-template-columns: 1fr 96px;
  }

  .range-field-control output {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .launch-footprint-grid {
    grid-template-columns: 1fr;
  }

}

/* Clean P10: profile-first UX simplification. */
.card--primary-resource {
  margin-top: 0;
}

.card-head--resource {
  align-items: flex-start;
}

.resource-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
  gap: 12px;
  min-width: min(460px, 100%);
}

.inline-form--resource-filter {
  min-width: 220px;
}

.form-split--single-primary {
  grid-template-columns: minmax(220px, 280px);
}

.launch-footprint-grid {
  grid-template-columns: 120px 120px;
}

.validation-card-head {
  margin-bottom: 12px;
}

.validation-compact-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.validation-compact-meta div,
.validation-arn {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}

.validation-compact-meta span,
.validation-arn span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.validation-compact-meta strong,
.validation-arn code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.readonly-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.readonly-check {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "box label" "box state";
  gap: 2px 8px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.readonly-check input[type="checkbox"] {
  grid-area: box;
  cursor: default;
}

.readonly-check span {
  grid-area: label;
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.readonly-check small {
  grid-area: state;
  color: var(--muted);
  font-size: 12px;
}

.readonly-check--ok {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.readonly-check--error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.validation-arn,
.validation-short-message {
  margin-top: 12px;
}

@media (max-width: 960px) {
  .card-head--resource,
  .resource-card-actions {
    align-items: stretch;
  }

  .resource-card-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .inline-form--resource-filter,
  .resource-card-actions .btn {
    width: 100%;
  }

  .validation-compact-meta,
  .readonly-check-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .validation-compact-meta,
  .readonly-check-grid,
  .launch-footprint-grid,
  .form-split--single-primary {
    grid-template-columns: 1fr;
  }
}

/* Clean P11: compact profile management and resource controls. */
.profiles-management-card {
  display: grid;
  gap: 20px;
}

.profiles-management-head {
  margin-bottom: 0;
}

.profiles-head-actions {
  justify-content: flex-end;
}

.profiles-editor-grid {
  align-items: start;
}

.profiles-list {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

.profiles-list-head {
  padding-top: 4px;
}

.profiles-table-wrap {
  margin-top: 0;
}

.data-table--compact th,
.data-table--compact td {
  padding: 11px 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid rgba(47, 107, 255, 0.14);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  vertical-align: middle;
}

.status-pill--success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.topbar-profile-switch select {
  min-width: 230px;
  max-width: min(360px, 42vw);
  min-height: 42px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-radius: 14px;
  font-weight: 700;
  background-color: #fff;
}

.resource-control-bar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin: 18px 0 18px;
  padding: 14px;
  border: 1px solid rgba(217, 227, 242, 0.78);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.84), rgba(255, 255, 255, 0.96));
}

.resource-exchange-form {
  min-width: 0;
}

.resource-region-chip {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  width: fit-content;
  max-width: 100%;
  padding: 0 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.08), rgba(106, 199, 255, 0.12));
  border: 1px solid rgba(47, 107, 255, 0.16);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.resource-create-button {
  min-width: 132px;
  align-self: end;
}

@media (max-width: 1100px) {
  .resource-control-bar {
    grid-template-columns: 1fr 1fr;
  }

  .resource-create-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 960px) {
  .profiles-management-head,
  .profiles-list-head {
    align-items: stretch;
  }

  .profiles-head-actions {
    justify-content: flex-start;
  }

  .topbar-profile-switch,
  .topbar-profile-switch select {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .resource-control-bar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .resource-region-chip,
  .resource-create-button {
    width: 100%;
  }
}


.data-table--sortable thead th {
  white-space: nowrap;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible,
.table-sort-button.is-active {
  color: var(--primary, #1687ff);
}

.table-sort-button:focus-visible {
  outline: 2px solid var(--primary, #1687ff);
  outline-offset: 4px;
  border-radius: 4px;
}

.table-sort-indicator {
  min-width: 1em;
  color: currentColor;
  font-size: 11px;
  opacity: .72;
}
/* Clean P12: friendly EC2 management layout. */
.instances-card {
  display: grid;
  gap: 18px;
  overflow: hidden;
}

.instances-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  align-items: start;
}

.instances-card-copy {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.instances-card-head {
  margin-bottom: 0;
}

.instances-card-head p {
  max-width: 720px;
  margin-bottom: 8px;
}

.instances-inline-warning {
  width: min(720px, 100%);
  margin: 0;
}

.instances-controls,
.resource-control-bar.instances-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-self: start;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(217, 227, 242, 0.88);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.94), rgba(255, 255, 255, 0.98));
  box-shadow: 0 16px 36px rgba(8, 17, 32, 0.07);
}

.instances-exchange-form,
.resource-exchange-form.instances-exchange-form {
  display: grid;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.instance-control-field,
.instance-region-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.instance-control-field span,
.instance-control-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.instance-control-field select {
  width: 100%;
  min-width: 0;
}

.resource-region-chip--full {
  display: flex;
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  line-height: 1.25;
}

.instances-controls .resource-create-button {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.toolbar--instances {
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(217, 227, 242, 0.78);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.72);
}

.toolbar--instances .toolbar-group {
  gap: 8px;
}

.toolbar--instances .toolbar-note {
  max-width: 420px;
  text-align: right;
}

.card--primary-resource .table-wrap {
  border-radius: 16px;
  overflow: auto;
}

@media (min-width: 1340px) {
  .instances-card-header {
    grid-template-columns: minmax(0, 1fr) 400px;
  }
}

@media (max-width: 1180px) {
  .instances-card-header {
    grid-template-columns: 1fr;
  }

  .instances-controls,
  .resource-control-bar.instances-controls {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(150px, auto);
    align-items: end;
  }

  .instances-controls .resource-create-button {
    min-height: 48px;
  }
}

@media (max-width: 760px) {
  .instances-controls,
  .resource-control-bar.instances-controls {
    grid-template-columns: 1fr;
  }

  .toolbar--instances {
    align-items: stretch;
  }

  .toolbar--instances .toolbar-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .toolbar--instances .toolbar-group .btn {
    width: 100%;
  }

  .toolbar--instances .toolbar-note {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .toolbar--instances .toolbar-group {
    grid-template-columns: 1fr;
  }
}

/* v3.1: explicit AWS profile lifecycle controls. */
.profile-state-badges,
.profile-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-state-badges {
  justify-content: flex-end;
}

.profile-row--disabled {
  opacity: 0.72;
}

.profile-row--disabled:hover {
  opacity: 0.9;
}

.profiles-table .table-actions {
  min-width: 250px;
}

@media (max-width: 760px) {
  .profile-state-badges {
    justify-content: flex-start;
  }

  .profiles-table .table-actions {
    min-width: 220px;
  }
}

/* v3.5.0-preview4: extended AWS network topology and Direct Connect telemetry. */
.network-overview {
  display: grid;
  gap: 18px;
}

.network-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.network-overview-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.network-overview-tile:hover {
  border-color: var(--primary-border);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 54, 108, .12);
}

.network-overview-tile span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.network-overview-tile strong {
  grid-row: span 2;
  font-size: 26px;
  line-height: 1;
  color: var(--accent-muted, var(--primary));
}

.network-overview-tile small {
  min-width: 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.network-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.network-card-grid > .card {
  min-width: 0;
  margin: 0;
}

.data-table--network-wide {
  min-width: 1120px;
}

.network-wrap-text {
  display: inline-block;
  min-width: 0;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.network-description-cell {
  min-width: 220px;
  max-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.network-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.network-stack > strong,
.network-stack > small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.network-stack > small {
  color: var(--muted);
  font-size: 11px;
}

.network-detail-row > td {
  padding: 0 !important;
  border-top: 0 !important;
  background: var(--surface-alt);
}

.network-details {
  padding: 0 14px 14px;
}

.network-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 2px;
  cursor: pointer;
  color: var(--accent-muted, var(--primary));
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  list-style: none;
}

.network-details > summary::-webkit-details-marker {
  display: none;
}

.network-details > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  transition: transform .16s ease;
}

.network-details[open] > summary::before {
  content: "−";
}

.network-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  padding-top: 4px;
}

.network-detail-grid--rules > div,
.network-subsection {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.network-detail-grid h3,
.network-subsection h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.network-kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
}

.network-kv-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
}

.network-kv-grid > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.network-kv-grid > div > strong {
  min-width: 0;
  color: var(--text-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.network-mini-table-wrap {
  margin-top: 12px;
  border-radius: var(--radius-sm);
}

.network-mini-table {
  min-width: 680px;
  font-size: 12px;
}

.network-rule-list {
  display: grid;
  gap: 8px;
}

.network-rule-row {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
}

.network-rule-row > span {
  min-width: 0;
  color: var(--text-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.network-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-weight: 700;
  text-transform: capitalize;
}

.network-health::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.network-health--available {
  color: var(--success);
}

.network-health--pending {
  color: var(--warning);
}

.network-health--failed {
  color: var(--danger);
}

.network-health--unknown {
  color: var(--muted);
}

.network-subsection {
  margin-top: 12px;
}

@media (max-width: 1280px) {
  .network-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .network-card-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .network-overview-grid,
  .network-detail-grid,
  .network-kv-grid {
    grid-template-columns: 1fr;
  }

  .network-overview-tile {
    padding: 13px 14px;
  }

  .network-rule-row {
    grid-template-columns: 1fr;
  }

  .network-details {
    padding-inline: 10px;
  }
}

/* v3.6.0: exchange credential validation controls. */
.exchange-credential-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.exchange-credential-actions form {
    margin: 0;
}

.exchange-key-check-message {
    margin-top: 0.875rem;
    overflow-wrap: anywhere;
}

/* Security Group management */
.modal--wide {
  width: min(760px, calc(100vw - 32px));
}

.security-group-card-actions,
.security-group-actions,
.security-rule-actions,
.security-rule-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.security-group-card-actions,
.security-rule-heading {
  justify-content: space-between;
}

.security-group-actions,
.security-rule-actions {
  align-items: stretch;
}

.security-group-actions .inline-form,
.security-rule-actions .inline-form {
  margin: 0;
}

.security-group-table {
  min-width: 1180px;
}

.security-group-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  padding: 8px 0 12px;
  color: var(--text-soft);
  font-size: 12px;
}

.security-group-detail-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.security-rule-grid {
  grid-template-columns: 1fr;
}

.security-rule-heading {
  margin-bottom: 10px;
}

.security-rule-heading h3 {
  margin: 0 0 3px;
}

.security-rule-heading small {
  color: var(--muted);
}

.security-rule-table-wrap {
  border-radius: var(--radius-sm);
}

.security-rule-table {
  min-width: 900px;
  font-size: 12px;
}

.security-rule-table th:last-child,
.security-rule-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.security-rule-warning {
  margin-bottom: 10px;
}

.security-rule-form-grid,
.security-rule-port-grid {
  align-items: start;
}

.security-public-ingress-confirm {
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 82, 57, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(201, 82, 57, 0.07);
  color: var(--text-soft);
}

.security-public-ingress-confirm input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.security-public-ingress-confirm span {
  line-height: 1.45;
}

@media (max-width: 760px) {
  .security-group-card-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .security-group-card-actions .btn {
    flex: 1 1 auto;
  }

  .security-rule-heading {
    align-items: flex-start;
  }

  .security-rule-heading .btn {
    width: 100%;
  }
}

.security-group-assignment {
  margin-top: 12px;
}

.security-group-selector {
  display: grid;
  gap: 8px;
  max-height: 340px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.security-group-selector legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.security-group-selector-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  cursor: pointer;
}

.security-group-selector-row:hover {
  border-color: var(--border-strong);
}

.security-group-selector-row > input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.security-group-selector-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.security-group-selector-row strong,
.security-group-selector-row code,
.security-group-selector-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.security-group-selector-row small {
  color: var(--muted);
}


/* HFTControl v1.7.4: always-expanded ENI Security Group assignment with current/proposed cumulative rules. */
.security-group-assignment--expanded {
  display: grid;
  gap: 0;
  margin-top: 12px;
  overflow: hidden;
}

.security-group-assignment__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.security-group-assignment__title > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.security-group-assignment__title strong {
  color: var(--text);
}

.security-group-assignment__title small {
  color: var(--muted);
  line-height: 1.4;
}

.eni-sg-assignment-form {
  gap: 1rem;
}

.eni-sg-choice-split {
  grid-template-columns: minmax(18rem, .82fr) minmax(30rem, 1.18fr);
  align-items: start;
}

.eni-sg-selection-pane,
.eni-sg-rules-pane {
  min-width: 0;
}

.eni-security-group-selector {
  max-height: 30rem;
}

.eni-security-group-selector-row {
  transition: border-color .12s ease, background-color .12s ease, box-shadow .12s ease;
}

.eni-security-group-selector-row.is-current {
  border-color: color-mix(in srgb, var(--success) 58%, var(--border));
  background: color-mix(in srgb, var(--success-bg) 68%, var(--surface));
}

.eni-security-group-selector-row.is-selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.eni-security-group-selector-row.is-current.is-selected {
  box-shadow: inset 3px 0 0 var(--success);
}

.eni-sg-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  min-width: 0;
}

.eni-sg-group-heading strong {
  flex: 1 1 auto;
}

.eni-sg-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 1.35rem;
  padding: .12rem .42rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.eni-sg-state-badge.is-current {
  border-color: color-mix(in srgb, var(--success) 58%, var(--border));
  color: var(--success);
  background: var(--success-bg);
}

.eni-sg-state-badge.is-added {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.eni-sg-state-badge.is-removed {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--border));
  color: var(--danger);
  background: var(--danger-bg);
}

.eni-sg-selection-stats {
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: var(--surface);
  font-size: .75rem;
  line-height: 1.4;
}

.eni-sg-selection-stats.is-warning {
  border-color: color-mix(in srgb, var(--warning) 58%, var(--border));
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

.eni-sg-selected-groups {
  display: grid;
  gap: .65rem;
  max-height: 24rem;
  overflow: auto;
  padding-right: .1rem;
}

.eni-sg-group-card.is-current {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
}

.eni-sg-group-card.is-added {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.eni-sg-group-card header > span {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.eni-sg-cumulative-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  min-width: 0;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

.eni-sg-cumulative-card {
  display: grid;
  align-content: start;
  gap: .55rem;
  min-width: 0;
  max-height: 26rem;
  padding: .75rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
}

.eni-sg-cumulative-card.is-current {
  border-color: color-mix(in srgb, var(--success) 38%, var(--border));
}

.eni-sg-cumulative-card.is-proposed {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.eni-sg-cumulative-card > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
}

.eni-sg-cumulative-card > header strong {
  color: var(--text);
}

.eni-sg-cumulative-card > header span {
  color: var(--muted);
  font-size: .7rem;
  white-space: nowrap;
}

.eni-sg-rule-list {
  gap: .35rem;
}

.eni-sg-rule-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: start;
  padding: .52rem .58rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
}

.eni-sg-rule-item.is-current {
  border-color: color-mix(in srgb, var(--success) 48%, var(--border));
  background: color-mix(in srgb, var(--success-bg) 62%, var(--surface-alt));
}

.eni-sg-rule-item.is-added {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-alt));
}

.eni-sg-rule-item.is-removed {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--border));
  background: color-mix(in srgb, var(--danger-bg) 62%, var(--surface-alt));
}

.eni-sg-rule-copy {
  display: grid;
  gap: .2rem;
  min-width: 0;
}

.eni-sg-rule-copy strong {
  color: var(--text);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: .72rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.eni-sg-rule-copy small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .eni-sg-choice-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .security-group-assignment__title,
  .eni-sg-cumulative-card > header,
  .eni-sg-group-card header,
  .eni-sg-group-card header > span {
    align-items: flex-start;
    flex-direction: column;
  }

  .eni-sg-cumulative-grid {
    grid-template-columns: 1fr;
  }

  .eni-sg-rule-item {
    grid-template-columns: 1fr;
  }
}
/* v1.3.5: compact exchange credentials and asynchronous credential health. */
.credential-health-bootstrap {
  display: none !important;
}

.credential-health-banner {
  margin: 12px 24px 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--warning-border);
  border-radius: 14px;
  background: var(--warning-bg);
  color: var(--text);
}

.credential-health-banner[hidden] {
  display: none !important;
}

.credential-health-banner.is-error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.credential-health-banner__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.credential-health-banner__copy strong {
  color: var(--text);
  font-size: 14px;
}

.credential-health-banner__copy span {
  color: var(--text-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.credential-health-banner__actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.credential-health-banner__more {
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

/* v1.4.1: exchange-management card layout. */
.exchange-page-head {
  gap: 32px;
}

.exchange-page-head__actions {
  align-self: center;
}

.exchange-credentials-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 18px;
  align-items: stretch;
}

.exchange-credential-card {
  --exchange-brand-color: var(--accent);
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 260px;
  padding: 24px;
  overflow: hidden;
}

.exchange-credential-card--featured {
  --exchange-brand-color: #f3ba2f;
  grid-column: span 7;
}

.exchange-credential-card--featured.exchange-credential-card--configured {
  grid-row: span 2;
  min-height: 536px;
}

.exchange-credential-card:not(.exchange-credential-card--featured):nth-child(2),
.exchange-credential-card:not(.exchange-credential-card--featured):nth-child(3) {
  grid-column: span 5;
}

.exchange-credential-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.exchange-credential-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.exchange-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid color-mix(in srgb, var(--exchange-brand-color) 46%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--exchange-brand-color) 13%, transparent);
  color: var(--exchange-brand-color);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.exchange-brand-mark .ui-icon {
  width: 25px;
  height: 25px;
}

.exchange-brand-mark--bybit { --exchange-brand-color: #f5b941; }
.exchange-brand-mark--okx { --exchange-brand-color: #d8e6f7; }
.exchange-brand-mark--coinbase {
  --exchange-brand-color: #2d7cff;
  border-radius: 50%;
}
.exchange-brand-mark--bitget { --exchange-brand-color: #2ed4d5; }
.exchange-brand-mark--kraken {
  --exchange-brand-color: #8c6cff;
  border-radius: 50%;
}
.exchange-brand-mark--hyperliquid { --exchange-brand-color: #6fe4c0; }

.exchange-credential-identity__copy {
  min-width: 0;
}

.exchange-credential-identity__copy h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.exchange-credential-region {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.exchange-credential-region .ui-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.exchange-credential-region span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.exchange-credential-state {
  flex: 0 0 auto;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.exchange-credential-description {
  min-height: 38px;
  margin: 18px 0 20px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.exchange-credential-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.exchange-credential-save-form {
  display: grid;
  gap: 8px;
  margin: auto 0 0;
}

.exchange-credential-field-label,
.exchange-credential-key-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.exchange-credential-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.exchange-credential-key-row input {
  min-width: 0;
  min-height: 46px;
}

.exchange-credential-key-row .btn {
  min-width: 104px;
  min-height: 46px;
}

.exchange-credential-submit .ui-icon,
.exchange-credential-recheck-form .ui-icon,
.exchange-credential-remove-form .ui-icon {
  width: 17px;
  height: 17px;
}

.exchange-credential-security-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.45;
}

.exchange-credential-security-note .ui-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}

.exchange-credential-saved-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}

.exchange-credential-key-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.exchange-credential-key-state code {
  max-width: 100%;
  color: var(--text);
  overflow-wrap: anywhere;
}

.exchange-credential-recheck-form {
  flex: 0 0 auto;
  margin: 0;
}

.exchange-credential-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 11px 12px;
  border: 1px solid var(--warning-border);
  border-radius: 11px;
  background: var(--warning-bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.exchange-credential-message .ui-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
}

.exchange-credential-message--invalid {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.exchange-credential-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--text-soft);
  overflow: hidden;
}

.exchange-credential-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.exchange-credential-details summary::-webkit-details-marker {
  display: none;
}

.exchange-credential-details summary:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.exchange-credential-details summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.exchange-credential-details__chevron {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  transition: transform 0.16s ease;
}

.exchange-credential-details[open] .exchange-credential-details__chevron {
  transform: rotate(180deg);
}

.exchange-credential-details[open] summary {
  border-bottom: 1px solid var(--border);
}

.exchange-credential-manage-body {
  display: grid;
  gap: 16px;
  padding: 14px;
}

.exchange-credential-replace-form {
  margin-top: 0;
}

.exchange-credential-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
}

.exchange-credential-meta > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 1px;
  min-width: 0;
  padding: 11px 12px;
  background: var(--surface);
}

.exchange-credential-meta > div:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.exchange-credential-meta > div:nth-child(n + 3) {
  border-top: 1px solid var(--border);
}

.exchange-credential-meta .ui-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--muted);
}

.exchange-credential-meta dt {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.exchange-credential-meta dd {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.exchange-credential-validation-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0 2px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.exchange-credential-validation-note .ui-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
}

.exchange-credential-validation-note--valid { color: var(--success); }
.exchange-credential-validation-note--invalid { color: var(--danger); }
.exchange-credential-validation-note--unavailable { color: var(--warning); }

.exchange-credential-remove-form {
  margin: 0;
  padding-top: 2px;
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .exchange-brand-mark {
    border-color: var(--border-strong);
    background: var(--surface-muted);
  }
}

@media (max-width: 1320px) {
  .exchange-credential-card--featured {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 0;
  }

  .exchange-credential-card:not(.exchange-credential-card--featured),
  .exchange-credential-card:not(.exchange-credential-card--featured):nth-child(2),
  .exchange-credential-card:not(.exchange-credential-card--featured):nth-child(3) {
    grid-column: span 6;
  }
}

@media (max-width: 820px) {
  .exchange-credentials-grid {
    grid-template-columns: 1fr;
  }

  .exchange-credential-card,
  .exchange-credential-card--featured,
  .exchange-credential-card:not(.exchange-credential-card--featured),
  .exchange-credential-card:not(.exchange-credential-card--featured):nth-child(2),
  .exchange-credential-card:not(.exchange-credential-card--featured):nth-child(3) {
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .exchange-page-head {
    gap: 20px;
  }

  .exchange-credential-card {
    padding: 20px;
  }

  .exchange-credential-card__header,
  .exchange-credential-saved-state {
    align-items: stretch;
    flex-direction: column;
  }

  .exchange-credential-state {
    align-self: flex-start;
  }

  .exchange-credential-description {
    min-height: 0;
  }

  .exchange-credential-key-row {
    grid-template-columns: 1fr;
  }

  .exchange-credential-key-row .btn,
  .exchange-credential-recheck-form,
  .exchange-credential-recheck-form .btn {
    width: 100%;
  }

  .exchange-credential-meta {
    grid-template-columns: 1fr;
  }

  .exchange-credential-meta > div:nth-child(odd) {
    border-right: 0;
  }

  .exchange-credential-meta > div:nth-child(n + 2) {
    border-top: 1px solid var(--border);
  }
}

/* Public authentication pages keep the branded composition while disabling costly motion. */
.public-layout.ui-performance-economy {
  background:
    radial-gradient(ellipse 76% 58% at 50% 47%, rgba(57, 231, 95, 0.105) 0%, rgba(18, 87, 38, 0.055) 42%, transparent 72%),
    linear-gradient(180deg, #010503 0%, #020804 58%, #010302 100%) !important;
}

.public-layout.ui-performance-economy *,
.public-layout.ui-performance-economy *::before,
.public-layout.ui-performance-economy *::after {
  transition: none !important;
  animation: none !important;
}

.public-layout.ui-performance-economy .refresh-indicator.is-active svg,
.public-layout.ui-performance-economy .btn.is-loading::after {
  animation: spin .9s linear infinite !important;
}

.public-layout.ui-performance-economy .auth-card {
  backdrop-filter: none !important;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(17, 64, 29, 0.28),
    0 0 38px rgba(27, 204, 66, 0.05) !important;
}

.public-layout.ui-performance-economy .page-loader {
  backdrop-filter: none !important;
}
/* HFTControl MCP read/control surfaces */
.mcp-endpoint-grid { align-items: stretch; }
.mcp-endpoint-code { display: block; overflow-wrap: anywhere; padding: .75rem; border: 1px solid var(--border-color, #1d4d72); border-radius: .5rem; background: rgba(2, 18, 33, .55); }
.mcp-section-card { margin-top: 1rem; }
.mcp-action-list { display: grid; gap: 1rem; }
.mcp-action-card { padding: 1rem; border: 1px solid var(--border-color, #1d4d72); border-radius: .65rem; background: rgba(2, 18, 33, .35); }
.mcp-action-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.mcp-action-meta { margin: .8rem 0; }
.mcp-effect-list { margin: .75rem 0; padding-left: 1.25rem; }
.mcp-payload-details { margin: .9rem 0; border: 1px solid var(--border-color, #1d4d72); border-radius: .55rem; overflow: hidden; }
.mcp-payload-details > summary { cursor: pointer; padding: .7rem .8rem; font-weight: 650; background: rgba(6, 42, 70, .45); }
.mcp-payload-details > p { margin: .75rem .8rem .25rem; }
.mcp-payload-details pre { max-height: 24rem; overflow: auto; margin: .65rem .8rem .8rem; padding: .8rem; border-radius: .45rem; background: #020d18; color: #d9ecff; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.mcp-action-buttons { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .75rem; }
.mcp-deny-form { display: flex; flex: 1 1 24rem; gap: .6rem; }
.mcp-deny-form input { min-width: 12rem; flex: 1; }
@media (max-width: 720px) {
  .mcp-action-card__head, .mcp-action-buttons, .mcp-deny-form { flex-direction: column; }
  .mcp-action-buttons form, .mcp-action-buttons button, .mcp-deny-form input { width: 100%; }
}


/* v1.4.4 unified MCP account-linking surfaces. */
.mcp-primary-endpoint-card {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
}

.mcp-endpoint-primary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.mcp-endpoint-primary-row .mcp-endpoint-code {
  min-width: 0;
  margin: 0;
}

.mcp-scope-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mcp-provider-grid {
  margin-top: 18px;
  align-items: stretch;
}

.mcp-provider-card,
.mcp-connection-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mcp-provider-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.mcp-provider-card__head,
.mcp-connection-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mcp-connection-card__head {
  justify-content: space-between;
}

.mcp-provider-card__head h2,
.mcp-provider-card__head h3,
.mcp-provider-card__head p,
.mcp-connection-card__head h3,
.mcp-connection-card__head p {
  margin: 0;
}

.mcp-provider-card__head p,
.mcp-connection-card__head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.mcp-provider-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface-alt);
}

.mcp-provider-mark--chatgpt { color: #0f8f73; border-color: rgba(15, 143, 115, .36); background: rgba(15, 143, 115, .10); }
.mcp-provider-mark--claude { color: #b66b3d; border-color: rgba(182, 107, 61, .36); background: rgba(182, 107, 61, .10); }
.mcp-provider-mark--generic { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }

.mcp-compact-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 21px;
  color: var(--text-soft);
}

.mcp-legacy-endpoints {
  margin-top: 18px;
}

.mcp-legacy-endpoints > summary {
  cursor: pointer;
  font-weight: 700;
}

.mcp-legacy-endpoints[open] > summary {
  margin-bottom: 12px;
}

.mcp-connection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mcp-connection-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.mcp-connection-meta {
  margin: 0;
}

.mcp-connection-card .button-row {
  margin-top: auto;
}

.mcp-settings-entry-card__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
}

.mcp-settings-entry-card__summary .ui-icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
  margin-top: 2px;
}

.mcp-settings-entry-card__summary strong,
.mcp-settings-entry-card__summary span {
  display: block;
}

.mcp-settings-entry-card__summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .mcp-provider-grid,
  .mcp-connection-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .mcp-endpoint-primary-row,
  .mcp-provider-grid,
  .mcp-connection-list {
    grid-template-columns: 1fr;
  }

  .mcp-endpoint-primary-row .btn,
  .mcp-provider-card .btn,
  .mcp-connection-card .button-row,
  .mcp-connection-card .button-row .btn,
  .mcp-connection-card .button-row form {
    width: 100%;
  }

  .mcp-connection-card__head {
    flex-direction: column;
  }
}

/* MCP v1.5.0 access profiles */
.mcp-access-profile-form{display:grid;gap:1rem}.mcp-access-profile-options{display:grid;gap:.75rem;border:0;padding:0;margin:0}.mcp-access-profile-options>legend{font-weight:700;margin-bottom:.25rem}.mcp-access-profile-option{display:flex;gap:.8rem;align-items:flex-start;padding:1rem;border:1px solid var(--border,#1d4e6d);border-radius:10px;background:rgba(6,23,38,.45);cursor:pointer}.mcp-access-profile-option:hover{border-color:var(--accent,#13a8ff)}.mcp-access-profile-option>input{margin-top:.3rem}.mcp-access-profile-option__body{display:grid;gap:.4rem;min-width:0}.mcp-access-profile-option__head{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.mcp-access-profile-option--recommended{border-color:rgba(23,190,116,.55)}.mcp-access-profile-option--control{border-color:rgba(255,184,77,.55)}.mcp-access-profile-option--disabled{cursor:not-allowed;opacity:.72}.token-chip--optional{border-style:dashed}.mcp-connection-card .button-row{flex-wrap:wrap}.mcp-control-permission-table form{margin:0}

/* HFTControl v1.5.3 latency Security Group selection and rule inspection */
.latency-sg-split {
    display: grid;
    grid-template-columns: minmax(18rem, .9fr) minmax(22rem, 1.1fr);
    gap: 1rem;
    min-width: 0;
}
.latency-sg-pane {
    display: grid;
    align-content: start;
    gap: .75rem;
    min-width: 0;
    padding: .9rem;
    border: 1px solid var(--border, #17496c);
    border-radius: .7rem;
    background: rgba(4, 20, 34, .42);
}
.latency-sg-pane__head { display: grid; gap: .2rem; }
.latency-sg-pane__head strong { color: var(--text, #edf7ff); }
.latency-sg-pane__head small { color: var(--muted, #91abc2); }
.latency-sg-pane .latency-security-group-select { width: 100%; min-height: 11rem; }
.latency-sg-rule-summary {
    display: grid;
    align-content: start;
    gap: .55rem;
    min-height: 11rem;
    max-height: 17rem;
    overflow: auto;
    padding: .05rem;
    color: var(--muted, #91abc2);
    font-size: .78rem;
    line-height: 1.4;
}
.latency-sg-rule-card {
    display: grid;
    gap: .4rem;
    padding: .65rem .7rem;
    border: 1px solid color-mix(in srgb, var(--border, #17496c) 78%, transparent);
    border-radius: .55rem;
    background: rgba(7, 29, 48, .62);
}
.latency-sg-rule-card header { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; min-width: 0; }
.latency-sg-rule-card strong { color: var(--text, #edf7ff); min-width: 0; overflow-wrap: anywhere; }
.latency-sg-rule-card code { color: var(--accent, #13a8ff); white-space: nowrap; }
.latency-sg-rule-card p { margin: 0; color: var(--muted, #91abc2); overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .latency-sg-split { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .latency-sg-rule-card header { align-items: flex-start; flex-direction: column; }
}
.latency-sg-pane--rules { min-width: 0; }


.latency-sg-rule-card .sg-rule-list {
    display: grid;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted, #91abc2);
}
/* HFTControl v1.5.9: shared Security Group chooser, credential attention, and bulk AWS credential paste. */
.sg-choice-split {
  display: grid;
  grid-template-columns: minmax(18rem, .9fr) minmax(22rem, 1.1fr);
  gap: 1rem;
  min-width: 0;
}

.sg-choice-pane {
  display: grid;
  align-content: start;
  gap: .75rem;
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.sg-choice-pane__head {
  display: grid;
  gap: .2rem;
}

.sg-choice-pane__head strong {
  color: var(--text);
}

.sg-choice-pane__head small {
  color: var(--muted);
}

.sg-choice-select {
  width: 100%;
  min-height: 11rem;
}

.sg-rule-summary {
  display: grid;
  align-content: start;
  gap: .55rem;
  min-height: 11rem;
  max-height: 17rem;
  overflow: auto;
  padding: .05rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.sg-rule-card {
  display: grid;
  gap: .4rem;
  padding: .65rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
}

.sg-rule-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  min-width: 0;
}

.sg-rule-card strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.sg-rule-card code {
  color: var(--accent);
  white-space: nowrap;
}

.sg-rule-card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.create-ec2-sg-split {
  margin-block: .25rem 1rem;
}

.aws-credential-attention {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin: 0 0 1.2rem;
  padding: 1.25rem 1.35rem;
  border: 2px solid var(--danger-border);
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.aws-credential-attention[hidden] {
  display: none !important;
}

.aws-credential-attention__icon {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid var(--danger-border);
  border-radius: 999px;
  color: var(--danger);
  background: var(--surface);
  font-size: 1.35rem;
  font-weight: 900;
}

.aws-credential-attention__copy {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.aws-credential-attention__copy strong {
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.25;
}

.aws-credential-attention__copy p {
  margin: 0;
  color: var(--text);
  font-size: .94rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.aws-credential-attention__copy small {
  color: var(--muted);
}

.aws-credential-attention__action {
  white-space: nowrap;
}

.credential-health-banner.is-error {
  padding: 1rem 1.2rem;
  border-width: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
}

.credential-health-banner.is-error .credential-health-banner__copy strong {
  font-size: 1.05rem;
}

.aws-credential-bundle {
  display: grid;
  gap: .7rem;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.aws-credential-bundle__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.aws-credential-bundle__head > div {
  display: grid;
  gap: .25rem;
}

.aws-credential-bundle__head small {
  color: var(--muted);
  line-height: 1.45;
}

.aws-credential-bundle textarea {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: .82rem;
  line-height: 1.45;
}

.aws-credential-bundle .inline-note.is-success {
  color: var(--success);
}

@media (max-width: 900px) {
  .sg-choice-split {
    grid-template-columns: 1fr;
  }

  .aws-credential-attention {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .aws-credential-attention__action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .sg-rule-card header,
  .aws-credential-bundle__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .aws-credential-bundle__head .btn {
    width: 100%;
  }
}


.sg-rule-list {
  display: grid;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.sg-rule-list li {
  overflow-wrap: anywhere;
}
/* Audit Log: keep wide event metadata compact and move verbose context below it. */
.audit-log-table {
  min-width: 980px;
}

.audit-log-table .audit-event-row td {
  border-bottom: 0;
}

.audit-log-table .audit-context-row td {
  padding-top: 0;
  padding-bottom: 18px;
}

.audit-log-table .audit-event-group + .audit-event-group .audit-event-row td {
  border-top: 1px solid rgba(217, 227, 242, 0.84);
}

.audit-log-table .audit-context-row:hover,
.audit-log-table .audit-context-row:hover td {
  background: transparent;
}

.audit-context-block {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
}

.audit-context-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.audit-context-value {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

.log-context {
  display: block;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .audit-log-table {
    min-width: 840px;
  }

  .audit-context-value {
    max-height: 280px;
  }
}
/* Native hidden must win over component display declarations. */
[hidden] {
  display: none !important;
}

.diagnostic-details {
  margin-top: 12px;
  border: 1px solid var(--border, #1e4f72);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(2, 18, 32, 0.45);
}

.diagnostic-details summary {
  cursor: pointer;
  font-weight: 700;
}

.diagnostic-details pre {
  margin: 10px 0 0;
  max-height: 28rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
