:root {
  --bg0: #05070f;
  --bg1: #0a1020;
  --card: rgba(14, 22, 42, 0.72);
  --card-solid: #0e162a;
  --line: rgba(99, 140, 255, 0.22);
  --line2: rgba(255, 255, 255, 0.06);
  --text: #e8eefc;
  --muted: #8b9bb8;
  --primary: #3b82f6;
  --primary2: #06b6d4;
  --accent: #a78bfa;
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --radius: 18px;
  --font: "Inter", system-ui, sans-serif;
  --display: "Orbitron", "Inter", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg0);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: #7dd3fc; text-decoration: none; }
a:hover { color: #bae6fd; }
button, input, select, textarea { font: inherit; color: inherit; }
em { font-style: normal; color: var(--accent); font-size: 0.85em; }

/* ── Background FX ── */
.fx-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(167, 139, 250, 0.14), transparent 55%),
    radial-gradient(800px 500px at 50% 100%, rgba(6, 182, 212, 0.1), transparent 50%),
    linear-gradient(180deg, #05070f, #070b16 40%, #05070f);
}
.fx-grid {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(99, 140, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 140, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(600px) rotateX(60deg) translateY(-10%) scale(1.4);
  animation: gridDrift 28s linear infinite;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 480px, 480px 0; }
}
.fx-orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55;
  animation: float 12s ease-in-out infinite;
}
.fx-orb-a { width: 340px; height: 340px; background: #1d4ed8; top: 8%; left: 6%; }
.fx-orb-b { width: 280px; height: 280px; background: #7c3aed; bottom: 10%; right: 8%; animation-delay: -4s; }
.fx-orb-c { width: 200px; height: 200px; background: #0891b2; top: 45%; left: 45%; animation-delay: -7s; opacity: 0.35; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -24px) scale(1.08); }
}

/* ── Glass / 3D ── */
.glass-3d {
  background: linear-gradient(145deg, rgba(22, 32, 58, 0.78), rgba(10, 16, 32, 0.82));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  position: relative;
}
.glass-3d::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%, transparent 60%, rgba(59, 130, 246, 0.05));
}
.glass-inset {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 14px 16px;
}

/* ── Logo ── */
.logo-3d {
  width: 72px; height: 72px; position: relative;
  display: grid; place-items: center;
  transform-style: preserve-3d;
}
.logo-3d.sm { width: 42px; height: 42px; }
.logo-core {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 1px;
  background: linear-gradient(145deg, #60a5fa, #2563eb 45%, #7c3aed);
  box-shadow:
    0 12px 30px rgba(37, 99, 235, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 -8px 16px rgba(0, 0, 0, 0.35) inset;
  z-index: 2;
}
.logo-3d.sm .logo-core { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.logo-ring {
  position: absolute; inset: -4px; border-radius: 22px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-solid), var(--card-solid)) padding-box,
    linear-gradient(135deg, #22d3ee, transparent 40%, #a78bfa) border-box;
  animation: spin 8s linear infinite;
  opacity: 0.85;
}
.logo-3d.sm .logo-ring { inset: -3px; border-radius: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  padding: 36px 32px 28px;
  transform: translateZ(0) perspective(900px) rotateX(2deg);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.login-card:hover {
  transform: translateZ(0) perspective(900px) rotateX(0deg) translateY(-4px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 60px rgba(59, 130, 246, 0.12);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .logo-3d { margin: 0 auto 14px; }
.login-brand h1 {
  margin: 0; font-family: var(--display); font-size: 32px; letter-spacing: 3px; font-weight: 800;
}
.login-brand h1 span {
  background: linear-gradient(90deg, #22d3ee, #a78bfa); -webkit-background-clip: text; color: transparent;
}
.tag { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 14px; }
.login-foot { text-align: center; color: var(--muted); font-size: 11px; margin: 18px 0 0; }

/* ── Fields / Buttons ── */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.field input, .field select, .field textarea,
input[type="text"], input[type="password"], input[type="number"], input[type="file"],
select, textarea {
  width: 100%;
  background: rgba(5, 10, 22, 0.75);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.45; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); user-select: none; }
.check input { width: auto; accent-color: var(--primary); }

.btn {
  appearance: none; border: 1px solid transparent; border-radius: 12px;
  padding: 10px 16px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1 55%, #06b6d4);
  color: #fff; border-color: rgba(255, 255, 255, 0.12);
}
.btn-glow { box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset; }
.btn-glow:hover { box-shadow: 0 14px 40px rgba(59, 130, 246, 0.5), 0 0 24px rgba(6, 182, 212, 0.25); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }
.btn-ghost {
  background: transparent; border-color: var(--line2); color: var(--muted);
}
.btn-ghost:hover { color: var(--text); border-color: var(--line); }
.btn-danger {
  background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.22); }

.alert {
  border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
  border: 1px solid transparent;
}
.alert-error, .alert-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fecaca; }
.alert-ok { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #bbf7d0; }
.alert-warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); color: #fde68a; }
.flash-stack { margin-bottom: 12px; }

/* ── App shell ── */
.topbar {
  display: flex; align-items: center; gap: 18px;
  margin: 14px 16px 0; padding: 12px 16px;
  position: sticky; top: 10px; z-index: 40;
}
.brand-mini { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.brand-mini strong { display: block; font-family: var(--display); letter-spacing: 1.5px; font-size: 14px; }
.brand-mini small { color: var(--muted); font-size: 11px; }
.topnav { display: flex; gap: 6px; flex: 1; }
.topnav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 13px;
  border: 1px solid transparent;
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.topnav a.active {
  color: #fff; background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(124, 58, 237, 0.25));
  border-color: rgba(99, 140, 255, 0.35);
}
.top-user { display: flex; align-items: center; gap: 10px; }
.pill {
  font-size: 12px; padding: 6px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line2); color: var(--muted);
}
.pill.admin { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.35); }

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 14px;
  padding: 14px 16px 20px;
  height: calc(100vh - 114px);
  overflow: hidden;
}
.side-panel, .result-panel, .composer {
  padding: 16px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 140, 255, 0.5) rgba(255, 255, 255, 0.045);
}
.side-panel h3, .result-panel h3 {
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line2);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.side-panel h3::before, .result-panel h3::before {
  content: ""; width: 3px; height: 12px; border-radius: 2px; flex: 0 0 auto;
  background: linear-gradient(180deg, #3b82f6, #a78bfa);
}
.side-panel h3 + .preset-grid { margin-bottom: 18px; }
.side-panel h3:not(:first-child) { margin-top: 18px; }

.preset-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-chip {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line2); color: var(--text);
  border-radius: 999px; padding: 7px 11px; font-size: 12px; cursor: pointer;
  transition: 0.15s;
}
.preset-chip:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.intel-box .field-row { display: flex; gap: 8px; }
.intel-box input { flex: 1; }
.intel-out, .code-block {
  margin-top: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line2);
  border-radius: 12px; padding: 12px; font-family: var(--mono); font-size: 11.5px;
  color: #b7c5de; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
}
.code-block.sm { max-height: 320px; min-height: 140px; }
.code-block { max-height: 360px; }

.log-mini { display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.log-item {
  padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line2); font-size: 11.5px;
}
.log-item .s { font-weight: 600; }
.log-item.ok { border-color: rgba(34, 197, 94, 0.25); }
.log-item.bad { border-color: rgba(239, 68, 68, 0.25); }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }

.composer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
}
.composer-head h2 {
  margin: 0; font-family: var(--display); font-size: 16px; letter-spacing: 1px;
}
.mode-tabs { display: flex; background: rgba(0, 0, 0, 0.28); border-radius: 999px; padding: 3px; border: 1px solid var(--line2); }
.mode-tab {
  border: 0; background: transparent; color: var(--muted); padding: 7px 14px;
  border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 12px;
}
.mode-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.55), rgba(6, 182, 212, 0.4));
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid-4 { display: grid; grid-template-columns: 1.2fr 1.2fr 0.8fr 0.7fr; gap: 12px; }
.composer .field { margin-bottom: 12px; }

.editor-tabs { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.ed-tab {
  border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.03);
  color: var(--muted); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.ed-tab.active {
  color: #fff; border-color: rgba(99, 140, 255, 0.45);
  background: rgba(59, 130, 246, 0.18);
}
.editor-pane { display: none; }
.editor-pane.active { display: block; }
.html-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
}
.html-toolbar button {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line2);
  color: var(--text); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12px;
}
.html-toolbar button:hover { border-color: var(--line); }
#htmlPreview {
  width: 100%; height: 340px; border: 1px solid var(--line2); border-radius: 12px;
  background: #fff;
}
.adv { margin: 8px 0 14px; }
.adv summary {
  cursor: pointer; font-weight: 700; font-size: 13px; color: #c7d2fe; margin-bottom: 12px;
  list-style: none;
}
.adv summary::-webkit-details-marker { display: none; }
.adv h4 { margin: 4px 0 10px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.relay-fields.hidden, .direct-fields.hidden, .hidden { display: none !important; }
.checks-inline { display: flex; flex-direction: column; gap: 8px; justify-content: end; }
.file-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.actions {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
  padding-top: 6px;
}

.result-box {
  border-radius: 14px; padding: 16px; min-height: 120px;
  border: 1px solid var(--line2); background: rgba(0, 0, 0, 0.28); margin-bottom: 14px;
}
.result-box .result-status {
  font-family: var(--display); letter-spacing: 1px; font-size: 14px; margin-bottom: 8px;
}
.result-box.idle .result-status { color: var(--muted); }
.result-box.ok {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.08) inset;
}
.result-box.ok .result-status { color: var(--ok); }
.result-box.bad {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.08) inset;
}
.result-box.bad .result-status { color: #f87171; }
.result-box.busy .result-status { color: #38bdf8; }
.result-detail { font-size: 13px; line-height: 1.5; word-break: break-word; }

/* ── Admin ── */
.admin-shell { padding: 14px 16px 28px; }
.stats-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px;
}
.stat-card { padding: 18px 16px; text-align: center; }
.stat-n {
  font-family: var(--display); font-size: 28px; font-weight: 800;
  background: linear-gradient(90deg, #e2e8f0, #93c5fd); -webkit-background-clip: text; color: transparent;
}
.stat-card.ok .stat-n { background: linear-gradient(90deg, #86efac, #22c55e); -webkit-background-clip: text; }
.stat-card.bad .stat-n { background: linear-gradient(90deg, #fca5a5, #ef4444); -webkit-background-clip: text; }
.stat-l { color: var(--muted); font-size: 12px; margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; }

.admin-grid { display: grid; gap: 14px; }
.panel { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-family: var(--display); font-size: 15px; letter-spacing: 1px; }
.create-user { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line2); }
.create-user h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.field-action { display: grid; }

.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line2); }
.table-wrap.tall { max-height: 520px; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px;
}
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line2); vertical-align: top;
}
.data-table th {
  background: rgba(0, 0, 0, 0.28); color: var(--muted); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; position: sticky; top: 0; z-index: 1;
}
.data-table.compact { font-size: 12px; min-width: 960px; }
.data-table.compact th, .data-table.compact td { padding: 8px 10px; }
.row-ok td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline-flex; gap: 4px; align-items: center; }
.inline-form input, .inline-form select {
  width: auto; min-width: 90px; padding: 5px 8px; font-size: 12px; border-radius: 8px;
}
.ok-dot { color: #86efac; font-weight: 600; }
.bad-dot { color: #fca5a5; font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .side-panel, .result-panel, .composer { min-height: 0; overflow-y: visible; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .brand-mini { min-width: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}


/* ═══════════════ EMAILX v2 ═══════════════ */

.ver-chip {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: #7dd3fc; background: rgba(14, 165, 233, 0.12); border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 999px; padding: 2px 8px; vertical-align: 2px;
}

/* Quick Launch tabs + preset cards */
.ql-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ql-tab {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line2); color: var(--muted);
  border-radius: 8px; padding: 5px 10px; font-size: 11.5px; cursor: pointer; transition: 0.15s;
}
.ql-tab.active {
  color: #fff; border-color: rgba(59, 130, 246, 0.6); background: rgba(59, 130, 246, 0.18);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.18);
}
.preset-grid { display: grid; gap: 9px; margin-bottom: 14px; }
.preset-card {
  position: relative; text-align: left; display: flex; gap: 11px; align-items: center;
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
  background: linear-gradient(150deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02));
  border: 1px solid var(--line2); color: var(--text);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
  overflow: hidden;
}
.preset-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120px 60px at 15% 0%, rgba(59,130,246,0.10), transparent 70%);
  opacity: 0; transition: opacity 0.2s;
}
.preset-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.55);
  background: linear-gradient(150deg, rgba(59,130,246,0.16), rgba(255,255,255,0.03));
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 18px rgba(59,130,246,0.14);
}
.preset-card:hover::after { opacity: 1; }
.preset-card:active { transform: translateY(0); }
.pc-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: 0.4px;
  font-family: var(--display); color: #fff;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), 0 4px 12px rgba(59,130,246,0.35);
  position: relative; z-index: 1;
}
.preset-card[data-brand="microsoft"] .pc-ico { background: linear-gradient(135deg, #0078d4, #00bcf2); box-shadow: 0 4px 12px rgba(0,120,212,0.4); }
.preset-card[data-brand="dhl"] .pc-ico { background: linear-gradient(135deg, #d40511, #ff5f00); box-shadow: 0 4px 12px rgba(212,5,17,0.4); }
.preset-card[data-brand="proton"] .pc-ico { background: linear-gradient(135deg, #6d4aff, #8b5cf6); box-shadow: 0 4px 12px rgba(109,74,255,0.4); }
.preset-card[data-brand="gmail"] .pc-ico { background: linear-gradient(135deg, #ea4335, #fbbc05); box-shadow: 0 4px 12px rgba(234,67,53,0.4); }
.preset-card[data-brand="official"] .pc-ico { background: linear-gradient(135deg, #10b981, #14b8a6); box-shadow: 0 4px 12px rgba(16,185,129,0.4); }
.preset-card[data-brand="custom"] .pc-ico { background: linear-gradient(135deg, #64748b, #94a3b8); box-shadow: 0 4px 12px rgba(100,116,139,0.35); }
.pc-body { flex: 1; min-width: 0; display: grid; gap: 2px; position: relative; z-index: 1; }
.pc-name { font-weight: 650; font-size: 12.8px; letter-spacing: 0.1px; }
.pc-desc { font-size: 10.8px; color: var(--muted); line-height: 1.35; }
.pc-meta {
  font-size: 9.5px; letter-spacing: 0.7px; text-transform: uppercase; color: #93c5fd;
  margin-top: 1px;
}
.pc-badge {
  justify-self: start; font-size: 8.5px; font-weight: 800; letter-spacing: 0.8px;
  color: #fde68a; background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245,158,11,0.4);
  border-radius: 999px; padding: 1px 7px; margin-top: 3px;
}
.pc-go {
  position: relative; z-index: 1; color: var(--muted); font-size: 17px; font-weight: 400;
  transition: color 0.15s, transform 0.15s;
}
.preset-card:hover .pc-go { color: #93c5fd; transform: translateX(2px); }
.small { font-size: 11px; }

/* Live probe / send status widgets */
.dns-probe { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.probe-spin {
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid rgba(59,130,246,0.25); border-top-color: #60a5fa;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.probe-txt { font-size: 12px; color: var(--muted); }
.probe-elapsed { color: #93c5fd; font-variant-numeric: tabular-nums; }
.send-phase { color: #cbd5e1; font-size: 13px; }
.send-elapsed {
  display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700;
  color: #93c5fd; font-variant-numeric: tabular-nums;
  background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3);
  border-radius: 999px; padding: 2px 10px;
}

/* Phish link flow */
.phish-box { margin-bottom: 14px; }
.phish-box .field-row { display: flex; gap: 8px; }
.phish-box input { flex: 1; }
.phish-hint { font-size: 11px; margin-top: 6px; line-height: 1.4; min-height: 30px; }

/* Domain Intel cards */
.intel-cards { display: grid; gap: 8px; margin-top: 10px; }
.intel-empty { font-size: 12px; line-height: 1.5; padding: 6px 2px; }
.ap-card {
  border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
}
.ap-card.pass { border-color: rgba(34, 197, 94, 0.35); }
.ap-card.warn { border-color: rgba(245, 158, 11, 0.35); }
.ap-card.fail { border-color: rgba(239, 68, 68, 0.4); }
.ap-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-ico {
  font-family: var(--display); font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  color: #93c5fd; background: rgba(59, 130, 246, 0.12); border-radius: 6px; padding: 3px 6px;
}
.ap-label { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; }
.ap-status { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.ap-pass { color: #4ade80; }
.ap-warn { color: #fbbf24; }
.ap-fail { color: #f87171; }
.ap-info { color: var(--muted); }
.ap-rec { margin-top: 8px; }
.ap-rec code {
  display: block; font-family: var(--mono); font-size: 10.5px; color: #cbd5e1; word-break: break-all;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 9px; line-height: 1.5;
}
.ap-explain { margin-top: 7px; font-size: 11px; color: #a5b4cd; line-height: 1.5; }
.ap-risk {
  border: 1px solid rgba(139, 92, 246, 0.45); border-radius: 10px; padding: 10px 12px;
  background: rgba(139, 92, 246, 0.08); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ap-risk-chip { font-size: 12px; font-weight: 800; letter-spacing: 0.8px; }
.ap-risk-score { font-size: 11px; color: #c4b5fd; font-weight: 600; }
.ap-risk .ap-explain { width: 100%; }
.ap-notes { margin-top: 6px; font-size: 11px; }
.ap-meta { margin-top: 4px; font-size: 10px; text-align: right; }

/* Verdict chips */
.vd {
  display: inline-block; border-radius: 6px; padding: 2px 7px; font-size: 10px;
  font-weight: 800; letter-spacing: 0.8px;
}
.vd-pass { color: #4ade80; background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35); }
.vd-warn { color: #fbbf24; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); }
.vd-bad { color: #f87171; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); }

/* Pipeline stepper */
.pipeline { display: grid; gap: 6px; margin-bottom: 14px; }
.pipe-empty { font-size: 12px; padding: 4px 2px; }
.pipe-step {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line2);
  border-radius: 10px; padding: 8px 11px; background: rgba(0, 0, 0, 0.25);
}
.pipe-ico { font-size: 14px; width: 22px; text-align: center; }
.pipe-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pipe-label { font-size: 12px; font-weight: 600; }
.pipe-detail {
  font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
}
.pipe-ms { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.pipe-step.pipe-ok { border-color: rgba(34, 197, 94, 0.35); }
.pipe-step.pipe-ok .pipe-ico { color: #4ade80; }
.pipe-step.pipe-warn { border-color: rgba(245, 158, 11, 0.4); }
.pipe-step.pipe-warn .pipe-ico { color: #fbbf24; }
.pipe-step.pipe-fail { border-color: rgba(239, 68, 68, 0.45); }
.pipe-step.pipe-fail .pipe-ico { color: #f87171; }

/* Result extras */
.result-box.warn { border-color: rgba(245, 158, 11, 0.4); box-shadow: 0 0 30px rgba(245, 158, 11, 0.08) inset; }
.result-box.warn .result-status { color: #fbbf24; }
.result-meta { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.result-meta b { color: #cbd5e1; }
.btn.busy { opacity: 0.6; pointer-events: none; }

/* Log mini v2 */
.log-item { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; background: rgba(0, 0, 0, 0.2); }
.log-line { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.log-line b { font-size: 12px; }
.log-flag { font-size: 9px; font-weight: 800; border-radius: 5px; padding: 1px 5px; letter-spacing: 0.5px; }
.log-flag.ok { color: #4ade80; background: rgba(34, 197, 94, 0.12); }
.log-flag.bad { color: #f87171; background: rgba(239, 68, 68, 0.12); }

/* Help modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px;
}
.modal {
  max-width: 720px; width: 100%; max-height: 84vh; overflow: auto; border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.35);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line2);
}
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: 0.5px; }
.modal-body { padding: 18px 20px; }
.modal-body h3 { font-size: 13px; margin: 18px 0 8px; letter-spacing: 0.4px; color: #93c5fd; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p, .modal-body td { font-size: 12.5px; line-height: 1.55; color: #c3cde4; }
.modal-body code {
  font-family: var(--mono); font-size: 11px; color: #7dd3fc;
  background: rgba(14, 165, 233, 0.08); border-radius: 4px; padding: 1px 5px;
}
.help-table { border-collapse: collapse; width: 100%; }
.help-table td { border-bottom: 1px solid var(--line2); padding: 7px 4px; vertical-align: top; }
.help-table td:first-child { width: 130px; }

/* WYSIWYG (TinyMCE) skin integration */
.tox-tinymce { border-radius: 12px !important; border-color: var(--line2) !important; }
.tox .tox-toolbar__group { border: none !important; }
.tox-tinymce .tox-statusbar { background: rgba(0, 0, 0, 0.35) !important; }
.tox .tox-edit-area__iframe { background: #ffffff; }



/* Custom scrollbars — v2.1 */
.side-panel::-webkit-scrollbar, .result-panel::-webkit-scrollbar, .composer::-webkit-scrollbar,
.code-block::-webkit-scrollbar, .log-mini::-webkit-scrollbar, .modal::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar, .intel-cards::-webkit-scrollbar {
  width: 10px; height: 10px;
}
.side-panel::-webkit-scrollbar-track, .result-panel::-webkit-scrollbar-track, .composer::-webkit-scrollbar-track,
.code-block::-webkit-scrollbar-track, .log-mini::-webkit-scrollbar-track, .modal::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track, .intel-cards::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03); border-radius: 999px;
}
.side-panel::-webkit-scrollbar-thumb, .result-panel::-webkit-scrollbar-thumb, .composer::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb, .log-mini::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb, .intel-cards::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.45), rgba(124, 58, 237, 0.45));
  border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
.side-panel::-webkit-scrollbar-thumb:hover, .result-panel::-webkit-scrollbar-thumb:hover,
.composer::-webkit-scrollbar-thumb:hover, .code-block::-webkit-scrollbar-thumb:hover,
.log-mini::-webkit-scrollbar-thumb:hover, .modal::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover, .intel-cards::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.75), rgba(124, 58, 237, 0.75));
  background-clip: padding-box; border: 2px solid transparent;
}
.side-panel::-webkit-scrollbar-corner, .result-panel::-webkit-scrollbar-corner,
.composer::-webkit-scrollbar-corner { background: transparent; }

/* Failure hint inside Live Result */
.result-hint {
  margin-top: 10px; padding: 9px 11px; font-size: 12px; line-height: 1.5;
  border-radius: 10px; border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08); color: #fde68a;
}
.result-hint b { color: #fff; }


/* Quick Launch carousel — one preset at a time, keeps the sidebar compact */
.preset-carousel {
  display: flex; align-items: stretch; gap: 6px; margin-bottom: 4px;
}
.preset-carousel .preset-grid { margin-bottom: 0; flex: 1; min-width: 0; align-content: center; }
.preset-nav {
  flex: 0 0 auto; width: 26px; align-self: center; height: 42px; padding: 0;
  border: 1px solid var(--line2); border-radius: 9px;
  background: rgba(255, 255, 255, 0.04); color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; transition: 0.15s;
}
.preset-nav:hover:not(:disabled) {
  color: #fff; border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.14);
}
.preset-nav:disabled { opacity: 0.28; cursor: default; }
.preset-counter {
  text-align: center; font-size: 10px; color: var(--muted); letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums; margin-bottom: 16px;
}

