/* PULSE · now.css: the Now view (js/views/now.js) and the counter and sensor
   detail cards (js/place/counter.js, sensor.js). Built on the tokens and
   components in pulse.css (.hero, .badge, .block, .kv, .chart, .factor…);
   only what those do not cover is here. */

/* ------------------------------------------------------------------ when */

.now-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: var(--navy); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.now-when-lead { display: inline-flex; align-items: center; gap: 6px; color: var(--pulse-ink); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.now-when-lead::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pulse); }

/* ------------------------------------------------------------------ stat rows (All) */

.now-stats { display: flex; flex-direction: column; gap: 6px; }
.now-stat-slot { display: contents; }
.now-stat {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr 12px;
  grid-template-areas: "head head go" "fig text go" "sub sub go";
  align-items: center;
  gap: 3px 12px;
  width: 100%;
  margin: 0;
  padding: 9px 10px 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--stat-colour, var(--navy));
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font: inherit;
}
button.now-stat:hover { background: var(--wash); border-color: var(--line-strong); border-left-color: var(--stat-colour, var(--navy)); }
button.now-stat:hover .now-stat-go { border-color: var(--navy); }
.now-stat-head { grid-area: head; display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.now-stat-head .badge { margin-left: auto; }
.now-stat-dot { display: none; }
.now-stat-figure { grid-area: fig; color: var(--navy); font-size: 27px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.now-stat-body { display: contents; }
.now-stat-text { grid-area: text; min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.3; }
.now-stat-sub { grid-area: sub; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.now-stat-go { grid-area: go; justify-self: end; width: 7px; height: 7px; margin-right: 2px; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: rotate(45deg); }

/* ------------------------------------------------------------------ slots and small text */

.now-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.now-slot:empty { display: none; }
.now-hero .hero-figure { font-variant-numeric: tabular-nums; }
.now-chart { min-height: 0; }
.now-basis { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.now-basis .badge { margin: 0 1px; vertical-align: 0; }
.now-basis-sep { color: var(--line-strong); }
.now-basis.is-chart { margin-top: -2px; }
.now-weather-day { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.now-factors-lead { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.now-compare { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.now-compare strong { color: var(--navy); font-size: 15px; font-variant-numeric: tabular-nums; }
.now-kvs { display: flex; flex-direction: column; }
.now-kvs + .now-chart, .now-kvs + .note { margin-top: 6px; }
.now-zoom { align-self: flex-start; margin: -6px 0 -4px -4px; font-size: 12.5px; }
.now-foot { gap: 6px; }
.now-more { align-self: flex-start; min-height: 24px; padding: 2px 6px; margin-left: -6px; font-size: 12.5px; }

/* ------------------------------------------------------------------ ranked lists (TEAM) */

.rank-list { display: flex; flex-direction: column; gap: 1px; margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.rank-list li { counter-increment: rank; }
.rank-row { display: grid; grid-template-columns: 20px 1fr auto; grid-template-areas: "n name meta" "n reason reason"; gap: 1px 8px; width: 100%; padding: 6px 6px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left; font: inherit; }
.rank-row::before { content: counter(rank); grid-area: n; color: var(--muted); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.rank-row:hover { background: var(--wash); }
.rank-row:focus-visible, .now-hidden-row:focus-visible { outline-offset: -2px; }
.rank-name { grid-area: name; min-width: 0; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.35; }
.rank-meta { grid-area: meta; color: var(--navy); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-reason { grid-area: reason; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-tag { display: inline-block; min-width: 2.2em; padding: 0 5px; border-radius: 4px; background: var(--mode-bus); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; vertical-align: 1px; }
.rank-tag.is-train { background: var(--mode-train); }
.rank-tag.is-ferry { background: var(--mode-ferry); }

/* ------------------------------------------------------------------ sites with no estimate */

.now-hidden { border-top: 1px solid var(--line); padding-top: 10px; }
.now-hidden > summary { display: flex; align-items: center; gap: 7px; min-height: 24px; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; cursor: pointer; list-style: none; }
.now-hidden > summary::-webkit-details-marker { display: none; }
.now-hidden > summary::before { content: ""; width: 6px; height: 6px; margin: 0 2px 0 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 120ms ease; }
.now-hidden[open] > summary::before { transform: rotate(45deg); }
.now-hidden > summary:hover { color: var(--navy); }
.now-hidden > .note { margin-top: 8px; }
.now-hidden-list { display: flex; flex-direction: column; gap: 1px; margin: 6px 0 0; padding: 0; list-style: none; }
.now-hidden-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--ink); text-align: left; font: inherit; font-size: 12.5px; }
.now-hidden-row:hover { background: var(--wash); }
.now-hidden-name { font-weight: 600; }
.now-hidden-why { color: var(--muted); font-size: 12px; text-align: right; }

/* ------------------------------------------------------------------ card actions */

.now-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 2px; }
.now-action { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--navy); font: inherit; font-size: 12.5px; font-weight: 600; }
.now-action:hover { border-color: var(--navy); background: var(--wash); }
.now-action.is-story::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: linear-gradient(to top, var(--pulse) 0 40%, transparent 40% 55%, var(--navy) 55%); }

/* ------------------------------------------------------------------ detail cards */

.now-card-now { display: flex; flex-direction: column; gap: 8px; }
.now-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--navy); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.now-card-head > .badge.is-estimated { margin-left: auto; }
.now-card-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.now-card-figure strong { color: var(--navy); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.now-card-figure span { color: var(--ink); font-size: 13px; }
.now-card-sub { margin: 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.now-card-big { color: var(--navy); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.place-section > .chart + .note, .place-section > .note + .chart { margin-top: 6px; }
.place-section > .note { margin-top: 6px; }
.place-section > .kv + .note { margin-top: 8px; }
.place-section h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--navy); }
.place-section h3 .badge { font-weight: 700; }
.now-card-list { margin: 4px 0 0; padding-left: 16px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.now-card-list li + li { margin-top: 3px; }
.now-card-loading { min-height: 40px; }

/* ------------------------------------------------------------------ map key (layers/counters.js, sensors.js) */

.now-key-extras { flex-wrap: wrap; gap: 2px 8px; padding-left: 0; }
.now-key-item { display: inline-flex; align-items: center; gap: 4px; }
.now-key-item .key-dot, .now-key-item .key-ring { margin: 0 1px; }
.now-key-item .key-label { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------------ a week by the hour */

.now-heat svg { overflow: visible; }
.now-heat-cell { shape-rendering: crispEdges; }
.now-heat-key { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; }
.now-heat-swatch { width: 14px; height: 9px; border-radius: 2px; }
.now-heat-key-label:first-child { margin-right: 3px; }
.now-heat-key-label:last-child { margin-left: 3px; }

@media (max-width: 760px) {
  .now-stat-figure { font-size: 25px; }
  .now-stat { grid-template-columns: minmax(92px, auto) 1fr 12px; }
}
