body.apps-analytics-page {
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 70, 229, 0.08), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.07), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #f3f7ff 46%, #f8fbff 100%);
  color: var(--ink, #0f172a);
}

.apps-analytics {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.aa-hero,
.aa-insights-card,
.aa-attention-card,
.aa-toolbar,
.aa-section {
  border: 1px solid rgba(202, 213, 231, 0.9);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(30, 43, 75, 0.08);
}

.aa-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 30px 34px;
}

.aa-eyebrow,
.aa-block-head > div > span,
.aa-section-head > div > span {
  display: block;
  margin: 0 0 8px;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.aa-hero h1 {
  margin: 0;
  max-width: 880px;
  color: var(--ink, #0f172a);
  font-size: clamp(42px, 3.8vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.aa-hero p:not(.aa-eyebrow) {
  max-width: 850px;
  margin: 12px 0 0;
  color: var(--muted, #64748b);
  font-size: 17px;
  line-height: 1.38;
  font-weight: 750;
}

.aa-period-tabs,
.aa-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aa-period-tabs-hero {
  justify-content: flex-end;
}

.aa-period,
.aa-type {
  appearance: none;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid #c9d4e8;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

.aa-period:hover,
.aa-type:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.45);
}

.aa-period.active,
.aa-type.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.22);
}

.aa-insights-card {
  margin-top: 16px;
  padding: 22px 24px;
}

.aa-block-head,
.aa-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.aa-insights-card .aa-block-head {
  display: block;
}

.aa-block-head h2,
.aa-toolbar h2,
.aa-section-head h2 {
  margin: 7px 0 0;
  color: var(--ink, #0f172a);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.aa-insights-card .aa-block-head h2 {
  font-size: 26px;
}

.aa-block-head p,
.aa-toolbar p,
.aa-section-head p {
  max-width: 920px;
  margin: 8px 0 0;
  color: var(--muted, #64748b);
  font-weight: 750;
  line-height: 1.45;
}

.aa-insights-card .aa-block-head p {
  font-size: 16px;
}

.aa-executive-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.aa-exec-card,
.aa-executive-details article {
  border: 1px solid rgba(202, 213, 231, 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 10px 26px rgba(30, 43, 75, 0.045);
}

.aa-exec-card {
  min-height: 106px;
  padding: 14px 16px;
}

.aa-exec-card span,
.aa-executive-details article span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aa-exec-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink, #0f172a);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.aa-exec-card p,
.aa-executive-details article p {
  margin: 8px 0 0;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.aa-exec-negative {
  border-color: rgba(220, 38, 38, 0.22);
}

.aa-exec-negative strong {
  color: #991b1b;
}

.aa-exec-balance {
  border-color: rgba(79, 70, 229, 0.22);
}

.aa-exec-balance strong {
  color: #312e81;
}

.aa-exec-release {
  border-color: rgba(2, 132, 199, 0.22);
}

.aa-exec-release strong {
  color: #075985;
}

.aa-exec-activity {
  border-color: rgba(109, 40, 217, 0.22);
}

.aa-exec-activity strong {
  color: #4c1d95;
}

.aa-executive-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.aa-executive-details article {
  min-height: 88px;
  padding: 13px 15px;
}

.aa-executive-details article strong {
  display: block;
  margin-top: 8px;
  color: var(--ink, #0f172a);
  font-size: 16px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.aa-exec-actions {
  grid-column: span 4;
  min-height: auto !important;
}

.aa-exec-actions ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink, #0f172a);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.4;
}

.aa-exec-actions li + li {
  margin-top: 0;
}

.aa-attention-card {
  margin-top: 16px;
  padding: 24px 26px 26px;
}

.aa-status {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted, #64748b);
  font-weight: 850;
}

.aa-status[data-tone="success"] {
  color: #15803d;
}

.aa-status[data-tone="error"] {
  color: #dc2626;
}

.aa-attention-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.aa-attention-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid #dfe7f3;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.aa-attention-main {
  min-width: 0;
  display: flex;
  gap: 12px;
}

.aa-attention-title {
  display: flex;
  gap: 8px;
  align-items: center;
}

.aa-attention-title span {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 900;
}

.aa-attention-title h3 {
  margin: 0;
  color: var(--ink, #0f172a);
  font-size: 16px;
  line-height: 1.2;
}

.aa-attention-item p {
  margin: 8px 0 0;
  color: var(--ink, #0f172a);
  font-size: 13px;
  font-weight: 850;
}

.aa-attention-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 750;
}

.aa-attention-item > strong {
  align-self: flex-start;
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 950;
}

.aa-attention-negative {
  border-color: rgba(220, 38, 38, 0.24);
}

.aa-attention-negative > strong {
  color: #991b1b;
  background: #fee2e2;
}

.aa-attention-activity {
  border-color: rgba(109, 40, 217, 0.22);
}

.aa-attention-activity > strong {
  color: #4c1d95;
  background: #ede9fe;
}

.aa-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.aa-summary-card {
  min-height: 82px;
  padding: 15px 18px;
  border: 1px solid rgba(202, 213, 231, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(30, 43, 75, 0.06);
}

.aa-summary-card span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 850;
}

.aa-summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink, #0f172a);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.aa-toolbar {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px 26px;
  margin-bottom: 14px;
}

.aa-sections {
  display: grid;
  gap: 16px;
}

.aa-section {
  padding: 24px 26px 26px;
}

.aa-section-head > strong {
  flex: 0 0 auto;
  min-width: 54px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #312e81;
  font-size: 20px;
  font-weight: 950;
}

.aa-list {
  display: grid;
  gap: 10px;
}

.aa-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid #dfe7f3;
  border-radius: 21px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 8px 24px rgba(30, 43, 75, 0.045);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.aa-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(30, 43, 75, 0.08);
}

.aa-row-positive {
  border-color: rgba(22, 163, 74, 0.24);
}

.aa-row-negative {
  border-color: rgba(220, 38, 38, 0.24);
}

.aa-row-activity {
  border-color: rgba(109, 40, 217, 0.22);
}

.aa-row-release {
  border-color: rgba(2, 132, 199, 0.22);
}

.aa-row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.aa-app-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  background: #fff;
  color: #4f46e5;
  font-size: 17px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(30, 43, 75, 0.08);
}

.aa-app-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.aa-app-icon-fallback {
  background: linear-gradient(135deg, #f8faff, #edf2ff);
}

.aa-row-content {
  min-width: 0;
}

.aa-row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.aa-row-title > span {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 900;
}

.aa-row-title h3 {
  margin: 0;
  color: var(--ink, #0f172a);
  font-size: 16.5px;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.aa-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.aa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f5f8fc;
  color: #475569;
  font-size: 12.5px;
  font-weight: 750;
}

.aa-chip em {
  color: var(--muted, #64748b);
  font-style: normal;
}

.aa-chip b {
  color: var(--ink, #0f172a);
  font-weight: 900;
}

.aa-row-value {
  flex: 0 0 auto;
  min-width: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.aa-row-value span {
  color: var(--muted, #64748b);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aa-row-value strong {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 16px;
  font-weight: 950;
}

.aa-row-positive .aa-row-value strong {
  color: #166534;
  background: #dcfce7;
}

.aa-row-negative .aa-row-value strong {
  color: #991b1b;
  background: #fee2e2;
}

.aa-row-activity .aa-row-value strong {
  color: #4c1d95;
  background: #ede9fe;
}

.aa-row-release .aa-row-value strong {
  color: #075985;
  background: #e0f2fe;
}

.aa-empty {
  padding: 16px 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: var(--muted, #64748b);
  background: #f8fafc;
  font-weight: 750;
}

.aa-skeleton {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(202, 213, 231, 0.9);
  border-radius: 22px;
  background: linear-gradient(90deg, #ffffff 0%, #eef4ff 45%, #ffffff 90%);
  background-size: 220% 100%;
  animation: aaSkeleton 1.15s ease-in-out infinite;
  box-shadow: 0 10px 26px rgba(30, 43, 75, 0.045);
}

.aa-skeleton-attention {
  min-height: 126px;
}

.aa-skeleton-summary {
  min-height: 94px;
}

.aa-skeleton-section,
.aa-skeleton-insight {
  min-height: 154px;
}

@keyframes aaSkeleton {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

@media (max-width: 1120px) {
  .aa-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .aa-period-tabs-hero {
    justify-content: flex-start;
  }

  .aa-executive-metrics,
  .aa-executive-details,
  .aa-summary,
  .aa-attention-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aa-exec-actions {
    grid-column: span 2;
  }

  .aa-exec-actions ul {
    grid-template-columns: 1fr;
  }

  .aa-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .apps-analytics {
    width: min(100% - 24px, 1480px);
    padding-top: 20px;
  }

  .aa-hero {
    padding: 24px 22px;
  }

  .aa-hero h1 {
    font-size: 38px;
  }

  .aa-period,
  .aa-type {
    width: 100%;
  }

  .aa-executive-metrics,
  .aa-executive-details,
  .aa-summary,
  .aa-attention-list {
    grid-template-columns: 1fr;
  }

  .aa-exec-actions {
    grid-column: span 1;
  }

  .aa-row {
    display: grid;
  }

  .aa-row-value {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* CPO recommendation details */
.aa-exec-actions ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.aa-action-item {
  list-style-position: outside;
}

.aa-action-title {
  color: var(--ink, #0f172a);
  font-weight: 850;
  line-height: 1.35;
}

.aa-action-meta {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(202, 213, 231, 0.75);
  border-radius: 14px;
  background: #f8fbff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.aa-action-meta span {
  color: #4f46e5;
  font-weight: 950;
}

/* Compact expandable CPO recommendations */
.aa-action-details {
  border: 1px solid rgba(202, 213, 231, 0.85);
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.aa-action-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.aa-action-details summary::-webkit-details-marker {
  display: none;
}

.aa-action-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.aa-action-details[open] .aa-action-toggle {
  background: #4f46e5;
  color: #fff;
}

.aa-action-details .aa-action-meta {
  margin: 0 12px 12px;
  background: #f8fbff;
}

.aa-exec-actions ul {
  gap: 8px;
}

.aa-action-item {
  margin: 0;
}
