/* ---------------------------------------------------------------------------
   Pip's day as a clock, in Pip's panel
   ---------------------------------------------------------------------------
   A 24-hour face: a ring per stage from the centre out, each half hour's
   work in its stage's colour with round ends, the day so far a darker track
   and the hours to come faded, every hour numbered with quarter-hour ticks,
   now a red hand and pill, tonight's booking a dashed arc, the total in the
   middle. Under it a tile per stage; one pressed lights only its ring.
   App: app/pulse-clock.js.
   --------------------------------------------------------------------------- */

.pclock { display: flex; flex-direction: column; align-items: center; gap: 8px }
.pclock > .pulsesec__head { align-self: stretch }
.pclock__face { display: block; width: 264px; height: 264px; max-width: 100% }
.pclock__face path { fill: none }
.pclock__ring path { stroke-linecap: round }
.pclock__ring .pclock__past, .pclock__ring .pclock__ahead { stroke-linecap: butt }
.pclock__past { stroke: color-mix(in srgb, var(--text) 9%, var(--card)) }
.pclock__ahead { stroke: color-mix(in srgb, var(--text) 4%, var(--card)) }
.pclock__ring { transition: opacity .2s ease }
.pclock__tick { stroke: color-mix(in srgb, var(--text) 22%, var(--card)); stroke-width: 1; stroke-linecap: round }
.pclock__tick--hour { stroke: var(--text); stroke-width: 1.6 }
.pclock__hour { font-size: 10.5px; font-weight: 500; fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums }
.pclock__hour--main { font-size: 12px; font-weight: 700; fill: var(--text) }
.pclock__ahead-mark { opacity: .5 }
.pclock__booked { stroke: var(--muted); stroke-width: 5; stroke-dasharray: 3 2.5 }
.pclock__hand { stroke: var(--stage-4); stroke-width: 2.5; stroke-linecap: round }
.pclock__handtip, .pclock__pill { fill: var(--stage-4) }
.pclock__pilltext { font-size: 11px; font-weight: 600; fill: #fff; text-anchor: middle; font-variant-numeric: tabular-nums }
.pclock__total { font-size: 26px; font-weight: 600; fill: var(--text); text-anchor: middle; font-variant-numeric: tabular-nums }
.pclock__totallabel { font-size: 10px; font-weight: 500; fill: var(--muted); text-anchor: middle }

/* One stage picked: its ring stays, the others fade. */
.pclock[data-pick] .pclock__ring { opacity: .15 }
.pclock[data-pick="research"] .pclock__ring[data-stage="research"],
.pclock[data-pick="people"] .pclock__ring[data-stage="people"],
.pclock[data-pick="drafts"] .pclock__ring[data-stage="drafts"],
.pclock[data-pick="sends"] .pclock__ring[data-stage="sends"],
.pclock[data-pick="replies"] .pclock__ring[data-stage="replies"] { opacity: 1 }

/* The key: a tile per stage, three a row, as the Problems tiles: tinted in
   its ring's colour, its icon and the businesses as logos on top, the count
   large, a short label. 12px corners, as the other tiles in the panel. */
.pclock__keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 8px }
.pclock__key {
  --tile: color-mix(in srgb, var(--stage) 11%, var(--card));
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; min-height: 44px;
  padding: 10px; border: 0; border-radius: 12px; background: var(--tile); cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
  transition: filter .16s ease, opacity .16s ease, transform .14s var(--ease-out);
}
.pclock__keytop { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 22px }
.pclock__keytop > .ms { font-size: 19px; color: var(--stage) }
.pclock__marks { display: flex; align-items: center }
.pclock__mark {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; margin-left: -6px; overflow: hidden;
  display: grid; place-items: center; font-size: 8.5px; font-weight: 600;
  background: var(--card); color: var(--text); box-shadow: 0 0 0 2px var(--tile);
}
.pclock__mark:first-child { margin-left: 0 }
.pclock__mark img { width: 100%; height: 100%; object-fit: cover }
.pclock__key b { font-size: 24px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums }
.pclock__keylabel { font-size: 12px; font-weight: 600; line-height: 1.2; color: color-mix(in srgb, var(--stage) 60%, var(--text)) }
.pclock__keywarn { font-size: 11.5px; font-weight: 600; color: #8A5A00; line-height: 1.2; white-space: nowrap }
.pclock__key:hover { filter: brightness(.97) }
.pclock__key:active { transform: scale(.98) }
.pclock__key[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--stage) }
.pclock[data-pick] .pclock__key[aria-pressed="false"] { opacity: .45 }
.pclock__key:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px }

@media (prefers-reduced-motion: reduce) {
  .pclock__ring, .pclock__key { transition: none }
  .pclock__key:active { transform: none }
}
