:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --bg: #07101f;
  --surface: #0f1b2e;
  --surface-raised: #132238;
  --border: #24344c;
  --border-strong: #354963;
  --text: #f8fafc;
  --muted: #9fb0c5;
  --subtle: #70849d;
  --accent: #22c55e;
  --accent-hover: #2dd66b;
  --accent-ink: #04140a;
  --danger: #fb7185;
  --warning: #fbbf24;
  --focus: #7dd3fc;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(34, 197, 94, 0.08), transparent 29rem),
    radial-gradient(circle at 88% 85%, rgba(56, 189, 248, 0.07), transparent 32rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(1160px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(53, 73, 99, 0.55);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 13px;
  color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
}

.brand-mark svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.secure-badge,
.gateway-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #bbf7d0;
  font-size: 13px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 64px 0;
}

.view {
  width: 100%;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: clamp(48px, 8vw, 110px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

.intro-block h1,
.dashboard-heading h1 {
  margin-bottom: 24px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.intro-copy,
.dashboard-copy {
  max-width: 560px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.trust-list {
  display: grid;
  gap: 14px;
  color: #d9e3ef;
  font-size: 14px;
}

.trust-list div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.trust-list svg {
  width: 20px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.panel,
.gateway-card,
.loading-panel,
.empty-panel {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(19, 34, 56, 0.94), rgba(12, 24, 42, 0.97));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.panel {
  border-radius: 22px;
  padding: clamp(24px, 4vw, 36px);
}

.panel-heading {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

.panel-heading h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.panel-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(34, 197, 94, 0.09);
}

.panel-icon svg,
.gateway-icon svg,
.secondary-button svg,
.primary-button svg,
.open-button svg,
.icon-button svg,
.empty-panel svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-icon svg {
  width: 22px;
  stroke-width: 1.8;
}

.field {
  margin-bottom: 21px;
}

.field label {
  display: inline-block;
  margin-bottom: 9px;
  color: #dbe6f2;
  font-size: 13px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.label-row span {
  color: var(--subtle);
  font-size: 12px;
}

.field input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(5, 14, 27, 0.7);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.field input:hover {
  border-color: #4b627f;
}

.field input:focus {
  border-color: var(--accent);
  background: #081425;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
  outline: none;
}

.field input::placeholder {
  color: #58708c;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.icon-button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  transition: color 180ms ease, background-color 180ms ease;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.icon-button svg {
  width: 20px;
  stroke-width: 1.7;
}

.eye-closed {
  display: none;
}

.icon-button[aria-pressed="true"] .eye-open {
  display: none;
}

.icon-button[aria-pressed="true"] .eye-closed {
  display: block;
}


.primary-button,
.open-button,
.secondary-button,
.text-button {
  min-height: 46px;
  border-radius: 11px;
  font-weight: 750;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.primary-button,
.open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}

.primary-button {
  width: 100%;
  margin-top: 4px;
}

.primary-button:hover:not(:disabled),
.open-button:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.primary-button:disabled,
.open-button:disabled,
.secondary-button:disabled {
  opacity: 0.48;
}

.primary-button svg,
.open-button svg {
  width: 19px;
  stroke-width: 2;
}

.message {
  margin: 0 0 18px;
  border: 1px solid rgba(251, 113, 133, 0.38);
  border-radius: 10px;
  padding: 11px 13px;
  color: #fecdd3;
  background: rgba(159, 18, 57, 0.13);
  font-size: 13px;
  line-height: 1.55;
}

.message.info {
  border-color: rgba(125, 211, 252, 0.28);
  color: #bae6fd;
  background: rgba(14, 116, 144, 0.12);
}

.gateway-view {
  align-self: flex-start;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
}

.dashboard-heading h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4vw, 48px);
}

.dashboard-copy {
  margin-bottom: 0;
}

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

.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  color: #dbe6f2;
  background: rgba(15, 27, 46, 0.8);
}

.secondary-button:hover:not(:disabled),
.text-button:hover {
  border-color: #516884;
  color: var(--text);
  background: var(--surface-raised);
}

.secondary-button svg {
  width: 17px;
  stroke-width: 1.9;
}

.text-button {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.gateway-list {
  display: grid;
  gap: 14px;
}

.gateway-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-radius: 17px;
  padding: 20px;
}

.gateway-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: #93c5fd;
  background: rgba(30, 64, 175, 0.1);
}

.gateway-icon svg {
  width: 25px;
  stroke-width: 1.6;
}

.gateway-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gateway-name {
  overflow: hidden;
  margin: 0;
  font-size: 17px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gateway-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.08);
  font-size: 11px;
}

.gateway-status.offline {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.09);
}

.gateway-status.offline .status-dot {
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1);
}

.gateway-address {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
}

.gateway-meta {
  margin: 5px 0 0;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.open-button {
  min-width: 154px;
  padding: 0 18px;
}

.gateway-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 10px;
}

.gateway-actions .open-button,
.gateway-actions .secondary-button {
  min-width: 0;
  padding: 0 16px;
}

.loading-panel,
.empty-panel {
  min-height: 180px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 21px;
  height: 21px;
  border: 2px solid rgba(159, 176, 197, 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.empty-panel {
  flex-direction: column;
  text-align: center;
}

.empty-panel svg {
  width: 42px;
  color: var(--subtle);
  stroke-width: 1.4;
}

.empty-panel h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.empty-panel p {
  margin: 0;
  color: var(--muted);
}

footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(53, 73, 99, 0.55);
  color: var(--subtle);
  font-size: 12px;
}

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

@media (max-width: 840px) {
  main {
    align-items: flex-start;
    padding: 44px 0;
  }

  .login-view {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .intro-block {
    max-width: 660px;
  }

  .login-panel {
    width: 100%;
    max-width: 580px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 28px, 560px);
  }

  .site-header {
    min-height: 78px;
  }

  .secure-badge {
    font-size: 0;
  }

  .secure-badge .status-dot {
    width: 9px;
    height: 9px;
  }

  main {
    padding: 34px 0 44px;
  }

  .intro-block h1 {
    font-size: 36px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .panel {
    border-radius: 17px;
    padding: 22px 18px;
  }

  .heading-actions,
  .secondary-button,
  .text-button {
    width: 100%;
  }

  .gateway-card {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 17px;
  }

  .gateway-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

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

  .gateway-actions {
    width: 100%;
    grid-column: 1 / -1;
  }

  .gateway-actions .secondary-button { width: 100%; }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.portal-switch {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.portal-switch a {
  color: #86efac;
  font-weight: 750;
}

.management-section {
  margin-top: 56px;
  padding-top: 44px;
  border-top: 1px solid rgba(53, 73, 99, 0.72);
}

.section-heading,
.list-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 3vw, 36px);
}

.section-heading p,
.list-heading p,
.form-help,
.activation-result p,
.empty-copy {
  color: var(--muted);
  line-height: 1.65;
}

.section-heading .eyebrow {
  margin-bottom: 12px;
}

.role-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
  padding: 7px 12px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.role-badge.elevated {
  border-color: rgba(125, 211, 252, 0.35);
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.08);
}

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

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

.compact-panel {
  width: auto;
  padding: 24px;
}

.compact-panel h3,
.list-heading h3 {
  margin: 0 0 18px;
  font-size: 18px;
}

.list-heading h3 {
  margin-bottom: 6px;
}

.form-help {
  margin: -8px 0 18px;
  font-size: 13px;
}

.field select {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 0 40px 0 14px;
  color: var(--text);
  background: #081425;
  font: inherit;
}

.field select:hover,
.field select:focus {
  border-color: var(--accent);
}

.field select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent);
  outline-offset: 3px;
}

.activation-result {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.activation-result label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 750;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.copy-row input {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 12px;
  color: #dbeafe;
  background: rgba(5, 14, 27, 0.72);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

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

.management-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(5, 14, 27, 0.46);
}

.management-item strong,
.management-item span {
  display: block;
  overflow-wrap: anywhere;
}

.management-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.item-status {
  color: #86efac;
  font-size: 12px;
  font-weight: 800;
}

.item-status.muted {
  color: var(--muted);
}

.customer-gateway-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.target-button-group {
  display: flex;
  gap: 8px;
}

.compact-action-button {
  min-width: 86px;
  min-height: 36px;
  padding: 0 11px;
  font-size: 12px;
}

@media (max-width: 760px) {
  .customer-gateway-item { grid-template-columns: 1fr; }
  .customer-gateway-actions { align-items: stretch; flex-direction: column; }
  .target-button-group > button { flex: 1 1 0; }
}

.danger-button {
  min-height: 42px;
  border: 1px solid rgba(251, 113, 133, 0.55);
  border-radius: 10px;
  padding: 0 14px;
  color: #fecdd3;
  background: rgba(159, 18, 57, 0.13);
  font: inherit;
  font-weight: 750;
}

.danger-button:hover:not(:disabled) {
  background: rgba(159, 18, 57, 0.26);
}

.danger-button.subtle {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.empty-copy {
  margin: 20px 0 0;
  text-align: center;
}

@media (max-width: 760px) {
  .management-grid,
  .platform-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
  }

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

.portal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
}

.full-link {
  width: 100%;
}

.activation-details {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
}

.activation-details div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid rgba(53, 73, 99, 0.55);
  padding-bottom: 10px;
}

.activation-details dt {
  color: var(--muted);
  font-size: 13px;
}

.activation-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.success-panel {
  text-align: center;
}

.success-panel .panel-icon {
  margin: 0 auto 18px;
}

.success-panel h2 {
  margin-bottom: 10px;
}

.success-panel p {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 620px) {
  .activation-details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.inline-links {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 18px;
}

.inline-links a,
#customer-account-panel a {
  color: #86efac;
  font-weight: 700;
  text-decoration: none;
}

.inline-links a:hover,
#customer-account-panel a:hover {
  text-decoration: underline;
}

.portal-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 24px;
}

.portal-tabs .active {
  border-color: var(--accent);
  color: #ecfdf5;
  background: rgba(34, 197, 94, 0.16);
}

.household-list {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.household-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.household-card-heading h2,
#customer-account-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.household-card-heading .form-help {
  margin: 0;
}

#customer-account-panel .portal-link {
  margin-top: 14px;
  padding: 0;
}

@media (max-width: 620px) {
  .portal-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .household-card-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Direct SA -> Cloud household binding */
.binding-main { align-items: center; }

.binding-view {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  align-items: center;
  gap: clamp(46px, 8vw, 108px);
}

.binding-intro h1 {
  margin-bottom: 24px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.binding-step-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.binding-step-list li { display: flex; align-items: center; gap: 13px; }

.binding-step-list li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(34, 197, 94, 0.36);
  border-radius: 9px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.binding-step-list strong,
.binding-step-list small { display: block; }
.binding-step-list strong { margin-bottom: 3px; font-size: 14px; }
.binding-step-list small { color: var(--muted); font-size: 12px; }

.binding-panel {
  min-height: 520px;
  display: flex;
  align-items: center;
}

.binding-stage { width: 100%; }
.binding-stage > h2 { margin-bottom: 10px; font-size: 24px; }
.binding-stage > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }

.binding-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -10px 0 26px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.binding-account-row small,
.binding-account-row strong { display: block; }
.binding-account-row small { margin-bottom: 4px; color: var(--subtle); font-size: 11px; letter-spacing: 0.08em; }
.binding-account-row strong { font-size: 14px; }

.inline-action {
  border: 0;
  padding: 0;
  color: #86efac;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.inline-action:hover { text-decoration: underline; }

.binding-create-household {
  margin: -6px 0 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: rgba(5, 14, 27, 0.45);
}

.binding-create-household .field { margin-bottom: 12px; }

.binding-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  margin: 0 0 20px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 11px;
  padding: 13px;
  color: #ccefff;
  background: rgba(14, 116, 144, 0.08);
}

.binding-summary svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.binding-summary p { margin: 0; font-size: 12px; line-height: 1.6; }

.binding-state-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 20px;
}

.binding-state-icon svg {
  width: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.binding-state-icon.success { color: #86efac; background: rgba(34, 197, 94, 0.12); }
.binding-state-icon.danger { color: #fda4af; background: rgba(159, 18, 57, 0.16); }
.binding-actions { display: grid; gap: 10px; margin-top: 26px; }
.binding-full-button { width: 100%; text-decoration: none; }

@media (max-width: 840px) {
  .binding-view { grid-template-columns: 1fr; gap: 38px; }
  .binding-intro { max-width: 660px; }
  .binding-panel { width: 100%; max-width: 580px; min-height: 0; }
}

@media (max-width: 620px) {
  .binding-main { padding-top: 30px; }
  .binding-intro h1 { font-size: 36px; }
  .binding-account-row { align-items: flex-start; flex-direction: column; }
  .binding-account-row .text-button { width: auto; min-height: 36px; padding: 0; }
}

/* Bounded management directories keep large account/host inventories navigable. */
.action-panel { margin-bottom: 20px; }
.action-panel summary { cursor: pointer; font-weight: 650; padding: 4px 0; }
.inline-form, .directory-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 18px; }
.inline-form .field { flex: 1; min-width: 200px; }
.inline-form .primary-button { width: auto; margin-bottom: 20px; }
.directory { margin-top: 24px; }
.directory-tabs, .directory-scope, .directory-pager, .table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.directory-tabs { border-bottom: 1px solid #334155; padding-bottom: 12px; }
.directory-tabs [aria-current="page"] { background: #163c35; color: #86efac; }
.directory-filters input { flex: 2; min-width: 220px; }
.directory-filters select { flex: 1; min-width: 150px; }
.directory-filters button, .directory-pager button, .table-actions button { width: auto; white-space: nowrap; }
.directory-table-scroll { overflow-x: auto; }
.directory-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
.directory-table th { color: #94a3b8; font-weight: 500; white-space: nowrap; }
.directory-table th, .directory-table td { padding: 16px 12px; border-bottom: 1px solid #26364b; vertical-align: top; }
.directory-table td { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.8; min-width: 100px; }
.directory-table td:first-child { min-width: 210px; }
.directory-table tr:hover { background: rgba(148, 163, 184, .04); }
.directory-pager { justify-content: flex-end; margin-top: 20px; }
.directory-pager select { width: auto; }
.directory-scope:empty { display: none; }
.directory-scope { margin-top: 15px; color: #86efac; }
#delivery-panel { margin-top: 24px; scroll-margin-top: 24px; }
@media (max-width: 620px) { .directory-filters > * { width: 100%; flex-basis: 100%; } .directory-pager { justify-content: flex-start; } }

.directory-filters input, .directory-filters select, .directory-pager select {
  height: 46px; padding: 0 14px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: #081425; color: var(--text); font: inherit;
}
.directory-filters input:focus, .directory-filters select:focus, .directory-pager select:focus {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.directory-filters { align-items: center; margin-bottom: 14px; }
.directory .form-help { margin: 12px 0; }
.directory-tabs .text-button { width: auto; }
.management-layout main { padding-top: 28px; }
.management-layout .dashboard-heading { margin-bottom: 20px; }
.management-layout .dashboard-heading h1 { font-size: 32px; }
.management-layout .management-section { margin-top: 24px; padding-top: 24px; }
.management-layout .section-heading h2 { font-size: 23px; }
.management-layout .section-heading .eyebrow { display: none; }
.management-layout .heading-actions { flex-wrap: wrap; }
.management-layout .heading-actions button { width: auto; white-space: nowrap; }
@media (max-width: 620px) {
  .directory-tabs { gap: 2px; }
  .directory-tabs button { font-size: 13px; padding: 0 9px; }
  .management-layout .section-heading { gap: 10px; }
  .management-layout .dashboard-heading { gap: 14px; }
}
