/* Activity (web/activity.js): what people did in an app. The studio draws it
   in the stage, under the app design's variables (--fg, --bg, --card, --soft,
   --line, --accent, --ok, --warn, --bad); the command center's app creator
   maps its own tokens to the same names. */
.act { position: absolute; inset: 0; overflow-y: auto; padding: 0 24px 48px; color: var(--fg); font-family: var(--font, inherit); font-size: 14px; container-type: inline-size; }
.act > :not(.act-head) { max-width: 1180px; margin-left: auto; margin-right: auto; }
.act-title p.act-brief { margin: 2px 0 0; font-size: 13px; color: var(--muted); max-width: 640px; }
.act-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin: 0 -24px 18px;
  padding: 26px max(24px, calc((100% + 48px - 1180px) / 2)) 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(115deg, color-mix(in srgb, var(--g1, var(--accent)) 16%, transparent), color-mix(in srgb, var(--g2, var(--accent)) 9%, transparent) 50%, color-mix(in srgb, var(--g3, var(--accent)) 16%, transparent)); }
.act-title h1 { margin: 0; font-family: var(--font-title, inherit); font-size: 28px; letter-spacing: -.02em; line-height: 1.1; }
.act-title p { margin: 4px 0 0; color: var(--muted); }
.act-title p b { color: var(--fg); }
.act-live { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 6px; }
.act-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: act-pulse 2.2s ease-in-out infinite; animation-play-state: var(--play, running); }
@keyframes act-pulse { 50% { opacity: .3; } }
.act-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2, var(--line)); background: var(--card); color: var(--fg); border-radius: var(--radius-control, 9px); cursor: pointer; }
.act-btn:hover { border-color: var(--accent); }
.act-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--fill, var(--soft)); border: 1px solid var(--line); border-radius: calc(var(--radius-control, 9px) + 3px); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.act-seg button { border: 0; background: transparent; color: var(--muted); padding: 5px 12px; min-height: 30px; border-radius: var(--radius-control, 9px); cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; }
.act-seg button:hover { color: var(--fg); }
.act-seg button.on { background: var(--seg-on, var(--card)); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.act-seg.small { margin-bottom: 10px; }
.act-seg.small button { padding: 3px 10px; min-height: 26px; font-size: 12.5px; }
.act-select { border: 1px solid var(--line-2, var(--line)); background: var(--card); color: var(--fg); border-radius: var(--radius-control, 9px); padding: 6px 10px; font: inherit; font-size: 13px; min-height: 36px; }
.act-meta { color: var(--muted); font-size: 12.5px; }
.act-err { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.act-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; color: var(--fg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.act-chip i { font-style: normal; color: var(--muted); }
.act .ico { flex: none; }

.act-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.act-tile, .act-card { background: var(--card); border: 1px solid var(--card-border, var(--line)); box-shadow: var(--card-shadow, none); border-radius: var(--radius); min-width: 0; }
.act-tile { position: relative; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.act-tile .act-tl { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.act-tile .act-tl .ico { color: var(--accent); }
.act-tile .act-tv { font-family: var(--font-title, inherit); font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 4px; }
.act-tile .act-ts { color: var(--muted); font-size: 12.5px; }
.act-tile .act-ts .warn { color: var(--fg); display: inline-flex; align-items: center; gap: 4px; }
.act-tile .act-ts .warn .ico { color: var(--warn); }
.act-spark { position: absolute; right: 14px; top: 12px; }
.act-spark polyline { fill: none; stroke: color-mix(in srgb, var(--fg) 30%, transparent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.act-spark circle { fill: var(--accent); stroke: var(--card); stroke-width: 2; }

.act-card { padding: 16px 18px 18px; margin-bottom: 14px; }
.act-ch { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.act-ch h2 { margin: 0; font-family: var(--font-title, inherit); font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.act-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; margin-bottom: 14px; }
.act-two.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.act-two.one { grid-template-columns: minmax(0, 1fr); }
.act-two > .act-card { margin-bottom: 0; }

.act-chart, .act-punch { display: block; max-width: 100%; height: auto; overflow: visible; }
.act-chart .grid { stroke: var(--line); stroke-width: 1; }
.act-chart .tick, .act-punch .tick { fill: var(--muted); font-size: 11px; font-family: var(--font, inherit); }
.act-chart .bar { fill: var(--accent); }
.act-chart .hit { fill: transparent; }
.act-chart .hit:hover { fill: color-mix(in srgb, var(--fg) 6%, transparent); }
.act-punch .off { fill: var(--soft); }
.act-punchwrap { display: flex; flex-direction: column; gap: 10px; }
.act-scale { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11.5px; }
.act-scale i { width: 11px; height: 11px; border-radius: 3px; background: var(--accent); display: inline-block; }
.act-scale i:first-of-type { margin-left: 5px; }
.act-scale i:last-of-type { margin-right: 5px; }
.act-busy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.act-busy > div { display: flex; flex-direction: column; min-width: 0; }
.act-busy b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-punch .on { fill: var(--accent); }
.act-punch rect:hover { stroke: var(--fg); stroke-width: 1.5; }

.act-flow { overflow-x: auto; padding: 2px 0 4px; }
.act-flow-in { display: flex; flex-direction: column; margin: 0 auto; }
.act-arcs { display: block; overflow: visible; }
.act-arcs .arc { fill: none; stroke: var(--accent); stroke-opacity: .5; stroke-linecap: round; }
.act-arcs .arc-head { fill: none; stroke: var(--accent); stroke-opacity: .75; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act-arcs .arc-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; }
.act-arcs .arc-pill { fill: var(--card); stroke: var(--line-2, var(--line)); }
.act-arcs .arc-n { fill: var(--fg); font-size: 11px; font-weight: 600; font-family: var(--font, inherit); }
.act-nodes { display: grid; }
.act-node { margin: 0 6px; text-align: left; border: 1px solid var(--line-2, var(--line)); background: var(--card); border-radius: var(--radius-control, 10px); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; color: var(--fg); font: inherit; min-width: 0; }
.act-node:hover { border-color: var(--accent); }
.act-nodes.col { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.act-nodes.col .act-node { margin: 0; }
.act-moves { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.act-moves li { display: flex; align-items: baseline; gap: 6px; padding: 6px 0; flex-wrap: wrap; }
.act-moves li + li { border-top: 1px solid var(--line); }
.act-moves .arrow { color: var(--accent); }
.act-moves .act-meta { margin-left: auto; }
.act-node .nt { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-node .nn { font-size: 13px; }
.act-node .nbar { height: 4px; border-radius: 2px; background: var(--soft); overflow: hidden; }
.act-node .nbar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.act-node .nm { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-node.idle { opacity: .55; }

.act-tables { display: flex; flex-direction: column; gap: 14px; }
.act-table + .act-table { border-top: 1px solid var(--line); padding-top: 14px; }
.act-table .tt { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.act-stats { display: flex; gap: 16px; margin: 6px 0 10px; flex-wrap: wrap; }
.act-stat { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.act-stat b { color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; }
.act-stat .ico { color: var(--accent); }
.act-stat.zero { opacity: .5; }
.act-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.act-rows { list-style: none; margin: 0; padding: 0; }
.act-rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.act-rows li + li { border-top: 1px solid var(--line); }
.act-rows .rn { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.act-rows .rn.gone { text-decoration: line-through; color: var(--muted); }
.act-rows .act-meta { flex: none; }

.act-attn { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.act-attn li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--radius-control, 10px); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.act-attn li.bad { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.act-attn .ai { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.act-attn li.bad .ai { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.act-attn .when { white-space: nowrap; }
.ux-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ux-m { padding: 12px 14px; border-radius: var(--radius-control, 10px); background: var(--soft); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ux-m .ux-l { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.ux-m .ux-l .ico { color: var(--accent); }
.ux-m .ux-v { font-family: var(--font-title, inherit); font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ux-m .ux-l .ico, .ux-m .ux-s .ico { flex: none; margin-top: 2px; }
.ux-m.wait .ux-v { color: var(--muted); }
.ux-m .ux-s { display: flex; align-items: flex-start; gap: 5px; font-size: 12.5px; margin-top: 4px; color: var(--muted); }
.ux-m.ok .ux-s { color: var(--fg); } .ux-m.ok .ux-s .ico { color: var(--ok); }
.ux-m.over { background: color-mix(in srgb, var(--warn) 10%, var(--soft)); }
.ux-m.over .ux-s { color: var(--fg); font-weight: 550; } .ux-m.over .ux-s .ico { color: var(--warn); }
.ux-vs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.ux-vs .act-chip.on { border-color: var(--accent); }
.ux-f { margin-top: 12px; }
@media (max-width: 760px) { .ux-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .ux-m { padding: 10px 12px; } .ux-m .ux-v { font-size: 22px; } }
.act-ok { display: flex; gap: 8px; align-items: center; color: var(--muted); padding: 10px 12px; background: var(--soft); border-radius: var(--radius-control, 10px); }
.act-ok .ico { color: var(--ok); }
.act-sub { margin: 16px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.act-signals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.act-signals li { display: flex; gap: 8px; align-items: flex-start; }
.act-signals .ico { color: var(--accent); margin-top: 3px; }

.act-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.act-visits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.act-visit { border: 1px solid var(--line); border-radius: var(--radius-control, 10px); }
.act-visit .vh { width: 100%; display: grid; grid-template-columns: 34px minmax(150px, auto) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--fg); border-radius: inherit; }
.act-visit .vh:hover { background: var(--soft); }
.act-visit .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft, var(--soft)); color: var(--accent); }
.act-visit .av.me { background: var(--accent); color: var(--accent-fg); font-size: 11px; }
.act-visit .vw { display: flex; flex-direction: column; min-width: 0; }
.act-visit .vp { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.act-visit .vp .sep { color: var(--muted); }
.act-visit .vs { text-align: right; }
.act-steps { list-style: none; margin: 0; padding: 2px 12px 12px 18px; position: relative; }
.act-steps::before { content: ''; position: absolute; left: 28.5px; top: 0; bottom: 18px; width: 1px; background: var(--line-2, var(--line)); }
.act-steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 4px 0; font-size: 13.5px; }
.act-steps .si { grid-column: 1; grid-row: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line-2, var(--line)); color: var(--muted); position: relative; }
.act-steps .sw { grid-column: 2; grid-row: 1; min-width: 0; }
.act-steps .st { grid-column: 3; grid-row: 1; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-steps li:is(.add, .change, .remove) .si { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.act-steps li.warn .si { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.act-steps li.bad .si { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.act-more { margin-top: 10px; border: 1px solid var(--line-2, var(--line)); background: var(--card); color: var(--fg); padding: 7px 14px; min-height: 36px; border-radius: var(--radius-control, 9px); cursor: pointer; font: inherit; }
.act-more:hover { border-color: var(--accent); }
.act-empty { color: var(--muted); padding: 14px 0; }
.act-hello { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.act-hello-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft, var(--soft)); color: var(--accent); }
.act-hello h2 { font-family: var(--font-title, inherit); margin: 6px 0 0; }
.act-hello p { color: var(--muted); max-width: 440px; margin: 0; }
.act-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--card); color: var(--fg); border: 1px solid var(--line-2, var(--line)); box-shadow: 0 8px 24px rgba(0,0,0,.16); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; max-width: 280px; font-family: var(--font, inherit); }
.act-tip[hidden] { display: none; }
.act-tip b { display: block; font-size: 13px; }
@container (max-width: 760px) {
  .act-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .act-tile .act-tv { font-size: 26px; }
  .act-visit .vh { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .act-visit .vp { grid-column: 2 / -1; grid-row: 2; }
}
@container (max-width: 420px) { .act-spark { display: none; } .act-head { padding-top: 18px; } }
@media (max-width: 700px) { .act { padding: 0 14px 40px; } .act-head { margin: 0 -14px 14px; padding-left: 14px; padding-right: 14px; } }

