/* Compact information architecture. Loaded last. */

.compact-page {
  gap: 14px !important;
}

.compact-primary-card,
.compact-section,
.compact-list-card,
.compact-profile-head,
.compact-empty {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.compact-primary-card {
  padding: 18px;
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 42%),
    var(--surface);
}

.compact-primary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.compact-primary-card h2 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.compact-primary-card p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compact-status,
.compact-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.compact-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 12%, transparent);
}

.compact-status.success { color: var(--cyan); }
.compact-status.success i { background: var(--cyan); }
.compact-status.danger { color: var(--danger); }
.compact-status.danger i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.compact-status.partner { color: var(--accent); }
.compact-status.partner i { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.compact-expiry {
  min-width: 142px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
}

.compact-expiry span,
.compact-expiry small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.compact-expiry strong {
  display: block;
  margin: 3px 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 740;
}

.compact-main-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.compact-main-actions .primary-btn,
.compact-main-actions .secondary-btn {
  min-height: 46px;
}

.compact-inline-stats,
.compact-traffic-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.compact-inline-stats.three,
.compact-traffic-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-stat {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface-2);
}

.compact-stat span,
.compact-stat strong,
.compact-stat small {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-stat span {
  color: var(--faint);
  font-size: 9px;
}

.compact-stat strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
}

.compact-stat small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.compact-list-card {
  overflow: hidden;
}

.compact-action {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.compact-action:last-child { border-bottom: 0; }
.compact-action > span:nth-child(2) { min-width: 0; }
.compact-action b { display: block; font-size: 13px; font-weight: 680; }
.compact-action small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.compact-action > svg { width: 16px; color: var(--faint); }

.compact-action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--cyan);
  background: var(--cyan-soft);
}

.compact-action-icon svg { width: 16px; height: 16px; }

.compact-steps {
  padding: 4px 14px;
}

.compact-steps > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.compact-steps > div:last-child { border-bottom: 0; }
.compact-steps > div > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 760;
}
.compact-steps p { margin: 0; }
.compact-steps b { display: block; color: var(--text); font-size: 12px; }
.compact-steps small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.compact-section {
  padding: 15px;
}

.compact-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.compact-section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 710;
  line-height: 1.2;
}

.compact-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.compact-section-head .icon-action {
  width: 38px;
  min-height: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.compact-period {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.compact-period button {
  min-height: 38px;
  padding: 0 5px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 650;
}

.compact-period button.active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.compact-traffic-list {
  display: grid;
  gap: 8px;
}

.compact-traffic-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.compact-traffic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px 9px;
}

.compact-traffic-head > div:first-child { min-width: 0; }
.compact-traffic-head b { display: block; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.compact-traffic-head code { display: block; overflow: hidden; max-width: 520px; margin-top: 3px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.compact-traffic-head > div:last-child { display: flex; gap: 5px; }
.compact-traffic-head .icon-action { width: 36px; min-height: 36px; height: 36px; }
.compact-traffic-stats { margin: 0; border-width: 1px 0 0; border-radius: 0; }

.compact-member-list > div {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.compact-member-list > div:last-child { border-bottom: 0; }
.compact-member-list b { display: block; color: var(--text); font-size: 12px; }
.compact-member-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.compact-analytics .metric-switch {
  margin-bottom: 10px;
}

.compact-analytics .partner-line-chart {
  margin-top: 0;
}

.compact-analytics .chart-legend {
  margin-top: 8px;
}

.compact-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.compact-profile-head .cx-profile-avatar { flex: 0 0 auto; }
.compact-profile-head h2 { margin: 0; color: var(--text); font-size: 17px; }
.compact-profile-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.compact-profile-head span { display: inline-block; margin-top: 5px; color: var(--cyan); font-size: 10px; font-weight: 650; }

.compact-setting-row {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.compact-setting-row:last-child { border-bottom: 0; }
.compact-setting-row > span b { display: block; color: var(--text); font-size: 12px; }
.compact-setting-row > span small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.compact-theme {
  margin-top: 9px;
}

.compact-promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 9px;
}
.compact-promo input { min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--surface-2); font-size: 16px; }
.compact-promo .primary-btn { min-height: 44px; }

.compact-reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.compact-reward-row span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.compact-reward-row svg { width: 15px; }
.compact-reward-row strong { color: var(--text); font-size: 13px; }

.compact-text-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}
.compact-text-button svg { width: 14px; }

.compact-empty,
.compact-empty-row {
  color: var(--muted);
}
.compact-empty { padding: 28px 18px; text-align: center; }
.compact-empty > svg { width: 30px; height: 30px; color: var(--faint); }
.compact-empty h2 { margin: 10px 0 0; color: var(--text); font-size: 18px; }
.compact-empty p { max-width: 420px; margin: 7px auto 14px; font-size: 11px; line-height: 1.45; }
.compact-empty-row { padding: 13px; border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 10px; line-height: 1.4; }

/* Reduce visual duplication left by older component layers. */
.compact-page .section,
.compact-page .partner-kpis,
.compact-page .stats-row,
.compact-page .compact-metrics,
.compact-page .bonus-nudge,
.compact-page .cx-card,
.compact-page .cx-metric-grid,
.compact-page .cx-promo-row {
  margin: 0 !important;
}

@media (max-width: 700px) {
  .compact-page { gap: 10px !important; }
  .compact-primary-card { padding: 14px; border-radius: 17px; }
  .compact-primary-top { gap: 12px; }
  .compact-primary-card h2 { font-size: 23px; }
  .compact-primary-card p { font-size: 11px; }
  .compact-expiry { min-width: 112px; padding: 10px 11px; }
  .compact-expiry strong { font-size: 15px; }
  .compact-main-actions { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 7px; margin-top: 13px; }
  .compact-main-actions .primary-btn,
  .compact-main-actions .secondary-btn { min-width: 0; padding-inline: 10px; font-size: 12px; }
  .compact-inline-stats { margin-top: 11px; }
  .compact-stat { padding: 9px 10px; }
  .compact-stat strong { font-size: 13px; }
  .compact-list-card,
  .compact-section,
  .compact-profile-head { border-radius: 16px; }
  .compact-action { min-height: 57px; padding: 9px 12px; }
  .compact-section { padding: 13px; }
  .compact-section-head { margin-bottom: 10px; }
  .compact-traffic-head code { max-width: calc(100vw - 185px); }
  .compact-analytics .chart-legend { display: none; }
  .compact-analytics .partner-line-chart svg { min-height: 185px; }
}

@media (max-width: 390px) {
  .compact-primary-top { display: block; }
  .compact-expiry { width: 100%; margin-top: 11px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; }
  .compact-expiry strong { margin: 0; text-align: center; }
  .compact-expiry small { text-align: right; }
  .compact-main-actions { grid-template-columns: 1fr; }
  .compact-inline-stats.three,
  .compact-traffic-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compact-stat { padding: 8px; }
  .compact-stat span { font-size: 8px; }
  .compact-stat strong { font-size: 12px; }
  .compact-stat small { display: none; }
  .compact-period button { min-height: 36px; font-size: 9px; }
  .compact-traffic-head code { max-width: calc(100vw - 160px); }
  .compact-setting-row { padding: 12px; }
  .compact-promo { grid-template-columns: 1fr; }
}
