:root {
  /* Surfaces */
  --bg: #f4f6f9;
  --bg-subtle: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-muted: #f1f5f9;

  /* Typography */
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;

  /* Borders */
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --line-subtle: #f1f5f9;

  /* Brand / Accent */
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --accent-ring: rgba(29, 78, 216, 0.16);

  /* Semantic */
  --ok: #047857;
  --ok-dot: #10b981;
  --ok-soft: #ecfdf5;
  --ok-border: #a7f3d0;

  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  /* Code / Dark Surfaces */
  --code-bg: #0b1120;
  --code-header: #111827;
  --code-border: #1e293b;
  --code-text: #e2e8f0;

  /* Radii */
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 12px 28px -4px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 4px 10px rgba(15, 23, 42, 0.06), 0 20px 44px -8px rgba(15, 23, 42, 0.1);

  /* Fonts */
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --sidebar-w: 256px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   CUSTOM STYLED SCROLLBARS (GLOBAL LIGHT + DARK CODE WINDOWS)
   ============================================================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.36) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.15s ease;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(71, 85, 105, 0.62);
}
*::-webkit-scrollbar-thumb:active {
  background-color: var(--accent);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Dark theme scrollbars inside code/JSON windows */
.code-window,
.code-window * {
  scrollbar-width: thin;
  scrollbar-color: #334155 rgba(15, 23, 42, 0.65);
}
.code-window pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.code-window pre::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 999px;
}
.code-window pre::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.6);
  background-clip: padding-box;
}
.code-window pre::-webkit-scrollbar-thumb:hover {
  background-color: #475569;
}

/* Ultra-slim horizontal scrollbars on nav bars */
.mobile-nav::-webkit-scrollbar,
.subnav-bar::-webkit-scrollbar,
.lang-tabs::-webkit-scrollbar {
  height: 5px;
}

/* Subtle refined background atmosphere */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(960px 480px at 10% -10%, rgba(29, 78, 216, 0.075), transparent 60%),
    radial-gradient(720px 420px at 90% -5%, rgba(14, 165, 233, 0.055), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-muted);
  color: var(--ink-secondary);
  padding: 0.14em 0.42em;
  border-radius: 5px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

/* Inline SVG helper */
.ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 20px; height: 20px; }
.ico-xl { width: 24px; height: 24px; }

/* Boot screen */
.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--muted);
  padding: 2rem;
}
.boot-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #0f172a 100%);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.25);
}
.boot-logo svg {
  width: 22px;
  height: 22px;
}
.boot-mark {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.boot p {
  margin: 0;
  font-size: 0.875rem;
}
.boot-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Brand mark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.brand-mark svg {
  width: 17px;
  height: 17px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-text strong {
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.brand-text span {
  font-size: 0.73rem;
  color: var(--muted);
  font-weight: 500;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.58rem 1rem;
  min-height: 38px;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-sm {
  min-height: 32px;
  padding: 0.38rem 0.72rem;
  font-size: 0.78rem;
  border-radius: 7px;
}
.btn-lg {
  min-height: 44px;
  padding: 0.72rem 1.35rem;
  font-size: 0.9rem;
}
.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(29, 78, 216, 0.22);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1), 0 6px 16px rgba(29, 78, 216, 0.28);
}

.btn-secondary,
.btn-ghost {
  background: var(--surface);
  color: var(--ink-secondary);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}
.btn-soft:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
}
.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}
.btn-danger-solid:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-bottom: 1rem;
}
.field:last-child {
  margin-bottom: 0;
}
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
}
.field-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-muted);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="search"],
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.85rem;
  font-size: 0.88rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-light);
}
.field input:hover:not(:read-only):not(:disabled),
.field select:hover:not(:disabled),
.field textarea:hover:not(:disabled) {
  border-color: var(--line-strong);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
.field input:read-only {
  background: var(--bg-subtle);
  color: var(--muted);
  border-style: dashed;
  cursor: default;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap input {
  padding-right: 2.6rem;
}
.input-eye {
  position: absolute;
  right: 0.4rem;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.input-eye:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.input-addon-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-addon-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
.input-addon-group input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
}
.input-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 0.8rem;
  background: var(--bg-subtle);
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

.input-action-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}
.input-action-row input {
  flex: 1;
  min-width: 0;
}
@media (max-width: 560px) {
  .input-action-row {
    flex-direction: column;
  }
}

.field-hint {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.45;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Custom Toggle Switch */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.toggle-row:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}
.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.toggle-info strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}
.toggle-info span {
  font-size: 0.76rem;
  color: var(--muted);
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 0.2s ease;
  position: relative;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.switch input:checked + .switch-track {
  background: var(--accent);
}
.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}
.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Password strength bar */
.pw-meter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.2rem;
}
.pw-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  flex: 1;
  max-width: 180px;
}
.pw-bars span {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.2s ease;
}
.pw-meter[data-level="1"] .pw-bars span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] .pw-bars span:nth-child(-n+2) { background: #f59e0b; }
.pw-meter[data-level="3"] .pw-bars span:nth-child(-n+3) { background: var(--accent); }
.pw-meter[data-level="4"] .pw-bars span:nth-child(-n+4) { background: var(--ok-dot); }
.pw-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
}

/* ==========================================================================
   CALLOUTS & BADGES
   ========================================================================== */
.callout {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  background: var(--bg-subtle);
}
.callout-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--ink-secondary);
  border: 1px solid var(--line);
}
.callout-body {
  min-width: 0;
  flex: 1;
}
.callout-body h3,
.callout-body strong.callout-title {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.callout-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}
.callout-body ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--ink-secondary);
}
.callout-body li + li {
  margin-top: 0.2rem;
}

.callout.info {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.callout.info .callout-ico {
  background: #dbeafe;
  border-color: var(--accent-border);
  color: var(--accent);
}

.callout.ok {
  background: var(--ok-soft);
  border-color: var(--ok-border);
}
.callout.ok .callout-ico {
  background: #d1fae5;
  border-color: var(--ok-border);
  color: var(--ok);
}

.callout.amber {
  background: var(--amber-soft);
  border-color: var(--amber-border);
}
.callout.amber .callout-ico {
  background: #fef3c7;
  border-color: var(--amber-border);
  color: var(--amber);
}

.callout.danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}
.callout.danger .callout-ico {
  background: #fee2e2;
  border-color: var(--danger-border);
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }
.badge-warn { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-bad { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-info { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-neutral { background: var(--surface-muted); color: var(--ink-secondary); border: 1px solid var(--line); }

/* ==========================================================================
   AUTH / LOGIN VIEW
   ========================================================================== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}
.auth-header {
  text-align: center;
  margin-bottom: 1.6rem;
}
.auth-header .brand {
  justify-content: center;
  margin-bottom: 1.1rem;
}
.auth-header h1 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.auth-header p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ==========================================================================
   WIZARD LAYOUT
   ========================================================================== */
.wizard-shell {
  width: min(860px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.75rem 0 3.5rem;
}

.wizard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.step-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-xs);
  font-variant-numeric: tabular-nums;
}

/* Connected Horizontal Stepper */
.stepper-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-xs);
}
.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  position: relative;
  gap: 0.25rem;
}
.stepper.steps-5 {
  grid-template-columns: repeat(5, 1fr);
}
.step-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  background: transparent;
  border: 0;
  padding: 0.15rem 0.25rem;
  cursor: default;
  z-index: 1;
  opacity: 1;
}
.step-item:disabled {
  opacity: 1;
  cursor: default;
}
.step-item.clickable {
  cursor: pointer;
}
.step-item::before {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(-50% + 18px);
  right: calc(50% + 18px);
  height: 2px;
  background: var(--line);
  z-index: -1;
  transition: background-color 0.25s ease;
}
.step-item:first-child::before {
  display: none;
}
.step-item.done::before,
.step-item.active::before {
  background: var(--accent);
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  transition: all 0.2s ease;
}
.step-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.step-item.active .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.step-item.active .step-label {
  color: var(--ink);
  font-weight: 600;
}
.step-item.done .step-dot {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.step-item.done:hover .step-dot {
  background: var(--accent);
  color: #fff;
}
.step-item.done .step-label {
  color: var(--ink-secondary);
  font-weight: 500;
}

@media (max-width: 640px) {
  .stepper {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 0.85rem;
  }
  .step-item::before {
    display: none;
  }
}

/* Wizard Card Frame */
.wizard-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.wizard-body {
  padding: 2rem 2rem 1.75rem;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (max-width: 640px) {
  .wizard-body {
    padding: 1.35rem 1.25rem 1.25rem;
  }
}

.wizard-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.05rem 2rem;
  border-top: 1px solid var(--line);
  background: var(--bg-subtle);
}
@media (max-width: 640px) {
  .wizard-footer {
    padding: 0.9rem 1.25rem;
  }
}

.step-header {
  margin-bottom: 1.5rem;
}
.step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.step-header h1,
.step-header h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}
.step-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 62ch;
}

/* Path Selection Cards (Step 1) */
.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}
.path-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 740px) {
  .path-grid,
  .path-grid.cols-3 {
    grid-template-columns: 1fr;
  }
}
.path-card {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.15rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.path-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.path-card.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
.path-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.path-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.path-card.active .path-card-icon {
  background: var(--accent);
  color: #fff;
}
.path-card-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
  background: var(--surface);
  transition: all 0.15s ease;
}
.path-card.active .path-card-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.path-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.path-card strong {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
}
.path-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Glossary / Info Grid (Step 1) */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}
.glossary-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  background: var(--bg-subtle);
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}
.glossary-item-ico {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.glossary-item strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.glossary-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Provider Selector Grid (Step 2 External) */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}
@media (max-width: 640px) {
  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.provider-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.8rem;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.provider-card:hover {
  border-color: var(--line-strong);
  background: var(--bg-subtle);
}
.provider-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.provider-card strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.provider-card.active strong {
  color: var(--accent);
}
.provider-card span {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live Email Preview Card (Step 4 & Test Tab) */
.mail-preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  margin-top: 0.75rem;
}
.mail-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mail-preview-dots {
  display: flex;
  gap: 5px;
}
.mail-preview-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.mail-preview-content {
  padding: 1rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.mail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mail-meta {
  min-width: 0;
  flex: 1;
}
.mail-meta-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.mail-from-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}
.mail-time {
  font-size: 0.72rem;
  color: var(--muted-light);
}
.mail-from-addr {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
  margin-top: 0.1rem;
}
.mail-subject {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-top: 0.55rem;
}
.mail-snippet {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Review Summary Grid (Step 5) */
.review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  margin-bottom: 1.25rem;
}
@media (max-width: 640px) {
  .review-summary {
    grid-template-columns: 1fr;
  }
}
.review-item span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.review-item strong {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Success State (Step 6) */
.success-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
}
.success-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  color: var(--ok);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.12);
}
.success-hero h1 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.success-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 50ch;
}

/* ==========================================================================
   SECRET KEY BOX
   ========================================================================== */
.secret-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.secret-box code {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: 0;
  padding: 0;
  color: #fde68a;
  font-family: var(--mono);
  font-size: 0.83rem;
  word-break: break-all;
}
.secret-box .btn-copy-dark {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
}
.secret-box .btn-copy-dark:hover {
  background: #334155;
}

/* ==========================================================================
   PORTAL / DASHBOARD LAYOUT
   ========================================================================== */
.portal-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.9rem;
  z-index: 20;
}

.sidebar-brand {
  padding: 0.25rem 0.45rem 1.1rem;
  border-bottom: 1px solid var(--line-subtle);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-mode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.58rem 0.72rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}
.sidebar-mode-info {
  min-width: 0;
}
.sidebar-mode-info span {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-light);
}
.sidebar-mode-info strong {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.08rem;
}
.sidebar-mode-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  border-radius: 6px;
  padding: 0.22rem 0.52rem;
  font-size: 0.71rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.sidebar-mode-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-light);
  padding: 0 0.65rem;
  margin: 0 0 0.45rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.72rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}
.nav-item-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
}
.nav-item.active .nav-item-badge {
  background: #dbeafe;
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.user-meta {
  min-width: 0;
  flex: 1;
}
.user-meta strong {
  display: block;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span {
  display: block;
  font-size: 0.69rem;
  color: var(--muted);
}

/* Main Workspace */
.portal-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.portal-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.portal-topbar-title h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}
.portal-topbar-title p {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.portal-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.portal-content {
  width: min(1040px, 100%);
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Responsive Mobile Portal */
.mobile-header,
.mobile-nav {
  display: none;
}

@media (max-width: 960px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }
  .portal-sidebar {
    display: none;
  }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 25;
  }
  .mobile-nav {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 56px;
    z-index: 24;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-nav .nav-item {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }
  .portal-topbar {
    position: static;
    padding: 1rem 1rem 0.75rem;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 0;
    flex-wrap: wrap;
  }
  .portal-content {
    padding: 0.5rem 1rem 2.5rem;
  }
}

/* KPI / Infrastructure Strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 0.85rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.kpi-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kpi-meta {
  min-width: 0;
  flex: 1;
}
.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.kpi-value {
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Generic Card Panel */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.card-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.card-header p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.card-body {
  padding: 1.4rem;
}
@media (max-width: 640px) {
  .card-header, .card-body {
    padding: 1.1rem;
  }
}

/* Endpoint Bar */
.endpoint-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}
.method-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
}
.endpoint-url {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink);
  word-break: break-all;
  flex: 1;
  min-width: 180px;
}
.endpoint-auth {
  font-size: 0.76rem;
  color: var(--muted);
}

/* Language Tabs + Dark Code Window */
.code-window {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
  box-shadow: var(--shadow-sm);
}
.code-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--code-header);
  border-bottom: 1px solid var(--code-border);
  flex-wrap: wrap;
}
.lang-tabs {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}
.lang-tab {
  border: 0;
  background: transparent;
  color: #94a3b8;
  border-radius: 7px;
  padding: 0.34rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.lang-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}
.lang-tab.active {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 7px;
  padding: 0.32rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.copy-code-btn:hover {
  background: #334155;
  border-color: #475569;
}
.copy-code-btn.copied {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.code-window pre {
  margin: 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--code-text);
}
.code-window pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.callout code,
.path-card code {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

/* Subtle Syntax Highlighting tokens */
.tok-str  { color: #86efac; }
.tok-key  { color: #7dd3fc; }
.tok-prop { color: #93c5fd; }
.tok-kw   { color: #c4b5fd; }
.tok-fn   { color: #38bdf8; }
.tok-var  { color: #fda4af; }
.tok-num  { color: #fbbf24; }
.tok-sec  { color: #fcd34d; font-weight: 600; }
.tok-com  { color: #64748b; font-style: italic; }
.tok-flag { color: #fcd34d; }

.code-window-title {
  color: #cbd5e1;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
}

/* Payload Schema Reference */
.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.schema-table th,
.schema-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line-subtle);
  vertical-align: middle;
}
.schema-table tr:last-child td {
  border-bottom: 0;
}
.schema-table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg-subtle);
}
.type-pill {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-secondary);
  background: var(--surface-muted);
  padding: 0.14rem 0.45rem;
  border-radius: 5px;
}

/* Split layout for Test Mail tab */
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 820px) {
  .split-2 {
    grid-template-columns: 1fr;
  }
}

/* DNS Status Cards */
.dns-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.15rem;
}
@media (max-width: 820px) {
  .dns-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .dns-status-grid {
    grid-template-columns: 1fr;
  }
}

/* Coolify Express Preflight Grid */
.preflight-card {
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, #f8fbff 0%, #f1f6fe 100%);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 1.35rem;
}
.preflight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.preflight-head-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}
.preflight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
@media (max-width: 640px) {
  .preflight-grid {
    grid-template-columns: 1fr;
  }
}
.preflight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.preflight-item-left {
  min-width: 0;
  flex: 1;
}
.preflight-item-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.preflight-item-val {
  font-family: var(--mono);
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.auto-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  margin-left: 0.35rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-border);
  vertical-align: middle;
}

.record-type-stack {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.record-sublabel {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.dns-mx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--ink-secondary);
  flex-wrap: wrap;
}

/* ==========================================================================
   ANTI-SPAM DELIVERABILITY DIAGNOSTICS
   ========================================================================== */
.deliverability-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.deliverability-box.status-critical {
  border-color: var(--danger-border);
}
.deliverability-box.status-warning {
  border-color: var(--amber-border);
}
.deliverability-box.status-ready {
  border-color: var(--ok-border);
}

.deliverability-head {
  padding: 1rem 1.15rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.deliverability-box.status-critical .deliverability-head {
  background: linear-gradient(180deg, #fff5f5 0%, #fef2f2 100%);
  border-bottom-color: var(--danger-border);
}
.deliverability-box.status-warning .deliverability-head {
  background: linear-gradient(180deg, #fffdf5 0%, #fffbeb 100%);
  border-bottom-color: var(--amber-border);
}
.deliverability-box.status-ready .deliverability-head {
  background: linear-gradient(180deg, #f4fdf9 0%, #ecfdf5 100%);
  border-bottom-color: var(--ok-border);
}

.deliverability-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.deliverability-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.deliverability-title-wrap h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
}
.deliverability-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.deliverability-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.deliverability-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}
.status-critical .deliverability-meter > span { background: var(--danger); }
.status-warning .deliverability-meter > span { background: #f59e0b; }
.status-ready .deliverability-meter > span { background: var(--ok-dot); }

.diag-list {
  display: flex;
  flex-direction: column;
}
.diag-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line-subtle);
}
.diag-item:last-child {
  border-bottom: 0;
}
.diag-item.is-ok {
  background: var(--bg-subtle);
  padding-top: 0.78rem;
  padding-bottom: 0.78rem;
}

.diag-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.diag-ico.critical { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }
.diag-ico.high { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.diag-ico.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }

.diag-content {
  min-width: 0;
  flex: 1;
}
.diag-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.diag-top strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}
.diag-summary {
  margin: 0.3rem 0 0;
  font-size: 0.81rem;
  color: var(--ink-secondary);
  line-height: 1.48;
}
.diag-current {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.diag-current code {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  font-size: 0.73rem;
}
.diag-fix {
  margin-top: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}
.diag-fix-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 0.45rem;
}
.diag-fix-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.diag-fix-val {
  flex: 1;
  min-width: 180px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.4rem 0.65rem;
  word-break: break-all;
}

.spam-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--amber-border);
  background: var(--amber-soft);
}
.spam-banner.critical {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}
.spam-banner-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}
.spam-banner-left strong {
  display: block;
  font-size: 0.84rem;
  color: var(--ink);
}
.spam-banner-left span {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.nav-item-badge.warn {
  background: var(--danger-soft);
  color: var(--danger);
}
.nav-item-badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ==========================================================================
   CPANEL QUICK-CONNECT & DNS SYNC
   ========================================================================== */
.mode-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 640px) {
  .mode-pills {
    grid-template-columns: 1fr;
  }
}
.mode-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  padding: 0.78rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: all 0.15s ease;
}
.mode-pill:hover {
  border-color: var(--line-strong);
  background: var(--bg-subtle);
}
.mode-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.mode-pill-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mode-pill.active .mode-pill-ico {
  background: var(--accent);
  color: #fff;
}
.mode-pill strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}
.mode-pill span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.port-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.port-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.port-pill:hover {
  border-color: var(--line-strong);
  background: var(--bg-subtle);
}
.port-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 780px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.cpanel-sync-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 1.15rem 1.25rem;
  margin-top: 1rem;
}
.cpanel-sync-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.cpanel-sync-head h3 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
}
.cpanel-sync-head p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.cpanel-conn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--ok-border);
  background: var(--ok-soft);
}
.cpanel-conn-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.cpanel-conn-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--ink);
}
.cpanel-conn-info span {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-secondary);
  font-family: var(--mono);
}

.row-action-panel {
  background: var(--bg-subtle);
}
.inline-row-form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.inline-row-form input {
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.82rem;
  min-width: 220px;
}
.inline-row-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.email-compose-addon {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.email-compose-addon:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
.email-compose-addon input,
.email-compose-addon select {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: 42px;
}
.email-compose-addon input {
  flex: 1;
  min-width: 110px;
}
.email-compose-addon .at-sep {
  display: grid;
  place-items: center;
  padding: 0 0.55rem;
  background: var(--bg-subtle);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 600;
}
.email-compose-addon select {
  flex: 1.1;
  min-width: 140px;
  background: var(--bg-subtle);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.pw-gen-row {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}
.pw-gen-row .input-wrap {
  flex: 1;
}

/* ==========================================================================
   MAILBOXES, MASKED ALIASES, INBOX & BACKUP
   ========================================================================== */
.subnav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.subnav-btn:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}
.subnav-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.22);
}
.subnav-count {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-secondary);
}
.subnav-btn.active .subnav-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.batch-preview {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 0.8rem;
  color: var(--ink-secondary);
  margin-bottom: 1rem;
}

/* Split Inbox Reader */
.inbox-split {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 520px;
}
@media (max-width: 860px) {
  .inbox-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.inbox-list {
  border-right: 1px solid var(--line);
  max-height: 640px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
@media (max-width: 860px) {
  .inbox-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 320px;
  }
}

.inbox-row {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface);
  padding: 0.88rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  transition: background-color 0.14s ease;
}
.inbox-row:hover {
  background: var(--bg-subtle);
}
.inbox-row.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.inbox-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.inbox-row-sender {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.inbox-row-time {
  font-size: 0.7rem;
  color: var(--muted-light);
  white-space: nowrap;
}
.inbox-row-subject {
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-row-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}
.alias-chip {
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-reader {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.inbox-reader-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9rem;
}
.inbox-reader-head h3 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
}
.inbox-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1rem;
  font-size: 0.8rem;
  color: var(--ink-secondary);
}
@media (max-width: 640px) {
  .inbox-meta-grid {
    grid-template-columns: 1fr;
  }
}
.inbox-meta-grid span {
  color: var(--muted);
  font-weight: 600;
  margin-right: 0.3rem;
}

.inbox-body-frame {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.inbox-body-text {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-family: var(--font);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

.reply-thread {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.reply-bubble {
  border: 1px solid var(--ok-border);
  background: var(--ok-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
}
.reply-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--ok);
  font-weight: 600;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.reply-bubble p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
}

.reply-composer {
  border: 1px solid var(--accent-border);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.reply-composer-head {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.reply-composer textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.85rem;
  background: var(--surface);
  resize: vertical;
  font-size: 0.85rem;
}
.reply-composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}

.backup-stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.backup-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: var(--bg-subtle);
}
.backup-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.backup-stat strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.1rem;
}

.file-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.file-drop input[type="file"] {
  font-size: 0.8rem;
  max-width: 100%;
}
.dns-stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  background: var(--bg-subtle);
}
.dns-stat-card.ok {
  background: var(--ok-soft);
  border-color: var(--ok-border);
}
.dns-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.dns-stat-top strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}
.dns-stat-detail {
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}
.dns-stat-detail code {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Data & DNS Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
table.data-table th {
  text-align: left;
  padding: 0.68rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data-table td {
  text-align: left;
  padding: 0.78rem 0.9rem;
  border-bottom: 1px solid var(--line-subtle);
  vertical-align: middle;
  color: var(--ink-secondary);
}
table.data-table tbody tr:hover {
  background: var(--bg-subtle);
}
table.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.mono-cell {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
}
.copy-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
}
.copy-cell code {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--bg-subtle);
}
.icon-btn.copied {
  border-color: var(--ok-border);
  background: var(--ok-soft);
  color: var(--ok);
}

.record-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0.16rem 0.45rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

/* Inline Toolbar (Logs filter, New API Key bar) */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.4rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.search-input {
  min-height: 34px;
  padding: 0.35rem 0.75rem 0.35rem 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.82rem;
  min-width: 220px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-wrap .ico {
  position: absolute;
  left: 0.65rem;
  color: var(--muted-light);
  pointer-events: none;
}

.filter-pills {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}
.filter-pill {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.filter-pill.active {
  background: var(--ink);
  color: #fff;
}

/* Inline Create Key form */
.inline-create-form {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.inline-create-form input {
  min-height: 36px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.84rem;
  min-width: 220px;
}
.inline-create-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Empty State */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}
.empty-state-ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--surface-muted);
  color: var(--muted);
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
}
.empty-state h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.empty-state p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
  max-width: 38ch;
}

.truncate-cell {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inline Confirm group */
.confirm-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 100;
  max-width: min(400px, calc(100% - 2.5rem));
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  transform: translateY(130%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  font-size: 0.84rem;
  font-weight: 500;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.toast-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.toast.success {
  border-color: var(--ok-border);
}
.toast.success .toast-ico {
  background: var(--ok-soft);
  color: var(--ok);
}
.toast.error {
  border-color: var(--danger-border);
}
.toast.error .toast-ico {
  background: var(--danger-soft);
  color: var(--danger);
}
.toast.info {
  border-color: var(--accent-border);
}
.toast.info .toast-ico {
  background: var(--accent-soft);
  color: var(--accent);
}
.toast-msg {
  flex: 1;
  line-height: 1.35;
}

/* Interactive API Explorer (2-Column Stripe / Resend Style) */
.api-explorer {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 620px;
}
@media (max-width: 960px) {
  .api-explorer {
    grid-template-columns: 1fr;
  }
}

.api-sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg-subtle);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
@media (max-width: 960px) {
  .api-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.9rem;
  }
}

.api-nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.api-nav-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0.55rem 0.32rem;
}
.api-nav-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.44rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font);
  font-size: 0.81rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.api-nav-item:hover {
  background: var(--surface);
  color: var(--ink);
}
.api-nav-item.active {
  background: var(--surface);
  border-color: var(--accent-border);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.api-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-method-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.32rem;
  border-radius: 5px;
  line-height: 1.2;
}
.api-method-tag.tag-get {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}
.api-method-tag.tag-post {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.api-method-tag.tag-patch {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}
.api-method-tag.tag-delete {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.api-workspace {
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
@media (max-width: 640px) {
  .api-workspace {
    padding: 1.1rem;
  }
}

.api-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-subtle);
}
.api-workspace-title {
  min-width: 220px;
  flex: 1;
}
.api-workspace-title h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.api-workspace-title p {
  margin: 0.28rem 0 0;
  font-size: 0.83rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}
.api-auth-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .api-auth-box {
    align-items: flex-start;
  }
}
.api-auth-caption {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.api-workspace .endpoint-bar {
  margin-bottom: 0;
}
.method-pill.method-get { background: var(--ok); }
.method-pill.method-post { background: var(--accent); }
.method-pill.method-patch { background: var(--amber); }
.method-pill.method-delete { background: var(--danger); }

.api-subblock {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.api-subblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.api-subblock-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.api-params-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.code-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: #6ee7b7;
}
.code-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* ============================================================================
   SIDEBAR WORKSPACE / ENVIRONMENT SWITCHER & DOMAIN MANAGER
   ============================================================================ */
.sidebar-env-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: var(--radius-md);
  padding: 0.72rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-xs);
}
.sidebar-env-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.sidebar-env-mode {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  white-space: nowrap;
}
.env-dropdown {
  position: relative;
}
.env-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.env-trigger:hover,
.env-dropdown.open .env-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.env-trigger-ico {
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.env-trigger-ico .ico {
  width: 14px;
  height: 14px;
}
.env-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.env-trigger-caret {
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.env-dropdown.open .env-trigger-caret {
  transform: rotate(180deg);
}

.env-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  z-index: 40;
  overflow: hidden;
  animation: fadeIn 0.12s ease;
}
.env-menu-list {
  padding: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.env-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  transition: background 0.12s ease;
}
.env-menu-item:hover {
  background: var(--bg-subtle);
}
.env-menu-item.active {
  background: var(--accent-soft);
}
.env-menu-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}
.env-menu-main strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.env-menu-item.active .env-menu-main strong {
  color: var(--accent);
}
.env-menu-main span {
  font-size: 0.69rem;
  color: var(--muted);
}
.env-menu-check {
  color: var(--accent);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.env-menu-check .ico {
  width: 14px;
  height: 14px;
}
.env-menu-footer {
  border-top: 1px solid var(--line-subtle);
  padding: 0.35rem;
  background: var(--bg-subtle);
}
.env-menu-manage {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: background 0.12s ease, color 0.12s ease;
}
.env-menu-manage:hover {
  background: var(--surface);
  color: var(--accent);
}
.env-menu-manage .ico {
  width: 13px;
  height: 13px;
}
.sidebar-env-empty {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.35rem 0.5rem;
  border-radius: 7px;
  background: var(--surface-muted);
}
.sidebar-env-manage {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  padding: 0.12rem 0.1rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  transition: color 0.14s ease;
}
.sidebar-env-manage:hover {
  color: var(--accent);
}
.sidebar-env-manage .ico {
  width: 13px;
  height: 13px;
}

.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.mobile-env-select {
  max-width: 165px;
  height: 32px;
  padding: 0 1.5rem 0 0.5rem;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background-color: var(--bg-subtle);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
}

.domain-locked-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 0.8rem;
  min-height: 42px;
  background: var(--bg-subtle);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.domain-add-box {
  border: 1px solid var(--accent-border);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
}
.domain-add-head {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin-bottom: 0.95rem;
}
.domain-add-head strong {
  font-size: 0.92rem;
  color: var(--ink);
}
.domain-add-head span {
  font-size: 0.8rem;
  color: var(--muted);
}
.domain-discovered-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.domain-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
}
@media (max-width: 640px) {
  .domain-cards-grid {
    grid-template-columns: 1fr;
  }
}
.domain-item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.domain-item-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.domain-item-card.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.domain-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.domain-item-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.domain-globe {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.domain-item-title strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}
.domain-sender {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  word-break: break-all;
}
.domain-item-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.domain-stats-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--ink-secondary);
  padding: 0.45rem 0.65rem;
  background: var(--bg-subtle);
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
}
.domain-item-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}
.domain-active-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ok);
}
.domain-delete-confirm {
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  border-radius: 9px;
  padding: 0.75rem 0.85rem;
  font-size: 0.79rem;
  color: var(--ink);
}
.domain-delete-confirm p {
  margin: 0 0 0.6rem;
  line-height: 1.45;
}

/* ============================================================================
   GLOBAL RESPONSIVE POLISH (TABLETS & PHONES)
   ============================================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 960px) {
  .api-sidebar {
    max-height: 240px;
    overflow-y: auto;
  }
  .api-nav-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 0.3rem;
  }
  .api-nav-heading {
    grid-column: 1 / -1;
    padding-top: 0.2rem;
  }
}

@media (max-width: 680px) {
  .spam-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .spam-banner .btn {
    width: 100%;
    justify-content: center;
  }
  .subnav-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .subnav-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .card-header {
    align-items: flex-start;
  }
  .endpoint-bar .btn {
    width: 100%;
    justify-content: center;
  }
  .code-window pre {
    padding: 0.85rem 0.95rem;
    font-size: 0.75rem;
  }
  .lang-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    padding-bottom: 2px;
  }
  .lang-tab {
    flex-shrink: 0;
  }
}

@media (max-width: 520px) {
  .portal-content {
    padding: 0.45rem 0.75rem 2.25rem;
  }
  .portal-topbar {
    padding: 0.85rem 0.85rem 0.55rem;
  }
  .mobile-header {
    padding: 0.7rem 0.85rem;
  }
  .mobile-nav {
    padding: 0.5rem 0.85rem;
    top: 52px;
  }
  .email-compose-addon {
    flex-wrap: wrap;
  }
  .email-compose-addon input,
  .email-compose-addon select {
    flex: 1 1 100%;
    min-width: 0;
  }
  .email-compose-addon .at-sep {
    display: none;
  }
  .email-compose-addon select,
  .email-compose-addon input + .at-sep + input {
    border-top: 1px solid var(--line) !important;
  }
  .inline-row-form {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-row-form .btn,
  .inline-row-form input {
    width: 100%;
  }
  .wizard-card,
  .auth-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }
}

/* API Key inline reveal & actions */
.key-actions-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.key-actions-inline .ico {
  width: 14px;
  height: 14px;
}
.key-revealed-code {
  display: inline-block;
  max-width: 320px;
  word-break: break-all;
  white-space: normal;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(37, 99, 235, 0.22);
  padding: 0.28rem 0.52rem;
  border-radius: 6px;
  font-size: 0.76rem;
  line-height: 1.4;
  user-select: all;
}
.key-legacy-hint {
  font-size: 0.74rem;
  color: var(--muted-light);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-muted);
  cursor: help;
}

/* Active SMTP row highlight & direct cPanel SMTP guide */
.api-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.api-mode-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-muted);
  padding: 0.25rem;
  border-radius: 10px;
  flex-wrap: wrap;
}
.api-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.42rem 0.78rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.api-mode-pill .ico {
  width: 15px;
  height: 15px;
}
.api-mode-pill:hover {
  color: var(--ink);
}
.api-mode-pill.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.api-mode-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.09);
  color: var(--accent);
}
.api-mode-pill:not(.active) .api-mode-tag {
  background: rgba(100, 116, 139, 0.12);
  color: var(--muted);
}
.api-mode-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.cpanel-mail-table .nowrap-cell {
  white-space: nowrap;
  font-size: 0.8rem;
}
.cpanel-mail-table .cpanel-actions-cell .confirm-inline {
  justify-content: flex-end;
  gap: 0.32rem;
  flex-wrap: wrap;
}
.cpanel-mail-table .cpanel-actions-cell .btn-sm {
  padding: 0.32rem 0.58rem;
  font-size: 0.76rem;
  white-space: nowrap;
}
.cpanel-mail-table .cpanel-actions-cell .btn-sm .ico {
  width: 13px;
  height: 13px;
}

.env-trigger {
  padding: 0.48rem 0.55rem;
  gap: 0.4rem;
}
.env-trigger-domain {
  font-size: 0.76rem;
  letter-spacing: -0.02em;
}

.data-table tbody tr.row-active-smtp {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.07) 0%, rgba(16, 185, 129, 0.02) 60%, transparent 100%);
}
.data-table tbody tr.row-active-smtp td:first-child {
  box-shadow: inset 3px 0 0 var(--ok);
}

.smtp-guide-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.45rem 0.25rem;
  text-align: left;
}
.smtp-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.smtp-guide-head strong {
  font-size: 0.86rem;
  color: var(--ink);
  display: block;
}
.smtp-guide-head p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
}
.smtp-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 960px) {
  .smtp-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .smtp-guide-grid {
    grid-template-columns: 1fr;
  }
}
.smtp-guide-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.smtp-guide-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.smtp-guide-val-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.smtp-guide-val-row code {
  font-size: 0.78rem;
  word-break: break-all;
}
.smtp-guide-val-row .ico {
  width: 14px;
  height: 14px;
}
.smtp-guide-alt {
  font-size: 0.72rem;
  color: var(--muted);
}
.smtp-guide-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.smtp-guide-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.smtp-guide-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.32rem 0.65rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.smtp-guide-tab:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.smtp-guide-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.smtp-guide-code {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-x: auto;
  max-height: 320px;
}
.smtp-guide-code code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  font-size: inherit;
}

/* Spacing utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.25rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
