:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e8ef;
  --accent: #2563eb;
  --accent-soft: #eaf1fe;
  --accent-text: #ffffff;
  --valid: #16a34a;      --valid-soft: #e9f8ee;
  --invalid: #dc2626;    --invalid-soft: #fdecec;
  --catch_all: #d97706;  --catch_all-soft: #fdf3e3;
  --unknown: #64748b;    --unknown-soft: #eef1f5;
  --do_not_mail: #7c3aed;--do_not_mail-soft: #f2ecfd;
  --warn-bg: #fff7e6; --warn-text: #8a5a00;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117; --surface: #161b24; --surface-2: #1b2130; --text: #e7eaf0; --muted: #98a2b3; --border: #262e3d;
    --accent: #5b8cff; --accent-soft: #1b2a4a;
    --valid-soft: #10291a; --invalid-soft: #2f1416; --catch_all-soft: #2e220f; --unknown-soft: #1e2430; --do_not_mail-soft: #241a3a;
    --warn-bg: #33270d; --warn-text: #f5d28a; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--invalid); }
code, pre { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
a { color: var(--accent); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 0 8px; }
.logo.big { font-size: 20px; padding: 0; justify-content: center; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 16px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav button { display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 500; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
nav button svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
nav button:hover { background: var(--surface-2); color: var(--text); }
nav button.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.usage-pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.usage-pill span { display: block; font-size: 18px; font-weight: 700; color: var(--text); }
main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.page-head { margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 10px; }
  nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; }
  nav button { padding: 8px 10px; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .usage-pill { display: none; }
  main { padding: 18px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; resize: vertical; }
.input-row { display: flex; gap: 8px; margin: 10px 0; }
.input-row.wrap { flex-wrap: wrap; }
.input-row input[type=text], .input-row input:not([type]), #verifyEmail, #keyName { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input, .field select { color: var(--text); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.seg button { font: inherit; font-size: 12.5px; font-weight: 500; border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.link { text-decoration: none; font-weight: 500; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1.5px dashed var(--border); border-radius: 10px; padding: 22px 14px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.drop svg { width: 26px; height: 26px; fill: var(--accent); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { color: var(--text); }
.more { margin: 12px 0; }
.more summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
@media (max-width: 600px) { .opts { grid-template-columns: 1fr; } }
.warn { background: var(--warn-bg); color: var(--warn-text); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 500; z-index: 50; }

/* ---------- status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 12.5px; background: var(--unknown-soft); color: var(--unknown); }
.pill.valid { background: var(--valid-soft); color: var(--valid); }
.pill.invalid { background: var(--invalid-soft); color: var(--invalid); }
.pill.catch_all { background: var(--catch_all-soft); color: var(--catch_all); }
.pill.do_not_mail { background: var(--do_not_mail-soft); color: var(--do_not_mail); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); display: inline-block; flex: none; }
.dot.valid { background: var(--valid); } .dot.invalid { background: var(--invalid); } .dot.catch_all { background: var(--catch_all); } .dot.do_not_mail { background: var(--do_not_mail); }

/* ---------- result card ---------- */
.result { margin-top: 0; }
.result-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.result-email { font-size: 18px; font-weight: 600; word-break: break-all; }
.result-status { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.big-status { font-size: 15px; padding: 7px 16px; }
.score-ring { width: 54px; height: 54px; }
.verdict { margin: -6px 0 18px; padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.verdict.valid { background: var(--valid-soft); color: var(--valid); }
.verdict.invalid { background: var(--invalid-soft); color: var(--invalid); }
.verdict.catch_all { background: var(--catch_all-soft); color: var(--catch_all); }
.verdict.unknown { background: var(--unknown-soft); color: var(--unknown); }
.verdict.do_not_mail { background: var(--do_not_mail-soft); color: var(--do_not_mail); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; min-width: 0; }
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tile .v { margin-top: 3px; font-weight: 600; overflow-wrap: anywhere; }
.tile .v.none { color: var(--muted); font-weight: 500; }
.tile.yes .v { color: var(--valid); } .tile.bad .v { color: var(--invalid); } .tile.warnv .v { color: var(--catch_all); }
.tile.wide { grid-column: 1 / -1; }
.tile.wide .v { font-weight: 400; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.section-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px; }
.meter { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.meter > div { height: 100%; border-radius: 4px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--muted); }
.health { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.breakdown { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 10px; }
.brow { display: grid; grid-template-columns: 110px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.brow .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; }
.bars div { flex: 1; background: var(--accent); opacity: .85; border-radius: 4px 4px 0 0; min-height: 3px; position: relative; }
.bars div:hover { opacity: 1; }
.bars div:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 3px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; z-index: 2; }
.engine { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

/* ---------- lists ---------- */
.job { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.job-top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.job-title { font-weight: 600; font-size: 15px; }
.job-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 14px 0 6px; }
.progress > div { height: 100%; background: var(--accent); transition: width .4s; }
.stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 14px 0 6px; background: var(--border); }
.stack > div { height: 100%; }
.counts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; margin-top: 8px; }
.counts span { display: inline-flex; align-items: center; gap: 6px; }
.counts b { font-variant-numeric: tabular-nums; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; z-index: 10; min-width: 250px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.menu-list a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; color: var(--text); text-decoration: none; border-radius: 6px; font-size: 13px; }
.menu-list a:hover { background: var(--surface-2); }
.menu-list a span { color: var(--muted); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- finder ---------- */
.finder-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (max-width: 600px) { .finder-fields { grid-template-columns: 1fr; } }
.found-email { font-size: 22px; font-weight: 700; word-break: break-all; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.copy { font-size: 12px; }
.alt-list { display: flex; flex-wrap: wrap; gap: 6px; }
.alt-list code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-card .field { text-align: left; }

/* ---------- docs ---------- */
.docs h3 { font-size: 13px; margin: 18px 0 6px; }
.docs pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; margin: 0; }
.legend { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; align-items: start; }
.ok { color: var(--valid); font-weight: 600; } .bad { color: var(--invalid); font-weight: 600; }
