/* ListSweep by DigitalPatron: monochrome with the logo orange as the single accent.
   App-shell layout: fixed sidebar, a workspace that scrolls on its own. */
:root {
  --bg: #f0f0ed;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --ink: #141414;
  --muted: #62625d;
  --line: #e4e4e0;
  --line-strong: #cfcfca;
  --accent: #f26b1d;          /* ink text on it is 6:1; as a line on white it is 3:1 */
  --ok: #2f7d4f;
  --bad: #b3372e;
  --ring: #8a8a84;            /* "unknown" and "needs a look": a neutral hollow ring */
  --radius: 8px;
  --side: 224px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Background: a still dot grid, a soft pool of light that wanders very slowly, and a single sweep
   line that runs only while a check is in progress. Transform-only, so nothing repaints. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(circle, rgba(20, 20, 20, 0.2) 1px, transparent 1.4px);
  background-size: 22px 22px;
}
body::after {
  content: "";
  position: fixed;
  top: -20vmax; left: -20vmax;
  width: 80vmax; height: 80vmax;
  z-index: -1;
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0.85) 25%, rgba(255, 255, 255, 0) 62%);
  animation: light-drift 90s ease-in-out infinite alternate;
  will-change: transform;
  pointer-events: none;
}
.sweep {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 2px;
  z-index: 50;
  background: var(--accent);
  opacity: 0;
  transform: translate3d(0, -4px, 0);
  pointer-events: none;
}
body.busy .sweep { opacity: 0.85; animation: sweep 2.4s ease-in-out infinite; }
@keyframes light-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(70vw, 40vh, 0); }
}
@keyframes sweep {
  from { transform: translate3d(0, -4px, 0); }
  to   { transform: translate3d(0, 100vh, 0); }
}
@media (prefers-reduced-motion: reduce) {
  body::after, body.busy .sweep { animation: none; }
  body.busy .sweep { transform: none; opacity: 0.85; }
}

h1 { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
h3 { margin: 0; font-size: 13px; font-weight: 600; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
a { color: inherit; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; }
.side {
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--line);
  background: rgba(246, 246, 244, 0.72);
  overflow-y: auto;
}
.main { overflow-y: auto; padding: 28px clamp(20px, 3vw, 44px) 8px; scroll-behavior: smooth; }
.main > section, .main > footer { max-width: 1240px; margin-left: auto; margin-right: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 6px; }
.mark { height: 30px; width: auto; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-by { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0.01em; }

.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs button {
  position: relative; text-align: left;
  padding: 8px 12px; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font: inherit; font-weight: 500; cursor: pointer;
}
.tabs button:hover { color: var(--ink); background: rgba(20, 20, 20, 0.05); }
.tabs button[aria-selected=true] { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.tabs button[aria-selected=true]::before {
  content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.pill::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.pill.ok::before { background: var(--ok); }
.pill.pending::before { background: var(--line-strong); }

.page-head { margin-bottom: 18px; }
.lede { margin: 0; max-width: 640px; color: var(--muted); font-size: 15px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 16px; }
.notice {
  position: sticky; top: 0; z-index: 5;
  margin: 0 auto 16px; max-width: 1240px; padding: 11px 14px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--bad);
  box-shadow: 0 4px 16px rgba(20, 20, 20, 0.12);
}
.notice.info { border-left-color: var(--accent); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.note { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

/* ---------- controls ---------- */
label { display: block; font-weight: 500; }
input[type=password], input[type=text], input[type=url], input[type=search], input[type=number] {
  padding: 8px 11px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px;
}
input::placeholder { color: #767672; }
input:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible, .drop:focus-within, tr:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg, .depth { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.seg { margin-bottom: 14px; }
.seg button, .depth button {
  padding: 6px 14px; border: 0; border-radius: 5px; background: none; color: var(--muted);
  font: inherit; font-weight: 500; cursor: pointer;
}
.seg button:hover, .depth button:hover:not(:disabled) { color: var(--ink); }
.seg button.on, .depth button[aria-checked=true] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), inset 0 -2px 0 var(--accent); }
.depth button:disabled { opacity: 0.45; cursor: not-allowed; }
.depth-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-bottom: 16px; padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); border-radius: var(--radius);
}
.depth-bar .hint { flex: 1 1 320px; margin: 0; }
.opts-label { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.advanced { margin: 14px 0; font-size: 13px; }
.advanced summary { cursor: pointer; color: var(--muted); }
.num { display: block; padding-top: 8px; font-weight: 400; }
.num input { width: 72px; margin-left: 8px; }

.drop {
  position: relative; display: grid; gap: 4px; place-items: center; text-align: center;
  padding: 30px 16px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #fffaf6; }
.drop.has { border-style: solid; border-color: var(--ink); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop strong { font-weight: 600; }
.drop span { color: var(--muted); font-size: 13px; }
#sheet-url { width: 100%; margin-top: 8px; }
#start { margin-top: 4px; }

.btn {
  padding: 8px 14px; font: inherit; font-weight: 500; color: var(--ink); list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn::-webkit-details-marker { display: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { color: var(--ink); background: var(--accent); border-color: var(--accent); padding: 9px 20px; font-weight: 600; }
.btn.primary:hover { background: #ff7b2e; border-color: #ff7b2e; }
.btn.small { padding: 5px 10px; font-size: 13px; }

progress { width: 100%; height: 4px; accent-color: var(--accent); }

/* ---------- one address ---------- */
.single { display: flex; gap: 8px; }
.single input { flex: 1; min-width: 0; padding: 11px 13px; font-size: 15px; }
.single-result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.badge.big { font-size: 17px; font-weight: 600; gap: 9px; }
.badge.big::before { width: 10px; height: 10px; }
.verdict-text { margin: 6px 0 2px; }
.caveat { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; padding: 0; }
.steps li { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.steps b { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.steps b::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.steps .done b::before { background: var(--ok); }
.steps .bad b::before { background: var(--bad); }
.steps .warn b::before { background: transparent; box-shadow: inset 0 0 0 2px var(--ring); }
.steps span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0 20px; margin: 0; }
.facts dt, .facts dd { margin: 0; padding: 6px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { word-break: break-word; }
.section-title { margin: 6px 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.section-title:focus { outline: none; }

/* ---------- results ---------- */
.headline { display: grid; grid-template-columns: minmax(180px, auto) minmax(0, 1fr); gap: 8px 32px; align-items: center; }
.headline-num b { display: block; font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.headline-num span { color: var(--muted); font-size: 13px; }
.propbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.propbar i { display: block; height: 100%; }
.propbar .p-ok { background: var(--ok); }
.propbar .p-unknown { background: var(--line-strong); }
.propbar .p-bad { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.legend .ok::before { background: var(--ok); }
.legend .unknown::before { background: transparent; box-shadow: inset 0 0 0 2px var(--ring); }
.legend .bad::before { background: var(--bad); }
.legend b { color: var(--ink); font-weight: 600; }
.headline-extra { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.summary { list-style: none; margin: 0; padding: 0; }
.summary li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.summary li:last-child { border-bottom: 0; }
.summary li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transform: translateY(-1px); }
.summary li.ok::before { background: var(--ok); }
.summary li.warn::before { background: transparent; box-shadow: inset 0 0 0 2px var(--ring); }
.summary li.bad::before { background: var(--bad); }
.summary button { flex: none; margin-left: auto; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.summary button:hover { color: var(--ink); }
.stale-text { margin: 0 0 10px; }
#stale { border-left: 3px solid var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 14px; }
.toolbar h2 { margin: 0; }
.grow { flex: 1; }
.cluster { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 5px 12px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed=true] { background: var(--surface-2); color: var(--ink); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
.filter-note { margin: -4px 0 12px; color: var(--muted); font-size: 13px; }
.filter-note button { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; }
.menu { position: relative; }
.menu summary { display: block; }
.menu summary::after { content: " \25BE"; color: var(--muted); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 190px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.14);
}
.menu-pop button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 5px; background: none; text-align: left; font: inherit; cursor: pointer; }
.menu-pop button:hover { background: var(--surface-2); }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
th button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
th button:hover { color: var(--ink); }
th[aria-sort=ascending] button::after { content: " \2191"; }
th[aria-sort=descending] button::after { content: " \2193"; }
tbody tr:last-child td { border-bottom: 0; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--surface-2); }
tr.detail td { background: var(--surface-2); }
td.email { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
td.result .why { display: block; margin: 1px 0 0 15px; color: var(--muted); font-size: 12.5px; }
td.send { text-align: center; width: 1%; color: var(--muted); }
td.send.yes { color: var(--ok); font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: max-content 1fr; gap: 3px 18px; margin: 0; font-size: 13px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; word-break: break-word; }

/* Status: a small dot beside plain text. Green, a neutral hollow ring for unknown, red. */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge.deliverable_candidate::before, .badge.completed::before { background: var(--ok); }
.badge.unknown::before { background: transparent; box-shadow: inset 0 0 0 2px var(--ring); }
.badge.undeliverable::before, .badge.failed::before { background: var(--bad); }
.badge.running::before, .badge.queued::before { background: var(--accent); }
.badge.cancelled::before { background: var(--line-strong); }
.badge.big::before { width: 10px; height: 10px; }
.tag { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); font-size: 11px; }

.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.example { margin-bottom: 18px; }
.example:last-child { margin-bottom: 0; }
.example .toolbar { margin-bottom: 6px; }
pre {
  margin: 0; padding: 12px 14px; overflow-x: auto; white-space: pre;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
}
footer { padding: 18px 0 30px; color: var(--muted); font-size: 12.5px; }

/* ---------- API and agents ---------- */
.keycreate { display: flex; gap: 8px; margin: 14px 0; }
.keycreate input { flex: 1; min-width: 0; }
.reveal { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; background: var(--surface-2); }
.reveal-title { margin: 0 0 8px; font-weight: 600; }
.reveal-row { display: flex; gap: 8px; }
.reveal-row input { flex: 1; min-width: 0; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.lead-hint { margin-top: 0; }
td.keyid { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.method { padding: 18px 0 4px; border-top: 1px solid var(--line); }
.method:first-of-type { border-top: 0; padding-top: 4px; }
.method h3 { font-size: 15px; margin-bottom: 2px; }
.method h4 { margin: 16px 0 6px; font-size: 13px; }
.how { margin: 10px 0 14px; padding-left: 22px; }
.how li { margin: 4px 0; }
.method .example { margin-top: 10px; }
.method .scroll { margin-bottom: 14px; }

/* ---------- sign-in, account, admin ---------- */
body.locked .app { display: none; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 30px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(20, 20, 20, 0.08); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-card h1 { font-size: 22px; }
.login-card pre { margin: 10px 0; white-space: pre-wrap; word-break: break-all; }
.lede.small { font-size: 14px; margin-bottom: 18px; }
.login-card label, .narrow label { margin: 14px 0 6px; font-size: 13px; }
.login-card input, .narrow input { width: 100%; padding: 10px 12px; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; min-width: 0; }
.wide { width: 100%; margin-top: 18px; padding: 11px 20px; }
.form-error { margin: 12px 0 0; padding: 9px 12px; border-left: 3px solid var(--bad); background: #fdf3f2; border-radius: 4px; font-size: 13px; }
.narrow { max-width: 460px; }
.narrow .btn.primary { margin-top: 16px; }
.who { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.who-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.who-email { font-weight: 600; font-size: 13px; word-break: break-all; }
.who .tag { margin-left: 0; }
.who-actions { display: flex; gap: 14px; }
.link { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--ink); }
.peoplecreate { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.peoplecreate input[type=text] { flex: 2 1 200px; min-width: 0; }
.peoplecreate input[type=password] { flex: 2 1 180px; min-width: 0; }
select { padding: 8px 10px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
td select { padding: 4px 8px; font-size: 13px; }
.you { margin-left: 6px; }

/* ---------- narrower windows ---------- */
@media (max-width: 1100px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .headline { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .app { display: block; height: auto; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .tabs { flex-direction: row; gap: 18px; width: 100%; order: 3; }
  .tabs button { padding: 8px 2px; border-radius: 0; margin-bottom: -1px; border-bottom: 2px solid transparent; }
  .tabs button:hover { background: none; }
  .tabs button[aria-selected=true] { background: none; box-shadow: none; border-bottom-color: var(--accent); }
  .tabs button[aria-selected=true]::before { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; flex-direction: row; align-items: center; }
    .main { overflow: visible; padding: 18px 16px 8px; }
  .card { padding: 16px; }
  .single { flex-direction: column; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { border-top: 1px solid var(--line); padding-bottom: 0; }
  .facts dd { border-top: 0; padding-top: 0; }
  .depth { width: 100%; }
  .depth button { flex: 1; padding: 6px 8px; }
  .cluster { flex-wrap: wrap; }
  .notice { position: static; }
  .keycreate { flex-direction: column; }
  .reveal-row { flex-direction: column; }
  .peoplecreate { flex-direction: column; }
  .who { flex-direction: row; align-items: center; gap: 12px; border-bottom: 0; padding-bottom: 0; }
  .login-card { padding: 24px 20px; }
}
