/* Layout only: typography and controls reuse Pulse rhythm classes;
   plot, markers, tooltip and chart colors come from the shared Carbon renderer. */
.pulse-redesign .pulse-rhythm-section.has-history-carousel {
  margin-inline: calc(50% - 50vw);
  padding-inline: calc(50vw - 50%);
  touch-action: pan-y pinch-zoom;
}
.pulse-rhythm-section.is-swiping, .pulse-rhythm-section.is-swiping * { user-select: none; }
.pulse-redesign .pulse-history-carousel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  grid-template-areas: 'nav details' 'chart details';
  gap: 12px 40px;
  padding: 0;
  color: var(--pulse-rd-ink);
  touch-action: pan-y pinch-zoom;
  font-variant-numeric: tabular-nums;
}
.pulse-redesign .pulse-history-carousel[hidden] { display: none; }
.pulse-history-nav { grid-area: nav; display: grid; grid-template-columns: 42px 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-right: 12px; margin-bottom: 8px; }
.pulse-redesign .pulse-history-nav .pulse-rhythm-resume { flex: 0 0 auto; width: 42px; height: 42px; }
.pulse-history-nav button:disabled { opacity: .35; cursor: default; }
.pulse-history-nav button:focus-visible, .pulse-history-source:focus-visible {
  outline: 2px solid var(--pulse-rd-accent); outline-offset: 4px;
}
.pulse-history-nav svg { width: 18px; height: 18px; }
.pulse-redesign .pulse-history-heading { grid-area: auto; margin: 0 0 0 8px; font: inherit; }
.pulse-redesign .pulse-history-heading strong { display: block; margin-top: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.22; }
.pulse-history-figure { grid-area: chart; position: relative; min-width: 0; margin: 0; align-self: center; }
.pulse-redesign .pulse-history-chart { width: 100%; height: 225px; margin-top: 8px; touch-action: pan-y pinch-zoom; }
.pulse-history-state { position: absolute; inset: 8px 0 24px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; color: var(--pulse-rd-muted); font-size: 13px; line-height: 1.5; }
.pulse-history-state[hidden], .pulse-history-state button[hidden] { display: none; }
.pulse-history-state button { color: var(--pulse-rd-accent); background: transparent; border: 0; border-radius: 0; padding: 8px 0; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.pulse-history-period { text-align: right; white-space: nowrap; line-height: 1.5; }
.pulse-history-details { grid-area: details; display: grid; align-self: center; min-width: 0; gap: 24px; }
.pulse-history-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.pulse-history-copy { gap: 10px; }
.pulse-redesign .pulse-history-frequency { font-size: 13px; line-height: 1.4; }
.pulse-history-date { font-size: 13px; line-height: 1.5; }
.pulse-redesign .pulse-history-value { margin-left: auto; min-width: 0; flex-shrink: 0; justify-items: end; }
.pulse-history-comparisons { display: grid; gap: 18px; }
.pulse-history-comparison { display: grid; gap: 6px; }
.pulse-history-comparison-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 16px; }
.pulse-history-comparison-row .pulse-rhythm-date { font-size: 13px; line-height: 1.5; }
.pulse-history-comparison-row strong { color: var(--pulse-rd-ink); font-size: 14px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.pulse-history-comparison > .pulse-rhythm-date { line-height: 1.5; }
.pulse-redesign .pulse-history-meta { grid-area: auto; padding-top: 0; }
.pulse-history-source { color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.pulse-history-source:hover { text-decoration: underline; text-underline-offset: 3px; }
.pulse-history-carousel > [hidden], .pulse-history-nav > [hidden] { display: none; }
.pulse-history-rhythm-counter { margin-left: auto; white-space: nowrap; }
.pulse-redesign .pulse-history-carousel[data-slide="rhythm"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'nav' 'rhythm';
}
.pulse-history-carousel[data-slide="rhythm"] .pulse-history-figure { grid-area: rhythm; }
.pulse-history-rhythm { grid-area: rhythm; display: grid; align-items: center; min-width: 0; min-height: 267px; }
.pulse-redesign .pulse-history-rhythm .pulse-latest-rhythm { padding: 0 !important; min-width: 0; }
.pulse-history-rhythm .pulse-rhythm-monitor { touch-action: pan-y pinch-zoom; }
@media (max-width: 1100px) {
  .pulse-redesign .pulse-history-carousel { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 32px; }
  .pulse-history-period { max-width: 11ch; white-space: normal; }
}
@media (max-width: 720px) {
  .pulse-redesign .pulse-history-carousel { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'nav' 'chart' 'details'; gap: 20px; }
  .pulse-history-nav { grid-template-columns: 42px 42px minmax(0, 1fr); margin-bottom: 0; }
  .pulse-history-period { grid-column: 3; justify-self: end; max-width: none; }
  .pulse-redesign .pulse-history-chart { height: 240px; }
  .pulse-redesign .pulse-history-meta { justify-content: flex-start; gap: 0; }
  .pulse-history-carousel[data-slide="rhythm"] .pulse-history-nav { grid-template-columns: 42px 42px minmax(0, 1fr) auto; }
}
