/* StayLeads web: one stylesheet, light and dark through CSS variables. */

:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1a1f26;
  --muted: #5a6472;
  --border: #d8dde4;
  --border-strong: #b9c1cc;
  --accent: #1f4e78;
  --accent-hover: #173d5e;
  --accent-text: #ffffff;
  --accent-soft: #e4edf6;
  --focus: #2f7bd8;
  --green-bg: #d9f2df;
  --green-fg: #145a2a;
  --amber-bg: #fff0c2;
  --amber-fg: #664700;
  --red-bg: #fde0e2;
  --red-fg: #8a1622;
  --blue-bg: #e1ecfa;
  --blue-fg: #1a4c8a;
  --grey-bg: #e9ecf0;
  --grey-fg: #48515e;
  --log-bg: #f7f8fa;
  /* Charts (Admin page): one series hue, its hover step and a lighter track step of the same ramp. */
  --viz-1: #2a78d6;
  --viz-1-hover: #256abf;
  --viz-track: #cde2fb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.22);
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b;
    --surface: #1a2027;
    --surface-2: #222a33;
    --text: #e6eaef;
    --muted: #9aa5b3;
    --border: #2f3842;
    --border-strong: #46515e;
    --accent: #6ea8e0;
    --accent-hover: #8dbbe8;
    --accent-text: #0d1a27;
    --accent-soft: #1d3247;
    --focus: #7fb4ff;
    --green-bg: #173a24;
    --green-fg: #9fe0b2;
    --amber-bg: #3f3110;
    --amber-fg: #f5d27a;
    --red-bg: #45191e;
    --red-fg: #ffb3ba;
    --blue-bg: #1a2f4a;
    --blue-fg: #a9cbf5;
    --grey-bg: #29313b;
    --grey-fg: #c2cad4;
    --log-bg: #11151a;
    --viz-1: #3987e5;
    --viz-1-hover: #5598e7;
    --viz-track: #0d366b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.4em;
}

h1 {
  font-size: 1.6rem;
  font-weight: 650;
}

h2 {
  font-size: 1.15rem;
  font-weight: 650;
}

h3 {
  font-size: 0.95rem;
  font-weight: 650;
}

p {
  margin: 0 0 0.75em;
}

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

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.87rem;
}

.mono {
  font-family: var(--mono);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- top bar ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  min-height: 56px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-text);
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 550;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 0;
}

.user-name {
  color: var(--text);
  font-weight: 550;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .topbar-inner {
    gap: 4px 12px;
  }
  .user {
    margin-left: 0;
    width: 100%;
    order: 3;
    padding-bottom: 4px;
  }
  .nav {
    margin-left: auto;
  }
  .nav a {
    padding: 6px 8px;
  }
}

@media (max-width: 400px) {
  .nav {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------- page ---------- */

main.wrap {
  padding-top: 24px;
  padding-bottom: 64px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.page-head > div {
  min-width: 0;
  flex: 1 1 320px;
}

.page-head p {
  margin: 0;
}

.back {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  text-decoration: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card > :last-child {
  margin-bottom: 0;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.card-head h2 {
  margin: 0;
}

@media (max-width: 480px) {
  .card {
    padding: 14px 14px;
  }
  h1 {
    font-size: 1.35rem;
  }
}

.center-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.center-card {
  width: min(440px, 100%);
  text-align: center;
  padding: 28px 24px;
}

.center-card .brand {
  justify-content: center;
  margin-bottom: 14px;
  font-size: 1.3rem;
}

.stack {
  display: grid;
  gap: 10px;
  margin: 20px 0 8px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
}

.btn.small {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.87rem;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.linklike:hover {
  text-decoration: underline;
}

.icon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- badges and chips ---------- */

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
  background: var(--grey-bg);
  color: var(--grey-fg);
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.badge.state-queued,
.badge.state-running {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.badge.state-running::before {
  animation: pulse 1.4s ease-in-out infinite;
}

.badge.state-done {
  background: var(--green-bg);
  color: var(--green-fg);
}

.badge.state-stopped {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.badge.state-failed {
  background: var(--red-bg);
  color: var(--red-fg);
}

@keyframes pulse {
  50% {
    opacity: 0.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge.state-running::before {
    animation: none;
  }
}

.chip.good {
  background: var(--green-bg);
  color: var(--green-fg);
}

.chip.bad {
  background: var(--red-bg);
  color: var(--red-fg);
}

.chip.warn {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.chip.info {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.tier {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--grey-bg);
  color: var(--grey-fg);
}

.tier-A {
  background: var(--green-bg);
  color: var(--green-fg);
}

.tier-B {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 650;
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td {
  background: var(--surface-2);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.leads-table {
  min-width: 1180px;
}

.leads-table td {
  overflow-wrap: normal;
}

.leads-table .col-property {
  min-width: 190px;
}

.leads-table .col-email {
  white-space: nowrap;
}

.leads-table .col-website a {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.leads-table .draft-mark {
  margin-left: 6px;
  vertical-align: 1px;
}

/* Issues list: a table on wide screens, stacked rows on phones. */
.runs-table td:first-child a {
  font-weight: 650;
  text-decoration: none;
}

.runs-table td:first-child a:hover {
  text-decoration: underline;
}

.run-msg {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 3px;
}

@media (max-width: 640px) {
  .runs-wrap {
    border: 0;
    background: none;
    overflow: visible;
  }
  .runs-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .runs-table,
  .runs-table tbody {
    display: block;
  }
  .runs-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .runs-table td {
    border: 0;
    padding: 0;
  }
  .runs-table td.col-theme {
    grid-column: 1 / -1;
    font-size: 1rem;
  }
  .runs-table td.col-created,
  .runs-table td.col-counts {
    color: var(--muted);
    font-size: 0.85rem;
  }
  .runs-table td.col-state {
    grid-column: 1 / -1;
    order: 4;
  }
  .runs-table td.col-counts {
    text-align: right;
  }
}

/* ---------- metrics ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.metric-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- status and log ---------- */

.status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.status-msg {
  margin: 0;
}

.run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 6px;
}

.run-search {
  display: flex;
  gap: 0.3em;
  min-width: 0;
  max-width: min(640px, 100%);
}

.run-search a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

fieldset.tiers {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
}

fieldset.tiers legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 6px;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  background: var(--surface);
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.check:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.waiting {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

details.log {
  margin-top: 14px;
}

details.log summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}

pre.log-box {
  margin: 8px 0 0;
  max-height: 340px;
  overflow: auto;
  background: var(--log-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: 12.5px/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- forms ---------- */

.field {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
}

.field > label,
.field-label {
  font-weight: 600;
}

.hint {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="search"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 40px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}

input[readonly],
textarea[readonly] {
  background: var(--surface-2);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--red-fg);
}

.grid-2,
.grid-4 {
  display: grid;
  gap: 0 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-actions {
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* ---------- new issue steps ---------- */

ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.9rem;
}

ol.steps > li.card {
  padding-left: 60px;
}

@media (max-width: 480px) {
  ol.steps > li.card {
    padding-left: 50px;
  }
  ol.steps > li::before {
    left: 12px;
    top: 14px;
  }
}

.callout {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.callout.good {
  background: var(--green-bg);
  color: var(--green-fg);
}

.callout.warn {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.callout.bad {
  background: var(--red-bg);
  color: var(--red-fg);
}

.callout.info {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.callout strong {
  font-weight: 700;
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 460px;
  width: 100%;
  padding: 10px 10px 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  box-shadow: var(--shadow-lg);
  font-size: 0.93rem;
}

.toast p {
  margin: 6px 0;
  flex: 1;
}

.toast.error {
  border-left-color: var(--red-fg);
}

.toast.success {
  border-left-color: var(--green-fg);
}

.toast .icon-btn {
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
}

/* ---------- lead panel ---------- */

dialog.sheet {
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  width: min(600px, 100vw);
  max-width: 100vw;
  height: 100%;
  max-height: 100vh;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

dialog.sheet::backdrop {
  background: rgba(10, 15, 22, 0.45);
}

.sheet-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.sheet-head > div {
  flex: 1;
  min-width: 0;
}

.sheet-head h2 {
  margin: 0 0 2px;
}

.sheet-body {
  padding: 16px 18px 32px;
  overflow-y: auto;
  flex: 1;
}

.sheet-body section {
  margin-bottom: 20px;
}

.sheet-body section > h3 {
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.sheet-body ul {
  margin: 0;
  padding-left: 20px;
}

.sheet-body li {
  margin-bottom: 4px;
}

dl.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
}

dl.facts dt {
  color: var(--muted);
}

dl.facts dd {
  margin: 0;
  min-width: 0;
}

.copy-field {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.copy-field > :first-child {
  flex: 1;
  min-width: 0;
}

textarea.draft {
  min-height: 300px;
  font: 14px/1.55 var(--sans);
}

.errors {
  background: var(--red-bg);
  color: var(--red-fg);
  border-radius: 8px;
  padding: 10px 12px 10px 14px;
}

.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
}

.loading {
  color: var(--muted);
}

.run-search > span {
  flex: none;
}

@media (max-width: 480px) {
  .copy-field {
    flex-direction: column;
    align-items: flex-end;
  }
  .copy-field > :first-child {
    width: 100%;
  }
}

.hint + .btn-row {
  margin-top: 12px;
}

/* ---------- admin ---------- */

.admin-body {
  transition: opacity 0.15s;
}

.admin-body.is-stale {
  opacity: 0.55;
}

.admin-section {
  margin-bottom: 28px;
}

.admin-section > h2 {
  margin-bottom: 2px;
}

.admin-section > .hint {
  margin-bottom: 12px;
}

.stat-group {
  margin-top: 16px;
}

.stat-group > h3 {
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.stat {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.stat-wide {
  grid-column: span 2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Proportional figures for standalone values; tabular only in table columns. */
.stat-value {
  font-size: 1.6rem;
  font-weight: 650;
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.stat-note {
  margin-top: 8px;
}

.meter {
  display: block;
  height: 6px;
  margin: 6px 0 4px;
  border-radius: 3px;
  background: var(--viz-track);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  background: var(--viz-1);
  border-radius: 0 3px 3px 0;
}

.admin-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.admin-split > .card {
  min-width: 0;
}

.admin-split .card > .hint {
  margin-bottom: 12px;
}

.bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.bar-label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.bar-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Bars grow from the left edge: square there, 4px rounded at the data end. */
.bar-fill {
  flex: none;
  height: 14px;
  min-width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--viz-1);
}

.bar-row:hover .bar-fill {
  background: var(--viz-1-hover);
}

.bar-value {
  flex: none;
  white-space: nowrap;
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
}

.bar-value strong {
  font-weight: 650;
}

.admin-table {
  min-width: 1260px;
}

.admin-table td {
  overflow-wrap: normal;
  white-space: nowrap;
}

.admin-table td.col-theme {
  white-space: normal;
  min-width: 150px;
}

.admin-table td.col-theme a {
  font-weight: 650;
  text-decoration: none;
}

.admin-table td.col-theme a:hover {
  text-decoration: underline;
}

.admin-table td.col-who {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table td.col-state .chip {
  display: flex;
  width: max-content;
  margin-top: 4px;
}

.trunc-link {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.mini-bar {
  display: block;
  width: 64px;
  height: 4px;
  margin: 5px 0 0 auto;
  border-radius: 2px;
  background: var(--viz-track);
  overflow: hidden;
}

.mini-bar > span {
  display: block;
  height: 100%;
  background: var(--viz-1);
  border-radius: 0 2px 2px 0;
}

@media (max-width: 760px) {
  .admin-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 359px) {
  .stat-wide {
    grid-column: auto;
  }
}
