/* Forecast rows: each country badge and money label owns its space. */
#dash-trials-upcoming{container-type:inline-size;container-name:trial-list;min-width:0}
.trialday-table .trialday-row>span,.trialday-table .trialday-foot>span{min-width:0}
.trialday-table .trialday-eur{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:4px;white-space:normal;text-align:right;max-width:100%;line-height:1.4}
.trialday-table .trialday-eur b,.trialday-table .trialday-eur small{display:block;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.trialday-table .trialday-eur small{font-size:11px;color:var(--text-2)}
.trialday-table .trialday-eur .value-bar{display:none}
.trialday-table .trialday-flags{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:7px 10px;min-width:0}
.trialday-table .trialday-cc{display:inline-flex;width:auto;flex:0 0 auto;gap:3px;white-space:nowrap}
.trialday-table .trialday-cc img{flex-shrink:0}
.trialday-table .td-chip{max-width:100%;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere}
.trialday-table .td-foot-extra{white-space:normal;overflow-wrap:anywhere}
@media(min-width:641px){.trialday-table .trialday-head,.trialday-table .trialday-row,.trialday-table .trialday-foot{grid-template-columns:minmax(0,.9fr) minmax(0,.55fr) minmax(0,1.3fr) minmax(0,1.25fr) minmax(150px,1.3fr);column-gap:20px}.trialday-table .trialday-head{white-space:normal}.trialday-table .trialday-day{white-space:normal;overflow-wrap:anywhere}}
@container trial-list (max-width:760px){
 .trialday-table .trialday-head{display:none}
 .trialday-table .trialday-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"day money" "forecast money" "outcomes outcomes" "countries countries";gap:8px 16px;padding:14px 0;align-items:start}
 .trialday-table .trialday-row>span:nth-child(1){grid-area:day}.trialday-table .trialday-row>span:nth-child(2){grid-area:forecast;text-align:left}.trialday-table .trialday-row>span:nth-child(3){grid-area:outcomes}.trialday-table .trialday-row>span:nth-child(4){grid-area:countries}.trialday-table .trialday-row>span:nth-child(5){grid-area:money}
 .trialday-table .trialday-row>span:nth-child(2)::before{content:"Previsto ";font-size:10px;color:var(--text-2)}
 .trialday-table .trialday-foot{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 16px}
 .trialday-table .trialday-foot>span:nth-child(1){grid-column:1;grid-row:1}.trialday-table .trialday-foot>span:nth-child(2){grid-column:1;grid-row:2;text-align:left}.trialday-table .trialday-foot>span:nth-child(3){grid-column:1/-1;grid-row:3}.trialday-table .trialday-foot>span:nth-child(4){display:none}.trialday-table .trialday-foot>span:nth-child(5){grid-column:2;grid-row:1}
}

/* Overview refinement: quiet surfaces, deliberate proportions and chart reading. */
.app-context-pill { border:0; background:var(--panel-2); }
:is(#dash-kpis,#dash-cac-kpis) .kpi { box-shadow:none; border-radius:18px; }
#dash-kpis .kpi-cluster-primary .kpi { background:var(--panel); }
:is(#dash-kpis,#dash-cac-kpis) .kpi { padding:18px 20px; min-height:144px; }
:is(#dash-kpis,#dash-cac-kpis) .kpi-label { min-height:32px; margin-bottom:8px; font-weight:500; color:var(--text-2); }
:is(#dash-kpis,#dash-cac-kpis) .kpi-value { font-size:clamp(24px,2.2vw,30px); }
:is(#dash-kpis,#dash-cac-kpis) .kpi-sub { padding-top:12px; }
#dash-kpis .kpi-cluster-primary { grid-template-columns:minmax(0,1.2fr) repeat(2,minmax(0,1fr)); }
#dash-kpis .kpi-cluster-primary [data-kpi="mrr"] { grid-row:span 2; justify-content:center; }
#dash-kpis .kpi-cluster-primary [data-kpi="mrr"] .kpi-sub { margin-top:12px; }
#dash-cac-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
#dash-cac-kpis [data-kpi="cacpaid"] .kpi-value { font-size:17px; line-height:1.5; }
#dashboard-tab #dash-period-context { width:100%; flex-basis:100%; }
#dashboard-tab .chart-svg { height:var(--chart-height,240px); }
#dashboard-tab .dual-line-chart .chart-svg { height:268px; }
#dashboard-tab .chart-grid-line { stroke:color-mix(in srgb,var(--text) 9%,transparent); }
#dashboard-tab .chart-line { stroke-width:2; }
#dashboard-tab .chart-dot { width:6px; height:6px; box-shadow:none; }
#dashboard-tab .chart-wipe { animation:none; }
#dashboard-tab .chart-area,
#dashboard-tab .chart-gridlines,
#dashboard-tab .chart-axis .chart-ytick,
#dashboard-tab .chart-axis .chart-xtick,
#dashboard-tab .chart-dot { animation:chartFade 180ms ease-out both; }
#dashboard-tab .chart-cmp-line { animation:none; opacity:.55; }

.subscriber-view-controls { display:flex; flex-wrap:wrap; gap:4px; width:fit-content; margin:0 0 18px; padding:3px; border-radius:9px; background:var(--panel-2); }
.subscriber-view-controls button { min-height:36px; padding:8px 12px; border:0; border-radius:6px; background:transparent; color:var(--text-2); font:500 12px var(--font-body); cursor:pointer; }
.subscriber-view-controls button[aria-pressed="true"] { background:var(--panel); color:var(--text); box-shadow:0 1px 3px #00000012; }
.subscriber-view-controls button:focus-visible { outline:2px solid var(--accent-strong); outline-offset:2px; }
.subscriber-reading { color:var(--text-2); font-size:12px; line-height:1.6; margin:0 0 14px; max-width:78ch; }
.subscriber-reading strong { color:var(--text); font-weight:500; }
.subscriber-date-note { color:var(--muted); font-size:11px; line-height:1.6; margin:14px 0 0; max-width:100ch; }
.subscriber-chart-card .cohort-context { margin-top:0; margin-bottom:14px; }
#subscriber-payments-view[hidden],#subscriber-cohorts-view[hidden] { display:none; }
@container(max-width:680px) {
  .nsub-dense .nsub-xlab { display:none; }
  .nsub-dense .nsub-xlab:nth-child(14n + 1) { display:flex; }
}
@container(max-width:460px) {
  .nsub-dense .nsub-xlab { display:none; }
  .nsub-dense .nsub-xlab:nth-child(28n + 1) { display:flex; }
  .nsub-xlab:nth-last-child(-n + 4),.nsub-dense .nsub-xlab:nth-last-child(-n + 8) { display:none; }
  .nsub-xlab:first-child,.nsub-xlab:last-child { display:flex; }
}

@media(max-width:1100px) {
  #dash-kpis .kpi-cluster-primary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #dash-kpis .kpi-cluster-primary [data-kpi="mrr"] { grid-row:auto; grid-column:1/-1; }
  #dash-cac-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:640px) {
  #dash-kpis .kpi-cluster-primary,#dash-cac-kpis { grid-template-columns:minmax(0,1fr); }
  :is(#dash-kpis,#dash-cac-kpis) .kpi { min-height:128px; padding:16px 18px; }
  :is(#dash-kpis,#dash-cac-kpis) .kpi-value { font-size:28px; }
  #dashboard-tab .dual-line-chart .chart-svg { height:224px; }
  .subscriber-view-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; box-sizing:border-box; }
  .subscriber-view-controls button { padding:9px 7px; font-size:11px; }
}
@media(prefers-reduced-motion:reduce) {
  #dashboard-tab .chart-area,#dashboard-tab .chart-gridlines,#dashboard-tab .chart-axis .chart-ytick,#dashboard-tab .chart-axis .chart-xtick,#dashboard-tab .chart-dot { animation:none; }
}
