/* MMT Movement Dashboard ("Pulse"). Tokens only: no hex values here.
   See docs/design.md (Second Ink). Staff tables first; public chart
   primitives are added with the public pages. */

.pulse-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Staff pages (/sef/pulse/) reuse the Knowledge service's hub markup, which
   has no layout rules of its own: give it the masthead's side gutter. */
.hub-section > .hub-inner { padding: 0 clamp(16px, 3.5vw, 44px) 3rem; }

/* Locale switcher on the accuracy page: 44px touch targets. */
.pulse-locales { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.75rem; margin: 0.5rem 0; }
.pulse-locales a, .pulse-locales strong { display: inline-flex; align-items: center; min-height: 44px; }
.pulse-details > summary { min-height: 44px; padding: 0.7rem 0; cursor: pointer; }
/* Public country switcher (only when PULSE_COUNTRIES lists more than the UK). */
.pulse-countries { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; margin: 0.25rem 0 1rem; }
.pulse-countries a, .pulse-countries strong { display: inline-flex; align-items: center; min-height: 44px; }
.pulse-abroad { margin: 2rem 0; }

.pulse-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pulse-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm, 0.9rem); }
.pulse-table th, .pulse-table td {
  text-align: left; vertical-align: top; padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--rule-soft);
}
.pulse-table th { font-family: var(--font-mono, monospace); font-weight: 500; color: var(--ink-soft); }
.pulse-table td small { color: var(--ink-soft); }
.pulse-table form.inline { display: inline-block; margin: 0 0.4rem 0.4rem 0; }

.pulse-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 1rem 0 1.5rem; }
.pulse-meta dt { color: var(--ink-soft); }
.pulse-meta dd { margin: 0; }

.pulse-lead { color: var(--ink-soft); }

@media (max-width: 720px) {
  .pulse-meta { grid-template-columns: 1fr; }
  .pulse-meta dt { margin-top: 0.5rem; }
}

/* Hand-labelling card. Touch-first: 44px rows, 16px inputs. */
.pulse-card { max-width: 46rem; margin: 1.25rem 0 2rem; }
.pulse-progress, .pulse-kicker, .pulse-terms { color: var(--ink-soft); font-size: var(--fs-sm, 0.9rem); }
.pulse-label-title { margin: 0.25rem 0 0.75rem; }
.pulse-excerpt { margin: 0 0 0.75rem; padding: 0.6rem 0.9rem; border-left: 3px solid var(--rule-soft); background: var(--paper-deep); }
.pulse-suggestion summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.pulse-choices { border: 0; padding: 0; margin: 1rem 0; }
.pulse-choices legend { font-weight: 600; margin-bottom: 0.4rem; }
.pulse-choices label { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0 0.25rem; }
.pulse-choices input { width: 1.25rem; height: 1.25rem; }
.pulse-choices--concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1rem; }
.pulse-choices--concepts legend { grid-column: 1 / -1; }
.pulse-notes { display: block; font-weight: 600; margin-top: 0.5rem; }
.pulse-card textarea { width: 100%; font-size: 16px; padding: 0.5rem; }
.pulse-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.pulse-actions .btn, .pulse-actions .textbtn, .pulse-build .btn { min-height: 44px; }
.pulse-card :focus-visible, .pulse-table :focus-visible { outline: 2px solid var(--tenant-ink); outline-offset: 2px; }

/* ---------------------------------------------------------------------
   Public dashboard. Series colours were checked with the dataviz palette
   validator on the paper surface: tenant ink (primary) against ink-soft
   (comparison) passes the colour-vision and normal-vision separation
   checks; oxblood against black does not. Series also differ by dash and
   marker shape, and carry direct labels.
   --------------------------------------------------------------------- */
.pulse-headline { border-top: 3px solid var(--ink); padding-top: 1rem; margin: 1.25rem 0 2rem; }
.pulse-hero { font-family: var(--font-display); font-size: var(--type-h2); line-height: 1.15; margin: 0.25rem 0 0.5rem; }
.pulse-hero strong { color: var(--tenant-ink); }
.pulse-hero-sub { color: var(--ink-soft); }
.pulse-figure-meta { font-family: var(--font-data); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-soft); margin: 0.35rem 0 0.75rem; }

.pulse-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.pulse-card-tile { border-top: 1px solid var(--ink); padding-top: 0.75rem; min-width: 0; }
.pulse-card-title { font-family: var(--font-display); font-size: 1.15rem; margin: 0; }
.pulse-card-title a { color: var(--ink); text-decoration: none; }
.pulse-card-title a:hover, .pulse-card-title a:focus-visible { color: var(--tenant-ink); text-decoration: underline; }
.pulse-card-q { color: var(--ink-soft); font-size: var(--type-small); margin: 0.2rem 0 0.6rem; }
.pulse-number { font-family: var(--font-display); font-weight: 800; font-size: var(--type-monument); line-height: 1; margin: 0; }
.pulse-number--empty { font-size: var(--type-h2); color: var(--ink-soft); }
.pulse-unit, .pulse-delta, .pulse-compare { font-size: var(--type-small); margin: 0.25rem 0; }
.pulse-unit { color: var(--ink-soft); }
.pulse-spark { width: 100%; max-width: 220px; height: auto; display: block; margin: 0.4rem 0; }
.pulse-spark path { stroke: var(--tenant-ink); stroke-width: 2; }
.pulse-spark circle { fill: var(--tenant-ink); }

.pulse-chart { margin: 0.5rem 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pulse-chart svg { width: 100%; max-width: 860px; min-width: 600px; height: auto; display: block; }
.pulse-grid line { stroke: var(--rule-soft); stroke-width: 1; }
.pulse-tick { font-family: var(--font-data); font-size: 12px; fill: var(--ink-soft); }
.pulse-tick--y { text-anchor: end; }
.pulse-tick--x { text-anchor: middle; }
.pulse-series path { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pulse-series--primary path { stroke: var(--tenant-ink); }
.pulse-series--primary .pulse-point { fill: var(--tenant-ink); stroke: var(--paper); stroke-width: 2; }
.pulse-series--comparison path { stroke: var(--ink-soft); }
.pulse-series--comparison .pulse-point { fill: var(--ink-soft); stroke: var(--paper); stroke-width: 2; }
.pulse-point--hit { fill-opacity: 0; stroke-opacity: 0; }
.pulse-endlabel { font-family: var(--font-data); font-size: 12px; fill: var(--ink); }
.pulse-band { stroke: none; opacity: 0.55; }
.pulse-hatch { stroke: var(--tenant-ink); stroke-width: 1.5; }
.pulse-marker { fill: var(--ink); }
.pulse-legend { font-size: var(--type-small); color: var(--ink-soft); }
.pulse-legend-marker { color: var(--ink); }

.pulse-filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: flex-end; margin: 0.5rem 0 1.25rem; }
.pulse-filters label { display: flex; flex-direction: column; gap: 0.25rem; font-family: var(--font-data); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.pulse-filters select { font-size: 16px; min-height: 44px; padding: 0 0.5rem; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
.pulse-table-toggle summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: var(--type-small); }
.pulse-pager { display: flex; gap: 1rem; align-items: center; margin: 0.75rem 0; flex-wrap: wrap; }
.pulse-pager a { min-height: 44px; display: inline-flex; align-items: center; }
.pulse-activity-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.pulse-activity-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--rule-soft); }
.pulse-date { font-family: var(--font-data); font-size: 11px; color: var(--ink-soft); margin-right: 0.5rem; }
.pulse-source { border-top: 1px solid var(--rule-soft); padding-top: 0.75rem; margin-top: 0.75rem; }
.pulse-source h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.pulse-crosslink { margin-top: 1rem; }
.pulse-filters :focus-visible, .pulse-card-tile :focus-visible, .pulse-pager :focus-visible { outline: 2px solid var(--tenant-ink); outline-offset: 2px; }

/* Mentions: each item as a press cutting. The left rule marks the frame:
   tenant ink for an opposing frame, ink for MMT-consistent, dashed for both. */
.pulse-kinds { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.5rem; }
.pulse-kind { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 0.95rem; }
.pulse-kind strong { font-family: var(--font-data); font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.pulse-kind:hover { background: var(--paper-deep); }
.pulse-kind.is-active { background: var(--ink); color: var(--paper); }
.pulse-kind.is-active strong { color: var(--paper); }
.pulse-kind--opposing.is-active { background: var(--tenant-ink); border-color: var(--tenant-ink); }
/* Cuttings fill the page: as many ~28rem columns as fit, one on a phone. */
.pulse-clips { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr)); gap: 0 2rem; }
.pulse-clip { padding: 0.9rem 0.25rem 1rem 1rem; border-left: 3px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); margin-bottom: 0.25rem; display: flex; flex-direction: column; }
.pulse-clip .pulse-ideas { margin-top: auto; }
.pulse-clip--opposing { border-left-color: var(--tenant-ink); }
.pulse-clip--consistent { border-left-color: var(--ink); }
.pulse-clip--mixed { border-left-style: dashed; border-left-color: var(--ink); }
.pulse-clip-meta { margin: 0 0 0.3rem; font-family: var(--font-data); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.pulse-clip-meta .sep { margin: 0 0.4rem; }
.pulse-clip-meta a { color: var(--ink); }
.pulse-clip-title { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.3; margin: 0 0 0.45rem; }
.pulse-clip-title a { color: var(--ink); text-decoration-color: var(--rule-soft); }
.pulse-clip-title a:hover { text-decoration-color: var(--tenant-ink); }
.pulse-clip-excerpt { margin: 0 0 0.6rem; padding: 0; border: 0; font-family: var(--font-body); font-size: 0.98rem; line-height: 1.55; color: var(--ink); }
.pulse-clip-excerpt mark { background: none; color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--tenant-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pulse-clip-note { margin: 0 0 0.6rem; font-size: var(--type-small); color: var(--ink-soft); }
.pulse-ideas { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pulse-idea { font-family: var(--font-data); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.2rem 0.5rem; border: 1px solid var(--ink); }
.pulse-idea a { color: inherit; }
.pulse-idea--opposing { border-color: var(--tenant-ink); color: var(--tenant-ink); }
.pulse-idea--mmt_label { background: var(--ink); color: var(--paper); }
.pulse-clip-verdict { margin: 0.6rem 0 0; font-size: var(--type-small); color: var(--ink-soft); }
.pulse-kinds :focus-visible, .pulse-clip :focus-visible { outline: 2px solid var(--tenant-ink); outline-offset: 2px; }

/* Weekly briefing: frames and ideas on the move, voices. */
.pulse-moves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.pulse-moves-table { width: 100%; }
.pulse-moves-table td a { color: var(--ink); }
.pulse-move-group--opposing .subhead { color: var(--tenant-ink); }
.pulse-num { font-family: var(--font-data); text-align: right; white-space: nowrap; }
.pulse-trend { font-family: var(--font-data); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; color: var(--ink-soft); }
.pulse-trend--up { color: var(--tenant-ink); }
.pulse-trend--new { color: var(--ink); font-weight: 600; }
.pulse-voices { list-style: none; padding: 0; margin: 0.5rem 0 1rem; columns: 2 18rem; column-gap: 2rem; }
.pulse-voices li { break-inside: avoid; padding: 0.45rem 0; border-bottom: 1px solid var(--rule-soft); }
.pulse-voices a { font-family: var(--font-display); color: var(--ink); }
.pulse-voice-counts { display: block; font-family: var(--font-data); font-size: 11px; color: var(--ink-soft); }
.pulse-voice-opposing { color: var(--tenant-ink); }
@media (max-width: 720px) { .pulse-moves { grid-template-columns: 1fr; } }

/* "This week in MMT" by email: sign-up box. */
.pulse-subscribe { margin: 2rem 0; padding: 1.25rem 1.5rem; border: 1px solid var(--ink); background: var(--paper-deep); }
.pulse-subscribe .subhead { margin-top: 0; }
.pulse-subscribe-pitch { margin: 0 0 0.75rem; max-width: 60rem; }
.pulse-subscribe-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.5rem; }
.pulse-subscribe-form input[type="email"] { flex: 1 1 18rem; max-width: 28rem; min-height: 44px; font-size: 16px; padding: 0 0.75rem; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
.pulse-subscribe-form .btn { min-height: 44px; }
.pulse-subscribe-error { color: var(--tenant-ink); font-weight: 600; margin: 0 0 0.5rem; }
.pulse-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pulse-subscribe :focus-visible { outline: 2px solid var(--tenant-ink); outline-offset: 2px; }

@media (max-width: 1000px) { .pulse-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .pulse-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pulse-chart * { transition: none !important; } }
.pulse-embed-code { width: 100%; font-family: var(--font-data); font-size: 16px; padding: 0.5rem; }

/* Dashboard text runs the full width of the page. The Knowledge site caps
   lead and reading text at a measure (.page-lead 74ch, .reading-col 66ch);
   this stylesheet loads only on dashboard pages, so the override stays here. */
.page-lead, .reading-col { max-width: none; }
