/* ===== MailFlow — quiet dark surface, the landing's mood carried inside ===== */
:root {
  color-scheme: dark;
  --bg: #0a0d13; --bg-2: #0d1117; --solid: #10141b;
  --surface: rgba(255,255,255,.028); --surface-2: rgba(255,255,255,.06); --surface-3: rgba(255,255,255,.10);
  --ink: #e6e9ef; --ink-2: #a7aeba; --muted: #6b7380;
  --line: rgba(255,255,255,.075); --line-2: rgba(255,255,255,.14);
  --accent: #7aa6ee; --accent-ink: #9dbff7; --accent-deep: #2f6fdb; --accent-tint: rgba(122,166,238,.12); --accent-tint-2: rgba(122,166,238,.22);
  --sent: #d9884e;
  --good: #58b98a; --warn: #d6b062; --bad: #e57373;
  --r: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mark-bg: rgba(255,255,255,.08); --mark-fg: rgba(230,233,239,.92); --mark-dot: #d9884e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(ellipse 90% 45% at 50% -20%, rgba(91,147,236,.10), transparent 60%); background-attachment: fixed; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(122,166,238,.3); }
.foot { margin-top: auto; padding: 40px 20px; text-align: center; color: var(--muted); font-size: 11.5px; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 500; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.brand .mark { width: 24px; height: 24px; }

/* buttons — one quiet family */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); padding: 0 14px; border-radius: var(--r); cursor: pointer; text-decoration: none; font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: rgba(255,255,255,.22); }
.btn.primary { background: var(--accent-deep); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #3a7ae0; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.big { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.danger { color: var(--bad); }
.btn.busy { pointer-events: none; opacity: .7; }
.linkbtn { border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

/* landing gate (unchanged mood) */
body.landing { background-image: none; }
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body.landing .vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(10,13,19,0) 0%, rgba(10,13,19,.55) 60%, rgba(10,13,19,.95) 100%); }
.gate { position: relative; z-index: 2; min-height: calc(100vh - 80px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; }
.gate .brand { font-size: 14px; gap: 12px; }
.gate .brand .mark { width: 30px; height: 30px; }
.gate h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.12; letter-spacing: -.01em; margin: 38px 0 40px; color: #f2f4f8; text-wrap: balance; text-shadow: 0 0 40px rgba(91,147,236,.18); }
.gate-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #f2f4f8; height: 44px; padding: 0 20px; border-radius: 10px; font-size: 14.5px; }
.gate-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.28); }
.gate .fine { color: rgba(230,233,240,.42); font-size: 12px; letter-spacing: .06em; margin-top: 18px; }
.gate-foot { color: rgba(230,233,240,.22); letter-spacing: .2em; text-transform: uppercase; font-size: 10.5px; padding: 0 0 26px; margin-top: 0; position: relative; z-index: 2; }
.hero { max-width: 720px; margin: 0 auto; padding: 88px 24px 40px; position: relative; z-index: 2; }
.hero.narrow { max-width: 520px; text-align: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 38px); line-height: 1.12; letter-spacing: -.01em; margin: 28px 0 14px; text-wrap: balance; font-weight: 400; }
.lede { font-size: 16.5px; color: var(--ink-2); max-width: 600px; margin: 0 auto 28px; line-height: 1.55; }
.fine { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.notice { border-radius: var(--r); padding: 10px 14px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; }
.notice.warn { color: var(--warn); background: rgba(214,176,98,.10); }
.notice.bad { color: var(--bad); background: rgba(229,115,115,.10); }

/* ===== dashboard ===== */
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 32px; position: sticky; top: 0; z-index: 5; background: rgba(10,13,19,.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .who { margin-left: auto; display: flex; align-items: baseline; gap: 10px; line-height: 1.2; }
.topbar .name { font-size: 13px; color: var(--ink); } .topbar .upn { color: var(--muted); font-size: 12px; }
.topbar form { margin: 0; }
.activity { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); max-width: 46vw; }
.activity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.activity .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: breathe 2.4s ease-in-out infinite; flex: none; }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.dash-main { max-width: 880px; width: 100%; margin: 0 auto; padding: 24px 32px 64px; animation: appear .35s ease both; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.card { padding: 44px 0 46px; border-bottom: 1px solid var(--line); }
.card:last-child { border-bottom: 0; }
.card-head { display: grid; grid-template-columns: 96px 1fr; gap: 0 24px; align-items: baseline; margin-bottom: 18px; }
.card-head .step { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.card-head .step::after { content: ""; display: inline-block; flex: none; width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.card.running .step::after { background: var(--accent); animation: breathe 2.4s ease-in-out infinite; }
.card.done .step::after { content: "✓"; width: auto; height: auto; color: var(--good); font-size: 11px; }
.card-head h2 { margin: 0; font-family: var(--serif); font-size: 28px; letter-spacing: -.005em; font-weight: 400; line-height: 1.15; color: #f0f2f6; }
.card-head .sub { grid-column: 2; margin: 6px 0 0; color: var(--ink-2); font-size: 14px; max-width: 620px; }
.card-body { padding-left: 120px; }
@media (max-width: 720px) { .card-head { grid-template-columns: 1fr; } .card-head .step { margin-bottom: 6px; } .card-head .sub { grid-column: 1; } .card-body { padding-left: 0; } .topbar { padding: 12px 20px; } .dash-main { padding: 16px 20px 48px; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.controls { margin-top: 18px; }
.field { display: inline-flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.field input, .field select { height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; color: var(--ink); min-width: 160px; font-size: 13.5px; letter-spacing: 0; text-transform: none; }
.field select option { background: var(--solid); }
.field input:focus, .field select:focus, .search input:focus, .domain input:focus { outline: none; border-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; }
.check input { accent-color: var(--accent-deep); width: 15px; height: 15px; }
.hint { color: var(--muted); font-size: 12.5px; }
.statusline { font-size: 15px; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; font-variant-numeric: tabular-nums; }
.statusline strong { color: var(--ink); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.statusline .sep { color: var(--line-2); }

/* pills — text-first, no fills */
.pill { font-size: 11.5px; padding: 0; border-radius: 0; white-space: nowrap; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pill::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; }
.pill.ok { color: var(--good); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.run { color: var(--accent); }

/* progress — one thin line, one sentence */
.progress { margin-top: 20px; }
.progress .ph { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.progress .ph .state { font-weight: 600; color: var(--ink); }
.progress .ph .state.done { color: var(--good); } .progress .ph .state.error { color: var(--bad); } .progress .ph .state.cancelled { color: var(--warn); }
.progress .ph .detail { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.progress .ph .cancel { margin-left: auto; }
.progress .spinner { display: none; }
.bar { height: 2px; background: var(--surface-3); border-radius: 1px; overflow: hidden; margin: 12px 0 8px; position: relative; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .6s linear; }
.bar.indet i { width: 30% !important; animation: slide 1.6s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.progress .task { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.progress .task .count { color: var(--ink); font-weight: 600; }
.progress .task .pct { color: var(--muted); margin-left: 8px; }
.progress .log { margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); max-height: 96px; overflow: auto; line-height: 1.6; }
.progress .log li.warn { color: var(--warn); } .progress .log li.error { color: var(--bad); } .progress .log li.ok { color: var(--good); }
.progress .result { margin-top: 10px; color: var(--ink-2); font-size: 13.5px; }
.progress .result .ok { color: var(--good); } .progress .result .warn { color: var(--warn); }

/* coverage — a line of text, details on request */
.coverage { margin-top: 22px; }
.cov-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cov-text { color: var(--ink-2); font-size: 13.5px; flex: 1 1 320px; }
.cov-actions { display: inline-flex; gap: 2px; margin-left: auto; }
.cov-details { margin-top: 8px; }
.cov-details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none; }
.cov-details summary::before { content: "▸ "; } .cov-details[open] summary::before { content: "▾ "; }
.cov-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.cov-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cov-table td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.cov-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cov-table td.ok { color: var(--good); } .cov-table td.bad { color: var(--bad); font-weight: 600; }
.cov-table tr.zero td { color: var(--muted); }

/* people */
.search { position: relative; flex: 1; min-width: 240px; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; font-size: 13.5px; color: var(--ink); }
.search input::placeholder, .domain input::placeholder { color: var(--muted); }
.search svg { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 2; pointer-events: none; }
.domain { display: flex; gap: 6px; margin: 0; }
.domain input { height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; width: 190px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ink); }
.table-wrap { margin-top: 16px; max-height: 460px; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
table.people { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.people th { position: sticky; top: 0; background: var(--bg); text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.people td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.people tr:last-child td { border-bottom: 0; }
table.people tr:hover td { background: var(--surface); }
table.people tr.on td { background: var(--accent-tint); }
table.people tr.on td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
table.people .num { text-align: right; font-variant-numeric: tabular-nums; }
table.people td.addr { color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
table.people td.range { color: var(--muted); white-space: nowrap; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.people td.empty { text-align: center; color: var(--muted); padding: 32px; }
table.people input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent-deep); }
table.people label { display: block; cursor: pointer; }
table.people tr.grp td { background: var(--bg); color: var(--muted); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; padding: 8px; border-top: 1px solid var(--line); }
table.people tr.pinned td { background: var(--accent-tint); }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; min-height: 32px; align-items: center; }
.chips .empty { color: var(--muted); font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); border: 1px solid var(--line-2); border-radius: 999px; height: 30px; padding: 0 6px 0 12px; font-size: 13px; max-width: 320px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: var(--muted); }
.chip button { border: 0; background: transparent; color: var(--muted); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 12px; line-height: 1; }
.chip button:hover { color: var(--ink); background: var(--surface-2); }
.chip.domain { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* recent */
.recent { margin-top: 26px; }
.recent h3 { margin: 0 0 6px; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .16em; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; }
.recent li { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.recent li .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent li .m { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recent li a.btn { margin-left: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #e6e9ef; color: #0a0d13; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 50; }
@media (max-width: 640px) { .topbar .who { display: none; } }
