/* Carrier Login Manager. Modern, light, human. Built around the daily journey:
   find a login, copy the credentials, open the carrier site, add/edit, clean up.
   Higginbotham navy/coral live here as accents, not a rigid cage. */

:root {
  /* Brand anchors, used with restraint */
  --navy: #0d3b63;
  --navy-deep: #0a2e4d;
  --coral: #f0553f;
  --coral-strong: #dc4630;
  --coral-soft: #fdece9;

  /* Neutral foundation */
  --bg: #f4f6f9;
  --bg-tint: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #16202e;
  --ink-2: #47546a;
  --muted: #5f6b82;   /* 5.4:1 on white, 4.8:1 on --bg-tint: small labels stay readable */
  --faint: #9aa5b8;
  --line: #e7ebf1;
  --line-strong: #d6dbe4;

  /* Semantic (tinted, not saturated) */
  --ok: #0f9d63;
  --ok-bg: #e6f6ee;
  --warn: #b9750c;
  --warn-bg: #fbf0dc;
  --danger: #d6472e;
  --danger-bg: #fceae6;
  --info: #2f74c9;
  --info-bg: #e9f1fb;
  --brand-tint: #e9f0f8;
  /* Text on the tinted badge backgrounds: the same hues, deep enough for 4.5:1 */
  --ok-text: #0b7a4b;
  --warn-text: #945c0a;
  --info-text: #2866ad;
  --coral-text: #b83a26;

  /* Radius */
  --r-xs: 7px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(16,32,50,.06), 0 1px 1px rgba(16,32,50,.05);
  --sh-2: 0 1px 3px rgba(16,32,50,.07), 0 8px 20px -8px rgba(16,32,50,.16);
  --sh-3: 0 20px 48px -16px rgba(16,32,50,.30);
  --ring: 0 0 0 3px rgba(47,116,201,.30);
  --ring-coral: 0 0 0 3px rgba(240,85,63,.28);

  /* Type */
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, "Consolas", monospace;

  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: rgba(240,85,63,.18); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 9px 15px; font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; background: var(--surface); color: var(--ink);
  line-height: 1.1; text-align: center; white-space: nowrap;
  box-shadow: var(--sh-1);
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .06s var(--ease), color .15s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--coral); color: #fff; border-color: transparent; box-shadow: 0 1px 2px rgba(220,70,48,.35), 0 8px 18px -8px rgba(220,70,48,.55); }
.btn-primary:hover { background: var(--coral-strong); border-color: transparent; }
.btn-navy { background: var(--navy); color: #fff; border-color: transparent; box-shadow: 0 1px 2px rgba(13,59,99,.30), 0 8px 18px -8px rgba(13,59,99,.5); }
.btn-navy:hover { background: var(--navy-deep); }
.btn-secondary { background: var(--surface); color: var(--navy); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--brand-tint); border-color: var(--navy); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg-tint); color: var(--ink); }
.btn-ghost-light { background: rgba(255,255,255,0.10); color: #fff; border-color: rgba(255,255,255,0.28); box-shadow: none; }
.btn-ghost-light:hover { background: rgba(255,255,255,0.20); border-color: rgba(255,255,255,0.5); }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: #c23e26; }
.btn-block { width: 100%; padding: 12px; font-size: 14px; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: var(--r-xs); }
.btn-lg { padding: 12px 22px; font-size: 15px; }
a.btn { text-decoration: none; }
a.btn:hover { text-decoration: none; }

/* Segmented control: a row of options where one is pressed (Activity date presets,
   Employee Access modes). Quiet track, the pressed option lifts to a white pill. */
.segmented { display: inline-flex; align-items: center; gap: 2px; padding: 4px; background: var(--bg-tint); border-radius: var(--r-pill); max-width: 100%; }
.segmented .btn { border-radius: var(--r-pill); border-color: transparent; box-shadow: none; background: transparent; color: var(--ink-2); padding: 7px 14px; min-height: 0; }
.segmented .btn:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.segmented .btn[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: var(--sh-1); }

/* ---------- Login / gate ---------- */
.login {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #12456f 0%, var(--navy-deep) 55%, #071f34 100%);
  padding: 24px;
}
.login-card {
  background: var(--surface); border-radius: var(--r-lg);
  width: 100%; max-width: 400px; padding: 38px 34px;
  box-shadow: var(--sh-3);
}
.login-logo { width: 210px; max-width: 100%; display: block; margin: 0 auto 22px; }
.login-title { font-size: 22px; text-align: center; }
.login-sub { text-align: center; color: var(--muted); margin: 8px 0 24px; font-size: 14px; line-height: 1.5; }
.login-foot { color: rgba(255,255,255,0.72); font-size: 12px; margin-top: 22px; }

/* ---------- Fields ---------- */
.field { display: block; margin-bottom: 16px; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input[type=search] { appearance: none; -webkit-appearance: none; }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 68px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--info); box-shadow: var(--ring); }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2377839a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.req-star { color: var(--coral); }
.form-error {
  background: var(--danger-bg); border: 1px solid #f4c8bd; border-radius: var(--r-sm);
  color: #8f3320; padding: 11px 13px; font-size: 13px; margin-bottom: 14px;
}
.form-error ul { margin: 6px 0 0; padding-left: 18px; }
.valid-ok { color: var(--ok); }

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px; height: 62px; box-shadow: 0 1px 0 rgba(16,32,50,.06);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { height: 26px; display: block; }
.brand-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.24); flex: none; }
.brand-app { font-weight: 600; letter-spacing: -0.01em; font-size: 15px; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }

/* SANDBOX tag */
.sandbox-tag {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,0.20); border-radius: var(--r-pill);
  background: rgba(255,255,255,0.08); padding: 5px 12px 5px 10px; line-height: 1;
}
.sandbox-ic { width: 16px; height: 16px; color: #ffd7cf; flex: none; }
.sandbox-txt { display: flex; align-items: baseline; gap: 6px; }
.sandbox-a { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #fff; }
.sandbox-b { font-size: 10.5px; color: rgba(255,255,255,0.72); }

/* User chip */
.userchip { display: flex; align-items: center; gap: 9px; }
.userchip-name { font-size: 13px; color: rgba(255,255,255,0.96); font-weight: 600; white-space: nowrap; }

/* ---------- Viewing-as dropdown ---------- */
.viewas { position: relative; }
.viewas-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.10); color: #fff;
  border: 1px solid rgba(255,255,255,0.22); border-radius: var(--r-pill);
  padding: 6px 12px; font-family: inherit; cursor: pointer; line-height: 1.1;
  transition: background .15s var(--ease);
}
.viewas-btn:hover { background: rgba(255,255,255,0.18); }
.viewas-btn.impersonating { border-color: var(--coral); background: rgba(240,85,63,0.24); }
.viewas-btn .vic { width: 15px; height: 15px; flex: none; }
.viewas-btn .vchev { width: 13px; height: 13px; flex: none; opacity: .85; }
.viewas-btn-lbl { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.viewas-btn-k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,0.68); }
.viewas-btn-v { font-size: 12.5px; font-weight: 600; color: #fff; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewas-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  min-width: 300px; max-width: 360px; box-shadow: var(--sh-3); overflow: hidden;
}
.viewas-menu-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 12px 14px 8px; }
.viewas-menu-scroll { max-height: min(420px, 60vh); overflow: auto; }
.viewas-opt {
  display: block; width: 100%; text-align: left; background: none; cursor: pointer; font-family: inherit;
  border: none; border-top: 1px solid var(--line); padding: 10px 14px; color: var(--ink);
}
.viewas-opt:hover { background: var(--surface-2); }
.viewas-opt.active { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--coral); }
.viewas-opt-name { display: block; font-weight: 600; color: var(--ink); font-size: 13px; }
.viewas-opt-meta { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.viewas-stop { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; color: var(--ink); }
.viewas-stop .vic { width: 16px; height: 16px; color: var(--coral); flex: none; }
.viewas-stop:hover { background: var(--coral-soft); }

/* ---------- Impersonation banner ---------- */
.impersonation {
  display: flex; align-items: center; gap: 13px;
  background: var(--coral-soft); border-bottom: 1px solid #f6d3cb;
  padding: 11px 22px;
}
.impersonation-ic { width: 19px; height: 19px; color: var(--coral); flex: none; }
.impersonation-txt { margin: 0; color: #7c2f1e; font-size: 13.5px; line-height: 1.45; flex: 1; }
.impersonation-txt strong { color: #6a2818; font-weight: 700; }
.impersonation .btn { flex: none; }

/* ---------- Nav ---------- */
.nav { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: stretch; padding: 0 14px; gap: 2px; overflow-x: auto; box-shadow: var(--sh-1); }
.nav-link {
  position: relative; background: none; border: none; color: var(--ink-2); font-weight: 600; font-size: 13.5px; line-height: 1;
  padding: 16px 14px 14px; cursor: pointer; font-family: inherit; white-space: nowrap; border-radius: var(--r-xs) var(--r-xs) 0 0;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2.5px; border-radius: var(--r-pill); background: transparent; transition: background .18s var(--ease); }
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.active { color: var(--coral); }
.nav-link.active::after { background: var(--coral); }
/* On a narrow screen the nav scrolls sideways; a fade marks the clipped edge (renderNav toggles the classes). */
.nav { scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.nav.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px); mask-image: linear-gradient(90deg, transparent, #000 48px); }
.nav.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }

/* ---------- View / layout ---------- */
.view { padding: 26px 24px; max-width: 1340px; margin: 0 auto; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.view-head > div { display: flex; gap: 10px; align-items: center; }
.view-title { font-size: 24px; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.count { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* ---------- Toolbar (search + filters) ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.toolbar .field { margin: 0; }
.toolbar input[type=text], .toolbar select { min-width: 160px; }
.search-wrap { flex: 1 1 240px; }
/* The filter controls sit inline on a desktop; on a phone they fold behind a Filters button (renderEntity). */
.toolbar-filters { display: contents; }
.toolbar-filters-btn { display: none; }
.filters-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.toolbar-filters-btn .ic { width: 15px; height: 15px; }

/* ---------- Stat chips (quiet, non-intrusive metric strip) ---------- */
.statstrip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.statchip {
  display: inline-flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 15px 8px 11px;
  cursor: pointer; font-family: inherit; box-shadow: var(--sh-1); color: inherit;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease);
}
.statchip:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.statchip .sc-ic { width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--brand-tint); color: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; }
.statchip .sc-ic .gl { width: 15px; height: 15px; }
.statchip.alert .sc-ic { background: var(--coral-soft); color: var(--coral); }
.statchip-num { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.statchip.alert .statchip-num { color: var(--coral); }
.statchip-lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.statchip-skel { display: inline-block; width: 42px; height: 15px; border-radius: var(--r-xs); background: var(--bg-tint); }
.statchip:disabled { cursor: default; }

/* ---------- Table ---------- */
/* Every table scrolls sideways inside its frame when it is wider than the screen; the page never does. */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: auto; box-shadow: var(--sh-1); }
.table-wrap.scroll-x { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
thead th {
  background: var(--surface-2); color: var(--ink-2);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  text-align: left; padding: 12px 15px; white-space: nowrap; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--line);
}
thead th.no-sort { cursor: default; }
thead th .arrow { color: var(--coral); margin-left: 4px; font-size: 10px; }
tbody td { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.actions { white-space: nowrap; text-align: right; }
.cell-id { color: var(--ink); font-weight: 600; white-space: nowrap; }
#users-host td { white-space: nowrap; }
.empty { padding: 44px; text-align: center; color: var(--muted); }

/* ---------- Empty / loading / error state ---------- */
.state-block { padding: 50px 24px; text-align: center; }
.state-ic { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--r-pill); background: var(--brand-tint); color: var(--navy); margin-bottom: 14px; }
.state-ic .gl { width: 26px; height: 26px; }
.state-title { color: var(--ink); font-weight: 700; font-size: 16px; margin-bottom: 5px; }
.state-sub { font-size: 13.5px; color: var(--muted); max-width: 460px; margin: 0 auto; line-height: 1.5; }
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.loading::before {
  content: ""; display: block; width: 22px; height: 22px; margin: 0 auto 12px;
  border: 2.5px solid var(--line-strong); border-top-color: var(--coral); border-radius: 50%;
  animation: clm-spin 0.7s linear infinite;
}
@keyframes clm-spin { to { transform: rotate(360deg); } }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--bg-tint); border-radius: var(--r-pill); line-height: 1.4; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-active { color: var(--ok-text); background: var(--ok-bg); }
.badge-inactive { color: var(--muted); background: var(--bg-tint); }
.badge-review { color: var(--coral-text); background: var(--coral-soft); }
.badge-ok { color: var(--ink-2); background: var(--bg-tint); }
.badge-info { color: var(--info-text); background: var(--info-bg); }
.badge-admin { color: var(--coral-text); background: var(--coral-soft); }
.badge-editor { color: var(--info-text); background: var(--info-bg); }
.badge-viewer { color: var(--ink-2); background: var(--bg-tint); }
.badge-tier-1 { color: var(--coral-text); background: var(--danger-bg); }
.badge-tier-2 { color: var(--warn-text); background: var(--warn-bg); }
.badge-tier-3 { color: var(--info-text); background: var(--info-bg); }
.badge.no-dot::before { display: none; }

/* ---------- Secret cell (mask + reveal) ---------- */
.secret { display: inline-flex; align-items: center; gap: 6px; }
.secret-val { font-family: var(--mono); letter-spacing: .5px; color: var(--ink); font-size: 13px; }
.eye { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-xs); cursor: pointer; padding: 4px 8px; font-size: 11px; line-height: 1; color: var(--ink-2); font-weight: 600; transition: border-color .15s var(--ease), color .15s var(--ease); }
.eye:hover { border-color: var(--info); color: var(--navy); }
.none { color: var(--faint); }

/* ---------- Review reason ---------- */
.review-reason { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.review-banner { margin-bottom: 16px; background: var(--coral-soft); border: 1px solid #f6d3cb; border-radius: var(--r-md); padding: 13px 15px; }
.review-banner-h { font-size: 12px; font-weight: 700; color: var(--coral); margin-bottom: 5px; }
.review-banner-body { color: #7c2f1e; font-size: 14px; line-height: 1.5; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.pager .muted { font-size: 12.5px; }
.pager-size { display: flex; align-items: center; gap: 6px; margin-right: auto; font-size: 12.5px; color: var(--muted); }
.pager-size select { min-width: auto; width: auto; padding: 6px 28px 6px 10px; font-size: 12.5px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,30,52,0.44); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; z-index: 50; animation: clm-fade .15s var(--ease); }
@keyframes clm-fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); width: 100%; max-width: 640px; border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden; animation: clm-pop .18s var(--ease); }
@keyframes clm-pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 22px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { color: var(--ink); font-size: 17px; }
.modal-x { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; transition: background .15s var(--ease), color .15s var(--ease); }
.modal-x:hover { background: var(--coral-soft); color: var(--coral); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); align-items: center; }
.modal-foot .spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.full { grid-column: 1 / -1; }
.modal.wide { max-width: 900px; }

/* ---------- Profile (drill-down) ---------- */
a.profile-link { color: var(--info); cursor: pointer; font-weight: 500; }
a.profile-link:hover { color: var(--navy); text-decoration: underline; }
tbody td > a.profile-link { white-space: nowrap; }
a.ext-link { color: var(--info); word-break: break-all; }
a.ext-link:hover { color: var(--navy); }
.profile-ref { margin-bottom: 16px; }
.profile-summary { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.profile-section { margin-bottom: 22px; }
.profile-h { font-size: 14px; margin: 0 0 10px; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.profile-h .profile-open { margin-left: auto; }
.empty-sm { color: var(--muted); font-size: 13px; padding: 4px 0; }
.profile-more { font-size: 12px; margin-top: 6px; }
.table-wrap.mini table { font-size: 13px; }
.table-wrap.mini thead th { font-size: 11px; padding: 9px 12px; cursor: default; }
.table-wrap.mini tbody td { padding: 9px 12px; white-space: nowrap; }
.table-wrap.mini tbody tr { cursor: pointer; }

/* Detail rows */
.detail-list { margin: -4px 0; }
.detail-row { display: grid; grid-template-columns: 190px 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.detail-row:last-child { border-bottom: none; }
.detail-row .label { margin: 0; padding-top: 4px; color: var(--muted); font-weight: 500; }
.detail-row .val { color: var(--ink); word-break: break-word; padding-top: 2px; }
.detail-row .row-actions { display: flex; align-items: center; }

/* Small inline icon buttons */
.btn-icon { background: none; border: 1px solid transparent; border-radius: var(--r-xs); cursor: pointer; padding: 4px 8px; font-size: 11px; line-height: 1; color: var(--muted); font-family: inherit; white-space: nowrap; font-weight: 600; transition: background .15s var(--ease), color .15s var(--ease); }
.btn-icon:hover { background: var(--bg-tint); color: var(--navy); }
.copy-text { opacity: 0; }
.detail-row:hover .copy-text { opacity: 1; }
.copy-secret { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-xs); cursor: pointer; padding: 4px 8px; font-size: 11px; line-height: 1; color: var(--ink-2); font-weight: 600; }
.copy-secret:hover { border-color: var(--info); color: var(--navy); }

/* Inline per-field editor */
.inline-edit { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.inline-edit input, .inline-edit select, .inline-edit textarea { width: 100%; }
.inline-actions { display: flex; gap: 8px; }
.inline-hint { font-size: 11.5px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 18px; font-size: 13.5px; z-index: 100; border-radius: var(--r-md); box-shadow: var(--sh-3); max-width: 90vw; display: flex; align-items: center; gap: 10px; animation: clm-toast .22s var(--ease); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.error::before { background: var(--coral); }
@keyframes clm-toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Autocomplete ---------- */
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); max-height: 260px; overflow-y: auto; z-index: 10; box-shadow: var(--sh-2); }
.ac-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: var(--brand-tint); }
.ac-item .ac-name { color: var(--ink); font-weight: 600; }
.ac-item .ac-meta { color: var(--muted); font-size: 12px; }

/* ---------- Users: role legend ---------- */
.users-hint { color: var(--muted); font-size: 13px; margin: -6px 0 16px; max-width: 720px; line-height: 1.55; }
.role-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--sh-1); min-width: 0; }
.role-card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.role-card-h .badge { font-size: 12px; padding: 4px 11px; }
.role-card-k { font-size: 12px; font-weight: 600; color: var(--muted); }
.role-card-d { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* Report tables: bounded height with sticky header */
#table-host > .table-wrap { max-height: max(360px, calc(100vh - 320px)); overflow: auto; }
#table-host > .table-wrap thead th { position: sticky; top: 0; z-index: 2; }

.combo-wrap input { min-width: 210px; }

/* Hover copy button on code cells */
.cell-code { white-space: nowrap; }
.cell-code .copy-cell { opacity: 0; margin-left: 6px; transition: opacity 0.12s; }
tr:hover .copy-cell, .copy-cell:focus, .copy-cell.always { opacity: 1; }

/* ---------- Icon buttons (copy, show/hide) ---------- */
.btn-ic {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 28px; height: 26px; padding: 0 6px; background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: var(--r-xs); cursor: pointer; font-family: inherit; vertical-align: middle;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn-ic .ic { width: 14px; height: 14px; display: block; }
.btn-ic:hover { border-color: var(--info); color: var(--navy); background: var(--brand-tint); }
.btn-ic:disabled { opacity: .5; cursor: wait; }
.btn-ic.copied { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.btn.copied { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.copied-lbl { font-size: 11px; font-weight: 600; }
.btn .ic { width: 14px; height: 14px; }
/* Open-site icon after a carrier name (lookups.carrierWebsites) */
.site-link { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 5px; color: var(--muted); opacity: .55; }
.site-link .ic { width: 13px; height: 13px; display: block; }
.site-link:hover, .site-link:focus-visible { color: var(--navy); opacity: 1; }
.cell-user { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell-user-v { color: var(--ink); }
.tag-quiet { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 9px; line-height: 1.4; }
.when { color: var(--muted); white-space: nowrap; font-size: 12.5px; cursor: default; }
.cell-when { white-space: nowrap; }
tbody tr.row-open { cursor: pointer; }
.btn-ghost-danger { color: var(--coral); border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost-danger:hover { color: var(--coral-strong); background: var(--coral-soft); }
.hint-inline { font-size: 11.5px; }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.field-hint code { font-family: var(--mono); color: var(--navy); font-size: 11.5px; }

/* ---------- Switch ---------- */
.switch-wrap { flex: none; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; height: 38px; padding: 0 4px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 38px; height: 22px; background: var(--line-strong); border-radius: var(--r-pill); flex: none; transition: background .18s var(--ease); }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: var(--sh-1); transition: transform .18s var(--ease); }
.switch input:checked + .switch-track { background: var(--coral); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-lbl { font-size: 12.5px; color: var(--ink); font-weight: 600; white-space: nowrap; }

/* ================================================================
   DASHBOARD: journey-first. Find + copy is the hero; cleanup is
   invited; stats stay quiet. (New structure in app.js.)
   ================================================================ */
.dash { display: flex; flex-direction: column; gap: 24px; }

/* Hero: find a login */
.dash-hero { background: linear-gradient(135deg, #0e3f68 0%, var(--navy-deep) 100%); border-radius: var(--r-lg); padding: 26px 28px; color: #fff; box-shadow: var(--sh-2); position: relative; overflow: hidden; }
.dash-hero-h { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.78); margin: 0 0 4px; }
.dash-hero-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 0 0 16px; }
.dash-find-row { display: flex; gap: 10px; position: relative; z-index: 1; }
.dash-find-field { flex: 1; position: relative; display: flex; align-items: center; }
.dash-find-field .dash-find-ic { position: absolute; left: 14px; color: var(--muted); display: flex; pointer-events: none; }
.dash-find-field .dash-find-ic .gl { width: 20px; height: 20px; }
.dash-find-field input[type=text] { height: 52px; font-size: 16px; padding: 0 14px 0 46px; border-radius: var(--r-md); border: none; box-shadow: var(--sh-2); }
.dash-find-field input[type=text]:focus { box-shadow: var(--sh-2), var(--ring-coral); }
.dash-find-row .btn { height: 52px; padding: 0 26px; font-size: 15px; border-radius: var(--r-md); }
.dash-find-hint { margin: 12px 0 0; font-size: 12.5px; color: rgba(255,255,255,0.68); }
.dash-find-hint kbd { font-family: var(--mono); font-size: 11px; background: rgba(255,255,255,0.14); border-radius: 5px; padding: 1px 6px; color: #fff; }

/* Live search results dropped under the hero search */
.dash-results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-2); overflow: hidden; }
.dash-results-h { font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 16px 8px; }
.result-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.result-row:hover { background: var(--surface-2); }
.result-main { min-width: 0; background: none; border: none; padding: 0; text-align: left; cursor: pointer; font-family: inherit; display: block; }
.result-main:hover .result-title { color: var(--info); }
.result-title { display: block; font-weight: 600; color: var(--ink); font-size: 14px; }
.result-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result-creds .btn span { display: inline; }
.result-creds { display: flex; gap: 8px; align-items: center; flex: none; }

/* Quick-action launchers (replace the redundant "where to go" grid) */
.dash-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; }
.action-card {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; font-family: inherit; color: inherit; cursor: pointer; box-shadow: var(--sh-1);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease);
}
.action-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-2px); }
.action-ic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--brand-tint); color: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; }
.action-ic .gl { width: 22px; height: 22px; }
.action-card.accent .action-ic { background: var(--coral-soft); color: var(--coral); }
.action-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.action-title { display: block; font-weight: 600; color: var(--ink); font-size: 14.5px; }
.action-desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* Cleanup spotlight: make the low-confidence review job inviting */
.cleanup-card { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, #fff 0%, var(--coral-soft) 100%); border: 1px solid #f6d3cb; border-radius: var(--r-lg); padding: 20px 24px; box-shadow: var(--sh-1); }
.cleanup-ic { width: 52px; height: 52px; border-radius: var(--r-md); background: #fff; color: var(--coral); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--sh-1); }
.cleanup-ic .gl { width: 26px; height: 26px; }
.cleanup-body { flex: 1; min-width: 0; }
.cleanup-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.cleanup-desc { font-size: 13px; color: var(--ink-2); margin-top: 3px; line-height: 1.45; }
.cleanup-num { color: var(--coral); font-weight: 700; }

.dash-h { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 12px; letter-spacing: -0.01em; }

/* Recent activity list */
.dash-recent { min-width: 0; }
.recent-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); }
.recent-list li + li { border-top: 1px solid var(--line); }
.recent-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; padding: 12px 14px; font-family: inherit; color: inherit; cursor: pointer; }
.recent-row:hover { background: var(--surface-2); }
.recent-row:hover .recent-label { color: var(--info); }
.recent-row > .ic { width: 14px; height: 14px; color: var(--faint); flex: none; margin-left: auto; }
.recent-kind { flex: none; width: 64px; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-align: center; padding: 4px 0; border-radius: var(--r-pill); color: var(--ink-2); background: var(--bg-tint); text-transform: uppercase; }
.recent-kind.kind-added { color: var(--ok); background: var(--ok-bg); }
.recent-kind.kind-updated { color: var(--info); background: var(--info-bg); }
.recent-kind.kind-removed, .recent-kind.kind-deleted { color: var(--danger); background: var(--danger-bg); }
.recent-kind.kind-restored { color: var(--ok); background: var(--ok-bg); }
/* Admin-only kinds: password views and CSV or Excel downloads. Quiet, not alarming. */
.recent-kind.kind-revealed { color: var(--warn); background: var(--warn-bg); }
.recent-kind.kind-exported { color: var(--navy); background: var(--brand-tint); }
.recent-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-label { color: var(--ink); font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta .when { font-size: 12px; }
.recent-ent { font-weight: 600; color: var(--ink-2); }
.recent-by { color: var(--ink-2); }

/* ---------- Detail modal groups, audit (the login header is the credential card, credential.css) ---------- */
.detail-groups { display: flex; flex-direction: column; gap: 20px; }
.dgroup-h { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 6px; padding: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); border: none; border-bottom: 1px solid var(--line); background: none; text-align: left; font-family: inherit; }
button.dgroup-h { cursor: pointer; padding-top: 6px; }
button.dgroup-h:hover { color: var(--info); }
.dgroup-h .ic { width: 15px; height: 15px; transition: transform 0.15s var(--ease); flex: none; }
.dgroup:not(.collapsed) .dgroup-toggle .ic { transform: rotate(90deg); }
.dgroup.collapsed .dgroup-h { border-bottom-color: var(--line); }
.dgroup-meta { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.dgroup-body { padding-top: 6px; }
.detail-codes { margin-top: 4px; }
.audit-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.audit-line .ic { width: 14px; height: 14px; flex: none; color: var(--faint); }
.audit-by { color: var(--ink-2); }
.profile-ref + .audit-line { margin: -4px 0 16px; border-top: none; padding-top: 0; }

/* ---------- Tablet (768) ---------- */
@media (max-width: 1024px) {
  /* The top bar keeps the logo and the controls; the app name and the sandbox subtitle go. */
  .brand-app, .brand-divider, .sandbox-b { display: none; }
  .topbar { padding: 0 16px; }
  .topbar-right { min-width: 0; }
  /* Seven chips and four cards: two columns instead of a ragged wrap or a squeezed third column. */
  .statstrip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statchip { justify-content: flex-start; }
  .dash-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  /* One compact row: logo, sandbox glyph, Viewing-as glyph, role, Sign out. The name is on the desktop. */
  .topbar { height: 54px; padding: 0 14px; gap: 10px; }
  .brand-logo { height: 22px; }
  .brand-app, .brand-divider { display: none; }
  .topbar-right { gap: 8px; min-width: 0; }
  .sandbox-tag { padding: 6px; gap: 0; }
  .sandbox-txt { display: none; }
  .userchip-name { display: none; }
  .viewas-btn { padding: 7px 9px; gap: 6px; }
  .viewas-btn-lbl { display: none; }
  /* The menu spans the screen under the top bar instead of hanging off a narrow button. */
  .viewas-menu { position: fixed; left: 8px; right: 8px; top: 60px; min-width: 0; max-width: none; }
  .nav { padding: 0 8px; }
  .nav-link { padding: 14px 12px 12px; }
  .view { padding: 16px 14px; }
  .view-title { font-size: 20px; }
  .view-head { margin-bottom: 14px; }
  .toolbar { padding: 12px; gap: 10px; margin-bottom: 14px; }
  .toolbar .field, .combo-wrap { flex: 1 1 100%; }
  .toolbar .search-wrap { flex: 1 1 auto; min-width: 0; }
  .toolbar input[type=text], .toolbar select, .combo-wrap input { min-width: 0; width: 100%; }
  /* Filters fold behind one button so the first row of results is on the first screen. */
  .toolbar-filters-btn { display: inline-flex; flex: none; height: 40px; padding: 0 14px; gap: 8px; }
  .toolbar-filters { display: none; flex: 1 1 100%; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
  .toolbar.filters-open .toolbar-filters { display: flex; }
  .count { margin-bottom: 10px; }
  .statstrip { gap: 8px; }
  .statchip { padding: 8px 12px 8px 9px; gap: 8px; }
  .statchip-num { font-size: 16px; }
  .dash { gap: 18px; }
  .dash-hero { padding: 20px 18px; }
  .dash-actions { grid-template-columns: 1fr; }
  .dash-find-row { flex-direction: column; }
  .dash-find-row .btn { width: 100%; }
  .cleanup-card { flex-direction: column; align-items: flex-start; }
  .cleanup-card .btn { width: 100%; }
  .modal-overlay { padding: 14px 8px; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 14px 16px; flex-wrap: wrap; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .detail-row .row-actions { justify-content: flex-start; }
  .impersonation { padding: 10px 14px; flex-wrap: wrap; gap: 8px 10px; }
  .impersonation-txt { flex: 1 1 240px; font-size: 13px; }
  .impersonation .btn { margin-left: auto; }
  .pager { flex-wrap: wrap; }
  .role-legend { grid-template-columns: 1fr; gap: 8px; }
  /* Toasts sit under the top bar, full width, where a virtual keyboard can never hide them. */
  .toast { top: 62px; bottom: auto; left: 8px; right: 8px; transform: none; max-width: none; animation: clm-toast-top .22s var(--ease); }
}
@keyframes clm-toast-top { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.row-edit .ic { width: 13px; height: 13px; vertical-align: middle; }

/* ---------- Dated activity view ---------- */
/* Same language as the reports: the filters sit in a toolbar card, the presets are a
   segmented control, the table lives in a table-wrap with a sticky header. */
.activity-view { min-width: 0; }
.activity-filters { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-1); }
.activity-presets, .activity-dates, .activity-filter-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.activity-presets { margin-bottom: 14px; }
.activity-dates { margin-bottom: 14px; }
.activity-dates[hidden] { display: none; }
.activity-dates > label { flex: 1 1 160px; max-width: 240px; }
.activity-filters label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; min-width: 0; color: var(--ink-2); }
.activity-filters input, .activity-filters select { width: 100%; min-width: 0; min-height: 40px; }
.activity-filter-fields > label { flex: 1 1 160px; }
.activity-filter-fields .activity-search { flex: 2 1 240px; }
#activity-meta { margin: 16px 0 12px; font-size: 13px; font-weight: 600; }
.activity-wrap { max-height: max(360px, calc(100vh - 340px)); overflow: auto; }
.activity-wrap thead th { position: sticky; top: 0; z-index: 2; cursor: default; }
.activity-table { width: 100%; table-layout: fixed; }
.activity-table th, .activity-table td { text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.activity-table th:nth-child(1) { width: 17%; }
.activity-table th:nth-child(2) { width: 41%; }
.activity-table th:nth-child(3) { width: 13%; }
.activity-table td { color: var(--ink-2); }
.activity-table td strong { color: var(--ink); font-weight: 600; }
.activity-table tr[tabindex] { cursor: pointer; }
.activity-table tr[tabindex]:focus { outline: none; box-shadow: inset var(--ring); }
.activity-table .badge, .activity-fields { margin-top: 6px; }
.activity-fields { font-size: 12.5px; }
.activity-skeleton > div { height: 55px; margin: 12px 0; display: block; width: 100%; background: var(--bg-tint); border-radius: var(--r-sm); }
#activity-pager { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; padding: 16px 0; }
.activity-table .recent-kind { display: inline-block; padding: 4px 8px; font-size: 10px; line-height: 1.3; width: auto; min-width: 0; white-space: nowrap; }
#activity-export { display: inline-flex; align-items: center; gap: 8px; }
#activity-export svg { width: 16px; height: 16px; flex: 0 0 16px; }
#activity-retry { display: block; margin: -24px auto 24px; }
@media (max-width: 620px) {
  .activity-view .view-head { gap: 12px; flex-wrap: wrap; }
  .activity-presets { gap: 6px; }
  .activity-presets .segmented { width: 100%; }
  .activity-presets .segmented .btn { flex: 1 1 auto; padding: 7px 6px; font-size: 12.5px; }
  /* Rows become cards: the wrap gives up its frame and each row carries its own. */
  .activity-wrap { max-height: none; overflow: visible; background: none; border: 0; box-shadow: none; border-radius: 0; }
  .activity-table, .activity-table tbody, .activity-table tr, .activity-table td { display: block; width: 100%; }
  .activity-table thead { display: none; }
  .activity-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); margin-bottom: 10px; padding: 8px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .activity-table tr:hover { background: var(--surface); }
  .activity-table td { border: 0; padding: 6px 14px; width: auto; }
  .activity-table td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
  .activity-table td:nth-child(1) { order: 0; }
  .activity-table td:nth-child(3) { order: 1; text-align: right; }
  .activity-table td:nth-child(2) { order: 2; grid-column: 1 / -1; }
  .activity-table td:nth-child(4) { order: 3; grid-column: 1 / -1; }
}
