.chart-panel .chart-heading { align-items: flex-start; margin-bottom: 9px; }
.chart-heading .icon-button { font-size: 17px; border: 1px solid var(--border); border-radius: 5px; min-height: 27px; }
.chart-panel .segmented { background: var(--surface-muted); border: 1px solid var(--border); }
.chart-panel .segmented button.selected { background: var(--surface-raised); }
.trend-periods { display: flex; gap: 4px; margin-top: 10px; }
.trend-periods button { border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 4px 7px; min-height: 27px; color: var(--soft); font-size: 10px; }
.trend-periods button.selected { border-color: var(--border); background: var(--surface-raised); color: var(--ink); }
.trend-periods button:hover { color: var(--ink); }
.trend-mode { display: flex; justify-content: space-between; align-items: baseline; font-size: 9px; color: var(--soft); min-height: 19px; margin-top: 3px; }
.trend-mode button, .trend-status-row button { padding: 0; border: 0; background: transparent; color: var(--cyan); font-size: 9px; }
.trend-range-label { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; margin: 5px 0 0; line-height: 1.7; white-space: nowrap; }
.trend-range-rail { height: 30px; position: relative; margin: 1px 8px 0; touch-action: none; user-select: none; }
.trend-range-rail::before { content: ''; position: absolute; height: 5px; background: var(--border); left: 0; right: 0; top: 12px; border-radius: 3px; }
.trend-range-selection { position: absolute; height: 7px; top: 11px; background: var(--chart-audience); border-radius: 3px; cursor: grab; min-width: 1px; }
.trend-range-rail.dragging .trend-range-selection { cursor: grabbing; }
.trend-range-handle { position: absolute; top: 3px; transform: translateX(-50%); width: 18px; height: 24px; padding: 0; background: var(--surface-raised); border: 1px solid var(--chart-audience); border-radius: 4px; touch-action: none; cursor: ew-resize; z-index: 1; }
.trend-range-handle::after { content: ''; display: block; height: 10px; width: 2px; margin: auto; background: var(--muted); border-radius: 1px; }
.trend-extent { display: flex; justify-content: space-between; color: var(--soft); font-size: 8px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.trend-custom { margin-top: 6px; color: var(--soft); font-size: 9px; }
.trend-custom > summary { cursor: pointer; list-style: none; width: fit-content; }
.trend-custom > summary::after { content: ' ›'; }
.trend-custom[open] > summary::after { content: ' ⌄'; }
.trend-custom > summary::-webkit-details-marker { display: none; }
.trend-custom form { display: grid; grid-template-columns: 1fr; gap: 7px; padding-top: 7px; }
.trend-custom label { font-size: 9px; color: var(--muted); display: grid; gap: 3px; }
.trend-custom input { min-width: 0; width: 100%; padding: 5px 6px; font-size: 10px; border: 1px solid var(--border); background: var(--surface-muted); border-radius: 5px; min-height: 30px; }
.trend-custom .button { min-height: 28px; padding: 5px 9px; font-size: 10px; justify-self: end; }
.trend-custom .form-error { font-size: 9px; }
.chart-panel .chart-container, .content-grid.expanded .chart-panel .chart-container { margin-top: 9px; height: 150px; }
.content-grid.expanded .chart-panel .chart-container { height: 210px; }
.trend-summary { display: flex; justify-content: space-between; gap: 9px; padding-top: 6px; min-height: 40px; }
.trend-summary > div { min-width: 0; }
.trend-summary span { display: block; color: var(--soft); font-size: 8px; }
.trend-summary strong { display: block; color: var(--ink); font-size: 11px; font-weight: 550; line-height: 1.8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-status-row { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; margin-top: 6px; min-height: 15px; font-size: 8px; color: var(--soft); }
.trend-status-row .error { color: var(--accent); }
.chart-tooltip { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--border); box-shadow: 0 4px 16px #0005; padding: 6px 8px; max-width: min(220px, 100%); }
.chart-tooltip strong { display: block; font-size: 11px; }
.chart-tooltip span { display: block; font-size: 8px; color: var(--soft); }
.chart-panel[aria-busy="true"] .chart-container { opacity: .72; }
@media (max-width: 700px) {
  .trend-periods button { min-height: 34px; }
  .trend-range-handle { width: 24px; height: 30px; top: 0; }
  .trend-range-rail { margin-top: 4px; margin-bottom: 3px; }
  .trend-mode button, .trend-custom > summary { min-height: 28px; display: flex; align-items: center; }
}
