/* Copied verbatim from F3D-Sonar (src/web/static/app.css) so the sign-in card
   looks exactly the same: kaki and sage from the logo on a cream ground, the
   dark kaki header, Inter with the system fallbacks. Tokens are those of the
   public site (F3D-Website, src/styles.css). The dark set keeps the same hues,
   deepened, and follows the system setting. SSO-only additions: sso.css. */
:root {
  --head: #404436;
  --head2: #4d5142;
  --bg: #f2f1e4;
  --card: #fbfaf2;
  --line: #e2ddcd;
  --ink: #2b2c24;
  --mute: #6f705f;
  --accent: #6f7d3f;
  --accent2: #869653;
  --accent-ink: #55612b;
  --soft: rgba(111, 125, 63, 0.13);
  --steel: #9a5a8a; /* second series: validated against the olive, see CONCEPTION 7 */
  --land: #e2ddcd;
  --warn-bg: #eef0dd;
  --warn-bd: #cbcea6;
  --bad: #b3402e;
  --bad-bg: #f8e9e4;
  --shadow: 0 1px 2px rgba(43, 44, 36, 0.06);
  color-scheme: light;
  font-family:
    "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial,
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: dark) {
  :root {
    --head: #2b2e22;
    --head2: #3a3e2e;
    --bg: #1b1d16;
    --card: #24271e;
    --line: #393d2d;
    --ink: #ecebdc;
    --mute: #a3a48f;
    --accent: #9bb05a;
    --accent2: #b3c47a;
    --accent-ink: #b3c47a;
    --soft: rgba(155, 176, 90, 0.16);
    --steel: #b479a6;
    --land: #393d2d;
    --warn-bg: #2f3322;
    --warn-bd: #4c5233;
    --bad: #ee8b79;
    --bad-bg: #3b1f19;
    --shadow: none;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}
a {
  color: var(--accent-ink);
}
button {
  font: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.i {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
/* Brand marks (browsers, systems, referrers): filled, each in its own colour,
   already chosen per theme by light-dark() in icons.ts. */
.i.ib {
  stroke: none;
}
/* Country flags: emoji from the ISO code, drawn by the system's colour font. */
.flag {
  font-family:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
    "Twemoji Mozilla", sans-serif;
  font-size: 1.1em;
  line-height: 1;
  flex: none;
}
/* Extension badge of a downloaded file (pdf, stp, 3mf, dxf, zip…). */
.ext {
  flex: none;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--soft);
}
.ext-pdf {
  color: var(--bad);
  background: var(--bad-bg);
}
.ext-cad,
.ext-plan {
  color: var(--steel);
  background: color-mix(in srgb, var(--steel) 14%, transparent);
}
.ext-zip {
  color: var(--ink);
  background: var(--warn-bg);
}

/* Header: the dark kaki band of farm-3d.com */
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--head);
  color: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
}
.hwrap {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}
.brand img {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 3px;
}
.brand b {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.01em;
}
.brand small {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: #d7d6c4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
header.top nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
}
header.top nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d7d6c4;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 5px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  white-space: nowrap;
}
header.top nav a:hover {
  background: var(--head2);
  color: #fff;
}
header.top nav a[aria-current] {
  background: var(--head2);
  color: #fff;
  border-bottom-color: var(--accent);
}
.acct {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #d7d6c4;
  font-size: 13.5px;
}
.acct form {
  margin: 0;
}
.acct .btn-out {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 13px;
}
.acct .btn-out:hover {
  border-color: var(--accent);
  background: var(--head2);
}

main {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 24px;
}
h1 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h1 .i {
  color: var(--accent);
}
h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h2 .i {
  color: var(--accent);
}
.mute {
  color: var(--mute);
  font-size: 13.5px;
}
.ok {
  color: var(--accent-ink);
}
.bad {
  color: var(--bad);
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 16px;
}
.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  min-width: 0;
  box-shadow: var(--shadow);
}
a.card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s,
    box-shadow 0.25s,
    transform 0.2s;
}
a.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(111, 125, 63, 0.18);
  transform: translateY(-1px);
}
.big {
  font-size: 34px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.tile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.chip {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--soft);
  color: var(--accent);
}
.chip .i {
  width: 20px;
  height: 20px;
}

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid var(--bad);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 16px;
  font-weight: 600;
}
.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  color: var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  text-wrap: pretty;
}
.note .i {
  color: var(--accent);
  margin-top: 2px;
}

.period {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.period a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
}
.period a:hover {
  border-color: var(--accent);
}
.period a[aria-current] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 700;
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
td.n,
th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.p {
  word-break: break-word;
  min-width: 9em;
}
.scroll {
  overflow-x: auto;
}
.scroll table {
  min-width: 600px;
}

.chart {
  width: 100%;
  height: auto;
  display: block;
}
.chart .grid {
  stroke: var(--line);
}
.chart .axis {
  fill: var(--mute);
  font-size: 11px;
}
.chart .area {
  fill: var(--accent);
  opacity: 0.16;
}
.chart .l-visits {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.chart .l-visitors {
  fill: none;
  stroke: var(--steel);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}
.legend {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--mute);
  margin-top: 6px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend b {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid var(--accent);
}
.legend b.dash {
  border-top: 2px dashed var(--steel);
}
.map {
  width: 100%;
  height: auto;
  display: block;
}
.map .land {
  fill: var(--land);
}
.map .hit {
  fill: var(--accent);
}
.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  box-shadow: 0 0 0 0 var(--accent);
}

details.visit {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
details.visit summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 4px 12px;
}
details.visit .meta {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
}
details.visit .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
details.visit ol {
  margin: 8px 0 4px 1.2em;
  padding: 0;
}

/* Forms */
form.stack {
  display: grid;
  gap: 14px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--head);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
@media (prefers-color-scheme: dark) {
  label {
    color: var(--mute);
  }
}
input[type="text"],
input[type="password"] {
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--soft);
}
button.btn,
a.btn {
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition:
    background 0.2s,
    border-color 0.2s;
}
button.btn:hover,
a.btn:hover {
  background: var(--accent2);
  border-color: var(--accent2);
}
.auth {
  max-width: 460px;
  margin: 28px auto;
  padding: 26px;
}
.auth .logo {
  display: block;
  margin: 0 auto 22px;
  height: 84px;
  width: auto;
  border-radius: 6px;
}
.auth h1 {
  font-size: 21px;
}
.qr {
  background: #fff;
  padding: 8px;
  display: inline-block;
  border-radius: 8px;
}
.qr svg {
  display: block;
  width: 200px;
  height: 200px;
}
code.k {
  word-break: break-all;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

footer {
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 24px 22px;
  color: var(--mute);
  font-size: 12.5px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
footer .i {
  margin-top: 2px;
  color: var(--accent);
}

@media (max-width: 720px) {
  .hwrap {
    gap: 10px;
    padding: 8px 12px;
    flex-wrap: wrap;
  }
  .brand small,
  .acct .user {
    display: none;
  }
  header.top nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .acct {
    margin-left: auto;
  }
  main {
    padding: 14px 12px;
  }
  details.visit summary {
    grid-template-columns: 1fr;
  }
}

/* ── Overview ─────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.toolbar .grow {
  flex: 1;
  min-width: 220px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.toolbar .grow .i {
  color: var(--accent);
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.seg a:hover {
  background: var(--soft);
}
.seg a[aria-current] {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.seg.vs a .i {
  width: 15px;
  height: 15px;
}
/* Free period: two dates and a button, in the same pill as the presets. */
.range-pick {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
.range-pick.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--soft);
}
.range-pick > .i {
  color: var(--accent);
}
.range-pick input[type="date"] {
  font: inherit;
  font-size: 13.5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
  color-scheme: inherit;
}
.range-pick input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--soft);
}
.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
}
.btn-mini:hover {
  background: var(--accent2);
  border-color: var(--accent2);
}
.btn-mini .i {
  width: 15px;
  height: 15px;
}
.note.history {
  margin: 0 0 16px;
}
.history-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  flex: none;
}
.dot.bad {
  background: var(--bad);
}
.seg a[aria-current] .dot {
  background: #fff;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.kpi .chip {
  width: 44px;
  height: 44px;
}
.kpi-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-val {
  font-size: 30px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  font-size: 13px;
  color: var(--mute);
}
.kpi-sub .i {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  color: var(--accent);
}
.live .live-dot {
  margin: 0;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(134, 150, 83, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(134, 150, 83, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .live .live-dot {
    animation: none;
  }
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 13px;
}
.delta .vs {
  font-weight: 400;
  color: var(--mute);
}
.delta.up {
  color: var(--accent-ink);
}
.delta.down {
  color: var(--bad);
}
.delta.flat {
  color: var(--mute);
  font-weight: 500;
}

.row2 {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 16px;
  margin-bottom: 16px;
}
.row3 {
  display: grid;
  grid-template-columns: minmax(0, 4.5fr) minmax(0, 3.5fr) minmax(0, 4fr);
  gap: 16px;
}
.chart .hit {
  fill: transparent;
}
.chart .col .cross {
  stroke: var(--mute);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
}
.chart .col .dot {
  fill: var(--card);
  stroke: var(--accent);
  stroke-width: 2.5;
  opacity: 0;
}
.chart .col:hover .cross,
.chart .col:hover .dot {
  opacity: 1;
}
.chart .col:hover .hit {
  fill: var(--soft);
}
.chart .bar-fill {
  fill: var(--accent);
}
.chart .col:hover .bar-fill {
  fill: var(--accent2);
}
.map .hit {
  cursor: default;
}
.map .hit:hover {
  stroke: var(--ink);
  stroke-width: 0.8;
}
.chips {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13.5px;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bars {
  display: grid;
  gap: 2px;
}
.bar {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(40px, 1.7fr) 6.2em;
  gap: 10px;
  align-items: center;
  padding: 2px 0;
}
.bar .lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar .lbl .i {
  color: var(--accent);
}
.bar .mono {
  font-size: 13.5px;
}
.bar .track {
  display: block;
  height: 8px;
  background: var(--soft);
  border-radius: 4px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  min-width: 2px;
}
.bar .val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.bar .val small {
  margin-left: 6px;
  font-weight: 400;
  color: var(--mute);
  font-size: 12px;
}
h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h3 .i {
  color: var(--accent);
}
.empty {
  margin: 8px 0;
}
.pair {
  display: flex;
  gap: 32px;
  margin-bottom: 8px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: -6px 0 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--mute);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button[aria-selected="true"] {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}

#tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--head);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  padding: 7px 10px;
  border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  max-width: 280px;
  opacity: 0;
  transition: opacity 0.1s;
}
#tip.on {
  opacity: 1;
}

/* One screen at 1920x1080: tighten the vertical rhythm on big, tall displays. */
@media (min-width: 1280px) and (min-height: 900px) {
  main {
    padding-top: 14px;
    padding-bottom: 8px;
  }
  .toolbar {
    margin-bottom: 12px;
  }
  .kpis,
  .row2 {
    margin-bottom: 14px;
  }
  .row2,
  .row3 {
    gap: 14px;
  }
  footer {
    padding-top: 6px;
    padding-bottom: 12px;
  }
}
@media (max-width: 1279px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .row2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .row3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row3 > :first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }
  .kpi.live {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
  }
  .kpi-val {
    font-size: 26px;
  }
  .row3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar .grow {
    justify-content: flex-start;
  }
  .seg {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .chart .axis {
    font-size: 26px;
  }
  .bar {
    grid-template-columns: minmax(0, 1.6fr) minmax(30px, 1fr) 5.6em;
  }
  .delta {
    flex-wrap: wrap;
  }
}

/* ── Live view, journal, one visit ─────────────────────────────────────── */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13.5px;
}
.status.retry {
  background: var(--warn-bg);
  color: var(--ink);
}
.status.retry .live-dot {
  background: var(--mute);
  animation: none;
}
.status .live-dot {
  margin: 0;
  animation: pulse 2s ease-out infinite;
}
.live-top {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 16px;
  margin-bottom: 16px;
}
.live-big .kpi-val {
  font-size: 52px;
}
.live-cols {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 16px;
}
.list {
  display: grid;
}
.list,
.feed {
  max-height: calc(100vh - 360px);
  min-height: 220px;
  overflow-y: auto;
}
.srow {
  display: grid;
  grid-template-columns: 14px 11em minmax(0, 1.3fr) minmax(0, 1fr) minmax(
      0,
      1.2fr
    ) auto auto;
  gap: 6px 14px;
  align-items: center;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.vlist .srow {
  grid-template-columns: 14px 7.5em 11em minmax(0, 1.3fr) minmax(0, 1fr) minmax(
      0,
      1.4fr
    ) auto;
}
.srow.all {
  grid-template-columns: 14px 11em minmax(0, 1.3fr) minmax(0, 1fr) minmax(
      0,
      1.2fr
    ) auto auto auto;
}
.vlist {
  max-height: none;
}
.vlist .srow.all {
  grid-template-columns: 14px 7.5em 11em minmax(0, 1.3fr) minmax(0, 1fr) minmax(
      0,
      1.4fr
    ) auto auto;
}
.srow:hover {
  background: var(--soft);
}
.srow > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srow .dev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.srow .dev .i,
.srow .src .i {
  color: var(--accent);
}
.srow .src,
.srow .who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.srow .t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srow .ago,
.srow .n,
.srow .when {
  color: var(--mute);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.srow .tag,
.tag {
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-ink);
  font-weight: 600;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.srow .dot.on {
  background: var(--accent2);
  box-shadow: 0 0 0 3px var(--soft);
}
.srow .dot.off {
  background: var(--line);
}
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed li {
  border-bottom: 1px solid var(--line);
}
.feed a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.feed a:hover {
  background: var(--soft);
}
.feed time {
  color: var(--mute);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.feed .i {
  color: var(--accent);
}
.feed .mono {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.feed li.fresh a {
  animation: flash 2.4s ease-out;
}
@keyframes flash {
  from {
    background: var(--soft);
  }
  to {
    background: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .feed li.fresh a {
    animation: none;
  }
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.badge.on .live-dot {
  margin: 0;
  width: 8px;
  height: 8px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.fact-val {
  font-size: 17px;
  font-weight: 650;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  position: relative;
}
.step {
  display: grid;
  grid-template-columns: 5.5em 22px minmax(0, 1fr);
  gap: 0 12px;
  position: relative;
  padding-bottom: 18px;
}
.step time {
  color: var(--mute);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  text-align: right;
}
.step .node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  margin: 6px auto 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--soft);
}
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(5.5em + 12px + 10px);
  top: 20px;
  bottom: -2px;
  width: 2px;
  background: var(--line);
}
.step.ev .node {
  background: var(--card);
  border: 2px solid var(--accent);
}
.step .what {
  min-width: 0;
}
.step .head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 15px;
}
.step .meta {
  display: flex;
  gap: 6px 18px;
  flex-wrap: wrap;
  color: var(--mute);
  font-size: 13.5px;
  margin-top: 2px;
}
.step .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.step.ev .what {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.step.ev .what .i {
  color: var(--accent);
}
.dwell {
  height: 6px;
  background: var(--soft);
  border-radius: 3px;
  margin-top: 8px;
  max-width: 420px;
  overflow: hidden;
}
.dwell i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

@media (max-width: 1279px) {
  .live-top,
  .live-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .srow,
  .srow.all {
    grid-template-columns: 14px 9em minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .srow .src,
  .vlist .srow .src {
    display: none;
  }
  .vlist .srow,
  .vlist .srow.all {
    grid-template-columns: 14px 6.5em 9em minmax(0, 1fr) auto;
  }
  .vlist .srow .dev {
    display: none;
  }
}
@media (max-width: 720px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .facts .kpi {
    flex-direction: row;
    align-items: center;
  }
  .srow,
  .srow.all,
  .vlist .srow,
  .vlist .srow.all {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
  }
  .srow .dev,
  .srow .ago,
  .srow .tag,
  .srow .src,
  .vlist .srow .when {
    display: none;
  }
  .srow .who {
    flex: 1;
  }
  .srow .cur {
    flex-basis: 100%;
    padding-left: 24px;
  }
  .step {
    grid-template-columns: 4.6em 18px minmax(0, 1fr);
    gap: 0 8px;
  }
  .step:not(:last-child)::before {
    left: calc(4.6em + 8px + 8px);
  }
  .live-big .kpi-val {
    font-size: 40px;
  }
}

/* Icons in tables, grades and lists: small, olive, never the only carrier of
   meaning (a word always goes with them). */
th .i {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: -2px;
  color: var(--accent);
}
td .i,
.notes-list b .i,
.exports .i,
.funnel .step-head .i,
.goals .small .i,
.vital .kpi-label .i {
  margin-right: 5px;
  color: var(--accent);
}
td .i.err,
a.err,
a.err .i {
  color: var(--st-bad);
}
.gtxt .i {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  color: inherit;
}
.gtxt.good {
  color: var(--st-good);
  font-weight: 700;
}
.vital .kpi-label {
  display: flex;
  align-items: center;
}
