/* Activity refine — shared, scoped light telemetry surface. No external assets. */
.activity-refined {
  --ar-ink: #18314f;
  --ar-muted: #637994;
  --ar-blue: #315fca;
  --ar-blue-soft: #edf3ff;
  --ar-line: #e3ebf6;
  --ar-soft: #f6f9fd;
  --ar-success: #18877e;
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 20px 0;
  padding: 24px;
  overflow: hidden;
  color: var(--ar-ink);
  background: linear-gradient(155deg, #ffffff 58%, #f6f9ff 100%);
  border: 1px solid #dce6f4;
  border-radius: 18px;
  box-shadow: 0 5px 24px #223f7010, inset 0 1px 0 #fff;
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  text-align: left;
  color-scheme: light;
}
.activity-refined,
.activity-refined * { box-sizing: border-box; }
.activity-refined::before,
.activity-refined::after { content: none; display: none; animation: none; }
.activity-refined button {
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.activity-refined button:disabled { opacity: .55; cursor: wait; }
.activity-refined button:focus-visible {
  outline: 2px solid #315fca;
  outline-offset: 3px;
}
.activity-refined .ar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
}
.activity-refined .ar-head > div { min-width: 0; }
.activity-refined .ar-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: #54719b;
  font: 650 10px/1.5 "Aptos", "Segoe UI", sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.activity-refined .ar-eyebrow::before {
  content: "";
  width: 14px;
  height: 6px;
  border-radius: 2px;
  background: #3967cf;
  box-shadow: 5px -3px 0 -1px #b7cff7;
}
.activity-refined .ar-title {
  margin: 0;
  color: var(--ar-ink);
  font-size: 20px;
  font-weight: 750;
  line-height: 1.45;
  letter-spacing: -.025em;
  text-shadow: none;
}
.activity-refined .ar-sub {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--ar-muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.activity-refined .ar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.activity-refined .ar-range {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid #e1e9f6;
  border-radius: 11px;
  background: #f1f5fb;
}
.activity-refined .ar-range button {
  min-width: 56px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #647a95;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.activity-refined .ar-range button:hover { color: #224aa8; background: #e7eefb; }
.activity-refined .ar-range button[aria-pressed="true"],
.activity-refined .ar-range button.active {
  color: #2856be;
  background: #fff;
  border-color: #dde7f6;
  box-shadow: 0 2px 5px #31527d0d;
}
.activity-refined .ar-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 42px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #dce6f4;
  border-radius: 10px;
  color: #456794;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: border-color .18s ease, background-color .18s ease;
}
.activity-refined .ar-refresh:hover { border-color: #adc4e9; background: #f4f8ff; }
.activity-refined .ar-refresh svg { width: 15px; height: 15px; }
.activity-refined .ar-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
  color: #718299;
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.activity-refined .ar-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #259385;
  box-shadow: 0 0 0 3px #e7f4f0;
}
.activity-refined .ar-status.is-error::before { background: #c47765; box-shadow: 0 0 0 3px #fcf0ed; }
.activity-refined .ar-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}
.activity-refined .ar-kpi {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid #e7edf7;
  border-radius: 11px;
  background: #f7f9fd;
  box-shadow: none;
}
.activity-refined .ar-kpi:first-child {
  background: #edf3ff;
  border-color: #dce7fc;
}
.activity-refined .ar-kpi span,
.activity-refined .ar-kpi small {
  display: block;
  color: #667b94;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
.activity-refined .ar-kpi b,
.activity-refined .ar-kpi strong {
  display: block;
  margin-top: 7px;
  color: #243e60;
  font-family: "Aptos Display", "Aptos", "Segoe UI", sans-serif;
  font-size: clamp(19px, 2vw, 27px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.18;
  letter-spacing: -.035em;
  text-shadow: none;
  overflow-wrap: anywhere;
}
.activity-refined .ar-kpi:first-child b,
.activity-refined .ar-kpi:first-child strong { color: #315fca; }
.activity-refined .ar-kpi.is-success b { color: #18877e; }
.activity-refined .ar-kpi.is-failure b { color: #a96859; }
.activity-refined .ar-kpi:last-child b { font-size: 19px; line-height: 1.65; letter-spacing: -.025em; }
.activity-refined .ar-chart {
  padding: 17px 18px 15px;
  border: 1px solid var(--ar-line);
  border-radius: 12px;
  background: #fff;
}
.activity-refined .ar-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  color: #667b94;
  font-size: 11px;
}
.activity-refined .ar-chart-head strong { color: #354f71; font-size: 12px; font-weight: 650; }
.activity-refined .ar-bars {
  display: flex;
  align-items: stretch;
  gap: clamp(3px, .65vw, 8px);
  height: 140px;
  min-width: 0;
  padding: 12px 0 0;
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #edf2f8 calc(25% - 1px), #edf2f8 25%);
  border-bottom: 1px solid #dce5f2;
}
.activity-refined .ar-bar {
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  justify-content: center;
  align-self: stretch;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 5px 5px 0 0;
  background: transparent;
  box-shadow: none;
}
.activity-refined .ar-bar > span {
  display: block;
  width: 100%;
  max-width: 40px;
  height: var(--height, 2%);
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #70a9e9 0%, #3d73cc 100%);
  box-shadow: inset 0 1px 0 #ffffff45;
  transform-origin: center bottom;
  transition: height .35s ease, filter .18s ease, opacity .18s ease;
}
.activity-refined .ar-bar:hover { background: #edf3ff91; }
.activity-refined .ar-bar:hover > span,
.activity-refined .ar-bar:focus-visible > span,
.activity-refined .ar-bar[aria-pressed="true"] > span,
.activity-refined .ar-bar.is-selected > span { background: linear-gradient(180deg, #397edc, #2b53ab); }
.activity-refined .ar-bar.is-empty > span { background: #e5edf8; }
.activity-refined .ar-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px 0 19px;
  color: #8391a7;
  font: 11px/1.5 "Aptos", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
.activity-refined .ar-heat {
  min-width: 0;
  max-width: 100%;
  padding: 4px 2px 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: #c6d5e9 #f0f4fa;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.activity-refined .ar-heat::-webkit-scrollbar { height: 5px; }
.activity-refined .ar-heat::-webkit-scrollbar-track { background: #f0f4fa; border-radius: 5px; }
.activity-refined .ar-heat::-webkit-scrollbar-thumb { background: #c6d5e9; border-radius: 5px; }
.activity-refined .ar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 100%;
  min-height: 28px;
}
.activity-refined .ar-row + .ar-row { margin-top: 3px; }
.activity-refined .ar-row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  flex: 0 0 38px;
  align-items: center;
  min-height: 28px;
  padding-right: 4px;
  color: #6c7f98;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 5px 0 6px #ffffffed;
}
.activity-refined .ar-track {
  display: grid;
  grid-template-columns: repeat(var(--cols, 48), minmax(0, 1fr));
  flex: 1 1 0;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 3px 2px;
}
.activity-refined .ar-cell {
  display: block;
  width: 100%;
  min-width: 0;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--cell, #edf1f6);
  box-shadow: inset 0 0 0 1px #18314f04;
  transform-origin: center;
  transition: transform .16s ease, box-shadow .16s ease;
}
.activity-refined .ar-cell:hover,
.activity-refined .ar-cell:focus-visible,
.activity-refined .ar-cell[aria-pressed="true"],
.activity-refined .ar-cell.is-selected {
  position: relative;
  z-index: 1;
  transform: scaleY(1.22);
  box-shadow: 0 0 0 1px #537cbe;
}
.activity-refined .ar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 13px 0 0;
  color: #71849d;
  font-size: 10px;
  line-height: 1.6;
}
.activity-refined .ar-legend > span,
.activity-refined .ar-legend > div { display: inline-flex; align-items: center; gap: 5px; }
.activity-refined .ar-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 2px;
  background: var(--cell, #edf1f6);
  box-shadow: inset 0 0 0 1px #18314f05;
}
.activity-refined .ar-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 44px;
  margin: 15px 0 0;
  padding: 11px 14px;
  border: 1px solid #e1eaf8;
  border-radius: 10px;
  color: #617a9b;
  background: #f5f8fe;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.activity-refined .ar-detail strong,
.activity-refined .ar-detail b { color: #315f9d; font-weight: 650; }
.activity-refined .ar-detail.is-active { border-color: #c9dbf7; background: #edf4ff; }
.activity-refined[aria-busy="true"] .ar-refresh { color: #8b9db5; background: #f7f9fc; }
@media (max-width: 1050px) {
  .activity-refined .ar-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .activity-refined { margin: 16px 0; padding: 18px 14px; border-radius: 15px; }
  .activity-refined .ar-head { gap: 15px; margin-bottom: 17px; }
  .activity-refined .ar-title { font-size: 19px; }
  .activity-refined .ar-sub { font-size: 11px; }
  .activity-refined .ar-controls { width: 100%; justify-content: space-between; gap: 8px; }
  .activity-refined .ar-range { flex: 1 1 auto; }
  .activity-refined .ar-range button { flex: 1; min-width: 0; min-height: 40px; padding: 7px 9px; }
  .activity-refined .ar-refresh { min-height: 48px; padding: 9px 12px; }
  .activity-refined .ar-kpis { gap: 8px; margin-bottom: 15px; }
  .activity-refined .ar-kpi { padding: 12px 10px; border-radius: 9px; }
  .activity-refined .ar-kpi b,
  .activity-refined .ar-kpi strong { font-size: 23px; }
  .activity-refined .ar-kpi:last-child b { font-size: 16px; line-height: 1.68; }
  .activity-refined .ar-chart { padding: 14px 10px 12px; border-radius: 10px; }
  .activity-refined .ar-bars { height: 116px; gap: 3px; }
  .activity-refined .ar-bar > span { border-radius: 2px 2px 0 0; }
  .activity-refined .ar-axis { margin-bottom: 14px; font-size: 10px; }
  .activity-refined .ar-row { min-height: 31px; gap: 9px; }
  .activity-refined .ar-row-label { min-height: 31px; flex-basis: 29px; }
  .activity-refined .ar-track { gap: 2px; min-width: 0; }
  .activity-refined .ar-cell { height: 19px; }
  .activity-refined .ar-legend { gap: 7px 11px; font-size: 10px; }
  .activity-refined .ar-detail { min-height: 50px; margin-top: 12px; padding: 10px 11px; font-size: 11px; }
  .activity-refined .ar-status { font-size: 10px; }
}
@media (max-width: 380px) {
  .activity-refined { padding: 16px 12px; }
  .activity-refined .ar-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-refined .ar-eyebrow { font-size: 9px; letter-spacing: .09em; }
  .activity-refined .ar-range button { padding: 7px 6px; font-size: 11px; }
  .activity-refined .ar-refresh { padding: 8px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .activity-refined *, .activity-refined *::before, .activity-refined *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .activity-refined .ar-cell:hover,
  .activity-refined .ar-cell:focus-visible,
  .activity-refined .ar-cell[aria-pressed="true"] { transform: none; }
}


.activity-refined .ar-chart-label {font-size:12px;font-weight:600;color:#5b708a;margin-bottom:8px;}
.activity-refined .ar-kpi:last-child strong {font-size:19px;line-height:1.65;}
.activity-refined .ar-legend {font-size:12px;color:#526a86;}
.activity-refined .ar-axis {color:#60748e;}
.activity-refined .ar-status {color:#60748e;}
.activity-refined .ar-row-label {color:#526a86;}
.activity-refined .ar-title {font-size:22px;margin:0;letter-spacing:-.02em;}
.activity-refined .ar-bar.is-empty > span {height:2px;min-height:2px;}
@media(max-width:640px){.activity-refined .ar-cell{height:26px}.activity-refined .ar-sub,.activity-refined .ar-status,.activity-refined .ar-detail{font-size:12px}.activity-refined .ar-kpi:last-child strong{font-size:18px}}

/* Submission-first disclosure: collapsed on each page load, no saved open state. */
.activity-refined [hidden] { display:none !important; }
.activity-refined .ar-head { align-items:center; }
.activity-refined .ar-head .ar-heading { flex:1; }
.activity-refined .ar-toggle { display:inline-flex; align-items:center; justify-content:center; gap:9px; flex-shrink:0; min-height:40px; padding:8px 13px; color:#315f9d; background:#f4f8fe; border:1px solid #dce6f4; border-radius:9px; font-size:13px; font-weight:600; }
.activity-refined .ar-toggle::after { content:""; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(225deg); margin-top:4px; }
.activity-refined .ar-toggle[aria-expanded="false"]::after { transform:rotate(45deg); margin-top:-3px; }
.activity-refined .ar-toggle:hover { background:#eaf2ff; border-color:#bacfeb; }
.activity-refined .ar-body>.ar-controls { margin-bottom:18px; }
.activity-refined.is-collapsed { padding:10px 16px; margin:12px 0; border-radius:12px; box-shadow:none; background:#fff; }
.activity-refined.is-collapsed .ar-head { flex-wrap:nowrap; margin:0; gap:12px; }
.activity-refined.is-collapsed .ar-title { font-size:15px; line-height:1.5; font-weight:600; }
.activity-refined.is-collapsed .ar-eyebrow,.activity-refined.is-collapsed .ar-sub { display:none; }
@media(max-width:640px){
 .activity-refined.is-collapsed { padding:8px 12px; }
 .activity-refined .ar-toggle { min-height:42px; padding:8px 11px; font-size:12px; }
 .activity-refined .ar-head { gap:12px; }
 .activity-refined .ar-body>.ar-controls { margin-bottom:16px; }
}


/* Direct bar/cell feedback. A body portal avoids the card's clipped boundary. */
.ar-tooltip {
  position: fixed;
  z-index: 2000;
  box-sizing: border-box;
  width: 264px;
  max-width: calc(100vw - 16px);
  padding: 13px 14px 12px;
  border: 1px solid #c9dbef;
  border-radius: 12px;
  background: #fff;
  color: #18314f;
  box-shadow: 0 8px 28px #19375b26, 0 2px 6px #19375b12;
  font: 12px/1.55 "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.ar-tooltip[hidden] { display: none !important; }
.ar-tooltip-title { display: block; color: #506983; font-size: 11px; font-weight: 600; }
.ar-tooltip-total { display: block; margin-top: 7px; font-size: 13px; font-weight: 700; }
.ar-tooltip-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.ar-tooltip-values span { display: block; padding: 5px 8px; border-radius: 6px; font-size: 14px; font-weight: 700; }
.ar-tooltip-success { color: #14735c; background: #eaf7f0; }
.ar-tooltip-failure { color: #b4444c; background: #fff0f1; }
.ar-tooltip-extra { display: block; margin-top: 8px; color: #627992; font-size: 11px; }
