/* ACC Daily · app.css
 * Base, shell, layout, sheets, figures, controls, about, tooltip, table, charts. Colors only from tokens.css.
 * Prefixes: sh- shell, c- components, t- table, ch- charts. Page styles live in css/pages/{page}.css. */

/* ===== base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-variant-numeric: lining-nums; text-rendering: optimizeLegibility; overflow-wrap: break-word; overflow-x: hidden; }
h1, h2, h3, h4, p, dl, dd, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--ink-1); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ink-4); }
a:hover { text-decoration-color: var(--ink-1); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--surface-selected); color: var(--ink-1); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ===== type roles ===== */
.c-cap {
  font: 600 11px/14px var(--font-ui); font-stretch: 125%;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2);
}
.c-h1 { display: flex; align-items: center; gap: 12px; font: 600 var(--fs-28)/34px var(--font-ui); letter-spacing: -.01em; color: var(--ink-1); }
.c-code { font: 450 12.5px/16px var(--font-mono); font-stretch: 87.5%; letter-spacing: 0; color: var(--ink-1); }
.c-note { font: 400 var(--fs-13)/19px var(--font-ui); color: var(--ink-3); }
.c-stamp { font: 400 var(--fs-12)/16px var(--font-ui); font-stretch: 92%; color: var(--ink-3); }
.c-num { font-variant-numeric: tabular-nums lining-nums; }
.c-key { display: inline-block; width: 8px; height: 8px; flex: none; }
.c-key--sales { background: var(--sales); }
.c-key--stock { background: var(--stock); }
.c-key--supply { background: var(--supply); }
.c-key--ink { background: var(--ink-1); }
.c-h1 .c-key { width: 10px; height: 10px; }
@media (max-width: 639px) { .c-h1 { font-size: var(--fs-24); line-height: 30px; } }

/* ===== shell ===== */
.sh-in { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.sh-skip { position: absolute; left: -999px; top: 0; z-index: 100; padding: 8px 12px; background: var(--surface); }
.sh-skip:focus { left: 8px; }
.sh-strip { height: 26px; display: flex; align-items: center; background: var(--page); }
.sh-strip .sh-in { width: 100%; display: flex; justify-content: flex-end; }
.sh-strip__t { font: 400 var(--fs-12)/16px var(--font-ui); font-stretch: 92%; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sh-head { position: sticky; top: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 2px solid var(--rule-heavy); }
.sh-head__in { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.sh-word { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-1); text-decoration: none; flex: none; }
.sh-mark {
  width: 30px; height: 30px; border: 2px solid var(--ink-1); display: inline-flex; align-items: center; justify-content: center;
  font: 700 10.5px/1 var(--font-ui); font-stretch: 100%; letter-spacing: -.01em;
}
.sh-name { font: 600 var(--fs-16)/20px var(--font-ui); white-space: nowrap; }
.sh-nav { display: flex; align-items: stretch; height: 100%; gap: 4px; }
.sh-nav__i {
  display: inline-flex; align-items: center; padding: 0 12px; color: var(--ink-2); text-decoration: none;
  font: 500 var(--fs-15)/20px var(--font-ui); white-space: nowrap; position: relative;
}
.sh-nav__i:hover { color: var(--ink-1); background: var(--surface-hover); }
.sh-nav__i.is-active { color: var(--ink-1); font-weight: 600; }
.sh-nav__i.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--ink-1); }
.sh-nav__i:focus-visible { outline-offset: -2px; }
.sh-search { position: relative; flex: 0 1 340px; margin-left: auto; min-width: 0; }
.sh-search__field {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-2);
  background: var(--surface-sunken); color: var(--ink-3); cursor: text;
}
.sh-search__field:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; background: var(--surface); }
.sh-search__icon { display: inline-flex; }
.sh-search__in { flex: 1 1 auto; min-width: 0; height: 34px; border: 0; padding: 0; background: transparent; color: var(--ink-1); font: 400 var(--fs-14)/20px var(--font-ui); }
.sh-search__in:focus { outline: none; }
.sh-search__in::placeholder { color: var(--ink-3); opacity: 1; }
.sh-search__panel {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: max(100%, 420px); max-width: calc(100vw - 2 * var(--gutter));
  max-height: min(70vh, 520px); overflow: auto; padding: 6px 0 8px; background: var(--surface-raised); border: 1px solid var(--rule);
  border-radius: var(--r-3); box-shadow: var(--shadow-float);
}
.sh-search__cap { padding: 10px 14px 4px; color: var(--ink-3); }
.sh-search__none { padding: 10px 14px; font: 400 var(--fs-13)/18px var(--font-ui); color: var(--ink-2); }
.sh-opt { display: flex; align-items: baseline; gap: 10px; min-height: 34px; padding: 7px 14px; cursor: pointer; }
.sh-opt.is-active { background: var(--surface-selected); }
.sh-opt__t { flex: none; font-weight: 500; }
.sh-opt__s { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font: 400 var(--fs-13)/18px var(--font-ui); }
.sh-theme { flex: none; }
.sh-out { flex: none; margin-left: -14px; padding: 0 8px; color: var(--ink-2); font-weight: 500; }
.sh-out:hover { color: var(--ink-1); }
.sh-dl { flex: none; height: 34px; padding: 0 12px; }
.sh-dl .c-icon { flex: none; }
.sh-dl__short { display: none; }
@media (max-width: 1279px) { .sh-dl__long { display: none; } .sh-dl__short { display: inline; } }
@media (max-width: 899px) { .sh-dl__short { display: none; } .sh-dl { width: 36px; padding: 0; } }

.sh-main { padding: 28px 0 8px; }
.pg { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.pg:focus { outline: none; }
.sh-foot { margin-top: 40px; border-top: 1px solid var(--rule); }
.sh-foot__in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 16px; padding-bottom: 32px; font: 400 var(--fs-12)/18px var(--font-ui); color: var(--ink-3); }
.sh-foot__dl { color: var(--ink-1); font-weight: 500; white-space: nowrap; }

@media (max-width: 1099px) {
  .sh-head__in { gap: 16px; }
  .sh-nav__i { padding: 0 8px; }
  .sh-nav__i.is-active::after { left: 8px; right: 8px; }
  .sh-name { display: none; }
  .sh-out { margin-left: -8px; }
}
@media (max-width: 639px) {
  .sh-strip .sh-in { justify-content: flex-start; }
  .sh-head { position: static; }
  .sh-head__in { height: auto; display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "word dl theme" "search search search" "nav nav nav"; gap: 10px 8px; padding-top: 10px; }
  .sh-word { grid-area: word; }
  .sh-name { display: inline; }
  .sh-theme { grid-area: theme; }
  .sh-dl { grid-area: dl; width: 40px; height: 40px; padding: 0; }
  .sh-head__in--out { grid-template-columns: 1fr auto auto auto; grid-template-areas: "word dl theme out" "search search search search" "nav nav nav nav"; }
  .sh-out { grid-area: out; height: 40px; margin-left: 0; }
  .sh-dl__short, .sh-dl__long { display: none !important; }
  .sh-search { grid-area: search; flex: none; width: 100%; margin: 0; }
  .sh-search__field { height: 42px; }
  .sh-search__panel { left: 0; right: auto; width: 100%; max-width: 100%; }
  .sh-nav { grid-area: nav; height: 44px; margin: 0 -8px; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .sh-nav__i { padding: 0 9px; font-size: var(--fs-14); }
  .sh-nav__i.is-active::after { left: 9px; right: 9px; }
  .sh-main { padding-top: 20px; }
}

/* ===== page head ===== */
.c-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.c-pagehead__main { min-width: 0; display: grid; gap: 6px; }
.c-pagehead__sub { font: 400 var(--fs-14)/20px var(--font-ui); color: var(--ink-2); }
.c-pagehead__side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ===== grids ===== */
.c-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.c-grid > .c-stack > :last-child { flex: 1 1 auto; }   /* paired cards end on the same line */
.c-grid--3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.c-grid--2-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.c-grid--one { grid-template-columns: minmax(0, 1fr); }
.c-grid--stretch { align-items: stretch; }
.c-stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
@media (max-width: 1099px) { .c-grid, .c-grid--3-2, .c-grid--2-3 { grid-template-columns: minmax(0, 1fr); } }

/* ===== sheet: white, 1 px rule, 2 px ink top edge ===== */
.c-sheet {
  background: var(--surface); border: 1px solid var(--rule); border-top: 2px solid var(--rule-heavy);
  padding: 18px 24px 22px; min-width: 0;
}
.c-sheet__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.c-sheet__lead { display: grid; gap: 5px; min-width: 0; }
.c-sheet__title { display: flex; align-items: center; gap: 8px; }
.c-sheet__side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.c-sheet__body { min-width: 0; }
.c-sheet--flush { padding-left: 0; padding-right: 0; padding-bottom: 8px; }
.c-sheet--flush > .c-sheet__head, .c-sheet--flush > .c-about { padding-left: 24px; padding-right: 24px; }
.c-sheet--flush .t-bar, .c-sheet--flush .t-foot { padding-left: 24px; padding-right: 24px; }
.c-sheet--flush .t th:first-child, .c-sheet--flush .t td:first-child { padding-left: 24px; }
.c-sheet--flush .t th:last-child, .c-sheet--flush .t td:last-child { padding-right: 24px; }
@media (max-width: 639px) {
  .c-sheet { padding: 14px 16px 18px; }
  .c-sheet--flush { padding-left: 0; padding-right: 0; }
  .c-sheet--flush > .c-sheet__head, .c-sheet--flush > .c-about, .c-sheet--flush .t-bar, .c-sheet--flush .t-foot { padding-left: 16px; padding-right: 16px; }
  .c-sheet--flush .t th:first-child, .c-sheet--flush .t td:first-child { padding-left: 16px; }
  .c-sheet--flush .t th:last-child, .c-sheet--flush .t td:last-child { padding-right: 16px; }
}

/* ===== figures row ===== */
.c-figs {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--rule); border-top: 2px solid var(--rule-heavy);
}
.c-figs[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.c-figs[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.c-figs[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c-fig { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 20px 18px; box-shadow: -1px 0 0 var(--rule-soft); }
/* every cell shares the row's tracks, so values and changes line up even when a caption wraps */
@supports (grid-template-rows: subgrid) {
  .c-figs { grid-auto-rows: auto; }
  .c-fig { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 6px; align-content: start; }
  .c-fig__cap { align-self: end; }
}
.c-fig:first-child { box-shadow: none; }
.c-fig__cap { font: 600 11px/14px var(--font-ui); font-stretch: 125%; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.c-fig__val { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.c-fig__num { font: 600 var(--fs-32)/38px var(--font-ui); letter-spacing: -.02em; color: var(--ink-1); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.c-fig__num--na { color: var(--ink-3); font-weight: 400; }
.c-fig__cents { font-size: var(--fs-20); color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.c-fig__unit { font: 400 var(--fs-13)/16px var(--font-ui); color: var(--ink-3); }
.c-fig__chg { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; font: 600 var(--fs-13)/18px var(--font-ui); color: var(--ink-1); font-variant-numeric: tabular-nums; }
.c-fig__g { font-size: 9px; line-height: 18px; color: var(--ink-2); }
.c-fig__abs { font-weight: 400; color: var(--ink-3); }
.c-fig__chg--na { font-weight: 400; color: var(--ink-3); }
.c-fig__note { font: 400 var(--fs-12)/16px var(--font-ui); color: var(--ink-3); }
.c-fig__note .c-link { font-size: var(--fs-12); color: var(--ink-1); }
@media (max-width: 1099px) {
  .c-figs, .c-figs[data-n="5"], .c-figs[data-n="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-fig { box-shadow: -1px 0 0 var(--rule-soft), 0 -1px 0 var(--rule-soft); }
}
@media (max-width: 639px) {
  .c-figs, .c-figs[data-n="5"], .c-figs[data-n="4"], .c-figs[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-fig { padding: 12px 14px 14px; gap: 4px; }
  .c-fig__num { font-size: var(--fs-24); line-height: 30px; }
  .c-fig__cents { font-size: var(--fs-16); }
  .c-fig__chg { font-size: var(--fs-12); }
}

/* ===== buttons ===== */
.c-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl-h); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r-2); background: transparent; color: var(--ink-1);
  font: 500 var(--fs-14)/1 var(--font-ui); white-space: nowrap; text-decoration: none; vertical-align: middle;
  transition: background-color var(--fade), border-color var(--fade);
}
.c-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.c-btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.c-btn--secondary { background: var(--surface); border-color: var(--rule); }
.c-btn--secondary:hover { background: var(--surface-hover); border-color: var(--ink-4); }
.c-btn--text:hover { background: var(--surface-hover); }
.c-btn--icon { width: var(--ctl-h); padding: 0; }
.c-btn--link { height: auto; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-4); }
.c-btn--sm { height: 28px; padding: 0 10px; gap: 6px; font-size: var(--fs-13); }
.c-btn--sm.c-btn--icon { width: 28px; padding: 0; }
.c-btn--lg { height: auto; min-height: 56px; padding: 10px 20px; gap: 12px; font-size: var(--fs-16); }
.c-btn[disabled] { color: var(--ink-4); cursor: not-allowed; background: var(--surface); border-color: var(--rule-soft); }
.c-btn__sub { font-weight: 400; font-size: var(--fs-12); opacity: .78; }
.c-btn--lg { flex-wrap: wrap; justify-content: flex-start; text-align: left; white-space: normal; }
.c-btn--lg .c-btn__t { font-weight: 600; }
.c-btn--lg .c-btn__sub { flex-basis: 100%; padding-left: 28px; margin-top: -6px; }
.c-link { font-weight: 500; white-space: nowrap; }
.c-link__arrow { text-decoration: none; display: inline-block; margin-left: .3em; }
.c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }

/* ===== inputs, select, seg, tabs ===== */
.c-input {
  height: var(--ctl-h); min-width: 0; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-2);
  background: var(--surface); color: var(--ink-1); font: 400 var(--fs-14)/20px var(--font-ui);
}
.c-input::placeholder { color: var(--ink-3); opacity: 1; }
.c-input:hover { border-color: var(--ink-4); }
.c-field { display: inline-grid; gap: 5px; min-width: 0; vertical-align: bottom; }
.c-field__lab { color: var(--ink-3); }
.c-select { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.c-select__el {
  appearance: none; -webkit-appearance: none; width: 100%; min-width: 140px; height: var(--ctl-h); padding: 0 32px 0 10px;
  border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface); color: var(--ink-1);
  font: 500 var(--fs-14)/20px var(--font-ui); cursor: pointer;
}
.c-select__el:hover { border-color: var(--ink-4); }
.c-select__chev { position: absolute; right: 10px; color: var(--ink-2); pointer-events: none; display: inline-flex; }
.c-seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.c-seg__opt {
  height: calc(var(--ctl-h) - 6px); padding: 0 12px; border: 0; border-radius: 1px; background: transparent;
  color: var(--ink-2); font: 500 var(--fs-13)/1 var(--font-ui); white-space: nowrap;
}
.c-seg__opt:hover { background: var(--surface-hover); color: var(--ink-1); }
.c-seg__opt[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.c-seg--sm .c-seg__opt { height: 24px; padding: 0 10px; font-size: var(--fs-12); }
.c-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.c-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; flex: none;
  border: 0; background: none; color: var(--ink-2); font: 500 var(--fs-14)/20px var(--font-ui); white-space: nowrap;
}
.c-tab:hover { color: var(--ink-1); background: var(--surface-hover); }
.c-tab[aria-selected="true"] { color: var(--ink-1); font-weight: 600; }
.c-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink-1); }
.c-tab:focus-visible { outline-offset: -2px; }
.c-tab__n { font: 400 var(--fs-12)/16px var(--font-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.c-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-h); font: 500 var(--fs-13)/18px var(--font-ui); color: var(--ink-1); cursor: pointer; }
.c-toggle__in { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ===== chips and breadcrumb ===== */
.c-chip { display: inline-flex; align-items: stretch; min-height: 28px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface); font: 500 var(--fs-13)/18px var(--font-ui); }
.c-chip__main { display: inline-flex; align-items: center; padding: 4px 10px; border: 0; background: none; color: inherit; font: inherit; }
button.c-chip__main:hover { background: var(--surface-hover); }
.c-chip.is-on { border-color: var(--ink-1); }
.c-chip--code .c-chip__main { font-family: var(--font-mono); font-weight: 450; font-size: 12.5px; font-stretch: 87.5%; }
.c-chip__x { display: inline-flex; align-items: center; justify-content: center; width: 26px; padding: 0; border: 0; border-left: 1px solid var(--rule); background: none; color: var(--ink-2); }
.c-chip__x:hover { background: var(--surface-hover); color: var(--ink-1); }
.c-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.c-crumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; }
.c-crumbs__item { display: inline-flex; align-items: center; gap: 4px; }
.c-crumbs__sep { color: var(--ink-4); padding: 0 2px; }
.c-crumbs__btn { padding: 3px 6px; border: 0; border-radius: var(--r-2); background: none; color: var(--ink-2); font: 500 var(--fs-14)/20px var(--font-ui); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.c-crumbs__btn.c-code { font-size: 12.5px; }
.c-crumbs__btn:hover { color: var(--ink-1); background: var(--surface-hover); }
.c-crumbs__cur { padding: 3px 6px; font: 600 var(--fs-14)/20px var(--font-ui); color: var(--ink-1); }
.c-crumbs__cur.c-code { font-family: var(--font-mono); font-size: 12.5px; }

/* ===== about this data, empty, kv, status ===== */
.c-about { margin-top: 18px; border-top: 1px solid var(--rule-soft); }
.c-about__sum { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; list-style: none; font: 500 var(--fs-13)/18px var(--font-ui); color: var(--ink-2); }
.c-about__sum::-webkit-details-marker { display: none; }
.c-about__sum:hover { color: var(--ink-1); }
.c-about__sum .c-icon { transition: transform var(--fade); }
.c-about[open] > .c-about__sum .c-icon { transform: rotate(90deg); }
.c-about__body { padding: 2px 0 6px 20px; }
.c-about__list { display: grid; gap: 6px; list-style: none; font: 400 var(--fs-13)/19px var(--font-ui); color: var(--ink-2); max-width: 880px; }
.c-about__list li { position: relative; padding-left: 14px; }
.c-about__list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; background: var(--ink-4); }
.c-about__list strong { font-weight: 600; color: var(--ink-1); }
.c-empty { padding: 16px 18px; background: var(--surface-sunken); border: 1px solid var(--rule-soft); }
.c-empty__t { font: 500 var(--fs-14)/20px var(--font-ui); color: var(--ink-1); }
.c-empty__b { margin-top: 2px; font: 400 var(--fs-13)/18px var(--font-ui); color: var(--ink-3); }
.c-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; font: 400 var(--fs-13)/18px var(--font-ui); }
.c-kv dt { color: var(--ink-3); }
.c-kv dd { color: var(--ink-1); font-variant-numeric: tabular-nums; min-width: 0; }
.c-status { display: inline-flex; align-items: center; gap: 6px; font: 500 var(--fs-13)/18px var(--font-ui); }
.c-fill--good { fill: var(--good); } .c-fill--warning { fill: var(--warning); } .c-fill--serious { fill: var(--serious); } .c-fill--critical { fill: var(--critical); }
.c-status--good .c-status__t { color: var(--good-text); }
.c-status--warning .c-status__t { color: var(--warning-text); }
.c-status--serious .c-status__t { color: var(--serious-text); }
.c-status--critical .c-status__t { color: var(--critical-text); }
.c-icon { display: inline-block; flex: none; vertical-align: -2px; overflow: visible; }

/* in-cell bar */
.c-inbar { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.c-inbar__track { display: inline-flex; width: 56px; height: 6px; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--rule-soft); }
.c-inbar__fill { display: block; height: 6px; }
.c-inbar__fill--sales { background: var(--sales); }
.c-inbar__fill--stock { background: var(--stock); }
.c-inbar__fill--supply { background: var(--supply); }
.c-inbar__fill--ink { background: var(--series-ink); }
.c-inbar__t { min-width: 46px; text-align: right; }

/* ===== tooltip, toast ===== */
.c-tip {
  position: fixed; z-index: 1000; left: 0; top: 0; max-width: 300px; padding: 9px 12px; pointer-events: none;
  background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--r-3); box-shadow: var(--shadow-float);
  opacity: 0; visibility: hidden; transition: opacity var(--fade), visibility 0s linear var(--fade);
}
.c-tip.is-on { opacity: 1; visibility: visible; transition: opacity var(--fade); }
.c-tip__title { font: 600 var(--fs-12)/16px var(--font-ui); color: var(--ink-2); }
.c-tip__value { margin-top: 2px; font: 600 var(--fs-15)/20px var(--font-ui); color: var(--ink-1); font-variant-numeric: tabular-nums; }
.c-tip__rows { display: grid; grid-template-columns: auto auto; gap: 3px 16px; margin-top: 6px; font: 400 var(--fs-12)/16px var(--font-ui); }
.c-tip__rows dt { color: var(--ink-3); }
.c-tip__rows dd { color: var(--ink-1); text-align: right; font-variant-numeric: tabular-nums; }
.c-tip__note { margin-top: 6px; font: 400 var(--fs-12)/16px var(--font-ui); color: var(--ink-3); }
.c-toast {
  position: fixed; z-index: 1001; left: 50%; bottom: 24px; transform: translate(-50%, 12px); max-width: calc(100vw - 32px);
  padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font: 500 var(--fs-13)/18px var(--font-ui);
  border-radius: var(--r-3); box-shadow: var(--shadow-float); opacity: 0; pointer-events: none; transition: opacity var(--fade), transform var(--fade);
}
.c-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ===== table ===== */
.t-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.t-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.t-search { position: relative; display: inline-flex; align-items: center; flex: 0 1 300px; min-width: 180px; }
.t-search__icon { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; display: inline-flex; }
.t-search__in { width: 100%; height: 32px; padding-left: 32px; font-size: var(--fs-13); }
.t-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.t-bar--below { justify-content: flex-end; }
.t-spacer { flex: 1 1 auto; }
.t-count { font: 400 var(--fs-12)/16px var(--font-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-scroll { position: relative; min-width: 0; overflow: auto; max-width: 100%; }
.t-scroll:focus-visible { outline-offset: -2px; }
.t { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--ink-1); font: 400 var(--fs-13)/18px var(--font-ui); }
.t th, .t td { height: var(--row); padding: 0 12px; text-align: left; white-space: nowrap; vertical-align: middle; background: var(--surface); border-bottom: 1px solid var(--rule-soft); }
.t th:first-child, .t td:first-child { padding-left: 2px; }
.t th:last-child, .t td:last-child { padding-right: 2px; }
.t thead th { position: sticky; top: 0; z-index: 2; height: 36px; font: 600 var(--fs-12)/16px var(--font-ui); color: var(--ink-2); border-bottom: 1px solid var(--rule-heavy); vertical-align: bottom; padding-bottom: 8px; }
.t .t-num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.t td.t-code { font: 450 12.5px/16px var(--font-mono); font-stretch: 87.5%; }
.t td.t-na { color: var(--ink-3); }
.t .t-wrapcol { white-space: normal; min-width: 180px; }
.t .t-first { position: sticky; left: 0; z-index: 1; }
.t thead .t-first { z-index: 3; }
.t-sort { display: inline-flex; align-items: baseline; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: inherit; white-space: nowrap; }
th.t-num .t-sort { flex-direction: row-reverse; }
.t-sort:hover, .t-sort.is-active { color: var(--ink-1); }
.t-sorti { opacity: 0; color: var(--ink-3); font-size: 11px; }
.t-sort:hover .t-sorti { opacity: .6; }
.t-sort.is-active .t-sorti { opacity: 1; color: var(--ink-1); }
.t-hl { display: inline-flex; flex-direction: column; align-items: flex-start; }
th.t-num .t-hl { align-items: flex-end; }
.t-hsub { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.t-hcell { display: inline-block; }
.t tbody tr.t-row:hover > td { background: var(--surface-hover); }
.t--click tbody tr.t-row { cursor: pointer; }
.t tbody tr.is-selected > td { background: var(--surface-selected); }
.t tbody tr.t-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.t tbody tr.t-emptyrow > td { height: auto; padding: 12px 0; white-space: normal; }
.t-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.t-foot:empty { display: none; }
.t-pager { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; order: 2; }
.t-pageno { font: 400 var(--fs-12)/16px var(--font-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-note { font: 400 var(--fs-12)/16px var(--font-ui); color: var(--ink-3); order: 1; }
@media (max-width: 639px) {
  .t .t-nar { display: none; }               /* secondary columns step aside on phones; the CSV keeps them */
  .t thead th, .t-sort { white-space: normal; }   /* long headers wrap so the numbers fit */
  .t-hlab { display: block; max-width: 8.5em; }
  .t td.t-first:not(.t-code) { white-space: normal; min-width: 7em; max-width: 9.5em; line-height: 16px; padding-top: 6px; padding-bottom: 6px; }
  .t .c-inbar__track { display: none; }      /* numbers first on phones */
  .t-search { flex: 1 1 100%; }
  .t-pager { margin-left: 0; }
  .t-pager .c-btn span { display: none; }
  .t-pager .c-btn { width: 40px; padding: 0; }
}

/* ===== charts ===== */
.ch { position: relative; width: 100%; min-width: 0; }
.ch-svg { display: block; overflow: visible; }
.ch-svg text { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.ch-grid { stroke: var(--grid); stroke-width: 1; }
.ch-base { stroke: var(--axis); stroke-width: 1; }
.ch-tick { font-size: 11.5px; fill: var(--ink-3); }
.ch-xlab { font-size: 12px; fill: var(--ink-2); font-weight: 500; }
.ch-xlab.is-sel { fill: var(--ink-1); font-weight: 700; }
.ch-xsub { font-size: 11px; fill: var(--ink-3); }
.ch-val { font-size: 11.5px; fill: var(--ink-2); font-weight: 500; }
.ch-val.is-sel { fill: var(--ink-1); font-weight: 700; }
.ch-gap { stroke: var(--axis); stroke-width: 1; }
.ch-gaplab { font-size: 10.5px; fill: var(--ink-3); }
/* a missing day: empty dashed slot with a warning mark, never a bar (weekend gaps stay a thin dotted line) */
.ch-miss__box { fill: var(--warning-wash); stroke: var(--warning); stroke-width: 1; }
.ch-miss__lab { font-size: 11px; font-weight: 600; fill: var(--warning-text); }
.ch-xlab.is-miss, .ch-xsub.is-miss { fill: var(--warning-text); }
.ch-mark.ch-miss:focus-visible .ch-hit { stroke: var(--focus); stroke-width: 2; }
.ch-sep { stroke: var(--surface); stroke-width: 1.5; }
.ch-line { stroke-width: 2; fill: none; }
.ch-line--gap { stroke-dasharray: 3 4; opacity: .7; }
.ch-dot { stroke-width: 2; }
.ch-mark { outline: none; }
.ch-mark.is-click { cursor: pointer; }
.ch-mark:focus-visible .ch-hit { stroke: var(--focus); stroke-width: 2; }
.ch-mark:hover .ch-bar { filter: brightness(1.08); }
.ch-hrow:hover .ch-rowbg { fill: var(--surface-hover); }
.ch-hlab { font-size: 12.5px; fill: var(--ink-1); }
.ch-hrow.is-muted .ch-hlab { fill: var(--ink-3); }
.ch-hval { font-size: 12.5px; fill: var(--ink-1); font-weight: 600; }
.ch-hval--2 { fill: var(--ink-2); font-weight: 400; }
.ch-colhead { font-size: 11px; fill: var(--ink-3); font-weight: 600; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; font: 400 var(--fs-12)/16px var(--font-ui); color: var(--ink-2); }
.ch-legend__i { display: inline-flex; align-items: center; gap: 6px; }
.ch-sw { display: inline-block; width: 10px; height: 10px; }
.ch-view .t-wrap { margin-top: 4px; }
.ch-cap { margin: 20px 0 6px; }

/* ===== small transitions =====
   enter: a new page eases up into place, section by section. update: the same page redrawn for a new day,
   mill or tab fades in softly (the figures roll their numbers in JS, so they stay put). */
@keyframes pg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pg-fade { from { opacity: .55; } to { opacity: 1; } }
@keyframes fig-chg { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes tab-line { from { transform: scaleX(.35); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
#page[data-anim="enter"] > * { animation: pg-in 280ms cubic-bezier(.2, .7, .2, 1) both; }
#page[data-anim="enter"] > *:nth-child(2) { animation-delay: 40ms; }
#page[data-anim="enter"] > *:nth-child(3) { animation-delay: 80ms; }
#page[data-anim="enter"] > *:nth-child(4) { animation-delay: 120ms; }
#page[data-anim="enter"] > *:nth-child(n+5) { animation-delay: 160ms; }
#page[data-anim="update"] .c-sheet { animation: pg-fade 240ms ease-out both; }
.c-figs--roll .c-fig__chg { animation: fig-chg 360ms 160ms ease-out both; }
.c-tab[aria-selected="true"]::after { animation: tab-line 220ms cubic-bezier(.2, .7, .2, 1) both; }
.c-btn, .c-seg__opt, .c-tab { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms ease; }
.c-btn:active:not([disabled]), .c-seg__opt:active, .c-tab:active { transform: translateY(1px); }

/* ===== forced colors, motion ===== */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (forced-colors: active) {
  .c-sheet, .c-figs { border-color: CanvasText; }
  .ch-bar { forced-color-adjust: none; }
}
