/* Activity (activity.js, docs/ACTIVITY.md §8): flat, hairlines, no boxes. One column on a phone. */
.ac-page { min-width: 0; }
.ac-head { align-items: flex-end; gap: 16px; }
.ac-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.ac-sel { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.ac-sel.hide { display: none; }
.ac-sel select, .ac-logbar input, .ac-logbar select { background: var(--ink-2); border: 1px solid var(--control); border-radius: 4px; padding: 8px 10px; color: var(--text); font: 14px var(--sans); min-height: 38px; outline: 0; }
.ac-sel select:focus, .ac-logbar input:focus, .ac-logbar select:focus { border-color: var(--canopy); }
.ac-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; white-space: nowrap; }
.ac-tabs::-webkit-scrollbar { display: none; }
.ac-tabs .chip { flex: none; min-height: 44px; }
.ac-tabs .ac-locktab { color: var(--text-3); }
.ac-tabs .ac-locktab svg { vertical-align: -1px; opacity: .7; }
.ac-body { min-width: 0; }
.ac-empty { color: var(--text-3); font-size: 13px; padding: 10px 0 14px; margin: 0; }
.ac-foot { margin: 14px 0 0; }
.ac-h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 10px 0 4px; }

/* stats: one ruled row */
.ac-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: var(--hair); border-bottom: var(--hair); margin-bottom: 8px; }
.ac-stat { padding: 12px 16px 12px 0; border-left: var(--hair); padding-left: 16px; min-width: 0; }
.ac-stat:first-child { border-left: 0; padding-left: 0; }
.ac-stat .k { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-stat .v { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ac-stat .v small { font-size: 13px; color: var(--text-3); font-weight: 400; }
.ac-stat.warn .v { color: var(--warn); } .ac-stat.bad .v { color: var(--bad); } .ac-stat.live .v { color: var(--ok); }

/* sections and their rows */
.ac-sec { border-top: var(--hair); padding: 4px 0 10px; min-width: 0; }
.ac-sh { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 0 6px; }
.ac-sh h2 { font-size: 15px; margin: 0; }
.ac-sh .dim { font-size: 12px; }
.ac-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.ac-table { display: table; width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ac-tr { display: table-row; }
.ac-tr > span { display: table-cell; padding: 9px 14px 9px 0; border-top: var(--hair); vertical-align: top; overflow-wrap: anywhere; }
.ac-th > span { color: var(--text-3); font-size: 12px; font-weight: 500; border-top: 0; padding-top: 4px; }
.ac-proj { font: 12px var(--mono); color: var(--sky); }
.ac-acts { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.ac-chipsline { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 10px; }
.ac-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--idle); margin-right: 7px; vertical-align: 1px; flex: none; }
.ac-dot.ok { background: var(--ok); } .ac-dot.warn { background: var(--warn); } .ac-dot.bad { background: var(--bad); }
.ac-meter { display: inline-block; width: 100%; min-width: 60px; max-width: 220px; height: 4px; background: var(--ink-3); vertical-align: middle; }
.ac-meter i { display: block; height: 100%; background: var(--text-2); }
.ac-meter.warn i { background: var(--warn); } .ac-meter.bad i { background: var(--bad); }

/* the log */
.ac-logbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 4px 0 12px; }
.ac-logbar #acQ { flex: 1 1 220px; min-width: 0; }
.ac-logbar #acEvent { flex: 1 1 200px; min-width: 0; font-family: var(--mono); font-size: 13px; }
.ac-logbar .sp { flex: 1 0 0; }
.ac-live { font-size: 12px; color: var(--text-3); white-space: nowrap; display: inline-flex; align-items: center; }
.ac-chain { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 13px; padding: 10px 0; border-top: var(--hair); color: var(--text-2); }
.ac-chain.bad { color: var(--bad); }
.ac-chain .linkbtn { margin-left: auto; }
.ac-lines { list-style: none; margin: 0; padding: 0; }
.ac-line-row { border-top: var(--hair); }
.ac-line-row.fresh { animation: ac-in 1.6s ease-out; }
@keyframes ac-in { from { background: color-mix(in srgb, var(--canopy) 10%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .ac-line-row.fresh { animation: none; } }
.ac-line-row.sec .ac-what b { color: var(--warn); }
.ac-lr { display: grid; grid-template-columns: 92px minmax(120px, 190px) minmax(160px, 260px) 1fr; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; color: inherit; padding: 9px 0; font: 13.5px var(--sans); cursor: pointer; min-height: 44px; align-items: baseline; }
.ac-lr:hover { background: var(--ink-1); }
.ac-lr:focus-visible { outline: 1px solid var(--canopy); outline-offset: -1px; }
.ac-when { color: var(--text-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ac-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-kind { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.ac-kind.k-customer { color: var(--warn); } .ac-kind.k-agent { color: var(--sky); } .ac-kind.k-device, .ac-kind.k-machine { color: var(--ok); }
.ac-what { min-width: 0; overflow-wrap: anywhere; }
.ac-what b { font: 500 13px var(--mono); }
.ac-detail { min-width: 0; color: var(--text-3); font-size: 12.5px; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ac-kv { margin-right: 12px; }
.ac-kv b { font-weight: 500; color: var(--text-2); }
.ac-full { padding: 0 0 12px; }
.ac-full.hide { display: none; }
.ac-full pre { margin: 0 0 6px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.ac-more { padding: 12px 0; }

/* charts */
.ac-bars { margin: 6px 0 4px; }
.ac-bars svg { display: block; width: 100%; height: 120px; }
.ac-bars rect { fill: var(--text-2); }
.ac-bars rect:hover { fill: var(--canopy); }
.ac-bars line { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ac-bars figcaption, .ac-line figcaption { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--text-3); padding-top: 3px; gap: 8px; }
.ac-line { margin: 4px 0 8px; }
.ac-line svg { display: block; width: 100%; height: auto; overflow: visible; }
.ac-line .ln { fill: none; stroke: var(--text); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.ac-line .band { fill: var(--text-2); opacity: .16; }
.ac-line .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ac-line .limit { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.ac-line .llab { fill: var(--warn); font: 11px var(--mono); text-anchor: end; }
.ac-line .ylab { fill: var(--text-3); font: 11px var(--mono); text-anchor: end; }
.ac-line .xlab { fill: var(--text-3); font: 11px var(--mono); }
.ac-line .pt { fill: var(--canopy); }
.ac-line .last { fill: var(--canopy); stroke: var(--ink-0); stroke-width: 1.5; }

/* IoT */
.ac-iot { display: grid; grid-template-columns: 240px 1fr; gap: 0 28px; min-width: 0; }
.ac-devs { list-style: none; margin: 0; padding: 0; border-top: var(--hair); }
.ac-dev { display: flex; align-items: baseline; width: 100%; text-align: left; gap: 2px; background: transparent; border: 0; border-bottom: var(--hair); color: inherit; padding: 10px 6px; min-height: 52px; cursor: pointer; font: 14px var(--sans); }
.ac-dev > span { display: flex; flex-direction: column; min-width: 0; }
.ac-dev .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-dev.on { box-shadow: inset 2px 0 0 var(--canopy); background: var(--ink-1); }
.ac-iotmain { min-width: 0; }
.ac-iothead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 0 0 6px; }
.ac-iothead h2 { margin: 0 0 2px; font-size: 18px; }
.ac-chans { margin-bottom: 6px; overflow-x: auto; flex-wrap: nowrap; }
.ac-chans .chip { flex: none; min-height: 40px; }
.ac-range { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; padding: 4px 0 2px; }
.ac-range .linkbtn { min-height: 36px; }
.ac-range .linkbtn.on { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.ac-thform { padding-top: 10px; }
.ac-integ { list-style: none; margin: 0; padding: 0; }
.ac-integ li { display: flex; align-items: baseline; padding: 9px 0; border-top: var(--hair); }
.ac-integ li > span { display: flex; flex-direction: column; min-width: 0; }
.ac-integ .dim { overflow-wrap: anywhere; }
.ac-form .check { flex-direction: row; align-items: center; min-height: 44px; }
.ac-form select[multiple] { min-height: 84px; }

/* a phone: one column, every table a list of labelled rows */
@media (max-width: 780px) {
  .ac-head { flex-direction: column; align-items: stretch; }
  .ac-filters { width: 100%; }
  .ac-sel { flex: 1 1 140px; }
  .ac-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
  .ac-stat { border-left: 0; padding-left: 0; border-bottom: var(--hair); }
  .ac-stat:nth-child(2n) { padding-left: 14px; border-left: var(--hair); }
  .ac-stat .v { font-size: 19px; }
  .ac-two, .ac-iot { grid-template-columns: 1fr; }
  .ac-devs { display: flex; overflow-x: auto; gap: 0; border-bottom: var(--hair); margin-bottom: 12px; }
  .ac-devs li { flex: none; }
  .ac-dev { border-bottom: 0; border-right: var(--hair); min-width: 170px; }
  .ac-table, .ac-tr { display: block; }
  .ac-th { display: none; }
  .ac-tr { border-top: var(--hair); padding: 8px 0; }
  .ac-tr > span { display: flex; gap: 10px; border: 0; padding: 2px 0; }
  .ac-tr > span::before { content: attr(data-h); flex: 0 0 96px; color: var(--text-3); font-size: 12px; }
  .ac-tr > span[data-h=""]::before { content: none; }
  .ac-lr { grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; }
  .ac-lr .ac-when { order: 2; text-align: right; }
  .ac-lr .ac-who { order: 1; }
  .ac-lr .ac-what { order: 3; grid-column: 1 / -1; }
  .ac-lr .ac-detail { order: 4; grid-column: 1 / -1; }
  .ac-logbar .sp { display: none; }
  .ac-logbar select { flex: 1 1 140px; }
  .ac-chain .linkbtn { margin-left: 0; }
  .ac-line .ylab, .ac-line .xlab, .ac-line .llab { font-size: 13px; }
}
/* the log's empty state is a list item of its own: no row rule */
.ac-lines > li.ac-none { border: 0; padding: 0; }
