/* SCR-01: copy of components/bundle.css from the design system "weheals Corporate Design".
   Change it there, then copy again. */
/* weheals components — plain CSS, prefix wh-. Values come only from tokens.css (--wh-*).
   Form language: scales, tick marks and a pointer (the measuring instrument that heals).
   The portal renders these classes from Twig; no framework runtime is required. */

.wh-root, .wh-root * { box-sizing: border-box; }
.wh-root {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  color: var(--wh-ink);
  background: var(--wh-paper);
  font-variant-numeric: tabular-nums;
}
.wh-row { display: flex; flex-wrap: wrap; gap: var(--wh-space-3); align-items: center; }
.wh-stack { display: flex; flex-direction: column; gap: var(--wh-space-4); }

/* Width axis: narrow for titles and readings, wide for engraved labels. */
.wh-narrow { font-variation-settings: "wdth" 75; }
.wh-wide { font-variation-settings: "wdth" 112; }

/* Focus: 2px solid ring with a 2px gap; never removed, never hidden. */
.wh-root :focus-visible { outline: 2px solid var(--wh-focus); outline-offset: 2px; }
.wh-on-petrol :focus-visible { outline-color: var(--wh-focus-on-petrol); }

/* The ruler: a hairline with ticks every 8px, a long tick every 40px. Used under section
   and page titles and as the track of every scale. Drawn with repeating gradients (hard stops). */
.wh-ruler {
  height: var(--wh-tick-long);
  background:
    linear-gradient(var(--wh-tick), var(--wh-tick)) left bottom / 100% 1px no-repeat,
    repeating-linear-gradient(to right, var(--wh-tick) 0 1px, transparent 1px 40px) left bottom / 100% var(--wh-tick-long) no-repeat,
    repeating-linear-gradient(to right, var(--wh-tick) 0 1px, transparent 1px 8px) left bottom / 100% var(--wh-tick-short) no-repeat;
}

/* ---------- Button ---------- */
.wh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--wh-space-2);
  min-height: var(--wh-target); padding: 0 var(--wh-space-4);
  font: 600 15px/20px var(--font-sans);
  border-radius: var(--wh-radius);
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.wh-btn--primary { background: var(--wh-petrol); color: var(--wh-on-petrol); }
.wh-btn--primary:hover { background: var(--wh-ink); }
/* Variant B of the A/B test: bright ocher with ink text. */
.wh-btn--accent { background: var(--wh-ocker-bright); color: var(--wh-ink); }
.wh-btn--accent:hover { box-shadow: inset 0 0 0 1px var(--wh-ink); }
.wh-btn--secondary { background: var(--wh-paper); color: var(--wh-petrol); border-color: var(--wh-field-border); }
.wh-btn--secondary:hover { background: var(--wh-paper-2); }
.wh-btn--quiet { background: transparent; color: var(--wh-petrol); padding: 0 var(--wh-space-2); text-decoration: underline; text-underline-offset: 3px; }
.wh-btn--quiet:hover { text-decoration-thickness: 2px; }
.wh-btn--sm { min-height: 32px; padding: 0 var(--wh-space-3); font-size: 14px; }
.wh-btn[disabled], .wh-btn[aria-disabled="true"] { background: var(--wh-paper-3); color: var(--wh-ink-muted); border-color: var(--wh-hairline); cursor: not-allowed; box-shadow: none; }
.wh-btn[aria-busy="true"] { cursor: progress; }
/* Busy: a pointer sweeping a three-tick scale instead of a spinner. */
.wh-btn__busy { width: 18px; height: 10px; position: relative; flex: none;
  background: repeating-linear-gradient(to right, currentColor 0 2px, transparent 2px 8px) left bottom / 18px 5px no-repeat; }
.wh-btn__busy::after { content: ""; position: absolute; top: 0; left: 0; width: 0; height: 0;
  border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid var(--wh-ocker-bright);
  animation: wh-sweep 900ms ease-in-out infinite alternate; }
@keyframes wh-sweep { to { transform: translateX(12px); } }

/* ---------- Status: shape + word + colour (A11Y-02) ---------- */
.wh-status { display: inline-flex; align-items: center; gap: var(--wh-space-1); font-weight: 500; }
.wh-status svg { width: 16px; height: 16px; flex: none; }
.wh-status--positive { color: var(--wh-positive); }
.wh-status--negative { color: var(--wh-negative); }
.wh-status--warning { color: var(--wh-warning); }
.wh-status--neutral { color: var(--wh-ink-muted); }
.wh-status--neutral svg { color: var(--wh-tick); }
.wh-new { display: inline-block; padding: 0 6px; border-radius: var(--wh-radius); background: var(--wh-ocker-fill); color: var(--wh-ink);
  font: 600 11px/18px var(--font-sans); letter-spacing: .12em; text-transform: uppercase; font-variation-settings: "wdth" 112; }

/* ---------- Section header: overline, title, ruler ---------- */
.wh-section-head { display: grid; gap: 2px; }
.wh-section-head__overline { font: 600 12px/16px var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--wh-ink-muted); font-variation-settings: "wdth" 112; }
.wh-section-head__title { margin: 0 0 var(--wh-space-1); font: 620 24px/28px var(--font-sans); font-variation-settings: "wdth" 75; color: var(--wh-ink); text-wrap: balance; }

/* ---------- Gauge: the signature scale with ocher fill, target zone and pointer ---------- */
.wh-gauge { display: grid; gap: var(--wh-space-1); min-width: 0; }
.wh-gauge__head { display: flex; justify-content: space-between; gap: var(--wh-space-3); align-items: baseline; }
.wh-gauge__label { font: 600 12px/16px var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--wh-ink-muted); font-variation-settings: "wdth" 112; }
.wh-gauge__reading { font: 620 20px/24px var(--font-sans); font-variation-settings: "wdth" 75; }
.wh-gauge__track { position: relative; height: 26px; }
.wh-gauge__track .wh-ruler { position: absolute; left: 0; right: 0; bottom: 6px; }
.wh-gauge__zone { position: absolute; bottom: 6px; height: var(--wh-tick-long); background: var(--wh-ocker-fill); }
.wh-gauge__fill { position: absolute; left: 0; bottom: 0; height: 6px; background: var(--wh-ocker); transition: width var(--wh-duration-pointer) ease-out; }
.wh-gauge__pointer { position: absolute; top: 0; width: 0; height: 0; margin-left: -6px;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--wh-petrol);
  transition: left var(--wh-duration-pointer) ease-out; }
.wh-gauge__limit { position: absolute; bottom: 0; width: 2px; height: 20px; margin-left: -1px; background: var(--wh-negative); }
.wh-gauge__scale { display: flex; justify-content: space-between; font: 500 11px/14px var(--font-sans); color: var(--wh-ink-muted); }
.wh-gauge__note { font-size: 13px; line-height: 18px; color: var(--wh-ink-muted); }

/* ---------- KPI: label, reading, delta, period — framed by the ruler, not by a card ---------- */
.wh-kpi { display: grid; gap: var(--wh-space-1); padding: var(--wh-space-3) 0 0; border-top: 2px solid var(--wh-ink); min-width: 0; }
.wh-kpi__label { font: 600 12px/16px var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--wh-ink-muted); font-variation-settings: "wdth" 112; }
.wh-kpi__value { font: 620 34px/36px var(--font-sans); font-variation-settings: "wdth" 75; color: var(--wh-ink); font-variant-numeric: tabular-nums; }
.wh-kpi__unit { font-size: 18px; color: var(--wh-ink-muted); margin-left: 2px; }
.wh-kpi__value--unknown { color: var(--wh-ink-muted); }
.wh-kpi__delta { font-size: 14px; line-height: 20px; }
.wh-kpi__meta { font-size: 13px; line-height: 18px; color: var(--wh-ink-muted); }

/* ---------- Table: dense work list ---------- */
.wh-table-wrap { overflow-x: auto; border: 1px solid var(--wh-hairline); border-radius: var(--wh-radius); }
.wh-table { width: 100%; border-collapse: collapse; font: 400 14px/20px var(--font-sans); font-variant-numeric: tabular-nums; }
.wh-table th { position: sticky; top: 0; background: var(--wh-paper-3); text-align: left; font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--wh-ink-muted); font-variation-settings: "wdth" 112; padding: 10px var(--wh-space-3); border-bottom: 1px solid var(--wh-tick); white-space: nowrap; }
.wh-table td { height: var(--wh-row-height); padding: 0 var(--wh-space-3); border-bottom: 1px solid var(--wh-row-line); }
.wh-table tr:last-child td { border-bottom: 0; }
.wh-table .wh-num { text-align: right; }
.wh-table tr[aria-selected="true"] td { background: var(--wh-petrol-tint); }
.wh-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.wh-table th[aria-sort] { color: var(--wh-ink); }
.wh-table th button:focus-visible { outline: 2px solid var(--wh-focus); outline-offset: 2px; }
.wh-table a { color: var(--wh-petrol); }
.wh-rank { display: inline-flex; align-items: center; gap: 6px; }
.wh-rank__bar { width: 48px; height: 6px; background: var(--wh-paper-3); position: relative; }
.wh-rank__bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--wh-ocker); }

/* ---------- Text field ---------- */
.wh-field { display: grid; gap: var(--wh-space-1); max-width: 400px; }
.wh-field__label { font: 500 14px/20px var(--font-sans); color: var(--wh-ink); }
.wh-input { min-height: var(--wh-target); width: 100%; padding: 0 var(--wh-space-3); font: 400 15px/22px var(--font-sans); color: var(--wh-ink);
  background: var(--wh-paper); border: 1px solid var(--wh-field-border); border-radius: var(--wh-radius); }
.wh-input::placeholder { color: var(--wh-ink-muted); }
.wh-input:focus-visible { outline: 2px solid var(--wh-focus); outline-offset: 2px; }
.wh-input[aria-invalid="true"] { border-color: var(--wh-negative); border-width: 2px; padding: 0 11px; }
.wh-input:disabled { background: var(--wh-paper-3); color: var(--wh-ink-muted); }
.wh-field__hint { font-size: 13px; line-height: 18px; color: var(--wh-ink-muted); }
.wh-field__error { display: flex; gap: var(--wh-space-1); align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--wh-negative); font-weight: 500; }
.wh-field__error svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.wh-password { position: relative; }
.wh-password .wh-input { padding-right: 96px; }
.wh-password .wh-btn { position: absolute; right: 4px; top: 4px; min-height: 32px; }

/* ---------- Notice ---------- */
.wh-notice { display: flex; gap: var(--wh-space-2); align-items: flex-start; padding: var(--wh-space-3) var(--wh-space-4); border: 1px solid var(--wh-hairline); border-radius: var(--wh-radius); background: var(--wh-paper-2); color: var(--wh-ink); max-width: 560px; }
.wh-notice > span { display: inline-flex; }
.wh-notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.wh-notice__title { font-weight: 600; }
.wh-notice--positive { background: var(--wh-positive-surface); border-color: var(--wh-positive); }
.wh-notice--negative { background: var(--wh-negative-surface); border-color: var(--wh-negative); }
.wh-notice--warning { background: var(--wh-warning-surface); border-color: var(--wh-warning); }

/* ---------- Page header: title, data stand, market and period, one primary action, help ---------- */
.wh-page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--wh-space-3) var(--wh-space-5); align-items: start; }
.wh-page-head__title { margin: 0; font: 620 34px/36px var(--font-sans); letter-spacing: -.01em; font-variation-settings: "wdth" 75; color: var(--wh-ink); text-wrap: balance; }
.wh-page-head__meta { display: flex; flex-wrap: wrap; gap: var(--wh-space-2) var(--wh-space-4); align-items: center; font-size: 13px; line-height: 18px; color: var(--wh-ink-muted); grid-column: 1; }
.wh-page-head__actions { display: flex; flex-wrap: wrap; gap: var(--wh-space-2); align-items: center; grid-column: 2; grid-row: 1 / span 2; }
.wh-page-head .wh-ruler { grid-column: 1 / -1; }
.wh-chip { display: inline-flex; align-items: center; gap: var(--wh-space-1); min-height: 32px; padding: 0 var(--wh-space-3); border: 1px solid var(--wh-field-border); border-radius: var(--wh-radius); background: var(--wh-paper); color: var(--wh-ink); font: 500 14px/20px var(--font-sans); cursor: pointer; }
.wh-chip svg { width: 14px; height: 14px; }
.wh-stale { color: var(--wh-warning); font-weight: 500; }
@media (max-width: 640px) {
  .wh-page-head { grid-template-columns: minmax(0, 1fr); }
  .wh-page-head__actions { grid-column: 1; grid-row: auto; }
}

/* ---------- Brand on screen ---------- */
.wh-brand { display: inline-flex; align-items: center; gap: var(--wh-space-3); }
.wh-brand img { display: block; }
.wh-brand__by { font: 500 13px/18px var(--font-sans); color: var(--wh-ink-muted); }
.wh-on-petrol { background: var(--wh-petrol); color: var(--wh-on-petrol); }
.wh-on-petrol .wh-brand__by { color: var(--wh-on-petrol-muted); }

@media (prefers-reduced-motion: reduce) {
  .wh-btn__busy::after { animation: none; transform: translateX(6px); }
  .wh-gauge__fill, .wh-gauge__pointer { transition: none; }
}
