/* Stats (board #81, Dodd 2026-10-25: "feels a little AI... weird fonts that aren't matching... make things bigger and
   easier to see"). Markup: workspace.js stats(). Loaded last so it wins over workspace.css / mvp.css without !important.
   One type system: Caslon 400 for the page title, the month, the day and the big numbers; Inter for everything else.
   No uppercase tracked labels, no dots-and-corner-counts calendar, one note instead of the disclaimer paragraph.
   Calendar fill: dark stone rising into the theme's main colour for DMs sent that day (Dodd: "instead of fading to
   white, turn the main colour of the theme": red in the red theme; another theme sets --st-primary); green = replies. */
body:is([data-view="stats"], [data-ptab="stats"]) { /* Stats is a Profile tab since #159 (profile.js sets data-ptab) */
  --st-cell: rgba(236, 228, 216, .032);
  /* dark stone rising into the theme colour: more DMs = more of the theme's red */
  --st-primary: var(--red-hi, #cf1c26);
  --st-heat-1: color-mix(in oklab, var(--st-primary) 16%, #1d1416);
  --st-heat-2: color-mix(in oklab, var(--st-primary) 36%, #1d1416);
  --st-heat-3: color-mix(in oklab, var(--st-primary) 62%, #1d1416);
  --st-heat-4: color-mix(in oklab, var(--st-primary) 92%, #1d1416);
  --st-reply: #8fdcae;
  --st-call: #c9a2ff;
  --st-ink: #f6ead8;
  --st-ink-2: #c9bdb0;
}

/* ---------- head: title, the period in words, two small controls ---------- */
.st-head { align-items: flex-end; margin-bottom: 18px; }
.st-head > div > p { margin-top: 6px; font: 400 16px/1.4 var(--sans); color: var(--st-ink-2); }
.st-head .stats-controls { gap: 8px; }
.st-head .stats-controls label { gap: 0; }
.st-head .stats-controls select { min-height: 36px; padding: 6px 30px 6px 12px; font: 500 14.5px/1.2 var(--sans); background-color: rgba(10, 7, 8, .7); border-color: var(--line-hi); border-radius: var(--r-md); }

/* ---------- the numbers: one plate, five figures, big and plain ---------- */
/* Polish (Dodd 2026-10-25: "I don't really like how it looks"): five separate tablets with real depth instead of one
   divided strip; a warm top light, a lit top edge and a drop, and the theme colour as a thin bar under the label */
.st-figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.st-fig { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px 24px 18px; overflow: hidden; border-radius: var(--r-lg);
  background: radial-gradient(90% 70% at 20% 0%, rgba(255, 238, 214, .06), transparent 70%), var(--grain) 0 0 / 160px, var(--surface);
  box-shadow: var(--edge), inset 0 -1px 0 rgba(0, 0, 0, .5), 0 16px 34px rgba(0, 0, 0, .45), 0 2px 5px rgba(0, 0, 0, .35); }
.st-fig-label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 9px 0 1px; vertical-align: 2px; rotate: 45deg; background: var(--st-primary); box-shadow: 0 0 8px color-mix(in oklab, var(--st-primary) 70%, transparent); }
.st-fig-label { display: block; font: 500 16px/1.2 var(--sans); color: var(--st-ink-2); }
.st-fig strong { font: 400 clamp(50px, 4.4vw, 70px)/.95 var(--serif); letter-spacing: -.02em; color: var(--st-ink); font-variant-numeric: lining-nums tabular-nums; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
.st-fig small { min-height: 1.4em; font: 400 14.5px/1.4 var(--sans); color: var(--st-ink-2); }
.st-fig[title] { cursor: help; }
.st-fig small:empty { display: none; }
.st-fig.is-locked strong { filter: blur(9px); opacity: .55; user-select: none; }
.st-fig.is-locked small { visibility: hidden; }
.st-lock { display: inline-block; width: 10px; height: 12px; margin-left: 7px; vertical-align: -1px; background: var(--t-titan); opacity: .9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M2 5V3.5a3 3 0 0 1 6 0V5h.5A1.5 1.5 0 0 1 10 6.5v4A1.5 1.5 0 0 1 8.5 12h-7A1.5 1.5 0 0 1 0 10.5v-4A1.5 1.5 0 0 1 1.5 5H2zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0V5z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M2 5V3.5a3 3 0 0 1 6 0V5h.5A1.5 1.5 0 0 1 10 6.5v4A1.5 1.5 0 0 1 8.5 12h-7A1.5 1.5 0 0 1 0 10.5v-4A1.5 1.5 0 0 1 1.5 5H2zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0V5z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- calendar + the picked day ---------- */
.st-board { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; margin-top: 18px; align-items: stretch; }
.st-cal, .st-detail { border-radius: var(--r-lg); padding: 22px 24px 20px; min-width: 0;
  background: radial-gradient(70% 50% at 15% 0%, rgba(255, 238, 214, .05), transparent 70%), var(--grain) 0 0 / 160px, var(--surface);
  box-shadow: var(--edge), inset 0 -1px 0 rgba(0, 0, 0, .5), 0 20px 44px rgba(0, 0, 0, .48), 0 2px 6px rgba(0, 0, 0, .35); }

.st-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.st-cal-head h2, .st-detail-head h2 { margin: 0; font: 400 32px/1.1 var(--serif); letter-spacing: -.01em; color: var(--st-ink); }
.st-cal-nav { display: flex; align-items: center; gap: 4px; }
.st-nav { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: transparent; box-shadow: inset 0 0 0 1px var(--line-hi);
  color: var(--st-ink); font: 500 14.5px/1 var(--sans); transition: background-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease); }
.st-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.st-nav:active { transform: scale(.96); }
.st-nav-today[aria-current] { color: var(--st-ink-2); }
@media (hover: hover) and (pointer: fine) { .st-nav:hover { background: rgba(236, 228, 216, .08); } }

.st-week, .st-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.st-week { margin-bottom: 10px; }
.st-week span { padding-left: 12px; font: 500 14.5px/1 var(--sans); color: var(--st-ink-2); }

.st-day { position: relative; display: grid; grid-template-rows: auto 1fr auto; align-items: start; min-width: 0; height: 76px; padding: 10px 12px 10px; text-align: left;
  border: 0; border-radius: var(--r-sm); background: var(--st-cell); color: var(--st-ink); background-image: linear-gradient(180deg, rgba(255, 238, 214, .035), transparent 60%);
  box-shadow: inset 0 1px 0 rgba(255, 238, 214, .06), inset 0 -1px 0 rgba(0, 0, 0, .45);
  transition: background-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, transform var(--dur-fast) var(--ease); }
.st-day.lvl-1 { background: var(--st-heat-1); }
.st-day.lvl-2 { background: var(--st-heat-2); }
.st-day.lvl-3 { background: var(--st-heat-3); }
.st-day.lvl-4 { background: var(--st-heat-4); }
.st-day.is-future { background: transparent; box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .07); }
.st-day.is-future .st-num { color: var(--bone-3); }
.st-num { grid-row: 1; font: 600 16px/1 var(--sans); font-variant-numeric: tabular-nums; }
.st-day.is-today .st-num { justify-self: start; margin: -4px 0 0 -6px; padding: 4px 6px; border-radius: var(--r-xs); background: var(--bone); color: var(--black); }
.st-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--bone), 0 8px 20px rgba(0, 0, 0, .5); z-index: 1; }
.st-day:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .st-day:not([aria-pressed="true"]):hover { box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .38); } }
.st-sent { grid-row: 3; font: 600 16px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--st-ink); }
.st-sent em { font-style: normal; font-weight: 500; color: inherit; opacity: .78; }
.st-day.lvl-4, .st-day.lvl-3 { color: #fff4ef; }
.st-day.lvl-4 .st-sent, .st-day.lvl-4 .st-rep, .st-day.lvl-3 .st-sent, .st-day.lvl-3 .st-rep { color: #fff4ef; }
.st-day.lvl-4 { box-shadow: 0 0 16px color-mix(in oklab, var(--st-primary) 35%, transparent); }
.st-day.lvl-4[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--bone), 0 0 16px color-mix(in oklab, var(--st-primary) 35%, transparent), 0 6px 18px rgba(0, 0, 0, .45); }
body[data-theme="holo"]:is([data-view="stats"], [data-ptab="stats"]) { --st-primary: #a3abcf; } /* the black holo theme's main colour */
.st-rep { position: absolute; top: 9px; right: 9px; display: flex; align-items: center; gap: 5px; font: 600 14px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--st-ink); }
.st-rep i, .st-key-rep i { width: 8px; height: 8px; border-radius: 50%; background: var(--st-reply); box-shadow: 0 0 0 2px rgba(7, 5, 6, .55); }
.st-blank { height: 76px; }

.st-key { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin-top: 18px; padding-top: 16px; box-shadow: inset 0 1px 0 var(--line); font: 400 14.5px/1 var(--sans); color: var(--st-ink-2); }
.st-key-ramp, .st-key-rep { display: inline-flex; align-items: center; gap: 9px; }
.st-key-ramp > span { display: inline-flex; gap: 3px; }
.st-key-ramp > span i { width: 16px; height: 12px; border-radius: 3px; }
.st-key-ramp i.lvl-1 { background: var(--st-heat-1); } .st-key-ramp i.lvl-2 { background: var(--st-heat-2); }
.st-key-ramp i.lvl-3 { background: var(--st-heat-3); } .st-key-ramp i.lvl-4 { background: var(--st-heat-4); }

/* the picked day */
.st-detail { display: flex; flex-direction: column; }
.st-detail-head { display: grid; gap: 14px; margin-bottom: 14px; }
.st-detail-head h2 { font-size: 28px; }
.st-seg { display: flex; }
.st-seg button { flex: 1; min-height: 34px; padding: 6px 10px; font: 600 14px/1 var(--sans); }
.st-seg button:active { transform: scale(.98); }
.st-day-sum { margin: 0 0 6px; font: 400 15px/1.45 var(--sans); color: var(--st-ink-2); }
.st-detail-body { flex: 1 1 auto; max-height: 380px; overflow: auto; margin-right: -10px; padding-right: 10px; scrollbar-width: thin; scrollbar-color: rgba(236, 228, 216, .2) transparent; }
.st-group { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 2px; font: 600 14px/1.2 var(--sans); color: var(--st-ink-2); }
.st-group span { font-weight: 500; color: var(--bone-3); }
.st-rows { list-style: none; margin: 0; padding: 0; }
.st-row { width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 8px 13px 4px; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: var(--st-ink); transition: background-color var(--dur-fast) ease; }
.st-rows li:last-child .st-row { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { .st-row:hover { background: rgba(236, 228, 216, .05); } }
.st-row-name { min-width: 0; }
.st-row-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 17px/1.25 var(--serif); letter-spacing: 0; color: var(--st-ink); }
.st-row-name small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 13.5px/1.3 var(--sans); color: var(--st-ink-2); }
.st-row-who { font: 500 13.5px/1 var(--sans); color: var(--st-ink-2); }
.st-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--bone-3); }
.st-mark.sent { background: var(--t-titan); } .st-mark.replied { background: var(--st-reply); } .st-mark.callBooked { background: var(--st-call); }
.st-cohort { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 8px; }
.st-cohort span { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-sunk, rgba(0, 0, 0, .3)); box-shadow: inset 0 0 0 1px var(--line); font: 400 14px/1.2 var(--sans); color: var(--st-ink-2); }
.st-cohort b { font: 400 36px/1 var(--serif); color: var(--st-ink); }
.st-empty { margin: 10px 0 4px; font: 400 16px/1.5 var(--sans); color: var(--st-ink); }
.st-empty small { display: block; margin-top: 6px; font-size: 14px; color: var(--st-ink-2); }
.st-detail-body { display: flex; flex-direction: column; }
.st-detail-body > .st-empty:only-child { margin: auto 0; padding: 24px 0 40px; text-align: center; }
/* the empty day: a small carved diamond over the words, and the way to the last day with DMs */
.st-detail-body > .st-empty:only-child::before { content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 18px; rotate: 45deg; border-radius: 2px;
  background: linear-gradient(135deg, rgba(255, 238, 214, .1), rgba(0, 0, 0, .3)), #161012; box-shadow: inset 0 0 0 1px var(--line-hi), 0 0 16px color-mix(in oklab, var(--st-primary) 30%, transparent); }
.st-jump { display: inline-flex; margin-top: 18px; min-height: 40px; padding: 0 16px; font: 600 14.5px/1 var(--sans); } /* an empty day sits in the middle of its panel, not stranded at the top */

.st-note { margin: 16px 0 8px; max-width: 80ch; font: 400 13.5px/1.6 var(--sans); color: var(--bone-3); }

/* ---------- member view: the two open numbers, the rest under the frosted glass ---------- */
.st-locked { margin-top: 20px; }
.st-locked .locked-content { filter: blur(7px) saturate(.7); }
.st-locked .locked-content .st-board { margin-top: 0; }
.st-locked .unlock-card { top: min(50%, 250px); }

/* the black holographic theme keeps the same reading, with a cool selection ring */
body[data-theme="holo"] .st-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px rgba(200, 215, 250, .85), 0 6px 18px rgba(0, 0, 0, .45); }

/* ---------- smaller screens ---------- */
@media (max-width: 1150px) {
  .st-board { grid-template-columns: 1fr; align-items: start; }
  .st-detail-body { max-height: none; }
}
@media (max-width: 860px) {
  .st-head { align-items: flex-start; }
  .st-head .stats-controls { width: auto; }
  .st-head .stats-controls label { flex: 0 0 auto; }
  .st-head .stats-controls select { width: auto; }
  .st-figures { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .st-fig { grid-column: span 2; padding: 16px 14px 14px; gap: 8px; }
  .st-fig:nth-child(-n+2) { grid-column: span 3; }
  .st-fig:nth-child(-n+2) strong { font-size: 46px; }
  .st-fig:nth-child(n+3) strong { font-size: 32px; }
  .st-fig-label { font-size: 14px; }
  .st-fig small { font-size: 13px; }
  .st-fig:nth-child(n+3) small { display: none; }
  .st-cal, .st-detail { padding: 18px 14px; }
  .st-cal-head h2 { font-size: 26px; }
  .st-week, .st-grid { gap: 4px; }
  .st-week span { padding-left: 0; text-align: center; font-size: 12.5px; }
  .st-day { height: 58px; padding: 7px 7px 6px; }
  .st-blank { height: 58px; }
  .st-num { font-size: 14px; }
  .st-day.is-today .st-num { margin: -3px 0 0 -4px; padding: 3px 4px; }
  .st-sent { font-size: 14px; }
  .st-sent em { display: none; }
  .st-rep { top: 6px; right: 5px; font-size: 0; gap: 0; }
  .st-rep i { width: 7px; height: 7px; }
  .st-key { gap: 10px 18px; font-size: 13.5px; }
  .st-locked .unlock-card { top: 170px; }
}
@media (max-width: 380px) { .st-fig { padding: 14px 12px 12px; } }
@media (prefers-reduced-motion: reduce) { .st-day, .st-nav, .st-row { transition: none; } .st-day:active, .st-nav:active { transform: none; } }

/* #123 honest locks (the binder's Replied / Calls booked tabs and the top plate's reply rate, without the installation):
   the word stays, a small gold lock takes the count's place, a click opens the upgrade sheet */
.bd-tabs .bd-tab-lock { color: var(--bone-3); }
.bd-tabs .bd-tab-lock .hi-lock, .hud-link.is-locked .hud-num { display: inline-grid; place-items: center; }
.bd-tabs .bd-tab-lock .hi-lock svg { width: 12px; height: 12px; fill: none; stroke: var(--t-titan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
@media (hover: hover) and (pointer: fine) { .bd-tabs .bd-tab-lock:hover { color: var(--bone-2); } }
.hud-link.is-locked .hud-num svg { width: 20px; height: 20px; fill: none; stroke: var(--t-titan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.hud-link.is-locked .hud-label { color: var(--bone-3); }
