/* =====================================================================
   cib — components.css
   Built only on tokens.css. Plain class names, no framework.
   Rule of colour: neutral by default; the app accent appears only on
   the app icon, the one primary button, selected states and the key result.
   ===================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh-md);
  font-weight: var(--fw-regular); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-underline-offset: .18em; }
img, svg { display: block; }
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.icon { width: var(--icon); height: var(--icon); flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack { display: grid; gap: var(--gap, var(--space-4)); }
[hidden] { display: none !important; }

/* ---------- Page layout ---------- */
.page { max-width: var(--measure); margin: 0 auto; padding: var(--space-5) var(--gutter) var(--space-12); }
.page-title { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
.lead { color: var(--text-muted); margin-top: var(--space-1); }
.section-title {
  display: flex; align-items: center; gap: var(--space-2);
  margin: var(--space-8) 0 var(--space-3); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold);
}
.section-title .icon { color: var(--text-muted); }
.section-title small { margin-left: auto; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }

/* =====================================================================
   THE POCKET — signature elements
   ===================================================================== */

/* App icon: a filled pocket in the app colour, stitched seam, glyph inside. */
.app-icon {
  --size: 3rem;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--size); height: var(--size);
  background: var(--accent); color: var(--on-accent);
  -webkit-mask: var(--pocket-shape) center / 100% 100% no-repeat;
          mask: var(--pocket-shape) center / 100% 100% no-repeat;
}
.app-icon::before {
  content: ""; position: absolute; inset: 0; background: currentColor; opacity: .6;
  -webkit-mask: var(--pocket-seam) center / 100% 100% no-repeat;
          mask: var(--pocket-seam) center / 100% 100% no-repeat;
}
.app-icon > .icon { width: 46%; height: 46%; margin-top: 16%; stroke-width: 2.2; }
.app-icon--sm { --size: 2rem; }
.app-icon--sm > .icon { stroke-width: 2.5; }
.app-icon--lg { --size: 4rem; }

/* Studio mark: the empty pocket (outline) with "cib" inside. Always lowercase. */
.cib-mark {
  --size: 2.25rem;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--size); height: var(--size); padding-top: calc(var(--size) * .16);
  color: var(--text); font-weight: var(--fw-heavy); font-size: calc(var(--size) * .33);
  line-height: 1; letter-spacing: -.01em; text-transform: none;
}
.cib-mark::before, .cib-mark::after { content: ""; position: absolute; inset: 0; background: var(--text-muted); }
.cib-mark::before { -webkit-mask: var(--pocket-outline) center / 100% 100% no-repeat; mask: var(--pocket-outline) center / 100% 100% no-repeat; }
.cib-mark::after { opacity: .75; -webkit-mask: var(--pocket-seam) center / 100% 100% no-repeat; mask: var(--pocket-seam) center / 100% 100% no-repeat; }
.cib-mark--lg { --size: 3rem; }

/* Pocket container: a surface with a stitched hem along its top edge.
   Only for the few containers that hold "the thing": the app shelf, the
   key result, the play area, sheets. Not for every card. */
.pocket, .seam { position: relative; }
.pocket {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4) var(--space-4);
}
.pocket::before, .seam::before {
  --inset: .4375rem;
  content: ""; position: absolute; top: var(--inset); left: var(--inset); right: var(--inset); height: 1.5rem;
  border: 1.5px dashed var(--stitch); border-bottom: 0;
  border-radius: calc(var(--radius-lg) - var(--inset)) calc(var(--radius-lg) - var(--inset)) 0 0;
  -webkit-mask: linear-gradient(#000 35%, transparent); mask: linear-gradient(#000 35%, transparent);
  pointer-events: none;
}
.pocket--accent { background: var(--accent-subtle); border-color: var(--accent-line); }
.pocket--accent::before { border-color: var(--accent-line); }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: var(--space-2) var(--space-5);
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--text);
  font-size: var(--fs-md); line-height: 1.25; font-weight: var(--fw-bold); text-align: center; text-decoration: none;
  cursor: pointer; user-select: none;
  transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-solid); color: var(--on-danger); }
.btn--icon { width: var(--tap); padding: 0; }           /* never for a primary action; always aria-label */
.btn--block { width: 100%; }
.btn--sm { min-height: var(--tap-min); padding: var(--space-1) var(--space-4); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.btn-col { display: grid; gap: var(--space-3); }

/* =====================================================================
   TEXT INPUT: label above, optional unit, help, error
   ===================================================================== */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); min-width: 0; }
.field__label { font-weight: var(--fw-bold); }
.field__control {
  display: flex; align-items: center; min-height: var(--tap);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.field__control:hover { border-color: var(--text-muted); }
.field__control:focus-within { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.field__lead { display: grid; place-items: center; padding-left: var(--space-4); color: var(--text-muted); }
.field__input {
  flex: 1; width: 0; min-width: 0; align-self: stretch; padding: 0 var(--space-4); border: 0; border-radius: inherit;
  background: none; font-size: var(--fs-lg); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; outline: none;
}
.field__lead + .field__input { padding-left: var(--space-2); }
.field__input::placeholder { color: var(--text-muted); opacity: 1; }
.field__unit { padding: 0 var(--space-4) 0 var(--space-1); color: var(--text-muted); font-weight: var(--fw-bold); white-space: nowrap; }
.field__help { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-muted); }
.field__error { display: none; gap: var(--space-2); align-items: flex-start; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); color: var(--danger); }
.field__error .icon { width: 1.125rem; height: 1.125rem; margin-top: .0625rem; }
.field--error .field__control { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.field--error .field__error { display: flex; }
.field-row { display: flex; gap: var(--space-3); align-items: stretch; }
.field-row > .field__control { flex: 1; }

/* =====================================================================
   SEGMENTED CONTROL (radio group)
   ===================================================================== */
.seg {
  display: flex; gap: var(--space-1); padding: var(--space-1);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.seg__opt { position: relative; flex: 1 1 0; min-width: 0; display: flex; }
.seg__opt > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: var(--fw-medium); text-align: center; line-height: 1.2;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.seg__btn .icon { width: 1.125rem; height: 1.125rem; }
.seg__opt > input:hover + .seg__btn { color: var(--text); }
.seg__opt > input:checked + .seg__btn {
  background: var(--surface-raised); color: var(--accent-strong); font-weight: var(--fw-bold);
  box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--accent);
}
.seg__opt > input:focus-visible + .seg__btn { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
.seg--compact .seg__btn { padding-inline: var(--space-3); }

/* =====================================================================
   SWITCH (checkbox role=switch). Position + check mark, not colour alone.
   ===================================================================== */
.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; margin: 0; cursor: pointer;
  width: 3.25rem; height: 2rem; border-radius: var(--radius-pill); background: var(--border-strong);
  transition: background-color var(--dur-base) var(--ease-standard);
}
.switch::before {
  content: ""; position: absolute; top: .25rem; left: .25rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--surface-raised); box-shadow: 0 1px 2px oklch(0 0 0 / .25);
  transition: transform var(--dur-base) var(--ease-out);
}
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(1.25rem); background: var(--on-accent); }
.switch::after {
  content: ""; position: absolute; top: .5rem; left: 1.75rem; width: 1rem; height: 1rem; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%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 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0; transition: opacity var(--dur-base) var(--ease-standard);
}
.switch:checked::after { opacity: 1; }

/* =====================================================================
   CHIP (toggle filter) and BADGE (status label)
   ===================================================================== */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-min);
  padding: var(--space-1) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font-weight: var(--fw-medium); cursor: pointer; text-decoration: none;
}
.chip:hover { background: var(--surface-2); }
.chip .icon { width: 1.125rem; height: 1.125rem; }
.chip__check { display: none; }
.chip[aria-pressed="true"], .chip[aria-current] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-strong); font-weight: var(--fw-bold); }
.chip[aria-pressed="true"] .chip__check { display: block; }
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); min-height: 1.5rem;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-bold); color: var(--text); white-space: nowrap;
}
.badge--live { border-style: solid; border-color: transparent; background: var(--success-subtle); color: var(--success); }

/* =====================================================================
   CARD and LIST
   ===================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
a.card { display: block; color: inherit; text-decoration: none; box-shadow: var(--shadow-1); transition: border-color var(--dur-fast) var(--ease-standard); }
a.card:hover { border-color: var(--border-strong); }

.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.list > li + li, .list > .row + .row { border-top: 1px solid var(--border); }
.row {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 3.5rem;
  padding: var(--space-2) var(--space-4); border: 0; background: none; color: var(--text);
  text-align: left; text-decoration: none; cursor: default;
}
a.row, button.row, label.row { cursor: pointer; }
a.row:hover, button.row:hover, label.row:hover { background: var(--surface-2); }
.row:focus-visible { outline-offset: calc(var(--focus-width) * -1); border-radius: var(--radius-lg); }
.row__icon { color: var(--text-muted); }
.row__body { flex: 1; min-width: 0; display: grid; }
.row__title { font-weight: var(--fw-medium); }
.row__meta { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-muted); }
.row__end { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--fs-sm); }
.row__end .icon { width: 1.125rem; height: 1.125rem; }
.row--more .row__title { color: var(--accent-text); font-weight: var(--fw-bold); }

/* =====================================================================
   TOP APP BAR — identical in every app.
   [up]  [app icon + app name]  ...............  [settings]
   up = "Geri" on inner pages, the cib mark on an app's home page.
   When the three do not fit (large text, long names) the app name
   drops to its own row; nothing is hidden and nothing truncates.
   ===================================================================== */
.appbar { position: sticky; top: 0; z-index: var(--z-bar); background: var(--bg); border-bottom: 1px solid var(--border); container-type: inline-size; }
.appbar__in {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "up app set";
  align-items: center; column-gap: var(--space-1); max-width: var(--page-bar, var(--measure)); margin: 0 auto;
  padding: var(--space-1) var(--space-2); min-height: 3.5rem;
}
.appbar__up, .appbar__set {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap); min-width: var(--tap);
  padding: 0 var(--space-3) 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: none;
  color: var(--text); font-weight: var(--fw-bold); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.appbar__up { grid-area: up; }
.appbar__up--mark { padding: 0 var(--space-1); justify-content: center; }
.appbar__set { grid-area: set; justify-self: end; padding: 0 var(--space-3) 0 var(--space-2); }
.appbar__up:hover, .appbar__set:hover, .appbar__app:hover { background: var(--surface-2); }
.appbar__app {
  grid-area: app; justify-self: start; display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; max-width: 100%;
  min-height: var(--tap); padding: 0 var(--space-2); border-radius: var(--radius-md);
  color: var(--text); text-decoration: none; font-size: var(--fs-lg); font-weight: var(--fw-heavy); letter-spacing: var(--tracking-tight);
}
.appbar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar__wordmark { font-size: var(--fs-lg); font-weight: var(--fw-heavy); letter-spacing: -.02em; text-transform: none; }
@container (max-width: 23rem) {
  .appbar__in { grid-template-columns: auto 1fr auto; grid-template-areas: "up . set" "app app app"; row-gap: 0; }
  .appbar__app { padding-bottom: var(--space-1); }
  .appbar__name { white-space: normal; }
}

/* =====================================================================
   BOTTOM TAB BAR — only for apps with 3–5 top-level sections.
   Labels always visible.
   ===================================================================== */
.tabbar {
  position: sticky; bottom: 0; z-index: var(--z-bar); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: var(--space-1) var(--space-2) calc(var(--space-1) + env(safe-area-inset-bottom));
}
.tab {
  display: grid; justify-items: center; align-content: center; gap: var(--space-0-5); min-height: 3.5rem; padding: var(--space-1);
  border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); text-decoration: none;
}
.tab__ico { display: grid; place-items: center; width: 3.5rem; height: 2rem; border-radius: var(--radius-pill); }
.tab[aria-current="page"] { color: var(--accent-strong); font-weight: var(--fw-bold); }
.tab[aria-current="page"] .tab__ico { background: var(--accent-tint); }

/* =====================================================================
   SHEET (bottom on phones, centred on wide screens) and DIALOG
   Built on <dialog>: focus trap, Esc and backdrop for free.
   Every sheet has a labelled close button; swipe is never required.
   ===================================================================== */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 34rem; max-height: min(94dvh, 52rem);
  background: var(--surface-raised); color: var(--text); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-2); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in var(--dur-slow) var(--ease-out); }
dialog.sheet::backdrop { background: var(--scrim, rgba(20, 25, 35, .45)); }
@keyframes sheet-in { from { transform: translateY(1.5rem); opacity: 0; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-6) var(--space-4) var(--space-2) var(--space-5); }
.sheet__title:focus { outline: none; }
.sheet__title { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
.sheet__body { overflow: auto; padding: var(--space-2) var(--space-5) var(--space-6); display: grid; gap: var(--space-5); }
.sheet__foot { display: grid; gap: var(--space-3); padding: 0 var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom)); }
dialog.sheet--dialog { margin: auto; width: calc(100% - 2 * var(--gutter)); max-width: 26rem; border-radius: var(--radius-lg); }
dialog.sheet--dialog .sheet__head { padding-top: var(--space-5); }
@media (min-width: 40rem) {
  dialog.sheet { margin: auto; border-radius: var(--radius-lg); }
}
.setting { display: grid; gap: var(--space-2); }
.setting__label { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-weight: var(--fw-bold); }
.setting__label .icon { color: var(--text-muted); }
.setting__group-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text-muted); }
.size-a { font-weight: var(--fw-heavy); line-height: 1; }

/* =====================================================================
   TOAST — confirmations only; never the only place information appears.
   ===================================================================== */
.toast-region {
  position: fixed; left: 0; right: 0; bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); z-index: var(--z-toast);
  display: grid; justify-items: center; gap: var(--space-2); padding: 0 var(--gutter); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--space-3); max-width: 28rem; min-height: var(--tap);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius-md);
  background: var(--inverse); color: var(--on-inverse); box-shadow: var(--shadow-2); font-weight: var(--fw-medium);
  animation: sheet-in var(--dur-base) var(--ease-out);
}
.toast > span { padding-right: var(--space-2); }
.toast__action { min-height: var(--tap-min); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font-weight: var(--fw-bold); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }

/* =====================================================================
   EMPTY STATE — says what happened and what to do next.
   ===================================================================== */
.empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-4); text-align: center; }
.empty__art { --size: 4.5rem; margin-bottom: var(--space-2); }
.empty__art.cib-mark { font-size: 0; }
.empty__title { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); }
.empty__text { color: var(--text-muted); max-width: 30ch; }
.empty .btn { margin-top: var(--space-3); }

/* =====================================================================
   KEY RESULT (lives in a pocket--accent)
   ===================================================================== */
.result { display: grid; gap: var(--space-1); }
.result__label { font-weight: var(--fw-bold); color: var(--text); }
.result__value { font-size: var(--fs-2xl); line-height: var(--lh-2xl); font-weight: var(--fw-heavy); color: var(--accent-strong); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-tight); }
.result__value small { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.result__rows { display: grid; margin-top: var(--space-3); border-top: 1px solid var(--accent-line); }
.result__rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-2) 0; }
.result__rows > div + div { border-top: 1px solid var(--accent-tint); }
.result__rows dt { color: var(--text-muted); }
.result__rows dd { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; text-align: right; }

/* =====================================================================
   GAME: HUD stat, progress, play area. The shell and HUD stay neutral;
   colour is allowed only inside .play.
   ===================================================================== */
.hud { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: stretch; }
.stat {
  flex: 1 1 0; min-width: 4.75rem; display: grid; align-content: center; padding: var(--space-1) var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.stat__label { display: flex; align-items: center; gap: var(--space-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.stat__label .icon { width: 1rem; height: 1rem; }
.stat__value { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat--key .stat__value { color: var(--accent-strong); }

.progress-wrap { display: grid; gap: var(--space-1); }
.progress-wrap__label { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.progress { height: .75rem; padding: 1px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border-strong); overflow: hidden; }
.progress > span { display: block; height: 100%; width: var(--value, 0%); border-radius: inherit; background: var(--accent); transition: width var(--dur-slow) var(--ease-out); }

.play { position: relative; padding: var(--space-6) var(--space-3) var(--space-3); border-radius: var(--radius-lg); background: var(--accent-subtle); border: 1px solid var(--accent-line); }
.play::before { border-color: var(--accent-line); }

/* =====================================================================
   APP FOOTER — the quiet second way to the studio.
   ===================================================================== */
.app-foot { max-width: var(--measure); margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-10); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); color: var(--text-muted); font-size: var(--fs-sm); }
.app-foot__studio { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-min); color: var(--text); font-weight: var(--fw-bold); text-decoration: none; }
.app-foot__studio .cib-mark { --size: 2rem; }

/* Forced colours (Windows high contrast): keep shapes visible. */
@media (forced-colors: active) {
  .app-icon, .cib-mark::before, .cib-mark::after, .app-icon::before { forced-color-adjust: none; }
  .switch, .progress, .seg__btn { border: 1px solid CanvasText; }
}
