:root{--cy-sidepanel-width:520px}
/* Full-height activity and channel sidepanels; audience records remain beside the panel. */
.bp-activity-drawer {
  --activity-ink: var(--cy-white-95);
  --activity-muted: var(--cy-white-55);
  --activity-rule: var(--cy-white-10);
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  padding: 30px;
  width: var(--cy-sidepanel-width,520px);
  max-width: calc(100vw / var(--app-ui-scale, 1));
  height: calc(100dvh / var(--app-ui-scale, 1));
  max-height: calc(100dvh / var(--app-ui-scale, 1));
  overflow: auto;
  border: 0;
  border-radius: 8px;
  z-index: 90;
  box-shadow: none;
  background: var(--cy-surface);
  color: var(--activity-ink);
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 16px;
  letter-spacing: 0px;
  scrollbar-width: thin;
  scrollbar-color: var(--cy-white-35) transparent;
}
.bp-activity-drawer::backdrop { background: rgb(0 0 0 / 40%); }
.bp-activity-drawer *, .bp-activity-drawer *::before, .bp-activity-drawer *::after { box-sizing: border-box; letter-spacing: 0px; }
.bp-activity-drawer h2, .bp-activity-drawer h3, .bp-activity-drawer p { margin: 0; }
.bp-activity-drawer h2 { font-size: 20px; line-height: 20px; font-weight: 500; }
.bp-activity-header { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.bp-activity-close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -6px -6px -6px 0; padding: 0; border-radius: 0; }
.bp-activity-close img { display: block; width: 14px; height: 14px; }
.bp-activity-close:hover { background: var(--cy-white-5); }
.bp-activity-context { margin-top: 15px !important; display: flex; align-items: center; gap: 12px; color: var(--activity-muted); font-size: 16px; line-height: 16px; }
.bp-activity-primary { display: flex; align-items: baseline; gap: 8px; margin-top: 15px; }
.bp-activity-number { font-family: 'D-DIN', sans-serif; font-variant-numeric: tabular-nums; font-weight: 400; }
.bp-activity-primary strong { font-size: 40px; line-height: 40px; font-weight:700; color: #42cf8a; }
.bp-activity-unit { font-size: 16px; line-height: 16px; color: var(--activity-muted); }
.bp-activity-caption { display: flex; align-items: center; gap: 8px; margin-top: 0 !important; color: var(--activity-muted); font-size: 14px; line-height: 14px; }
.bp-activity-drawer hr { margin: 30px 0; border: 0; border-top: 1px solid var(--activity-rule); }
.bp-activity-drawer h3 { font-size: 16px; line-height: 16px; font-weight: 500; }
.bp-activity-note { margin-top: 15px !important; color: var(--activity-muted); font-size: 14px; line-height: 14px; }
.bp-activity-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 30px; }
.bp-activity-stat { min-width: 0; }
.bp-activity-stat-label { display: block; color: var(--cy-white-75); }
.bp-activity-stat-value { display: block; margin-top: 15px; font-size: 20px; line-height: 20px; }
.bp-activity-stat p { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; color: var(--activity-muted); font-size: 14px; line-height: 14px; }
.bp-activity-link { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 0; margin-top: 15px; color: var(--cy-tab-accent); font-size: 14px; line-height: 14px; text-decoration: none; }
.bp-activity-link img { display: block; width: 14px; height: 14px; flex: 0 0 14px; }
.bp-activity-link:hover { text-decoration: underline; }
.bp-activity-distribution-layout { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 30px; align-items: center; margin-top: 22px; }
.bp-activity-ring { display: block; flex-shrink: 0; width: 132px; height: 132px; overflow: visible; }
.bp-activity-states { min-width: 0; }
.bp-activity-state { display: grid; grid-template-columns: 8px 56px max-content minmax(66px, 1fr); gap: 8px; align-items: center; min-height: 44px; }
.bp-activity-state-label { font-size: 16px; line-height: 16px; }
.bp-activity-state-dot { display: block; width: 8px; height: 8px; border-radius: 50%; }

.bp-activity-state-value, .bp-activity-state-rate { text-align: left; font-size: 16px; line-height: 16px; }
.bp-activity-state-rate { color: var(--activity-muted); }
.bp-activity-state-metrics { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.bp-activity-state-separator { color: var(--activity-muted); font-size: 16px; line-height: 16px; }
.bp-activity-state .bp-activity-link { margin: 0; justify-self: end; white-space: nowrap; }
.bp-activity-positive { color: #42cf8a; }
.bp-activity-warning { color: #ea9d4d; }
.bp-activity-footnote { margin-top: 30px !important; display: flex; flex-direction: column; gap: 8px; color: var(--activity-muted); font-size: 14px; line-height: 14px; }
html[data-theme=light] .bp-activity-drawer { --activity-ink: rgb(0 0 0 / 95%); --activity-muted: rgb(0 0 0 / 55%); --activity-rule: rgb(0 0 0 / 10%); background: #fff; color: var(--activity-ink); }
html[data-theme=light] .bp-activity-drawer .bp-activity-close img { filter: brightness(0); }
html[data-theme=light] .bp-activity-drawer :is(.bp-activity-hero-label, .bp-activity-stat-label) { color: rgb(0 0 0 / 75%); }

@media (max-width: 420px) { .bp-activity-drawer { padding: 20px; } .bp-activity-pair { gap: 20px; } }

@keyframes cy-sidepanel-appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { .bp-activity-drawer[open] { animation: cy-sidepanel-appear 120ms ease-out; } }

.bp-activity-explanation { display:block; min-height:48px; margin:30px 0 0 !important; padding:14px 29px; border:1px solid rgb(234 157 77 / 35%); border-radius:8px; background:rgb(234 157 77 / 10%); color:var(--cy-white-75); font-family:'PingFang SC','Microsoft YaHei',sans-serif; font-size:16px; line-height:1.5; letter-spacing:0px; white-space:normal; overflow-wrap:break-word; min-width:0; }
html[lang="en"] .bp-activity-explanation { font-family:Inter,sans-serif; }
html[data-theme="light"] .bp-activity-explanation { color:rgb(0 0 0 / 75%); }
.bp-activity-guidance { display: flex; flex-direction: column; gap: 8px; margin-top: 15px !important; font-size: 16px; line-height: 16px; color: var(--cy-white-75); }


@media (max-width: 420px) { .bp-activity-distribution-layout { grid-template-columns: 112px minmax(0, 1fr); gap: 20px; } .bp-activity-ring { width: 112px; height: 112px; } }





/* Overview and event metrics share the same two-column reading grid. */
.bp-activity-overview { margin:0; }
.bp-activity-overview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:30px; margin:0; }
.bp-activity-overview-note { margin-top:8px !important; color:var(--activity-muted); font-size:16px; line-height:16px; }
.bp-activity-overview-footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 22px; }
.bp-activity-overview-footer .bp-activity-caption, .bp-activity-overview-footer .bp-activity-link { margin-top: 0 !important; }
.bp-activity-events .bp-activity-pair { margin-top: 22px; }
@media (max-width: 420px) { .bp-activity-overview-grid { gap: 20px; } }

.bp-activity-stat > .bp-activity-link { margin-top:15px; }
.bp-activity-drawer section[aria-labelledby="bp-activity-movement"] .bp-activity-stat { display:flex; flex-direction:column; align-items:flex-start; }
.bp-activity-drawer section[aria-labelledby="bp-activity-movement"] .bp-activity-stat > p { flex:1; }

/* Independent overview card follows the existing Hard Match metric-card treatment. */
.bp-activity-overview + hr {display:none;}
.bp-activity-events {margin-top:30px;}
html[data-theme="light"] .bp-activity-overview {background:rgb(0 0 0 / 3%);border-color:rgb(0 0 0 / 10%);}
@media (max-width:420px) { .bp-activity-overview {padding:19px;} }

.bp-activity-states {padding-right:30px;}
@media (max-width:420px) { .bp-activity-states {padding-right:20px;} }


.bp-activity-overview .bp-activity-stat-label {color:var(--activity-muted);}



/* Both upper quantitative sections follow the approved two-column card preview. */
.bp-activity-section {margin-top:30px;}
.bp-activity-section-heading {display:block;}
.bp-activity-section-heading h3 {font-size:16px;line-height:16px;font-weight:500;margin:0;}
.bp-activity-metric-card {display:flex;flex-direction:column;margin:0;padding:29px;border:1px solid var(--cy-white-10);border-radius:12px;background:var(--cy-white-5);}
.bp-activity-metric-card .bp-activity-overview-grid,.bp-activity-metric-card .bp-activity-pair {margin:0;min-height:0;}
.bp-activity-metric-card .bp-activity-stat-label {color:var(--activity-muted);}
.bp-activity-metric-card .bp-activity-primary strong {color:var(--activity-ink);}
.bp-activity-metric-card .bp-activity-primary strong.bp-activity-rate-value {color:#42cf8a;}
.bp-activity-metric-card .bp-activity-stat-value {font-size:40px;line-height:40px;font-weight:700;color:var(--activity-ink);}
.bp-activity-metric-card .bp-activity-stat-value.bp-activity-warning {color:#ea9d4d;}
.bp-activity-metric-card .bp-activity-stat p {font-size:16px;line-height:16px;margin-top:8px;}
.bp-activity-ratio-track {height:6px;margin-top:15px;background:var(--cy-white-10);overflow:hidden;}
.bp-activity-ratio-track > span {display:block;height:100%;background:#42cf8a;}
html[data-theme="light"] .bp-activity-period-card {background:rgb(0 0 0 / 3%);border-color:rgb(0 0 0 / 10%);}
@media (max-width:420px) {.bp-activity-metric-card {padding:19px;}.bp-activity-section-heading h3{font-size:16px;line-height:16px;}}


.bp-activity-metric-card .bp-activity-link {display:flex;width:fit-content;margin-top:8px;font-size:16px;line-height:16px;min-height:18px;}


/* Simple section titles and the reviewed two-row, common-scale activity comparison. */
.bp-activity-section-heading + .bp-activity-metric-card {margin-top:30px;}
.bp-activity-comparison-rows {display:grid;row-gap:22px;}
.bp-activity-comparison-row {display:grid;grid-template-columns:112px minmax(0,1fr) 80px;gap:15px;align-items:center;}
.bp-activity-comparison-label {font-size:16px;line-height:16px;white-space:nowrap;color:var(--activity-ink);}
.bp-activity-comparison-track {height:6px;background:var(--cy-white-10);}
.bp-activity-comparison-fill {display:block;height:100%;background:var(--cy-white-55);}
.bp-activity-comparison-fill.is-active {background:#42cf8a;}
.bp-activity-comparison-value {display:flex;align-items:baseline;justify-content:flex-end;gap:4px;white-space:nowrap;}
.bp-activity-comparison-value strong {font-size:20px;line-height:20px;font-weight:700;}
.bp-activity-comparison-unit {font-size:14px;line-height:14px;color:var(--activity-muted);}
.bp-activity-comparison-scale {display:grid;grid-template-columns:112px minmax(0,1fr) 80px;column-gap:15px;margin-top:8px;}
.bp-activity-comparison-scale > div {grid-column:2;display:flex;justify-content:space-between;color:var(--activity-muted);font:400 14px/14px 'D-DIN',sans-serif;}
.bp-activity-comparison-difference {display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-top:30px;}
.bp-activity-comparison-difference strong {color:#ea9d4d;}
.bp-activity-comparison .bp-activity-comparison-note {margin:8px 0 0;color:var(--activity-muted);font-size:16px;line-height:16px;}
.bp-activity-comparison .bp-activity-comparison-definition {margin:22px 0 0;color:var(--activity-muted);font-size:14px;line-height:14px;}
@media (max-width:580px) {.bp-activity-comparison-row,.bp-activity-comparison-scale {grid-template-columns:98px minmax(0,1fr) 68px;column-gap:10px;}}
@media (max-width:420px) {.bp-activity-comparison-row {grid-template-columns:minmax(0,1fr) auto;row-gap:8px;}.bp-activity-comparison-row .bp-activity-comparison-track {grid-column:1/-1;grid-row:2;}.bp-activity-comparison-row .bp-activity-comparison-value {grid-column:2;grid-row:1;}.bp-activity-comparison-scale {display:block;}}

/* State transitions use one quiet card and two complete directional rows. */
.bp-activity-flow-card {margin-top:30px;}
.bp-activity-flow-heading {display:flex;align-items:baseline;justify-content:space-between;gap:30px;}
.bp-activity-flow-heading h4 {margin:0;color:var(--cy-white-75);font-size:16px;line-height:16px;font-weight:400;}
.bp-activity-flow-card .bp-activity-flow-description {margin:15px 0 0;color:var(--activity-muted);font-size:16px;line-height:16px;}
.bp-activity-flow-card .bp-activity-flow-meta {margin:8px 0 0;color:var(--activity-muted);font-size:14px;line-height:14px;}
.bp-activity-flow-card .bp-activity-flow-rule {height:0;border:0;border-top:1px solid var(--cy-white-10);margin:22px 0;}
html[data-theme="light"] .bp-activity-flow-card {background:rgb(0 0 0 / 3%);border-color:rgb(0 0 0 / 10%);}
html[data-theme="light"] .bp-activity-flow-heading h4 {color:rgb(0 0 0 / 75%);}

.bp-activity-drawer .bp-activity-module-rule {display:block;height:0;border:0;border-top:1px solid var(--cy-white-10);margin:30px 0;}
.bp-activity-module-rule + .bp-activity-section {margin-top:0;}


/* Activity audience actions reuse the compact secondary button, with a two-character label. */
#bp-activity-drawer .bp-activity-link.bp-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 auto;width:64px;min-width:64px;height:36px;min-height:36px;padding:0;gap:0;border:0;outline:1px solid color-mix(in srgb,var(--cy-tab-accent) 35%,transparent);outline-offset:0;border-radius:4px;background:color-mix(in srgb,var(--cy-tab-accent) 10%,transparent);color:var(--cy-tab-accent);font-family:'PingFang SC','Microsoft YaHei',sans-serif;font-size:16px;line-height:16px;font-weight:400;letter-spacing:0px;text-decoration:none;white-space:nowrap;cursor:pointer}
#bp-activity-drawer .bp-activity-link.bp-button:hover{background:color-mix(in srgb,var(--cy-tab-accent) 15%,transparent);color:var(--cy-tab-accent);text-decoration:none}
#bp-activity-drawer .bp-activity-link.bp-button:focus-visible{outline:1px solid var(--cy-tab-accent);outline-offset:2px}
html[lang="en"] #bp-activity-drawer .bp-activity-link.bp-button{font-family:Inter,sans-serif}
