/* Journey Observatory - dashboard styles
   Shared by the GitHub Pages demo and the Marketing Cloud CloudPage
   (deployed there as a CSS Code Resource). */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e2e6eb;
  --border-strong: #cdd3db;
  --text: #15202b;
  --muted: #5a6573;
  --faint: #8a94a1;
  --brand: #0f3157;
  --brand-2: #1c5a96;
  --brand-tint: #e8f0f9;
  --accent: #c48a1c;
  --focus: #1c5a96;

  --good-bg: #e5f5e9;  --good-fg: #0b6420;
  --bad-bg: #fbe9e9;   --bad-fg: #a11f1f;
  --info-bg: #e7effc;  --info-fg: #1d4bb8;
  --warn-bg: #fff3d6;  --warn-fg: #7f5200;
  --neutral-bg: #eef0f3; --neutral-fg: #4a5462;

  /* chart status steps (dataviz status palette) */
  --st-good: #0aac23;
  --st-warning: #fbb315;
  --st-critical: #dc3c3d;
  --st-running: #7d9cc9;
  --st-none: #eceff3;
  --bar: #2f6db0;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name strong { font-size: 15px; letter-spacing: .1px; }
.brand-name span { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 500px at 10% -10%, #dfe9f6 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #efe6d3 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 49, 87, .08);
  padding: 32px 30px 26px;
}
.login-card h1 { font-size: 21px; margin: 22px 0 4px; letter-spacing: -.2px; }
.login-card .sub { margin: 0 0 22px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input {
  height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
}
.field input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(28, 90, 150, .15); }
.login-error { background: var(--bad-bg); color: var(--bad-fg); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; font-size: 13px; }
.login-note {
  margin-top: 18px; padding: 12px 14px; border-radius: 8px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font-size: 12.5px; color: var(--muted);
}
.login-note strong { color: var(--text); }
.login-foot { margin-top: 16px; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: #fff; cursor: pointer;
  font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #0b2746; }
.btn-block { width: 100%; height: 42px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 5px;
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--neutral-bg); color: var(--text); }

.input, .select {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
  min-width: 0;
}
.input:focus, .select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(28, 90, 150, .13); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }

/* ---------- shell ---------- */
.topbar {
  background: var(--brand); color: #fff;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: 58px;
}
.topbar .brand-name span { color: rgba(255, 255, 255, .7); }
.topbar .spacer { flex: 1; }
.env-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: rgba(196, 138, 28, .22); color: #f6d48f;
  border: 1px solid rgba(246, 212, 143, .35);
}
.freshness { font-size: 12.5px; color: rgba(255, 255, 255, .78); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.freshness.stale { color: #ffd48a; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); font-size: 12px; font-weight: 700;
}
.topbar .btn-ghost { color: #fff; }

.subbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 50px;
  position: sticky; top: 0; z-index: 20;
}
.tabs { display: flex; gap: 4px; height: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 12px;
  border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px;
  display: inline-grid; place-items: center; background: var(--bad-bg); color: var(--bad-fg);
}
.subbar .spacer { flex: 1; }
.bu-filter { display: flex; align-items: center; gap: 8px; }
.bu-filter > span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.segmented button {
  border: 0; background: #fff; padding: 0 11px; height: 30px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted);
  border-left: 1px solid var(--border);
}
.segmented button:first-child { border-left: 0; }
.segmented button[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand); }

main { padding: 22px 24px 40px; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 19px; letter-spacing: -.2px; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px;
}
.banner.warn { background: var(--warn-bg); color: var(--warn-fg); }
.banner.info { background: var(--info-bg); color: var(--info-fg); }

/* ---------- cards / KPIs ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; text-align: left;
}
button.card { cursor: pointer; font: inherit; color: inherit; }
button.card:hover { border-color: var(--border-strong); }
button.card[aria-pressed="true"] { border-color: var(--brand-2); box-shadow: 0 0 0 1px var(--brand-2), var(--shadow); }
.card .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; display: flex; align-items: center; gap: 6px; }
.card .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 14.5px; }
.panel-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.panel-body { padding: 14px 16px 16px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .input { width: 100%; }
.toolbar .search { position: relative; flex: 1 1 200px; }
.toolbar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.toolbar .search .input { padding-left: 32px; width: 100%; }
.toolbar .sep { width: 1px; height: 22px; background: var(--border); }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
  font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--text); }
table.grid th .arrow { display: inline-block; width: 10px; color: var(--brand-2); }
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tbody tr.row:hover td { background: #fafbfd; }
table.grid tr.row.expandable { cursor: pointer; }
table.grid tr.row.open td { background: #f6f9fd; border-bottom-color: transparent; }
table.grid td.name { font-weight: 600; min-width: 220px; max-width: 380px; overflow-wrap: anywhere; }
table.sub td.name { min-width: 160px; overflow-wrap: anywhere; }
.alert .entity, .alert .detail { overflow-wrap: anywhere; }
table.grid td.name .sub { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.cell-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
table.grid td.name .subj { color: var(--text); opacity: .8; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
table.sub td.name .sub { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.has-tip { cursor: help; border-bottom: 1px dotted var(--border-strong); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-2); text-decoration: underline; cursor: pointer; }
table.sub tr.vhead td { background: #eef3f9; padding-top: 8px; padding-bottom: 8px; font-size: 12.5px; }
table.sub tr.vhead .pill { margin-left: 2px; }
.rg-name[data-act] { cursor: pointer; }
.rg-name[data-act]:hover, .rg-name[data-act]:focus-visible { color: var(--brand-2); text-decoration: underline; }
.caret { display: inline-block; width: 16px; color: var(--faint); transition: transform .15s; }
tr.open .caret { transform: rotate(90deg); color: var(--brand-2); }
tr.detail > td { padding: 0 12px 14px 40px; background: #f6f9fd; }
.detail-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 14px 0 6px; }
tr.detail > td > .detail-title:first-child { margin-top: 2px; }
.detail-title .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.detail-foot { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.vhist-state { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 13px; }
table.sub tr.vrow { cursor: pointer; }
table.sub tr.vrow:hover td { background: #fafbfd; }
table.sub tr.vrow.open td { background: #f6f9fd; border-bottom-color: transparent; }
table.sub tr.vrow .pill { margin-left: 6px; }
table.sub tr.vdetail > td { padding: 2px 10px 12px 34px; background: #f6f9fd; }
table.sub { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
table.sub th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); text-align: left; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
table.sub td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
table.sub tr:last-child td { border-bottom: 0; }
table.sub tr.hit td { background: #fffbea; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager .controls { display: flex; align-items: center; gap: 8px; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-bg); color: var(--good-fg); }
.badge.bad { background: var(--bad-bg); color: var(--bad-fg); }
.badge.info { background: var(--info-bg); color: var(--info-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px; padding: 1px 6px; border-radius: 4px;
  background: var(--neutral-bg); color: var(--neutral-fg); vertical-align: 1px;
}
.chips { display: flex; flex-wrap: nowrap; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 700;
  letter-spacing: .3px; background: var(--brand-tint); color: var(--brand);
}
.chip.n { background: var(--neutral-bg); color: var(--neutral-fg); }
.copy-key { display: inline-flex; align-items: center; gap: 4px; }

/* pills: short labels next to a name (alerts, default names, current version) */
.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; border: 0;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: 1px; line-height: 1;
}
.pill svg { width: 12px; height: 12px; flex: none; }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill.good { background: var(--good-bg); color: var(--good-fg); }
.pill.info { background: var(--info-bg); color: var(--info-fg); }
.pill.neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
button.pill { cursor: pointer; }
button.pill:hover { box-shadow: inset 0 0 0 1px currentColor; }

/* info icon with a tooltip for technical details */

/* threshold flags */
.flag { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.flag svg { flex: none; }
.flag.warning { color: var(--warn-fg); }
.flag.critical { color: var(--bad-fg); }

/* data bar for magnitudes */
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-track { width: 90px; height: 8px; background: transparent; position: relative; flex: none; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }

/* ---------- automation run grid ---------- */
.run-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr 150px; align-items: center; row-gap: 6px; column-gap: 14px; }
.run-grid .rg-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-grid .rg-name .tag { margin-right: 6px; }
.run-grid .rg-cells { display: grid; grid-template-columns: repeat(30, minmax(10px, 1fr)); gap: 2px; }
.run-grid .rg-last { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.run-grid .rg-head { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; }
.run-grid .rg-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }
.cell {
  height: 18px; border-radius: 3px; background: var(--st-none); border: 0; padding: 0; cursor: default;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1; color: #fff;
}
.cell.ok { background: var(--st-good); }
.cell.skip { background: var(--st-warning); color: #0b0b0b; }
.cell.err { background: var(--st-critical); }
.cell.run { background: var(--st-running); }
.cell:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 14px; height: 14px; display: inline-grid; font-size: 9px; }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none; background: #0f1b28; color: #fff; font-size: 12px; line-height: 1.45;
  padding: 8px 10px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); max-width: 280px; display: none;
}
.tooltip strong { display: block; margin-bottom: 2px; }

.runs-list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.runs-list td, .runs-list th { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; text-align: left; vertical-align: top; }
.runs-list th { font-size: 11px; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.err-text { color: var(--bad-fg); font-family: var(--mono); font-size: 12px; }

/* ---------- alerts ---------- */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.alert.critical { border-left-color: var(--st-critical); }
.alert.warning { border-left-color: var(--st-warning); }
.alert.info { border-left-color: var(--brand-2); }
.alert .sev { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.alert.critical .sev { background: var(--bad-bg); color: var(--bad-fg); }
.alert.warning .sev { background: var(--warn-bg); color: var(--warn-fg); }
.alert.info .sev { background: var(--info-bg); color: var(--info-fg); }
.alert h4 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert .entity { font-family: var(--mono); font-size: 12.5px; color: var(--text); margin-top: 3px; word-break: break-all; }
.alert .detail { margin-top: 4px; color: var(--muted); font-size: 13px; }
.alert .sev-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.alert.critical .sev-label { color: var(--bad-fg); }
.alert.warning .sev-label { color: var(--warn-fg); }
.alert.info .sev-label { color: var(--info-fg); }
.al-groups { display: flex; flex-direction: column; gap: 10px; }
.al-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.al-group-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 0; border-radius: var(--radius);
  background: transparent; cursor: pointer; text-align: left; font-weight: 600; font-size: 14px;
}
.al-group-head:hover { background: #eef2f7; }
.al-group-head[aria-expanded="true"] .caret { transform: rotate(90deg); color: var(--brand-2); }
.al-group .sev-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; }
.al-group.critical .sev-dot { background: var(--bad-bg); color: var(--bad-fg); }
.al-group.warning .sev-dot { background: var(--warn-bg); color: var(--warn-fg); }
.al-group-title { flex: 1; min-width: 0; }
.al-group-mix { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.al-group-count {
  min-width: 30px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  display: inline-grid; place-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.al-group .alert-list { padding: 0 12px 12px; }
.cleanup-list { display: flex; flex-direction: column; gap: 8px; }
.cleanup-item {
  display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: center;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
}
.cleanup-count { font-size: 22px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cleanup-item p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.rules { columns: 2; column-gap: 32px; font-size: 13px; color: var(--muted); margin: 0; padding-left: 18px; }
.rules li { margin-bottom: 6px; break-inside: avoid; }
.rules code { font-family: var(--mono); font-size: 12px; color: var(--text); }

/* ---------- states ---------- */
.state { min-height: 60vh; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand-2); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; margin: 0; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #0f1b28; color: #fff;
  padding: 9px 14px; border-radius: 8px; font-size: 13px; z-index: 200; box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
footer.app-foot { text-align: center; font-size: 12px; color: var(--faint); padding: 8px 0 28px; }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .hide-lg { display: none; }
}
@media (max-width: 1180px) {
  .hide-md { display: none; }
  table.grid td.name { max-width: 300px; }
}
@media (max-width: 980px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .freshness { display: none; }
  .subbar { padding: 0 10px; height: auto; flex-wrap: wrap; padding-top: 6px; position: static; }
  .tabs { height: 44px; overflow-x: auto; }
  .bu-filter { padding-bottom: 8px; }
  main { padding: 16px 12px 32px; }
  .run-grid { grid-template-columns: 1fr; }
  .run-grid .rg-last, .run-grid .rg-headlast { display: none; }
  .rules { columns: 1; }
}
@media (max-width: 560px) {
  .user-chip .uname, .env-badge { display: none; }
  .alert { grid-template-columns: 28px 1fr; }
  .alert .actions { grid-column: 2; }
  .cleanup-item { grid-template-columns: 48px 1fr; }
  .cleanup-item .btn { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } .caret { transition: none; } }
@media print {
  .topbar, .subbar, .toolbar, .pager, .btn { display: none !important; }
  body { background: #fff; }
  .panel, .card { box-shadow: none; }
}
/* v2.6.1 cleanup list chip */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand-2); background: transparent; color: var(--brand-2); border-radius: 999px; padding: 3px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.filter-chip:hover { background: var(--hover, rgba(0,0,0,.04)); }
/* v2.7 bounce by domain */
.panel-sub { padding: 14px 16px 4px; border-top: 1px solid var(--border); }
.panel-sub h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.detail-foot.pad { padding: 10px 16px 14px; margin: 0; }
/* v2.8 multi-line tooltips (bounce reasons, provider answers) */
.tooltip { white-space: pre-line; max-width: 360px; }
/* v2.8.2 numeric headers of the inner tables line up with their values */
table.sub th.num { text-align: right; }
/* v3.0 bounce view */
.bar-cell.left { justify-content: flex-start; }
.bar-track.wide { width: 170px; }
.bounce-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .bounce-detail { grid-template-columns: 1fr; } }
.bounce-action { margin: 12px 0 4px; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--brand-2); border-radius: 6px; font-size: 13px; }
.panel-sub.first { border-top: 0; padding-bottom: 0; }
.cleanup-names { font-size: 13px; margin: 6px 0 0; line-height: 1.6; }
/* v3.1 period line */
.period-note { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.head-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bounce-detail.single { grid-template-columns: 1fr; }
table.sub td.name .sub.answer { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); font-weight: 400; white-space: normal; word-break: break-word; }
