/* ZaxSocial · css/analytics.css — responsive user/admin analytics layout. Owner: U10. */
.zs-anl { width: min(100% - 32px, 1200px); margin: 0 auto; padding: 24px 0 calc(var(--zs-safe-bottom) + 32px); color: var(--zs-text); }
.zs-anl-title { margin: 0 0 20px; }
.zs-anl-title h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.zs-anl-title p { margin: 7px 0 0; color: var(--zs-text-secondary); }
.zs-anl-controls { position: sticky; z-index: 2; top: 8px; display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 20px; padding: 10px; border: 1px solid var(--zs-hairline); border-radius: 18px; background: var(--zs-surface); box-shadow: var(--zs-shadow-xs); }
.zs-anl-control { display: grid; gap: 4px; min-width: 150px; font-size: 11px; color: var(--zs-text-secondary); }
.zs-anl-select { height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--zs-border); border-radius: 11px; background: var(--zs-surface); color: var(--zs-text); font: inherit; }
.zs-anl-kpis { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.zs-anl-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.zs-anl-card { min-width: 0; overflow: hidden; padding: 16px; border: 1px solid var(--zs-hairline); border-radius: 20px; background: var(--zs-surface); box-shadow: var(--zs-shadow-xs),var(--zs-ring-inset); }
.zs-anl-card__head { margin-bottom: 12px; }
.zs-anl-card__head h2 { margin: 0; font-size: 15px; line-height: 21px; font-weight: 680; }
.zs-anl-card__head p { margin: 3px 0 0; color: var(--zs-text-secondary); font-size: 12px; }
.zs-anl-card__body { min-width: 0; min-height: 170px; }
.zs-anl-card .zs-chartbox { min-height: 160px; }
.zs-anl-card .zs-chart { max-width: 100%; overflow: visible; }
.zs-anl-kpi .zs-stat { height: 100%; min-height: 106px; }
.zs-anl-loading,.zs-anl-error { display: grid; min-height: 150px; place-content: center; gap: 10px; padding: 16px; text-align: center; color: var(--zs-text-secondary); }
.zs-anl-loading { font-size: 13px; }
.zs-anl-error p { margin: 0; }
.zs-anl-table { width: 100%; }
.zs-anl-admin-tabs { margin: 0 0 18px; }
.zs-anl-admin-body { min-width: 0; }
.zs-anl--admin .zs-anl-grid { gap: 14px; }
.zs-anl--admin .zs-anl-card { min-height: 210px; }
.zs-anl-advanced-card { margin-top: 16px; }
.zs-anl-advanced-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.zs-anl-advanced-controls .zs-btn.is-active { border-color: var(--zs-brand); background: var(--zs-brand-soft); color: var(--zs-brand-strong); }
.zs-anl-advanced-chart { max-width: 720px; margin-inline: auto; }
.zs-anl-funnel-host,.zs-anl-cohorts { min-width: 0; }
.zs-anl-channel-table { min-width: 0; }
.zs-anl-note { margin: 0 0 10px; color: var(--zs-text-secondary); font-size: 12px; }
.zs-anl-cohort-scroll { overflow: auto; overscroll-behavior-inline: contain; }
.zs-anl-cohort-table { min-width: 760px; width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 12px; }
.zs-anl-cohort-table th { padding: 8px; color: var(--zs-text-secondary); font-weight: 600; text-align: left; white-space: nowrap; }
.zs-anl-cohort-cell { min-width: 42px; padding: 9px 5px; border-radius: 8px; background: color-mix(in srgb,var(--zs-chart-1) calc(14% + var(--cohort-retention,0) * 72%),var(--zs-surface)); color: var(--zs-text); text-align: center; font-variant-numeric: tabular-nums; }
.zs-anl-cohort-cell.is-pending { background: var(--zs-surface-2); color: var(--zs-text-tertiary); }
@media (min-width: 760px) {
  .zs-anl { width: min(100% - 48px, 1200px); padding-top: 30px; }
  .zs-anl-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
  .zs-anl-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .zs-anl-card { padding: 20px; }
}
@media (min-width: 1100px) { .zs-anl-kpis { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media print {
  .zs-topbar,.zs-tabbar,.zs-sidebar,.zs-anl-controls,.zs-anl-admin-tabs { display: none; }
  .zs-anl-card { break-inside: avoid; box-shadow: none; }
  .zs-anl-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* User analytics summaries retain compact table rows on phones.
   The generic table-to-card rule otherwise right-aligns unlabeled cells. */
[data-screen="anl.user"] .zs-anl-card:has(.zs-anl-table) { padding:20px; border-radius:20px; box-shadow:0 4px 18px #00000008; }
[data-screen="anl.user"] .zs-anl-card:has(.zs-anl-table) .zs-anl-card__head { margin:0 0 16px; padding:0 0 14px; border-bottom:1px solid var(--zs-hairline); }
[data-screen="anl.user"] .zs-anl-card:has(.zs-anl-table) h2 { text-align:left; font-size:17px; line-height:1.4; letter-spacing:-.02em; }
[data-screen="anl.user"] .zs-anl-card:has(.zs-anl-table) .zs-anl-card__body { min-height:0; }
[data-screen="anl.user"] .zs-anl-table { display:table; width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; }
[data-screen="anl.user"] .zs-anl-table thead { display:table-header-group; }
[data-screen="anl.user"] .zs-anl-table tbody { display:table-row-group; width:auto; }
[data-screen="anl.user"] .zs-anl-table tr { display:table-row; width:auto; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; }
[data-screen="anl.user"] .zs-anl-table :is(th,td) { display:table-cell; width:auto; padding:13px 12px; text-align:left; vertical-align:middle; border:0; border-bottom:1px solid var(--zs-hairline); white-space:normal; overflow-wrap:anywhere; }
[data-screen="anl.user"] .zs-anl-table th { padding-block:10px; font-size:11px; letter-spacing:.07em; text-transform:uppercase; color:var(--zs-text-secondary); background:var(--zs-surface-2); }
[data-screen="anl.user"] .zs-anl-table th:first-child { border-radius:9px 0 0 9px; }
[data-screen="anl.user"] .zs-anl-table th:last-child { border-radius:0 9px 9px 0; }
[data-screen="anl.user"] .zs-anl-table :is(th,td):first-child { width:75%; }
[data-screen="anl.user"] .zs-anl-table td:first-child { color:var(--zs-text); font-weight:550; font-size:14px; line-height:1.5; }
[data-screen="anl.user"] .zs-anl-table td:last-child { font-variant-numeric:tabular-nums; color:var(--zs-accent); font-size:14px; font-weight:650; }
[data-screen="anl.user"] .zs-anl-table td::before { content:none; display:none; }
[data-screen="anl.user"] .zs-anl-table tbody tr:last-child td { border-bottom:0; }
@media(max-width:480px) {
 [data-screen="anl.user"] .zs-anl-card:has(.zs-anl-table) { padding:16px; border-radius:18px; }
 [data-screen="anl.user"] .zs-anl-table :is(th,td) { padding-inline:10px; }
}
