/* Kit UI Oliveras - the components shared by every application of Maison Oliveras. They read the roles of tokens.css
   (--text, --action, --surface...) and its sizes and spaces only: no colour and no size written here (checked by the
   tests), except the 1px of a border. An application never redefines a class of this file in its app.css: it adds its
   own classes. Phone first: every rule is written for a phone, @media (min-width: 960px) gives the computer layout.
   Light only, no shadow: a surface stands out by its border. The reference page shows every component of this file.
   French names of the prototype (carte, pastille, jauge...) are listed in audit.DEPRECATED_CLASSES with their name here. */

/* Base ------------------------------------------------------------------------------------------------------------ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-15); font-weight: var(--fw-medium); line-height: var(--lh);
  color: var(--text); background: var(--surface-outside); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; color: var(--text-heading); line-height: var(--lh-tight); text-wrap: balance; }
h1 { font-size: var(--fs-24); font-weight: var(--fw-heavy); letter-spacing: -.01em; }
h2 { font-size: var(--fs-16); font-weight: var(--fw-heavy); }
h3 { font-size: var(--fs-14); font-weight: var(--fw-heavy); }
p { margin: 0; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-12); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.code { font-family: var(--font-mono); font-size: var(--fs-12); overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: var(--fs-11); font-weight: var(--fw-bold); letter-spacing: var(--ls-caps); text-transform: uppercase;
  color: var(--text-muted); }
.note { font-size: var(--fs-11); color: var(--text-muted); text-wrap: pretty; }
/* The tone of a figure, written in words next to it as well (a mark, a percentage): never the colour alone */
.text-ok { color: var(--success); }
.text-warn { color: var(--warning); }
.text-bad { color: var(--danger); }

/* Shell: the column of the application. Phone and tablet: a column of 440 px on the sand, a black header stuck at the
   top, the tabs at the bottom. From 960 px: the tabs in the header, the screen on the whole width (1120 px at most). */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: var(--shell-w); margin: 0 auto;
  background: var(--surface-page); position: relative; }
.env-banner { padding: var(--space-4) var(--space-16); background: var(--warning-bg); color: var(--warning); font-size: var(--fs-12);
  font-weight: var(--fw-bold); text-align: center; }
.appbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-12); padding: var(--space-14) var(--space-18); background: var(--surface-dark); color: var(--text-on-dark); }
.appbar-brand { flex: none; display: flex; align-items: center; gap: var(--space-10); color: var(--text-on-dark); text-decoration: none; }
.appbar-logo { width: var(--logo-box); height: var(--logo-box); border-radius: var(--radius-logo); background: var(--action);
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.appbar-logo img { width: var(--logo-img); height: var(--logo-img); object-fit: contain; }
.appbar-name { font-size: var(--fs-15); font-weight: var(--fw-heavy); letter-spacing: var(--ls-brand); }
.appbar-nav { display: none; }
.appbar-end { display: flex; align-items: center; gap: var(--space-12); }
.appbar-date { font-size: var(--fs-12); font-weight: var(--fw-medium); color: var(--text-on-dark-muted); white-space: nowrap; }
.avatar { width: var(--avatar-size); height: var(--avatar-size); border-radius: var(--radius-full); background: var(--avatar);
  color: var(--text-on-dark); display: grid; place-items: center; font-size: var(--fs-12); font-weight: var(--fw-heavy);
  text-decoration: none; flex: none; }
.avatar[aria-current="page"] { background: var(--action); color: var(--action-ink); }
.page { flex: 1; width: 100%; padding: var(--space-18) var(--space-16) var(--space-28); display: flex; flex-direction: column;
  gap: var(--space-18); }
.page-foot { margin-top: auto; font-size: var(--fs-11); color: var(--text-muted); text-align: center; }
/* A screen without the shell (sign in, activation): one narrow column on the cream */
.page-bare { min-height: 100vh; max-width: var(--shell-w); margin: 0 auto; background: var(--surface-page);
  padding: var(--space-32) var(--space-16); display: flex; flex-direction: column; gap: var(--space-18); }
/* The tabs of the phone: a white bar stuck at the bottom; the active tab is a yellow pill; a red count for what waits */
.tabbar { position: sticky; bottom: 0; z-index: 5; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: var(--space-6) var(--space-4) calc(var(--space-8) + env(safe-area-inset-bottom)); background: var(--surface);
  border-top: 1px solid var(--border); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--tab-h); color: var(--text); text-decoration: none; }
.tabbar-label { padding: var(--space-4) var(--space-10); border-radius: var(--radius-full); font-size: var(--fs-12);
  font-weight: var(--fw-semibold); white-space: nowrap; }
.tabbar a[aria-current="page"] .tabbar-label { background: var(--action); color: var(--action-ink); font-weight: var(--fw-heavy); }
.tabbar .count { position: absolute; top: var(--space-2); right: var(--space-8); }
.count { min-width: var(--count-size); height: var(--count-size); border-radius: var(--radius-full); background: var(--count);
  color: var(--count-ink); font-size: var(--fs-10); font-weight: var(--fw-heavy); display: inline-flex; align-items: center;
  justify-content: center; padding: 0 var(--space-4); line-height: 1; }
/* A short notification at the bottom (the answer to an action), gone by itself after 2.6 s */
.toast { position: fixed; left: 50%; bottom: var(--toast-bottom); transform: translateX(-50%); z-index: 30;
  width: calc(100% - var(--space-32)); max-width: var(--toast-w); padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-control); background: var(--surface-dark); color: var(--text-on-dark); font-size: var(--fs-13);
  font-weight: var(--fw-semibold); text-align: center; animation: toast 2.6s forwards; }
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
@media (max-width: 440px) {
  .tabbar-label { padding: var(--space-4) var(--space-6); font-size: var(--fs-11); letter-spacing: -.01em; }
  .tabbar .count { right: var(--space-2); }
  /* Six tabs and more: each one as wide as its word (« Commandes » needs more than « Tarifs »), spread over the bar */
  .tabbar:has(> a:nth-child(6)) { grid-auto-columns: auto; justify-content: space-between; }
}
@media (max-width: 340px) {
  .appbar-date { display: none; }
  .tabbar-label { padding: var(--space-4); font-size: var(--fs-10); }
}
@media (min-width: 960px) {
  .shell { max-width: none; }
  .appbar { gap: var(--space-28); padding: var(--space-12) var(--space-32); }
  .appbar-nav { display: flex; flex: 1; min-width: 0; gap: var(--space-4); }
  .appbar-nav > a, .appbar-more > summary { display: inline-flex; align-items: center; gap: var(--space-6);
    padding: var(--space-8) var(--space-14); border-radius: var(--radius-full); color: var(--text-on-dark-muted);
    font-size: var(--fs-14); font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none; }
  .appbar-nav > a:hover, .appbar-more > summary:hover { color: var(--text-on-dark); }
  .appbar-nav > a[aria-current="page"], .appbar-more.active > summary { background: var(--action); color: var(--action-ink);
    font-weight: var(--fw-heavy); }
  .appbar-nav > [data-appbar-hidden] { display: none; }
  .page { max-width: var(--page-w); margin: 0 auto; padding: var(--space-28) var(--space-32) var(--space-48); }
  .tabbar { display: none; }
  .toast { bottom: var(--space-32); }
}

/* Menus: a <details class="dropdown"> opens a list (.dropdown-menu); "More" (.appbar-more) holds the tabs of the
   computer header that do not fit (theme.js measures them). Escape or a click outside closes them. -------------- */
.dropdown, .appbar-more { position: relative; flex: none; }
.dropdown > summary, .appbar-more > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker, .appbar-more > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after, .appbar-more > summary::after { content: "\25BE"; font-size: var(--fs-10); margin-left: var(--space-4); }
.dropdown-menu { position: absolute; top: calc(100% + var(--space-4)); left: 0; z-index: 30; min-width: var(--menu-w);
  padding: var(--space-4); display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-card-sm); }
.appbar-more > .dropdown-menu, .dropdown-end > .dropdown-menu { left: auto; right: 0; }
.dropdown-menu a, .dropdown-menu .dropdown-item { display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-8); min-height: var(--control-h); padding: 0 var(--space-12); border: 0; border-radius: var(--radius-segment);
  background: none; color: var(--text); font: inherit; font-size: var(--fs-14); font-weight: var(--fw-semibold);
  text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu .dropdown-item:hover, .dropdown-menu a:focus-visible { background: var(--surface-page); }
.dropdown-menu a[aria-current="page"], .dropdown-menu a.active { background: var(--action); color: var(--action-ink); }
.dropdown-group { padding: var(--space-8) var(--space-12) var(--space-4); font-size: var(--fs-11); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--text-muted); }
.dropdown-sep { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) calc(-1 * var(--space-4)); }

/* Screen title: the title of the screen and one line under it -------------------------------------------------- */
.screen-title { display: flex; flex-direction: column; gap: var(--space-2); }
.screen-title h1 { font-size: var(--fs-24); }
.screen-title-lg h1 { font-size: var(--fs-26); }
.screen-sub { font-size: var(--fs-13); color: var(--text-muted); }
.back-link { align-self: flex-start; font-size: var(--fs-13); font-weight: var(--fw-bold); color: var(--link); text-decoration: none;
  border-bottom: 2px solid var(--link-rule); }
.link-fine { font-size: var(--fs-12); font-weight: var(--fw-bold); color: var(--link); text-decoration: none;
  border-bottom: 2px solid var(--link-rule); }
@media (min-width: 960px) { .screen-title-lg h1 { font-size: var(--fs-30); } }

/* Layout: a stack of blocks, two columns on a computer (.duo), cards side by side (.card-grid) ---------------- */
.stack { display: flex; flex-direction: column; gap: var(--space-14); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-8); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-18); }
.stack > *, .stack-sm > *, .stack-lg > * { min-width: 0; }
.duo { display: flex; flex-direction: column; gap: var(--space-18); }
.card-grid { display: grid; gap: var(--space-10); grid-template-columns: minmax(0, 1fr); }
.narrow { width: 100%; max-width: var(--narrow-w); }
@media (min-width: 960px) {
  .duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: var(--space-18); }
  .duo > * { min-width: 0; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min-w)), 1fr)); }
}

/* Cards ----------------------------------------------------------------------------------------------------------- */
.card { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-16); min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); color: inherit; }
.card-sm { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-12) var(--space-14); min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card-sm); color: inherit; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-8); flex-wrap: wrap; }
.card-title, .card-head h2 { font-size: var(--fs-16); font-weight: var(--fw-heavy); }
.card-note { font-size: var(--fs-11); color: var(--text-muted); }
/* A card that is a link: the whole card opens the page; hovered, its border turns black */
.card-link { text-decoration: none; color: inherit; cursor: pointer; }
.card-link:hover { border-color: var(--border-strong); }
.card-line { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-8); font-size: var(--fs-14); }
.card-line b { text-wrap: pretty; }
/* The black card of a home screen: the week in two figures, a sentence, a button */
.hero { display: flex; flex-direction: column; gap: var(--space-14); padding: var(--space-18); border-radius: var(--radius-hero);
  background: var(--surface-dark); color: var(--text-on-dark); }
.hero-kicker { font-size: var(--fs-11); font-weight: var(--fw-bold); letter-spacing: .1em; text-transform: uppercase; color: var(--action); }
.hero-figures { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); }
.hero-figure { display: flex; flex-direction: column; gap: var(--space-2); }
.hero-label { font-size: var(--fs-12); color: var(--text-on-dark-muted); }
.hero-value { font-size: var(--fs-32); font-weight: var(--fw-heavy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: var(--fs-12); font-weight: var(--fw-bold); color: var(--text-on-dark-muted); }
.hero-sub.text-ok, .hero .text-ok { color: var(--success-on-dark); }
.hero-sub.text-bad, .hero .text-bad { color: var(--danger-on-dark); }
.hero-text { font-size: var(--fs-13); line-height: 1.45; color: var(--text-on-dark-soft); text-wrap: pretty; }
.hero .btn { align-self: flex-start; }
/* A dark list (the restocking of the clients late): the hero with lines */
.hero .list-row { border-top-color: var(--border-on-dark); color: var(--text-on-dark); }
.hero .list-row small, .hero .muted { color: var(--text-on-dark-muted); }
/* The box of what to do now (a client to call back): yellow, a word in capitals, then the action */
.callout { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-12) var(--space-14);
  border-radius: var(--radius-card-sm); background: var(--action-soft); }
.callout-kicker { font-size: var(--fs-11); font-weight: var(--fw-heavy); letter-spacing: .08em; text-transform: uppercase; }
.callout b { font-size: var(--fs-14); text-wrap: pretty; }
@media (min-width: 960px) { .hero { padding: var(--space-24); } .hero-value { font-size: var(--fs-40); } }

/* Key figures: two tiles a row, a label in capitals, the figure, a line under it ------------------------------ */
.kpis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-10); }
.kpi { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-14); min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card-sm); color: inherit; }
.kpi-label { font-size: var(--fs-11); font-weight: var(--fw-bold); letter-spacing: var(--ls-caps); text-transform: uppercase;
  color: var(--text-muted); }
.kpi-value { font-size: var(--fs-22); font-weight: var(--fw-heavy); line-height: var(--lh-tight); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere; }
.kpi-value-sm { font-size: var(--fs-18); }
.kpi-sub { font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--text-muted); }
/* The tone of the line under a figure: written again here, .kpi-sub comes after .text-ok and would win */
.kpi-sub.text-ok { color: var(--success); }
.kpi-sub.text-warn { color: var(--warning); }
.kpi-sub.text-bad { color: var(--danger); }
a.kpi { text-decoration: none; }
a.kpi:hover { border-color: var(--border-strong); }
@media (min-width: 960px) { .kpi-value { font-size: var(--fs-26); } .kpi-value-sm { font-size: var(--fs-18); } }

/* Pills and badges. A pill (.pill) says the state of a card in a word: yellow by default, ok, warn, bad, ink.
   A badge (.badge) says a state in a table, with a dot so that it reads without the colour. ------------------- */
.pill { display: inline-block; padding: var(--space-2) var(--space-8); border-radius: var(--radius-full); background: var(--action-soft);
  color: var(--text); font-size: var(--fs-11); font-weight: var(--fw-bold); line-height: var(--lh); white-space: nowrap; }
.pill-ok { background: var(--success-bg); color: var(--success); }
.pill-warn { background: var(--warning-bg); color: var(--warning); }
.pill-bad { background: var(--danger-bg); color: var(--danger); }
.pill-ink { background: var(--surface-dark); color: var(--text-on-dark); }
.badge { display: inline-flex; align-items: center; gap: var(--space-6); padding: 0 var(--space-10); border-radius: var(--radius-full);
  background: var(--surface-page); color: var(--text-muted); font-size: var(--fs-12); font-weight: var(--fw-bold);
  line-height: var(--space-24); white-space: nowrap; }
.badge::before { content: ""; width: var(--space-6); height: var(--space-6); border-radius: var(--radius-full); background: currentColor; flex: none; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-page); color: var(--text-muted); }
/* A small label (a channel: WhatsApp, email) and a gain (+0,5 pt) */
.tag { display: inline-block; padding: var(--space-2) var(--space-6); border-radius: var(--radius-tag); background: var(--surface-page);
  font-size: var(--fs-11); font-weight: var(--fw-heavy); white-space: nowrap; }
.gain { display: inline-block; padding: var(--space-4) var(--space-8); border-radius: var(--radius-logo); background: var(--action-soft);
  font-size: var(--fs-12); font-weight: var(--fw-heavy); white-space: nowrap; }
/* A change, sign always written: good, bad or flat (when its sense is not known) */
.delta { display: inline-block; padding: 1px var(--space-6); border-radius: var(--radius-tag); background: var(--surface-page);
  color: var(--text-muted); font-size: var(--fs-12); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta-good { background: var(--success-bg); color: var(--success); }
.delta-bad { background: var(--danger-bg); color: var(--danger); }

/* Gauge: a bar on the cream; its fill is black, or the tone of the figure (.fill-ok, .fill-warn, .fill-bad); its
   width is the value, written by the application (style="width: 62%") */
.gauge { display: block; height: var(--gauge-h); border-radius: var(--radius-bar); background: var(--surface-page); overflow: hidden; }
.gauge > i, .gauge-fill { display: block; height: 100%; background: var(--chart-current); }
.gauge-thin { height: var(--gauge-h-thin); }
.fill-ok { background: var(--success) !important; }
.fill-warn { background: var(--warning) !important; }
.fill-bad { background: var(--danger) !important; }
.fill-neutral { background: var(--neutral) !important; }
/* A figure and its gauge: the name and the value on one line, the gauge under them */
.meter { display: flex; flex-direction: column; gap: var(--space-4); text-decoration: none; color: inherit; }
.meter-head { display: flex; justify-content: space-between; gap: var(--space-8); font-size: var(--fs-13); }
.meter-name { font-weight: var(--fw-bold); }

/* Segmented control (links): one choice among a few (Semaine, Mois, Depuis janvier), the chosen one in white ---- */
.segmented { display: flex; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius-control); background: var(--surface-outside);
  max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented a, .segmented button { flex: 1; padding: var(--space-8) var(--space-10); border: 0; border-radius: var(--radius-segment);
  background: none; color: var(--text); font: inherit; font-size: var(--fs-13); font-weight: var(--fw-bold); text-align: center;
  text-decoration: none; white-space: nowrap; cursor: pointer; }
.segmented a[aria-current="true"], .segmented a[aria-current="page"], .segmented button[aria-pressed="true"],
.segmented button[aria-checked="true"] { background: var(--surface); }
/* The pill: a white pill with a thin rule, the chosen one in black. For a choice inside a card or a tool bar
   (12, 26 or 52 weeks; Tous, À risque, Perdus); the plain one heads a screen (the period). */
.segmented-pill { display: inline-flex; gap: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); }
.segmented-pill a, .segmented-pill button { flex: none; padding: var(--space-6) var(--space-14); border-radius: 0; color: var(--text-muted);
  font-weight: var(--fw-semibold); }
.segmented-pill a[aria-current="true"], .segmented-pill a[aria-current="page"], .segmented-pill button[aria-pressed="true"],
.segmented-pill button[aria-checked="true"] { background: var(--choice); color: var(--choice-ink); }
.segmented-pill a[aria-current] .muted, .segmented-pill button[aria-pressed="true"] .muted { color: var(--text-on-dark-muted); }
/* Filter chips (links): the chosen one in yellow */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.chips a, .chips button { padding: var(--space-6) var(--space-10); border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: none; color: var(--text); font: inherit; font-size: var(--fs-12); font-weight: var(--fw-bold); text-decoration: none; cursor: pointer; }
.chips a[aria-current="true"], .chips a[aria-current="page"], .chips button[aria-pressed="true"] { background: var(--action); color: var(--action-ink); }
/* Dark chips: a thin rule, the chosen one in black. For a mark put on a line (the reason a client is lost), not a filter */
.chips-dark a, .chips-dark button { border-color: var(--border); background: var(--surface); color: var(--text-muted); font-size: var(--fs-13);
  font-weight: var(--fw-semibold); }
.chips-dark a[aria-current="true"], .chips-dark a[aria-current="page"], .chips-dark button[aria-pressed="true"] { border-color: var(--choice);
  background: var(--choice); color: var(--choice-ink); }

/* Lists: lines with a name (and a line under it) and a value at the right; a line may start with a dot ------- */
.list { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8) var(--space-10); align-items: center;
  padding: var(--space-8) 0; border-top: 1px solid var(--surface-page); font-size: var(--fs-13); color: inherit; text-decoration: none; }
.list-row-3 { grid-template-columns: minmax(0, 1fr) var(--list-col) var(--list-col); }
.list-head { font-size: var(--fs-11); font-weight: var(--fw-bold); letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
  border-top: 0; border-bottom: 1px solid var(--border); padding-top: 0; }
.list-main { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.list-main b, .list-name { font-weight: var(--fw-bold); }
.list-main small { font-size: var(--fs-12); color: var(--text-muted); }
.list-row > :not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.list-end { font-weight: var(--fw-heavy); white-space: nowrap; }
a.list-row:hover .list-main b, a.list-row:hover .list-name { text-decoration: underline; }
/* A line with a dot (a task): the dot is a button that ticks the line; done, the line greys and is struck through */
.dot-row { display: grid; grid-template-columns: var(--avatar-size) minmax(0, 1fr) auto; gap: var(--space-8); align-items: center;
  padding: var(--space-6) var(--space-2); border-bottom: 1px solid var(--border); }
.dot-row a { font-size: var(--fs-13); font-weight: var(--fw-semibold); padding: var(--space-6) 0; text-decoration: none; }
.dot-row form { margin: 0; }
.dot-row-done { opacity: .5; }
.dot-row-done a:not(.dot-row-arrow) { text-decoration: line-through; }
.dot-row-arrow { font-size: var(--fs-12); font-weight: var(--fw-heavy); }
.dot-button { all: unset; width: var(--avatar-size); height: var(--avatar-size); display: grid; place-items: center;
  border-radius: var(--radius-full); cursor: pointer; }
.dot-button:focus-visible { outline: 2px solid var(--focus); }
.dot { display: block; width: var(--dot-size); height: var(--dot-size); border-radius: var(--radius-full); background: var(--chart-current); }
.dot-row-done .dot { background: var(--neutral) !important; }

/* Bar chart: one column per period, the current bar and its reference side by side; heights written by the
   application (style="height: 62%"); a legend says what each colour is. ----------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: var(--space-4); height: var(--chart-h); }
.bars-sm { height: var(--chart-h-sm); gap: var(--space-8); }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: var(--space-2); }
.bar { flex: 1; min-height: 1px; border-radius: var(--radius-bar) var(--radius-bar) 0 0; background: var(--chart-current); }
.bar-reference { background: var(--chart-reference); }
.bar-forecast { background: var(--chart-forecast); }
.bar-bad { background: var(--danger); }
.bar-label { height: var(--space-12); font-size: var(--fs-10); line-height: var(--space-12); color: var(--text-muted); }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-10); font-size: var(--fs-11); color: var(--text-muted); }
.legend span { display: flex; align-items: center; gap: var(--space-4); }
.legend i { display: block; width: var(--legend-size); height: var(--legend-size); border-radius: var(--radius-bar); background: var(--chart-current); }
.legend i.bar-reference { background: var(--chart-reference); }
.legend i.bar-forecast { background: var(--chart-forecast); }
@media (min-width: 960px) { .bars:not(.bars-sm) { height: var(--chart-h-lg); } }

/* Buttons. One principal button per zone (yellow); 44 px high at least, for a finger; a text, no icon. ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8); min-height: var(--control-h);
  padding: var(--space-12) var(--space-16); border: 1px solid var(--action); border-radius: var(--radius-control);
  background: var(--action); color: var(--action-ink); font: inherit; font-size: var(--fs-14); font-weight: var(--fw-heavy);
  line-height: var(--lh-tight); text-align: center; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(.96); }
.btn-secondary { background: transparent; border-color: var(--border-strong); color: var(--text); font-weight: var(--fw-bold); }
.btn-secondary:hover { background: var(--surface); filter: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text); font-weight: var(--fw-bold); }
.btn-ghost:hover { background: var(--surface-outside); filter: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.btn-whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: var(--whatsapp-ink); }
.btn-sm { min-height: var(--control-h-sm); padding: var(--space-8) var(--space-14); font-size: var(--fs-13); }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled, .btn.disabled, .btn[aria-disabled="true"] { background: var(--surface-page); border-color: var(--border);
  color: var(--text-muted); filter: none; cursor: not-allowed; }
.btn.disabled { pointer-events: none; }
.btn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); }
.inline-form { display: inline; margin: 0; }

/* Fields and forms ---------------------------------------------------------------------------------------------- */
.input, select, textarea { width: 100%; min-width: 0; padding: var(--space-10) var(--space-12); border: 1px solid var(--border);
  border-radius: var(--radius-field); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-16); }
textarea { resize: vertical; }
.input:focus, select:focus, textarea:focus { outline: 2px solid var(--action); outline-offset: 0; border-color: var(--border-strong); }
.input:disabled, select:disabled, textarea:disabled { background: var(--surface-page); color: var(--text-muted); }
.input-error { border-color: var(--danger); box-shadow: inset 3px 0 0 var(--danger); }
input[type="checkbox"], input[type="radio"] { width: var(--space-18); height: var(--space-18); margin: 0; accent-color: var(--text); }
.field, .form-grid label, .stack-form label { display: flex; flex-direction: column; gap: var(--space-6); font-size: var(--fs-13);
  font-weight: var(--fw-semibold); color: var(--text); }
.field-help { font-size: var(--fs-12); font-weight: var(--fw-medium); color: var(--text-muted); }
.field-error { font-size: var(--fs-12); font-weight: var(--fw-bold); color: var(--danger); }
.field-required::after { content: " *"; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-14) var(--space-18); }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-8); margin-top: var(--space-8); }
.form-actions .form-delete { margin-right: auto; }
.stack-form { display: flex; flex-direction: column; gap: var(--space-14); }
.stack-form .btn { align-self: stretch; }
.checks { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-16); font-size: var(--fs-14); }
.checks label { display: flex; flex-direction: row; align-items: center; gap: var(--space-8); font-weight: var(--fw-medium); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; }
.kv dt { font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--text-muted); }
.kv dd { margin: 0 0 var(--space-8); min-width: 0; overflow-wrap: anywhere; }
/* A bar of controls: search, lists, buttons on one line that wraps */
.toolbar, .filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-10); margin: 0; }
.filters .input, .filters select, .datagrid-bar .input, .datagrid-bar select { width: var(--filter-w); flex: 0 1 auto;
  padding-top: var(--space-6); padding-bottom: var(--space-6); font-size: var(--fs-15); }
.filters .input-search, .datagrid-bar .input-search, .toolbar .input-search { width: var(--search-w); max-width: 100%; }
.filters .filter-wide, .datagrid-bar .filter-wide { width: var(--filter-w-wide); max-width: 100%; }
.filters select:has(option[value=""]:checked), .datagrid-bar select:has(option[value=""]:checked) { color: var(--text-muted); }
.filters-end, .datagrid-columns { position: relative; margin-left: auto; }
/* A file to choose: a button; choosing the file sends the form (theme.js), or shows its name in .file-pick-name */
.file-pick { position: relative; overflow: hidden; }
.file-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.file-pick-name { font-size: var(--fs-13); color: var(--text-muted); }
/* Buttons that stay under the eyes at the bottom of a long form */
.sticky-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-8);
  padding: var(--space-12) 0; background: var(--surface-page); border-top: 1px solid var(--border); }
@media (min-width: 960px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-8) var(--space-16); }
  .kv dd { margin: 0; }
}

/* Messages: the answer to an action, or a situation that lasts, in the page. No border: a soft background. ---- */
.alert { padding: var(--space-10) var(--space-14); border-radius: var(--radius-control); background: var(--surface-page); color: var(--text);
  font-size: var(--fs-14); line-height: 1.45; }
.alert strong { font-weight: var(--fw-heavy); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--text); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); }
.empty { padding: var(--space-28) var(--space-10); color: var(--text-muted); text-align: center; }
.empty strong { display: block; color: var(--text); font-weight: var(--fw-bold); }

/* Windows: native <dialog>, opened by [data-dialog-open=id], closed by its [data-dialog-close] button (Fermer at
   the top, Annuler at the bottom), the Escape key or a click on the veil (theme.js). On a phone, it takes the width. */
dialog.modal { width: min(var(--modal-w), calc(100% - var(--space-24))); padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius-card); background: var(--surface); color: var(--text); text-align: left; }
dialog.modal.modal-wide { width: min(var(--modal-w-wide), calc(100% - var(--space-24))); }
dialog.drawer { margin: 0 0 0 auto; width: min(var(--modal-w), 100%); height: 100%; max-height: 100%; padding: 0; border: 0;
  border-left: 1px solid var(--border); background: var(--surface); color: var(--text); }
dialog.modal::backdrop, dialog.drawer::backdrop { background: var(--overlay); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-12);
  padding: var(--space-14) var(--space-16); border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: var(--fs-16); }
.drawer-body { padding: var(--space-16) var(--space-16) var(--space-24); overflow: auto; }

/* Tables. On a computer a real table in a card; on a phone, table.table-cards turns each line into a card whose
   cells say their title (td[data-label]). A wider table scrolls inside its card (theme.js wraps it). ---------- */
.table-card { padding: var(--space-6) var(--space-10); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); min-width: 0; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.table th { padding: var(--space-8); border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-12);
  font-weight: var(--fw-semibold); text-align: left; vertical-align: bottom; white-space: nowrap; }
.table td { padding: var(--space-8); border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover td { background: var(--surface-page); }
.table tr.row-current td { background: var(--action-soft); }
.table tr.row-future td { color: var(--text-muted); }
.table tr.total td { font-weight: var(--fw-heavy); }
.table tr.row-alert td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table-comfortable td { padding-top: var(--space-12); padding-bottom: var(--space-12); }
/* The name of a line, bold, and a second line under it in 12 px (a segment, a city) */
.table .cell-name { font-weight: var(--fw-semibold); }
.table .cell-sub { display: block; font-size: var(--fs-12); font-weight: var(--fw-medium); color: var(--text-muted); }
/* The type of a column decides its alignment, for every table, .datagrid included: th[data-type] is written by
   kit.col (type=, or number for kind='number') or by hand, and theme.js copies it on the cells of its column. text,
   code, date, status: left; number, delta, actions: right; bool: centred. .num, .right and .center are aliases. Types
   after aliases: same weight, the type wins. */
.table .num, .table .right { text-align: right; }
.table .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table [data-type="text"], .table [data-type="code"], .table [data-type="date"], .table [data-type="status"] { text-align: left; }
.table [data-type="number"], .table [data-type="delta"], .table [data-type="actions"] { text-align: right; }
.table [data-type="number"], .table [data-type="delta"], .table [data-type="date"] { font-variant-numeric: tabular-nums; }
.table [data-type="bool"] { text-align: center; }
.table td[data-type="code"] { font-family: var(--font-mono); font-size: var(--fs-12); white-space: nowrap; }
.table td[data-type="actions"] { white-space: nowrap; }
.table-fit th, .table-fit th.num, .table-fit th[data-type] { white-space: normal; }
.table-fit .badge, .table-fit .pill { white-space: normal; }
.table .code { overflow-wrap: break-word; }
.cell-yes { display: inline-flex; color: var(--success); }
.cell-yes svg { width: var(--fs-16); height: var(--fs-16); }
.cell-no { color: var(--text-muted); }
/* One line in a cell, cut with an ellipsis, whole on hover (title): a long name never makes a row taller */
.cell-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-8); margin-top: var(--space-12);
  font-size: var(--fs-13); color: var(--text-muted); }
.pager .muted { margin-right: var(--space-8); }
@media (max-width: 700px) {
  .table-card:has(table.table-cards) { padding: 0; border: 0; background: none; }
  table.table-cards thead { display: none; }
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
  table.table-cards tr { margin-bottom: var(--space-10); padding: var(--space-8) var(--space-12); border: 1px solid var(--border);
    border-radius: var(--radius-control); background: var(--surface); }
  table.table-cards tbody tr:hover td { background: none; }
  table.table-cards td { display: flex; justify-content: space-between; gap: var(--space-12); padding: var(--space-2) 0; border: 0;
    text-align: right; }
  table.table-cards td::before { content: attr(data-label); color: var(--text-muted); font-size: var(--fs-12);
    font-weight: var(--fw-semibold); text-align: left; }
  table.table-cards td.cell-name { display: block; padding-bottom: var(--space-6); font-size: var(--fs-15); text-align: left; }
  table.table-cards td.cell-name::before { content: none; }
  table.table-cards td:empty { display: none; }
}

/* Data grid: a list worked like a spreadsheet, in the page. table.datagrid[data-datagrid] with
   an id; thead button.datagrid-col[data-col][data-kind=text|number|list] is the title of a column: theme.js puts its
   name in .datagrid-label, then the sort icon, the funnel (.datagrid-filter) and the menu of the column, plus
   .datagrid-resize at the right edge. A click on the title sorts: ascending, descending, none. tbody
   tr[data-datagrid-row]; a cell is read through its data-sort when it has one, td[data-many] holds several values.
   Above it, .datagrid-bar. Sort, filters and grouping kept for the tab; order, columns shown and widths kept in the
   browser. */
.datagrid th { position: relative; }
/* Titles stuck at the top of a frame that scrolls (.table-tall, a frame of the application); a head of two levels stays
   whole, theme.js gives its second line the height of the first as top. Pinned columns stick at the left, the last
   with a rule; their titles above the other titles. */
.datagrid thead th { position: sticky; top: 0; z-index: 2; }
.datagrid .datagrid-pinned { position: sticky; z-index: 1; background: var(--surface); }
.datagrid thead th.datagrid-pinned { z-index: 3; background: var(--surface-page); }
.datagrid .datagrid-pinned-last { box-shadow: inset -1px 0 0 var(--border); }
.datagrid tbody tr:hover td.datagrid-pinned { background: var(--surface-page); }
.datagrid .datagrid-group-row .datagrid-pinned { background: var(--surface-page); }
.datagrid tfoot tr.datagrid-total td, .datagrid tfoot tr.datagrid-total th { position: sticky; bottom: 0; z-index: 1;
  background: var(--surface); border-top: 2px solid var(--border-strong); font-weight: var(--fw-bold); color: var(--text-heading); }
.datagrid tfoot tr.datagrid-total .datagrid-pinned { z-index: 3; }
.datagrid th:has(> .datagrid-head) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* A title at the right (number, delta, actions, or the aliases .num and .right) has its icons before its name, so that
   the name stands over the figures; a centred one (bool, .center) is centred whole. The type decides, the
   alignment itself is in the rules of .table above. */
.datagrid th:not(:is(.right, .num, .center, [data-type="number"], [data-type="delta"], [data-type="actions"], [data-type="bool"])):has(> .datagrid-head) { padding-right: var(--space-8); }
.datagrid th:is(.right, .num, [data-type="number"], [data-type="delta"], [data-type="actions"]):has(> .datagrid-head) { padding-left: var(--space-8); }
.datagrid th:is(.center, [data-type="bool"]):has(> .datagrid-head) { padding-left: var(--space-8); padding-right: var(--space-8); }
.datagrid th[hidden], .datagrid td[hidden] { display: none; }
.datagrid-head { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-4); min-width: 0; }
/* Short of room, the title goes to a second line between two words, and the icons together under it */
.datagrid th:has(> .datagrid-head) { white-space: normal; }
.datagrid-icons { flex: 0 1 auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.datagrid th:is(.right, .num, [data-type="number"], [data-type="delta"], [data-type="actions"]) .datagrid-icons { flex-direction: row-reverse; }
.datagrid th:is(.right, .num, [data-type="number"], [data-type="delta"], [data-type="actions"]) .datagrid-head { flex-direction: row-reverse; }
.datagrid th:is(.center, [data-type="bool"]) .datagrid-head { justify-content: center; }
.datagrid-col { display: inline-flex; align-items: center; gap: var(--space-4); min-width: 0; min-height: var(--grid-icon);
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.datagrid-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.datagrid-sort { flex: 0 0 auto; display: inline-flex; align-items: center; color: var(--neutral); }
.datagrid-rank { font-size: var(--fs-12); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.datagrid-rank:empty { display: none; }
.datagrid-sort svg { width: var(--space-12); height: var(--fs-14); }
.datagrid-filter svg { width: var(--fs-14); height: var(--fs-14); }
.datagrid th[aria-sort="ascending"] .datagrid-down, .datagrid th[aria-sort="descending"] .datagrid-up { opacity: .3; }
.datagrid th[aria-sort="ascending"] .datagrid-sort, .datagrid th[aria-sort="descending"] .datagrid-sort { color: var(--link); }
.datagrid-filter { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: var(--grid-icon);
  height: var(--grid-icon); padding: 0; border: 0; border-radius: var(--radius-tag); background: none; color: var(--text-muted); cursor: pointer; }
.datagrid-filter:hover, .datagrid-filter[aria-expanded="true"] { background: var(--surface); color: var(--text-heading); box-shadow: inset 0 0 0 1px var(--border); }
.datagrid th.filtered .datagrid-col { color: var(--link); }
.datagrid th.filtered .datagrid-filter { background: var(--action-soft); color: var(--link); }
.datagrid th.filtered .datagrid-filter path { fill: currentColor; }
/* The menu of a column: faint until the title is hovered or the menu open */
.datagrid-menu-button { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: calc(var(--grid-icon) - var(--space-4)); height: var(--grid-icon); padding: 0; border: 0; border-radius: var(--radius-tag);
  background: none; color: var(--text-muted); font: inherit; font-weight: var(--fw-bold); cursor: pointer; opacity: .35; }
.datagrid th:hover .datagrid-menu-button, .datagrid-menu-button:focus-visible, .datagrid-menu-button[aria-expanded="true"] { opacity: 1; }
.datagrid-menu-button:hover, .datagrid-menu-button[aria-expanded="true"] { background: var(--surface); color: var(--text-heading); box-shadow: inset 0 0 0 1px var(--border); }
.datagrid th.datagrid-fixed { cursor: default; }
.datagrid-resize { position: absolute; top: 0; right: 0; bottom: 0; width: var(--grid-resize-w); cursor: col-resize; touch-action: none; }
.datagrid-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 0; border-right: 1px solid var(--border); }
.datagrid-resize:hover::after, .datagrid th.datagrid-resizing .datagrid-resize::after { top: 0; bottom: 0; border-right-color: var(--border-strong); }
.datagrid th.datagrid-dragging { opacity: .5; }
.datagrid th.datagrid-drop-before { box-shadow: inset 3px 0 0 var(--border-strong); }
.datagrid th.datagrid-drop-after { box-shadow: inset -3px 0 0 var(--border-strong); }
.datagrid-ghost { position: fixed; z-index: 40; pointer-events: none; padding: var(--space-4) var(--space-12); background: var(--surface);
  border-radius: var(--radius-tag); border: 1px solid var(--border); font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--text-heading);
  white-space: nowrap; }
.datagrid-menu { position: absolute; z-index: 30; top: 100%; left: 0; min-width: var(--menu-w); max-width: var(--menu-w-max);
  padding: var(--space-8); background: var(--surface); border-radius: var(--radius-tag); border: 1px solid var(--border); display: flex;
  flex-direction: column; gap: var(--space-4); font-weight: var(--fw-medium); white-space: normal; text-align: left;
  -webkit-user-select: text; user-select: text; }
/* The filter and the menu of a column are placed by theme.js under their title, in position: fixed, so that a table
   that scrolls in its card does not cut them */
.datagrid-menu.datagrid-panel { position: fixed; z-index: 50; top: 0; left: 0; max-width: calc(100vw - var(--space-16)); }
.datagrid-filter-panel { width: var(--grid-filter-w); min-width: 0; padding: var(--space-12); border-radius: var(--radius-card-sm); gap: var(--space-8); }
.datagrid-filter-panel > .input { width: 100%; }
.datagrid-range { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
.datagrid-range .field { font-size: var(--fs-12); }
.datagrid-range .input { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.datagrid-filter-clear { align-self: flex-start; }
.datagrid-colmenu { width: var(--grid-colmenu-w); min-width: 0; padding: var(--space-4); gap: 0; }
.datagrid-colmenu-item { display: flex; align-items: center; width: 100%; min-height: var(--control-h-sm); padding: 0 var(--space-12);
  border: 0; border-radius: var(--radius-tag); background: none; color: var(--text-heading); font: inherit; font-size: var(--fs-13);
  text-align: left; cursor: pointer; }
.datagrid-colmenu-item:hover, .datagrid-colmenu-item:focus-visible { background: var(--action-soft); }
.datagrid-menu-list { max-height: var(--menu-list-h); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.datagrid-menu-list label, .datagrid-menu-all { display: flex; align-items: center; gap: var(--space-8); font-size: var(--fs-13); color: var(--text-heading); }
.datagrid-menu-all { padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); font-weight: var(--fw-semibold); }
.datagrid-menu.datagrid-chooser { left: auto; right: 0; min-width: var(--card-min-w); max-height: 60vh; overflow: auto; }
.datagrid-chooser-line { display: flex; align-items: center; gap: var(--space-4); }
.datagrid-chooser-line label { flex: 1 1 auto; display: flex; align-items: center; gap: var(--space-8); font-size: var(--fs-14); white-space: nowrap; }
.datagrid-chooser-move { min-width: var(--control-h-sm); padding: 0; font-size: var(--fs-16); font-weight: var(--fw-bold); }
.datagrid-chooser-reset { flex: 0 0 auto; margin-top: var(--space-8); width: 100%; }
.datagrid-group-row th, .datagrid-group-row td { background: var(--surface-page); font-size: var(--fs-13); font-weight: var(--fw-semibold);
  color: var(--text-heading); padding-top: var(--space-8); padding-bottom: var(--space-8); }
.datagrid-group-row th { text-align: left; }
.datagrid-group-row .datagrid-group-sum { font-weight: var(--fw-bold); }  /* the total of a data-agg="sum" column, in its column */
.datagrid-group-toggle { display: inline-flex; align-items: center; gap: var(--space-4); padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer; text-align: left; }
.datagrid-chevron { display: inline-flex; align-items: center; justify-content: center; width: var(--grid-chevron); height: var(--grid-chevron);
  color: var(--text-muted); }
.datagrid-group-count { margin-left: var(--space-8); font-size: var(--fs-12); font-weight: var(--fw-medium); color: var(--text-muted); }
/* The filters at work, as chips in the bar: one per filtered column, its × removes it */
.datagrid-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.datagrid-chip { display: inline-flex; align-items: center; gap: var(--space-4); height: var(--grid-chip-h);
  padding: 0 var(--space-4) 0 calc(var(--space-8) + var(--space-4) / 2); border-radius: var(--radius-full); background: var(--action-soft);
  color: var(--text); font-size: var(--fs-12); font-weight: var(--fw-semibold); white-space: nowrap; max-width: 100%; }
.datagrid-chip-remove { display: inline-flex; align-items: center; justify-content: center; width: var(--grid-chevron); height: var(--grid-chevron);
  padding: 0; border: 0; border-radius: var(--radius-full); background: none; color: inherit; font: inherit; font-size: var(--fs-14); cursor: pointer; }
.datagrid-chip-remove:hover, .datagrid-chip-remove:focus-visible { background: var(--surface); }
/* Compact / Comfortable, at the right of the bar, before Columns */
.datagrid-density { margin-left: auto; }
.datagrid-density + .datagrid-columns { margin-left: 0; }

@media print {
  .appbar, .tabbar, .toast, .env-banner { display: none; }
  body, .shell { background: var(--surface); max-width: none; }
}
