/*
 * Clef daily digest (css/digest.css): /digest only, after css/clef.css and built on its tokens. A quiet page head
 * (the caption as one paragraph, other days, the UTC day picker, Share, the totals), two benchmark panels, the hours
 * as tiles, two highlight panels and the practice band (top people, top models, model vs people). Checked from
 * 320 px: everything wraps, no horizontal scroll, tap targets of 44 px on touch screens.
 * CSP: no inline styles; bar heights and widths arrive as custom properties through the CSSOM (--h, --e, --p).
 */

/* ------------------------------------------------------------------ page head */

.dx-head { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--alabaster), var(--paper) 85%); }
.dx-head .eyebrow { margin-bottom: 14px; }
.dx-head .wrap { position: relative; z-index: 1; }
.dx-span { margin-top: 10px; font: 500 13px/1.5 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.dx-span:empty { display: none; }
.dx-lede { max-width: 700px; overflow-wrap: anywhere; }
.dx-note { margin-top: 14px; max-width: 700px; padding: 10px 14px; border: 1.5px solid var(--amber); border-radius: var(--r-md); background: var(--cream); font-size: 14px; line-height: 1.55; color: var(--rust); }
.dx-staff { overflow: visible; pointer-events: none; }
.dx-staff .staff-lines path { stroke: var(--staff-soft, #fde2bd); stroke-width: 1.5; fill: none; }
.dx-staff .staff-note { fill: var(--amber-soft, #fdd7a3); }
.dx-staff .staff-spark { fill: var(--spark, #f8a225); }
@media (max-width: 1100px) { .dx-staff { display: none; } }

.dx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 22px; max-width: 760px; }
.dx-days { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.dx-pick { display: flex; gap: 8px; min-width: 0; }
.dx-date { width: auto; min-width: 0; height: 32px; padding: 0 10px; font-size: 13.5px; }
.dx-share { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.dx-share[hidden], .dx-share [hidden] { display: none; }
.dx-share .btn, .dx-days .btn { display: inline-flex; gap: 6px; }

.dx-totals { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 28px 0 0; }
.dx-totals > div { display: grid; gap: 6px; min-width: 0; }
.dx-totals dt { font: 600 11.5px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.dx-totals dd { margin: 0; font: 500 22px/1.15 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); min-height: 25px; }

@media (max-width: 820px), (pointer: coarse) {
  .dx-date { height: 44px; }
}
@media (max-width: 520px) {
  .dx-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
  .dx-totals dd { font-size: 19px; }
  .dx-pick { flex: 1 1 100%; }
  .dx-date { flex: 1 1 auto; }
  .dx-share { width: 100%; }
  .dx-share .btn { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
}

/* ------------------------------------------------------------------ sections */

.dx-sec { padding-block: clamp(36px, 5vw, 56px) 0; }
.dx-sec-tight { padding-top: clamp(32px, 4.5vw, 48px); }
.dx-sec-last { padding-bottom: clamp(48px, 7vw, 80px); }
.dx-band { padding-block: clamp(48px, 7vw, 88px); }
.dx-sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 12px 40px; align-items: end; margin-bottom: 22px; }
.dx-sec-head > div { display: grid; gap: 10px; min-width: 0; }
.dx-sec-note { font-size: 14px; line-height: 1.6; color: var(--body); }
@media (max-width: 860px) { .dx-sec-head { grid-template-columns: minmax(0, 1fr); } }

.dx-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dx-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .dx-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dx-trio > :last-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .dx-pair, .dx-trio { grid-template-columns: minmax(0, 1fr); } }

.dx-panel { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 20px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.dx-band .dx-panel { background: var(--paper); }
.dx-panel-k { font: 600 11.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--orange-text); }
.dx-panel-title { font: 600 20px/1.25 var(--display); letter-spacing: -.015em; color: var(--ink); overflow-wrap: anywhere; }
.dx-panel-note { font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.dx-empty { font-size: 14px; line-height: 1.55; color: var(--muted); }
@media (max-width: 520px) { .dx-panel { padding: 16px 14px; } }

.dx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 4px 0 2px; }
.dx-stats .stat dd { display: grid; gap: 2px; margin: 0; }
.dx-stats .stat-v { font-size: 19px; }
.dx-stats .stat-sub { font-size: 12px; line-height: 1.4; color: var(--muted); }

/* a number that belongs to one hour links to that hour's recap */
.dx-num { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--orange) 45%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s var(--ease), text-decoration-color .2s var(--ease); }
.dx-num:hover { color: var(--orange-deep); text-decoration-color: var(--orange); }

/* ------------------------------------------------------------------ hour by hour */

.dx-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--muted); }
.dx-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 6px; }
.dx-key:first-child { margin-left: 0; }
.dx-key.is-bar { background: var(--orange-2); }
.dx-key.is-tick { height: 2px; background: var(--eclipse); }
.dx-key.is-under { background: var(--sand-2); }
.dx-key.is-model { width: 8px; height: 8px; border-radius: 50%; background: var(--rust); }

.dx-hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.dx-hours > li { min-width: 0; display: grid; }
.dx-hour { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 3px; min-height: 96px; padding: 9px 10px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); color: var(--ink); transition: border-color .2s var(--ease), background-color .2s var(--ease); }
a.dx-hour:hover { border-color: var(--amber); background: var(--cream); }
.dx-hour-t { font: 600 12px/1.2 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.dx-hour-v { font: 600 15px/1.2 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.dx-hour.is-under .dx-hour-v { color: var(--body); font-weight: 500; }
.dx-hour.is-void .dx-hour-v, .dx-hour.is-missing .dx-hour-v, .dx-hour.is-unscored .dx-hour-v, .dx-hour.is-later .dx-hour-v { font: 500 12.5px/1.2 var(--sans); color: var(--muted); }
.dx-hour.is-later { border-style: dashed; background: var(--alabaster); }
.dx-hour-bar { position: relative; align-self: end; height: 28px; border-bottom: 1px solid var(--line-2); }
.dx-hour-bar > i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--h, 0) * 100%); border-radius: 2px 2px 0 0; background: var(--orange-2); }
.dx-hour.is-under .dx-hour-bar > i { background: var(--sand-2); }
.dx-hour-bar > b { position: absolute; left: -2px; right: -2px; bottom: calc(var(--e, 0) * 100%); height: 2px; margin-bottom: -1px; border-radius: 2px; background: var(--eclipse); }
.dx-hour-m { display: inline-flex; align-items: center; gap: 5px; font: 500 12px/1.2 var(--mono); font-variant-numeric: tabular-nums; color: var(--rust); }
.dx-hour-m > i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--rust); }
@media (max-width: 359px) { .dx-hours { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .dx-hour { padding: 8px; } }

/* ------------------------------------------------------------------ highlights */

.dx-hi-v { font: 600 clamp(26px, 3.4vw, 34px)/1.15 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere; }
.dx-hi-t { font-size: 14.5px; line-height: 1.6; color: var(--body); }

/* ------------------------------------------------------------------ practice */

.dx-top { display: grid; }
.dx-top-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.dx-top-row:first-child { border-top: 0; padding-top: 4px; }
.dx-top-rank { font: 600 14px/1.5 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.dx-top-who { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; min-width: 0; }
.dx-top-nick { min-width: 0; font: 600 14.5px/1.4 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.dx-tag { flex: none; padding: 3px 7px; border-radius: 999px; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font: 600 10.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.dx-top-agent { flex: 1 1 100%; min-width: 0; font: 500 12px/1.4 var(--sans); color: var(--muted); overflow-wrap: anywhere; }
.dx-top-sub { flex: 1 1 100%; min-width: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.dx-top-mean { font: 600 15px/1.4 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }

.dx-vs { display: grid; gap: 14px; margin-top: 2px; }
.dx-vs-row { display: grid; gap: 7px; min-width: 0; }
.dx-vs-k { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13.5px; color: var(--body); }
.dx-vs-k > span:first-child { font-weight: 600; color: var(--ink); }
.dx-vs-who { min-width: 0; font: 500 12.5px/1.3 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.dx-vs-v { margin-left: auto; font: 600 14px/1.3 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.dx-vs-bar { display: block; height: 8px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.dx-vs-bar > i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--orange-2); }
.dx-vs-row:nth-child(2) .dx-vs-bar > i { background: var(--rust); }
.dx-vs-row:nth-child(3) .dx-vs-bar > i { background: var(--sand-2); }

/* first paint holds its shape while the digest loads */
main[data-digest-root] { min-height: calc(100svh - var(--hdr-h, 64px)); }
