/* Email Verifier — internal operations UI
   Design tokens, layout primitives, and components. Desktop-first, responsive to mobile. */

:root {
  /* Surfaces: a neutral very light page ground, white working surfaces. */
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-sunken: #fafbfc;
  --surface-header: #f7f8f9;

  /* Borders: soft on the outside, softer still between nested rows. */
  --border: #e6e8ec;
  --border-subtle: #eef0f3;
  --border-strong: #d2d7de;

  --text: #14181f;
  --text-muted: #5c6470;
  --text-subtle: #8e97a3;

  --accent: #2b5cd9;
  --accent-hover: #2049b0;
  --accent-soft: #eef2fd;
  --focus: #a9c2f4;

  --ok-fg: #0a7047;
  --ok-bg: #e8f6ef;
  --ok-dot: #12a373;
  --bad-fg: #b3261e;
  --bad-bg: #fdeeec;
  --bad-dot: #d9453d;
  --warn-fg: #8a5300;
  --warn-bg: #fdf4e6;
  --warn-dot: #d98216;
  --neutral-fg: #3f4854;
  --neutral-bg: #eef0f3;
  --neutral-dot: #98a1ad;
  --info-fg: #5b3fa6;
  --info-bg: #f3eefb;

  /* Restrained radius system: 8px containers, 6px controls. */
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(18, 26, 38, .04), 0 1px 1px rgba(18, 26, 38, .03);
  --shadow-pop: 0 10px 28px rgba(18, 26, 38, .16);

  --control-h: 32px;
  --control-h-sm: 28px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --page-max: 1376px;
  --page-pad: 28px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

a { color: var(--accent); }

/* ---------- Top header ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -.012em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  display: grid;
  place-items: center;
}

.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px var(--page-pad) 72px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Section order: browse view keeps recent jobs directly under the upload card;
   opening a job pushes recent jobs below the job workspace. */
#uploadPanel  { order: 1; }
#jobView      { order: 2; }
#recentPanel  { order: 3; }
#healthPanel  { order: 4; }
body[data-view="job"] #recentPanel { order: 5; }
body[data-view="job"] #healthPanel { order: 6; }

.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-head.bare { border-bottom: 0; }

.panel-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--text);
}

.panel-sub {
  color: var(--text-muted);
  font-size: 12.5px;
}

.panel-head .spacer { margin-left: auto; }

.panel-body { padding: 18px; }
.panel-body.tight { padding: 12px 18px; }
.panel-body.flush { padding: 0; }

/* Secondary containers recede: no shadow, quieter ground. */
.panel.quiet {
  background: var(--surface-sunken);
  box-shadow: none;
}

/* ---------- Buttons ---------- */

.btn {
  appearance: none;
  height: var(--control-h);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: 500 13px/1 var(--font);
  padding: 0 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.btn:hover:not(:disabled) { background: var(--surface-header); border-color: var(--border-strong); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--neutral-bg); border-color: transparent; color: var(--text); }

.btn-sm { height: var(--control-h-sm); padding: 0 10px; font-size: 12.5px; }

.btn-link { border: 0; background: none; color: var(--accent); padding: 0; height: auto; font-size: 13px; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

.btn[data-busy="1"] { position: relative; color: transparent; }
.btn[data-busy="1"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--text-muted);
  animation: spin .6s linear infinite;
}
.btn-primary[data-busy="1"]::after { color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Form controls ---------- */

.input, .select {
  height: var(--control-h);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  font: 13px var(--font);
  color: var(--text);
  min-width: 0;
}
.input:focus, .select:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--accent); }
.input::placeholder { color: var(--text-subtle); }

/* Segmented filter control */
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  flex-wrap: wrap;
}
.segmented button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  background: transparent;
  height: var(--control-h-sm);
  padding: 0 12px;
  font: 500 12.5px var(--font);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--surface-header); color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.segmented .seg-count { color: var(--text-subtle); font-weight: 400; margin-left: 6px; font-variant-numeric: tabular-nums; }
.segmented button[aria-pressed="true"] .seg-count { color: var(--accent); }

/* ---------- Chips, badges, dots ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neutral-dot); flex: none; }
.dot.ok { background: var(--ok-dot); }
.dot.bad { background: var(--bad-dot); }
.dot.warn { background: var(--warn-dot); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
  background: var(--neutral-bg);
  color: var(--neutral-fg);
  white-space: nowrap;
}
.badge.valid, .badge.completed, .badge.healthy, .badge.resolved { background: var(--ok-bg); color: var(--ok-fg); }
.badge.invalid, .badge.blocked, .badge.failed, .badge.unresolved { background: var(--bad-bg); color: var(--bad-fg); }
.badge.catch_all, .badge.throttled, .badge.running, .badge.queued, .badge.waiting { background: var(--warn-bg); color: var(--warn-fg); }
.badge.unknown, .badge.cooldown { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge.disposable { background: var(--info-bg); color: var(--info-fg); }
.badge.high { background: var(--ok-bg); color: var(--ok-fg); }
.badge.medium { background: var(--warn-bg); color: var(--warn-fg); }
.badge.low { background: var(--neutral-bg); color: var(--neutral-fg); }

/* ---------- Upload ---------- */

.dropzone {
  display: block;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-title { font-weight: 600; font-size: 14px; }
.dropzone-hint { color: var(--text-muted); font-size: 12.5px; margin-top: 6px; letter-spacing: .01em; }

.file-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: 13px;
}
.file-selected .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-selected .size { color: var(--text-muted); font-size: 12.5px; }

/* Import preview summary: a plain divided row, not a nested card. */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--border-subtle);
  margin-top: 18px;
  padding-top: 4px;
}
.summary-grid div { padding: 12px 16px 12px 0; }
.summary-grid dt { color: var(--text-muted); font-size: 12px; margin: 0; }
.summary-grid dd { margin: 4px 0 0; font-size: 21px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.015em; }
.summary-grid .ready dd { color: var(--ok-fg); }

/* ---------- Job header ---------- */

.job-head { display: flex; align-items: flex-start; gap: 16px; padding: 17px 18px; flex-wrap: wrap; }
.job-ident { min-width: 0; flex: 1 1 320px; }
.job-name {
  font-size: 17.5px;
  font-weight: 650;
  letter-spacing: -.018em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.job-meta { color: var(--text-muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.job-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-subtle); }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.progress-wrap { padding: 0 18px 17px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------- Metric cards ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
}
.metric-label { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.metric-value {
  font-size: 25px;
  font-weight: 640;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.metric-note { font-size: 11.5px; color: var(--text-subtle); margin-top: 3px; }
.metric.is-valid .metric-value { color: var(--ok-fg); }
.metric.is-invalid .metric-value { color: var(--bad-fg); }
.metric.is-catch_all .metric-value { color: var(--warn-fg); }
.metric.is-disposable .metric-value { color: var(--info-fg); }

/* ---------- Needs attention ---------- */

.attention.is-active { border-color: #ecd6ad; }
.attention.is-active .panel-head { background: #fdfaf3; border-radius: var(--radius) var(--radius) 0 0; }

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.attention-item { background: var(--surface); padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attention-item span { font-size: 12.5px; color: var(--text-muted); }
.attention-item b { font-size: 17px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.attention-item.zero b { color: var(--text-subtle); font-weight: 500; }

/* Nothing actionable left: collapse to a single quiet line, hiding nothing. */
.attention.is-compact { box-shadow: none; background: var(--surface-sunken); }
.attention.is-compact .panel-body { padding: 12px 18px; }
.attention.is-compact .attention-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  background: none;
  border: 0;
  border-radius: 0;
}
.attention.is-compact .attention-item {
  background: none;
  padding: 0;
  gap: 7px;
  justify-content: flex-start;
}
.attention.is-compact .attention-item b { font-size: 13px; font-weight: 600; }
.attention.is-compact .attention-item.zero { color: var(--text-subtle); }
.attention.is-compact .attention-item.zero span { color: var(--text-subtle); }

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 0 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}
.action-row:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.action-note { font-size: 12.5px; color: var(--text-muted); }

.credits { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Downloads ---------- */

/* Downloads is a utility strip, not a primary content block: ~22% less
   vertical padding than a standard panel. */
#downloadsPanel .panel-head { padding-top: 11px; padding-bottom: 11px; }
#downloadsPanel .panel-body { padding-top: 14px; padding-bottom: 14px; }

/* A plain row inside the panel — deliberately not a card within a card. */
.download-primary {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.download-primary .label { font-weight: 600; font-size: 13.5px; font-family: var(--mono); letter-spacing: -.01em; }
.download-primary .desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.menu { position: relative; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 244px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 6px;
}
.menu-panel a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}
.menu-panel a:hover { background: var(--surface-header); }
.menu-panel a .n { color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.menu-sep { height: 1px; background: var(--border-subtle); margin: 6px 0; }
.menu-label { padding: 6px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); font-weight: 600; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; }
.table-scroll.capped { max-height: 680px; overflow-y: auto; }

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
table.data th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-header);
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
table.data tbody tr { transition: background .1s ease; }
table.data tbody tr:hover td { background: var(--surface-sunken); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .muted { color: var(--text-muted); }
table.data .nowrap { white-space: nowrap; }

.cell-email { font-weight: 550; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-clip { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.cell-mono { font-family: var(--mono); font-size: 12.5px; }

.smtp-cell { display: flex; align-items: center; gap: 10px; max-width: 420px; }
.smtp-code { font-family: var(--mono); font-size: 12.5px; color: var(--text-muted); flex: none; }
.smtp-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 12.5px; }
.smtp-more { flex: none; }
.cell-action { text-align: right; white-space: nowrap; }
table.data tbody tr:hover .smtp-more { color: var(--accent); }

/* Desktop: fixed column widths so the results table fits the container without
   horizontal scrolling. SMTP absorbs the remaining space; everything long
   truncates, with the full value still available via Details. */
@media (min-width: 1100px) {
  #resultsTable { table-layout: fixed; }
  #resultsTable .col-email { width: 20%; }
  #resultsTable .col-status { width: 104px; }
  #resultsTable .col-confidence { width: 120px; }
  #resultsTable .col-reason { width: 11%; }
  #resultsTable .col-domain { width: 11%; }
  #resultsTable .col-mx { width: 13%; }
  #resultsTable .col-smtp { width: auto; }
  #resultsTable .col-details { width: 92px; }
  #resultsTable td { overflow: hidden; }
  #resultsTable .cell-email,
  #resultsTable .cell-clip,
  #resultsTable .smtp-cell { max-width: 100%; }
}

tr.detail-row td { background: var(--surface-sunken); padding: 0 14px 14px; }
tr.detail-row:hover td { background: var(--surface-sunken); }
.detail-box { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface); padding: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 24px; }
.detail-grid dt { font-size: 11.5px; color: var(--text-muted); }
.detail-grid dd { margin: 3px 0 0; font-size: 12.5px; word-break: break-word; }
.detail-raw {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.table-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.table-foot .spacer { margin-left: auto; }
.pager { display: flex; align-items: center; gap: 8px; }

/* ---------- Provider health ---------- */

.health-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.health-counts { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; }
.health-counts .sep { color: var(--border-strong); }
.health-counts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.health-counts .issue b { color: var(--warn-fg); }

.canary-line { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

/* ---------- Empty states ---------- */

.empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.empty-title { font-weight: 600; color: var(--text); font-size: 13.5px; }
.empty-hint { font-size: 12.5px; margin-top: 5px; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(400px, calc(100vw - 44px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--neutral-dot);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  padding: 12px 14px;
  font-size: 13px;
  animation: toast-in .16s ease-out;
}
.toast.ok { border-left-color: var(--ok-dot); }
.toast.error { border-left-color: var(--bad-dot); }
.toast.info { border-left-color: var(--accent); }
.toast .toast-body { flex: 1; min-width: 0; word-break: break-word; }
.toast .toast-title { font-weight: 600; }
.toast .toast-text { color: var(--text-muted); margin-top: 3px; }
.toast button { border: 0; background: none; color: var(--text-subtle); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Dialog ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(18, 26, 38, .36);
  display: grid;
  place-items: center;
  padding: 20px;
}
.dialog {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  width: min(468px, 100%);
  overflow: hidden;
}
.dialog h2 { font-size: 15.5px; padding: 17px 20px 0; letter-spacing: -.01em; }
.dialog .dialog-body { padding: 10px 20px 18px; font-size: 13.5px; color: var(--text-muted); }
.dialog .dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--border-subtle); background: var(--surface-sunken); }

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* ---------- Responsive ---------- */

@media (max-width: 1099px) {
  :root { --page-pad: 20px; }
  .metrics { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
  .cell-email { max-width: 260px; }
  .smtp-cell { max-width: 320px; }
}

@media (max-width: 900px) {
  :root { --page-pad: 16px; }
  .job-actions { width: 100%; }
  .cell-email { max-width: 220px; }
  .cell-clip { max-width: 180px; }
}

@media (max-width: 640px) {
  .topbar-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .topbar-meta { margin-left: 0; width: 100%; justify-content: flex-start; }
  .container { padding-top: 16px; gap: 14px; }
  .panel-head { padding: 13px 14px; }
  .panel-body { padding: 14px; }
  .panel-body.tight { padding: 11px 14px; }
  .job-head { padding: 15px 14px; }
  .progress-wrap { padding: 0 14px 15px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-value { font-size: 21px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-row > .btn, .job-actions > .btn { flex: 1 1 auto; }
  .download-primary { align-items: stretch; flex-direction: column; gap: 12px; }
  .download-primary .btn { width: 100%; }
  .table-scroll.capped { max-height: 480px; }
  .table-foot { padding: 11px 14px; }
  .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .segmented { width: 100%; }
  .segmented button { flex: 1 1 auto; }
  .attention.is-compact .attention-grid { gap: 6px 16px; }
}
