/* The overview uses the same grid for matched-period charts and practice actions. */
.today-followup {
  margin: 16px 0 0;
  padding: 12px 15px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(115deg, var(--blue-soft), var(--paper) 38%);
}
.today-heading, .today-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.today-heading { margin-bottom: 7px; }
.today-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.today-heading h2 { color: var(--brand-navy); font-size: var(--type-section); }
.today-heading a, .today-footer a { color: var(--blue); font-size: var(--type-label); font-weight: var(--weight-medium); }
.today-followup a:is(:hover,:focus-visible) { text-decoration: underline; text-underline-offset: 3px; }
#today-queues { font-size: var(--type-label); color: var(--muted); }
.today-queues {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0;
  list-style: none; padding: 0; margin: 0;
}
.today-queues li { min-width: 0; }
.today-queues li + li { border-left: 1px solid var(--line); }
.today-queue { display: grid; position: relative; gap: 2px; align-content: start; min-height: 54px; height: 100%; padding: 4px 12px; }
.today-queues li:first-child .today-queue { padding-left: 0; }
.today-count { font-size: var(--type-kpi); font-variant-numeric: tabular-nums; font-weight: var(--weight-medium); letter-spacing: -.04em; line-height: 1.1; }
.today-queue.has-work .today-count { color: var(--brand-royal); }
.today-queues li:nth-child(2) .has-work .today-count { color: var(--amber); }
.today-label { color: var(--ink); font-weight: var(--weight-regular); line-height: 1.3; }
.today-queue small { color: var(--muted); font-size: var(--type-micro); }
.today-queue[href]:is(:hover,:focus-visible) { background: var(--blue-soft); text-decoration: none; }
.today-queue[href]:is(:hover,:focus-visible) .today-label { text-decoration: underline; text-underline-offset: 3px; }
.today-queue[href] .today-label::after { content: '›'; margin-left: .35em; color: var(--blue); }
.today-footer { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; color: var(--muted); font-size: var(--type-micro); }
.today-footer a { font-size: inherit; }
@media (max-width: 720px) {
  .today-queues { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 6px; }
  .today-queues li:nth-child(3) { border-left: 0; }
  .today-queues li:nth-child(3) .today-queue { padding-left: 0; }
  .today-queue { min-height: 46px; }
}
.home-grid, .ha-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--panel-gap);
  margin-bottom: var(--panel-gap);
}
.home-grid > *, .ha-grid > * { min-width: 0; }
.home-grid .panel, .ha-grid .panel { margin: 0; }
.home-summary {
  margin: var(--panel-gap) 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  padding: 7px 10px;
}
.home-summary > summary { color: var(--ink); font-size: var(--type-body); font-weight: var(--weight-medium); }
.home-summary .brief-list { color: var(--ink); }
.home-summary .brief-item p { color: var(--muted); }
.lh-movement { display: flex; flex-direction: column; }
.lh-finding {
  margin: auto 0;
  padding: 12px 0 16px;
}
.lh-finding h3 {
  max-width: 36ch;
  color: var(--brand-navy);
  font-size: clamp(1rem, 1.45vw, 1.25rem);
  line-height: 1.3;
  font-weight: var(--weight-medium);
  letter-spacing: -.025em;
  text-wrap: pretty;
}
.lh-finding .lh-cohort-button {
  display: inline;
  color: var(--blue);
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: .13em;
}
.lh-finding p { margin-top: 6px; color: var(--muted); font-size: var(--type-body); max-width: 52ch; }
.lh-cohort-plot {
  margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--viz-grid); border-radius: 10px;
  background: linear-gradient(115deg, var(--viz-field), var(--viz-paper)); color: var(--viz-ink);
  font-size: var(--type-meta); font-variant-numeric: tabular-nums;
}
.lh-cohort-plot figcaption,.lh-plot-key,.lh-plot-key span { display: flex; align-items: center; }
.lh-cohort-plot figcaption { justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; font-weight: var(--weight-medium); }
.lh-plot-key { gap: 8px; color: var(--viz-muted); font-size: var(--type-micro); font-weight: var(--weight-regular); }
.lh-plot-key span { gap: 4px; }
.lh-cohort-plot ul { list-style: none; padding: 0; margin: 0; }
.lh-cohort-plot li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(44px, 1.4fr) minmax(5.4em, auto); gap: 10px; align-items: center; padding: 4px 0; }
.lh-plot-cohort { overflow-wrap: anywhere; }
.lh-cohort-track { position: relative; display: block; height: 2px; background: var(--viz-grid); }
.lh-cohort-track::before {
  content: ''; position: absolute; inset-block: 0; left: min(var(--now), var(--then)); right: calc(100% - max(var(--now), var(--then)));
  background: var(--viz-sky);
}
.lh-cohort-plot :is(.lh-then,.lh-now) { display: inline-block; box-sizing: border-box; border-radius: 50%; }
.lh-then { width: 10px; height: 10px; border: 1.5px solid var(--viz-prior); background: var(--viz-paper); }
.lh-now { width: 6px; height: 6px; background: var(--viz-royal); }
.lh-cohort-track i { position: absolute; top: 50%; transform: translate(-50%,-50%); }
.lh-cohort-track .lh-then { left: var(--then); }
.lh-cohort-track .lh-now { left: var(--now); }
.lh-plot-reading { text-align: right; font-weight: var(--weight-medium); }
.lh-comparison { border-top: 1px solid var(--line); padding-top: 8px; }
.lh-comparison > summary { cursor: pointer; width: fit-content; color: var(--blue); font-size: var(--type-label); font-weight: var(--weight-medium); }
.lh-comparison[open] > summary { margin-bottom: 6px; }
.lh-coverage-headline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
  line-height: 1.45;
}
.lh-movement .lh-cohorts {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: var(--type-body);
  font-variant-numeric: tabular-nums;
}
.lh-cohorts th, .lh-cohorts td {
  padding: 6px 5px;
  background: none;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
.lh-cohorts th:first-child {
  padding-left: 0;
  text-align: left;
  white-space: normal;
}
.lh-cohorts :is(th, td):last-child { padding-right: 0; }
.lh-cohorts thead th {
  font-size: var(--type-micro);
  color: var(--muted);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  text-transform: none;
}
.lh-cohorts tbody th, .lh-cohorts tfoot th {
  text-transform: none;
  letter-spacing: normal;
  font-size: var(--type-body);
}
.lh-cohorts tfoot :is(th, td) {
  border-top: 1px solid var(--control-border);
  border-bottom: 0;
  color: var(--ink);
  font-weight: var(--weight-medium);
}
.lh-cohorts tbody tr:is(:hover, :focus-within) { background: var(--blue-soft); }
.lh-cohort-button {
  display: inline;
  font: inherit;
  color: var(--blue);
  font-weight: var(--weight-regular);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.lh-cohort-button:is(:hover,:focus-visible) { text-decoration: underline; }
.lh-change {
  display: inline-block;
  color: var(--ink);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}
.lh-change.lh-up { color: var(--gain); }
.lh-change.lh-down { color: var(--loss); }
.lh-change.lh-flat { color: var(--muted); }
.lh-coverage-headline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 9px;
  margin: 4px 0 15px;
}
.lh-coverage-headline strong {
  font-weight: var(--weight-medium);
  color: var(--teal);
  font-size: var(--type-kpi);
  line-height: 1;
  letter-spacing: -.04em;
}
.lh-coverage-chart {
  display: grid;
  grid-template-columns: 4ch minmax(0, 1fr);
  grid-template-rows: clamp(84px, 9vw, 112px) auto;
  gap: 5px 8px;
  font-size: var(--type-micro);
  font-variant-numeric: tabular-nums;
  margin: 0 0 5px; padding: 13px 12px 4px 8px;
  border: 1px solid var(--viz-grid); border-radius: 10px; background: var(--viz-field);
}
.lh-rate-axis, .lh-rate-dates { position: relative; color: var(--muted); }
.lh-rate-axis span { position: absolute; right: 0; transform: translateY(-50%); line-height: 1; }
.lh-rate-axis span:nth-child(1) { top: 0; }
.lh-rate-axis span:nth-child(2) { top: 50%; }
.lh-rate-axis span:nth-child(3) { top: 100%; }
.lh-rate-plot {
  position: relative;
  background: linear-gradient(var(--viz-grid), var(--viz-grid)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--viz-grid), var(--viz-grid)) 0 50% / 100% 1px no-repeat,
    linear-gradient(var(--viz-grid), var(--viz-grid)) 0 100% / 100% 1px no-repeat;
}
.lh-average { position: absolute; width: 100%; border-top: 1px dashed var(--viz-prior); pointer-events: none; }
.lh-rate-key { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 4px 0 6px; color: var(--viz-muted); font-size: var(--type-micro); }
.lh-rate-key span { display: inline-flex; align-items: center; gap: 4px; }
.lh-rate-key span::before { content: ''; display: inline-block; width: 13px; border-top: 2px solid var(--viz-teal); }
.lh-rate-key span + span::before { border-top: 1px dashed var(--viz-prior); }
.lh-rate-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lh-rate-line path { fill: none; stroke: var(--viz-teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lh-rate-plot .lh-bin {
  position: absolute;
  inset-block: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.lh-dot {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--viz-teal);
  background: var(--paper);
  transform: translate(-50%, -50%);
}
.lh-rate-plot .lh-bin:is(:hover,:focus-visible) { z-index: 2; }
.lh-rate-plot .lh-bin:is(:hover,:focus-visible)::before { content: ''; position: absolute; inset-block: 0; left: 50%; border-left: 1px dashed var(--viz-teal); pointer-events: none; }
.lh-bin:is(:hover,:focus-visible) .lh-dot { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.lh-rate-plot .lh-bin:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; }
.lh-point-tip {
  display: none;
  position: absolute;
  z-index: 1;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(13rem, 48vw);
  border-radius: 5px;
  padding: 6px 8px;
  color: var(--paper);
  background: var(--brand-navy);
  text-align: left;
  font-size: var(--type-micro);
  line-height: 1.4;
  pointer-events: none;
}
.lh-bin[data-tip-edge="start"] .lh-point-tip { left: 0; transform: none; }
.lh-bin[data-tip-edge="end"] .lh-point-tip { left: auto; right: 0; transform: none; }
.lh-point-tip b, .lh-point-tip span { display: block; }
.lh-point-tip b { font-weight: var(--weight-medium); }
.lh-bin:is(:hover,:focus-visible) .lh-point-tip { display: block; }
.lh-rate-dates { grid-column: 2; height: 1.6em; }
.lh-rate-dates span { position: absolute; white-space: nowrap; transform: translateX(-50%); }
.lh-rate-dates span:first-child:not(:only-child) { transform: translateX(-20%); }
.lh-rate-dates span:last-child:not(:only-child) { transform: translateX(-80%); }
.lh-gap-note { margin: 0 0 6px; color: var(--muted); font-size: var(--type-micro); }
.lh-coverage .chart-details { margin-top: 4px; }
@media (max-width: 600px) {
  .lh-rate-dates span:nth-child(even):not(:last-child) { display: none; }
  .lh-cohort-plot { padding: 9px; }
  .lh-cohort-plot li { column-gap: 7px; grid-template-columns: minmax(0, 1.5fr) minmax(36px, 1fr) minmax(5.4em, auto); }
}
.ha-card { display: flex; flex-direction: column; }
.ha-head { margin-bottom: 6px; }
.ha-sub, .ha-detail, .ha-next { font-size: var(--type-label); color: var(--muted); }
.ha-sub { margin-top: 3px; }
.ha-signals { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; }
.ha-signal {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-content: start;
  align-items: baseline;
  gap: 2px 5px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: var(--type-label);
}
.ha-signal svg { width: 17px; height: 17px; align-self: start; color: var(--teal); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ha-signal strong { font-weight: var(--weight-regular); font-variant-numeric: tabular-nums; color: var(--ink); }
.ha-signal small { grid-column: 2 / -1; color: var(--muted); font-size: var(--type-micro); }
@media (max-width: 490px) { .ha-signals { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.ha-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 2px 0 9px; }
.ha-metric { display: grid; justify-content: start; gap: 2px; }
.ha-metric + .ha-metric { border-left: 1px solid var(--line); padding-left: 15px; }
.ha-metric strong { font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.2; letter-spacing: -.05em; font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.ha-metric span { color: var(--muted); font-size: var(--type-label); }
.ha-overdue strong, .ha-overdue span { color: var(--amber); }
.ha-next { padding: 0; color: var(--muted); }
.ha-link { align-self: flex-start; margin-top: auto; padding-top: 6px; color: var(--blue); font-size: var(--type-label); font-weight: var(--weight-medium); }
.ha-link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .home-grid, .ha-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 450px) {
  .tabs {
    display: grid;
    grid-template-columns: auto minmax(0, 1.16fr) auto minmax(0, 1fr);
    gap: 4px;
    overflow: visible;
  }
  .tabs a {
    justify-content: center;
    text-align: center;
    white-space: normal;
    min-height: 44px;
    line-height: 1.2;
  }
  .title-line { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .title-side { justify-content: space-between; }
  .title-side .statusline { display: inline-flex; max-width: none; }
  .mobile-fresh { display: none; }
  .filters { margin-top: 9px; }
  .lh-cohorts :is(th, td) { padding-inline: 3px; }
}
@media (pointer: coarse) {
  .lh-cohort-button, .ha-link { min-height: 36px; }
  .ha-link { display: inline-flex; align-items: center; gap: 4px; }
}
