#page-analytics .analytics-intro { margin: 0 0 24px; max-width: 68ch; }
.analytics-toolbar { display: grid; gap: 6px; min-width: 0; max-width: 100%; }
.analytics-toolbar select { max-width: 100%; width: 100%; }
.analytics-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.analytics-totals > div { padding: 16px; border: 1px solid var(--line); background: var(--panel); }
.analytics-totals small, .analytics-card-heading p, .analytics-place-metrics small { display: block; color: var(--muted); font-size: inherit; }
.analytics-totals strong { display: block; font-size: clamp(1.6rem, 4vw, 2.65rem); line-height: 1.2; margin-top: 5px; }
.analytics-panel { padding: clamp(14px, 3vw, 26px); border: 1px solid var(--line); background: var(--panel); }
.analytics-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.analytics-panel-head h3, .analytics-card-heading h3, .analytics-card-heading p { margin: 0; }
.analytics-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.analytics-legend span { display: inline-flex; align-items: center; gap: 7px; }
.analytics-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; flex: none; }
.analytics-deep { background: var(--accent); }
.analytics-light { background: #8fd1b0; }
.analytics-none { background: #747884; }
#place-analytics-trend { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(3px, 1vw, 10px); }
#place-analytics-trend > .empty { grid-column: 1/-1; }
.analytics-bar { min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); display: grid; gap: 5px; }
.analytics-bar-track { height: 152px; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%); }
.analytics-bar-stack { width: min(66%, 46px); display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; }
.analytics-segment { display: block; flex-basis: 0; }
.analytics-bar[aria-pressed=true] { color: var(--ink); background: var(--raised); border-color: var(--line); }
.analytics-bar-date { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 4px; padding-bottom: 4px; }
#place-analytics-trend-detail { color: var(--muted); margin-bottom: 0; }
.analytics-comparison { margin-top: 30px; }
.analytics-place-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.analytics-place-card { min-width: 0; padding: clamp(14px, 2vw, 22px); border: 1px solid var(--line); background: var(--panel); }
.analytics-card-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 6px 16px; overflow-wrap: anywhere; }
.analytics-card-heading > strong { font-size: 1.5rem; white-space: nowrap; }
.analytics-volume { height: 4px; background: var(--line); margin: 14px 0 10px; }
.analytics-volume span { display: block; height: 100%; background: var(--accent); }
.analytics-place-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--line); margin: 16px 0 8px; padding-top: 12px; }
.analytics-place-metrics dt { color: var(--muted); overflow-wrap: anywhere; }
.analytics-place-metrics dd small { font-weight: 400; font-size: 1rem; }
.analytics-place-metrics dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 650; }
.analytics-place-card .text-button { margin-top: 5px; }
@media (max-width: 550px) {
  .analytics-totals { grid-template-columns: 1fr; gap: 6px; }
  .analytics-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; }
  .analytics-totals strong { flex: none; margin: 0; }
  .analytics-bar-date { flex-direction: column; }
}

.analytics-week-panel { margin-bottom: 30px; }
.analytics-week-panel h4 { margin: 22px 0 4px; }
#analytics-week-range, #analytics-week-caption { margin: 4px 0 12px; }
.analytics-week-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.analytics-week-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(2px, 0.7vw, 10px);
}
.analytics-week-chart .analytics-bar-date { flex-direction: column; }
.analytics-week-table table { width: 100%; table-layout: fixed; }
.analytics-week-table th, .analytics-week-table td {
  display: table-cell;
  padding: 8px 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.analytics-week-table th:first-child { width: 32%; }
.analytics-week-table th { font: 600 13pt var(--font); letter-spacing: 0; text-transform: none; }
.analytics-week-table td { font: 13pt var(--font); }
.analytics-week-table td:last-child { font-weight: 650; }
.block-place label[hidden] { display: none; }
@media (max-width: 550px) {
  .analytics-week-chart .analytics-bar-track { height: 105px; }
  .analytics-week-chart .analytics-bar-date { font-size: 0.875rem; }
  .analytics-week-table th, .analytics-week-table td { padding-inline: 3px; }
}
