/* Studio section styles: dashboard. Owned by the dashboard view; tokens come from styles.css :root.
   Light surface only (the studio has no dark theme). The sparkline uses the series token (--series-1). */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.latest-card {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.latest-card .section-title { margin-bottom: 4px; }
.latest-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.latest-name { margin: 0; font-weight: 600; font-size: var(--fs-md); overflow-wrap: anywhere; text-wrap: balance; }
.latest-name a { color: var(--text); text-decoration: none; }
.latest-name a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.latest-stats { display: flex; flex-wrap: wrap; gap: 24px; margin: 4px 0; }
.latest-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.latest-stat .kpi-value { font-size: var(--fs-xl); }
.latest-compare { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
/* The empty latest block has no inner border: its state is the inline (tinted) one. */
.latest-empty { display: block; }
.latest-empty .state--inline { margin: 0; }

.dash-poster {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  background: var(--draft-bg);
  overflow: hidden;
}
.dash-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-poster .thumb-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

.summary-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin-bottom: 16px; }
.summary-kpis .kpi { padding: 12px 14px; border: 0; background: transparent; }
.summary-kpis .kpi-value { font-size: var(--fs-xl); }
.spark-wrap { min-width: 0; }
.spark { display: block; width: 100%; height: auto; overflow: visible; }
.spark-base { stroke: var(--line-strong); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--series-1); }
.spark-hit { fill: transparent; }
.spark-hit:hover { fill: var(--primary-tint); }
.spark-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.spark-table { margin-top: 12px; }
.spark-table summary {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  color: var(--primary);
  cursor: pointer;
}
.spark-table .table-wrap { margin-top: 8px; }
.summary-more { margin: 12px 0 0; font-size: var(--fs-sm); }
.summary-more a { color: var(--primary); }

.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.news-item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.news-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.news-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; text-decoration: none; }
a.news-title:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-card .section-title, .tips-card .section-title, .news-card .section-title { margin-bottom: 12px; }

.tips-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.tips-list li { text-wrap: pretty; }

/* The metric row: a grid on phones with the odd last tile spanning the width (the selector matches the metrics row). */
.dash-kpis { grid-auto-rows: 1fr; }

@media (max-width: 899px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  .latest-card { grid-template-columns: minmax(0, 1fr); }
  .dash-poster { aspect-ratio: 16 / 9; }
  .summary-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .quick-actions .btn { flex: 1 1 auto; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-kpis > .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .summary-kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
