/*
   MarocLIS Web — the Windows application's look (UiTheme.Palette), in a browser.
   Logical properties throughout (inline-start / inline-end): the same sheet lays out the
   Arabic interface right to left.
*/

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF,
                   U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF,
                   U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
    --surface: #F6F8F9;
    --surface-raised: #FFFFFF;
    --surface-sunken: #F1F4F6;
    --border: #DCE3E8;
    --border-strong: #C3CDD4;
    --text: #14212B;
    --text-secondary: #51606B;
    --text-muted: #667480;
    --accent: #0B6E79;
    --accent-hover: #095C65;
    --accent-pressed: #08515A;
    --accent-subtle: #E3F1F2;
    --band-text: #D6EEF0;
    --abnormal: #8C3505;
    --abnormal-bg: #FEF0E6;
    --critical: #B42318;
    --critical-bg: #FDECEA;
    --critical-ink: #8A1C12;
    --normal: #1E6B3A;
    --normal-bg: #E7F4EC;
    --info: #1F4E9A;
    --info-bg: #E8EEFA;
    --archive: #5B3A9E;
    --archive-bg: #F1ECFA;
    --radius: 4px;
    --header-height: 52px;
    --sidebar-width: 248px;
    --sidebar-collapsed-width: 56px;
    --control-height: 36px;
    --gap: 12px;
    --font: "Segoe UI", "IBM Plex Sans Arabic", system-ui, -apple-system, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* The Arabic interface reads in its own face first, Segoe UI's Arabic being a fallback. */
html[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", var(--font); }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { margin: 0; font-weight: 600; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The heading Blazor focuses after a navigation, for screen readers: not a control. */
h1:focus, h1:focus-visible { outline: none; }

/* ---------- Icons: the Windows glyphs as masks, painted in the text colour ---------- */

.icon {
    display: inline-block;
    inline-size: 16px;
    block-size: 16px;
    flex: none;
    background-color: currentColor;
    /* The image itself is named on each icon (Icon.razor), the rest in longhands here: WebKit drew
       no icon from a mask given through a custom property in the shorthand. */
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    vertical-align: -3px;
}

.icon-title { inline-size: 22px; block-size: 22px; color: var(--accent); vertical-align: -4px; margin-inline-end: 8px; }
.icon-large { inline-size: 40px; block-size: 40px; color: var(--text-muted); }

/* ---------- Buttons and fields ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-block-size: var(--control-height);
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #FFFFFF; }
.btn-primary:active { background: var(--accent-pressed); }

.btn-secondary { background: var(--surface-raised); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-sunken); color: var(--text); }

.btn-wide { inline-size: 100%; justify-content: center; min-block-size: 38px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { color: var(--text-secondary); font-weight: 600; font-size: 13px; }

.input {
    inline-size: 100%;
    min-block-size: var(--control-height);
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-raised);
    color: var(--text);
    font: inherit;
}
.input:focus { border-color: var(--accent); outline: 2px solid var(--accent-subtle); outline-offset: 0; }

/* A password field with its eye: the button sits inside the field's end edge (right in French,
   left in Arabic) and the text keeps clear of it. */
.pw-field { position: relative; display: block; }
.pw-field > .input { padding-inline-end: 38px; }
.pw-eye {
    position: absolute; inset-block: 1px; inset-inline-end: 1px; inline-size: 34px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--radius); background: transparent; color: var(--text-muted); cursor: pointer;
}
.pw-eye:hover { color: var(--text); }
.pw-eye[aria-pressed="true"] { color: var(--accent); }
.pw-field > .input:disabled + .pw-eye { display: none; }

.message { margin: 0; padding: 8px 12px; border-radius: var(--radius); border-inline-start: 3px solid; }
.message.is-critical { background: var(--critical-bg); color: var(--critical-ink); border-color: var(--critical); }
.message.is-warning { background: var(--abnormal-bg); color: var(--abnormal); border-color: var(--abnormal); }
.message.is-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.message.is-success { background: var(--normal-bg); color: var(--normal); border-color: var(--normal); }

/* ---------- Plain pages: sign-in, password change, licence ---------- */

.plain {
    min-block-size: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.plain-card {
    display: grid;
    grid-template-columns: 300px minmax(0, 440px);
    inline-size: min(100%, 740px);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(20, 33, 43, 0.08);
    overflow: hidden;
}

.band {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 32px 28px;
    background: var(--accent);
    color: var(--band-text);
}
.band-mark .icon { inline-size: 40px; block-size: 40px; color: #FFFFFF; }
.band-title { margin-block-start: 10px; font-size: 26px; font-weight: 600; color: #FFFFFF; }
.band-subtitle { font-size: 14px; }
.band-edition {
    align-self: flex-start;
    margin-block-start: 8px;
    padding: 2px 8px;
    border: 1px solid var(--band-text);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.band-footer { margin-block-start: auto; padding-block-start: 24px; font-size: 12px; opacity: 0.85; }

.plain-body { display: flex; flex-direction: column; gap: 14px; padding: 32px 32px 24px; }
.plain-body > .btn { align-self: flex-start; }

.form-title { font-size: 20px; }
.form-lead, .form-hint { margin: 0; color: var(--text-secondary); }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.form-footer { display: flex; justify-content: flex-end; padding-block-start: 10px; border-block-start: 1px solid var(--border); }
.form ul.validation-errors, .validation-message { color: var(--critical-ink); margin: 0; }

.workstations p { margin: 0 0 8px; }

/* ---------- Tables ---------- */

.grid { inline-size: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { background: var(--surface-sunken); color: var(--text-secondary); font-weight: 600; text-align: start; }
.grid th, .grid td { padding: 6px 8px; border-block-end: 1px solid var(--border); }
/* The last column's text kept clear of the list's edge (and of its scroll bar), on every list: each screen
   had to say so on its own, and the first ones never did. A left-to-right cell of an Arabic page ends on the right. */
.grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] .grid :is(th, td):last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }

/* ---------- Language switch ---------- */

.language-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.language-switch .lang {
    min-block-size: 34px;
    padding: 4px 10px;
    border: 0;
    border-inline-end: 1px solid var(--border);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.language-switch .lang:last-child { border-inline-end: 0; }
.language-switch .lang:hover { background: var(--surface-sunken); }
.language-switch .lang.is-current { background: var(--accent-subtle); color: var(--accent-pressed); font-weight: 600; }

/* ---------- The shell ---------- */

/*
   The shell fills the window and never scrolls as a whole: the menu scrolls on its own, the work
   surface on its own, and a screen with an action bar keeps the bar at its foot, out of the
   scrolled content (.screen-body).
*/
.shell { block-size: 100vh; block-size: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
    position: relative;
    z-index: 30;
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    min-block-size: var(--header-height);
    padding: 6px 16px;
    background: var(--surface-raised);
    border-block-end: 1px solid var(--border);
}
.brand { font-size: 17px; font-weight: 700; color: var(--accent); text-decoration: none; }
.topbar-rule { inline-size: 1px; block-size: 24px; background: var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 6px; min-inline-size: 0; color: var(--text-secondary); }
.crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-current { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--text-muted); }
html[dir="rtl"] .crumb-sep { transform: scaleX(-1); }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }

/* The operator's menu: the name and the workstation on its button, the password and the sign-out under it. */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-button {
    display: flex; align-items: center; gap: 10px; min-block-size: 40px; padding: 3px 10px 3px 4px;
    border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
html[dir="rtl"] .user-menu-button { padding: 3px 4px 3px 10px; }
.user-menu-button:hover, .user-menu[open] > .user-menu-button { background: var(--surface-sunken); border-color: var(--border); }
.who-initials {
    inline-size: 32px; block-size: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #FFFFFF; font-size: 13px; font-weight: 600;
}
.who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-inline-size: 0; }
.who-name { font-weight: 600; white-space: nowrap; }
.who-place { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.user-menu-caret { color: var(--text-muted); font-size: 12px; }
.user-menu-panel {
    position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 6px); z-index: 40; min-inline-size: 260px;
    display: flex; flex-direction: column; gap: 6px; padding: 8px;
    background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(20, 33, 43, .16);
}
.user-menu-panel > .btn { justify-content: flex-start; inline-size: 100%; }
.user-menu-panel .btn-secondary { border-color: transparent; }
.user-menu-panel .btn-secondary:hover { border-color: var(--border); }
.signout-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px; border-block-start: 1px solid var(--border); }
.signout-confirm > span { flex: 1 0 100%; font-weight: 600; }

.licence-banner { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-weight: 600; }
.licence-banner.is-warning { background: var(--abnormal-bg); color: var(--abnormal); border-block-end: 1px solid #F5C9A8; }
.licence-banner.is-critical { background: var(--critical-bg); color: var(--critical-ink); border-block-end: 1px solid #F3B8B2; }
.licence-banner-link { margin-inline-start: auto; color: inherit; }

.notice { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--info-bg); color: var(--info); border-block-end: 1px solid var(--border); }
.notice-text { flex: 1; }

.frame { flex: 1 1 auto; display: flex; min-block-size: 0; }

.sidebar {
    flex: none;
    inline-size: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-block-size: 0;
    background: var(--surface-raised);
    border-inline-end: 1px solid var(--border);
}

.nav { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 8px 0 12px; }
.nav-group { margin-block-start: 4px; }
.nav-group-title {
    display: flex;
    align-items: center;
    min-block-size: 30px;
    padding: 6px 16px 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
}
.nav-group-title::-webkit-details-marker { display: none; }
.nav-group-title::after { content: "▾"; margin-inline-start: 6px; }
.nav-group:not([open]) > .nav-group-title::after { content: "▸"; }
html[dir="rtl"] .nav-group:not([open]) > .nav-group-title::after { content: "◂"; }

/* « Administration »: a parent heading whose foldable sub-sections — and their links — sit indented one step in. */
.nav-subgroup { margin-block-start: 0; }
.nav-subgroup > .nav-group-title { padding-inline-start: 28px; text-transform: none; letter-spacing: 0.02em; color: var(--text-secondary); }
.nav-subgroup .nav-item { padding-inline-start: 26px; }
html.nav-collapsed .nav-subgroup > .nav-group-title { padding: 0; min-block-size: 16px; }
html.nav-collapsed .nav-subgroup .nav-item { padding-inline: 0 3px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-block-size: var(--control-height);
    padding-block: 4px;
    padding-inline: 13px 16px;
    border-inline-start: 3px solid transparent;
    color: var(--text);
    text-decoration: none;
}
.nav-item > span:not(.icon) { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .icon { color: var(--text-secondary); }
.nav-item:hover { background: var(--surface-sunken); color: var(--text); }
.nav-item.active { background: var(--accent-subtle); border-inline-start-color: var(--accent); color: var(--accent-pressed); font-weight: 600; }
.nav-item.active .icon { color: var(--accent); }

.sidebar-foot { flex: none; padding: 6px 8px; border-block-start: 1px solid var(--border); }
.nav-toggle {
    display: flex; align-items: center; inline-size: 100%; min-block-size: var(--control-height); padding: 4px 8px;
    border: 0; border-radius: var(--radius); background: none; color: var(--text-secondary); font: inherit; font-size: 13px; cursor: pointer;
}
.nav-toggle:hover { background: var(--surface-sunken); color: var(--text); }
.nav-toggle > span { display: inline-flex; align-items: center; gap: 10px; }
html[dir="rtl"] .nav-toggle .icon { transform: scaleX(-1); }
.when-collapsed { display: none !important; }
.visually-hidden { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The menu folded to its icons: the names are the icons' tooltips. */
html.nav-collapsed .sidebar { inline-size: var(--sidebar-collapsed-width); }
html.nav-collapsed .nav-item { justify-content: center; padding-inline: 0 3px; gap: 0; }
html.nav-collapsed .nav-item > span:not(.icon) { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
html.nav-collapsed .nav-group { margin-block-start: 2px; border-block-start: 1px solid var(--border); }
html.nav-collapsed .nav-group-title { justify-content: center; padding: 0; min-block-size: 18px; font-size: 0; letter-spacing: 0; }
html.nav-collapsed .nav-group-title::after { margin: 0; font-size: 10px; }
html.nav-collapsed .nav-toggle { justify-content: center; }
html.nav-collapsed .when-expanded { display: none !important; }
html.nav-collapsed .when-collapsed { display: inline-flex !important; }

.content { flex: 1 1 auto; min-inline-size: 0; min-block-size: 0; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; }

.page { flex: none; display: flex; flex-direction: column; gap: var(--gap); max-inline-size: 960px; }
/* A screen of the laboratory takes the whole work surface, its width and its height. */
.page-screen { flex: 1 1 auto; min-block-size: 0; max-inline-size: none; }
.page-title { font-size: 20px; display: flex; align-items: center; flex: none; }
.page-lead { margin: 0; color: var(--text-secondary); }

.card { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 6px; padding: 16px 20px; }
.card-empty, .card-refused { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 24px; text-align: center; }
.card-empty p, .card-refused p { margin: 0; font-size: 15px; max-inline-size: 560px; }
.card-refused { border-color: #F3B8B2; background: var(--critical-bg); color: var(--critical-ink); }
.card-refused .icon-large { color: var(--critical); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.facts dt { color: var(--text-secondary); }
.facts dd { margin: 0; font-weight: 600; }

/* « Comptes rendus »: the hand-overs of the selected version, under its details in the side panel. */
.report-deliveries { margin-block-start: 16px; padding-block-start: 12px; border-block-start: 1px solid var(--border); }
.report-deliveries-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-block-end: 6px; }
.report-deliveries-title { margin: 0; font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.report-delivery-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.report-delivery-list li { display: grid; gap: 2px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 760px) {
    .plain-card { grid-template-columns: 1fr; }
    .band { padding: 20px; }
    .band-footer { padding-block-start: 8px; }
    .plain-body { padding: 20px 16px; }
    .frame { flex-direction: column; }
    .sidebar, html.nav-collapsed .sidebar { inline-size: auto; max-block-size: 40vh; border-inline-end: 0; border-block-end: 1px solid var(--border); }
    .sidebar-foot { display: none; }
    .topbar { flex-wrap: wrap; }
    .breadcrumb, .topbar-rule, .who { display: none; }
    .content { padding: 16px; }
    html.nav-collapsed .nav-item { justify-content: flex-start; padding-inline: 13px 16px; gap: 10px; }
    html.nav-collapsed .nav-item > span:not(.icon) { position: static; inline-size: auto; block-size: auto; clip-path: none; }
}

/* ---- Screens of the laboratory (patients, orders, file) -------------------------------------- */

/*
   A screen: its body, which scrolls (or, split, whose columns scroll each on their own), and its
   action bar at the foot, out of the scroll. Work list on the start side, the open item on the end
   side taking the rest of the width.
*/
.screen { display: flex; flex-direction: column; gap: var(--gap); min-inline-size: 0; }
.page-screen > .screen { flex: 1 1 auto; min-block-size: 0; }
.screen-body { flex: 1 1 auto; min-block-size: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--gap); padding: 2px; margin: -2px; }
.screen-body > * { flex: none; }
.screen-body.split { display: grid; overflow: hidden; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.screen-body.split > * { min-block-size: 0; overflow: auto; }
/* A list in a card of a split body: the card holds the height, the table scrolls under its header. */
.screen-body.split > .card-flush { display: flex; flex-direction: column; overflow: hidden; }
.screen-body.split > .card-flush > .table-scroll, .screen-body.split > .card-flush > .grid-scroll { flex: 1 1 auto; min-block-size: 0; max-block-size: none; overflow: auto; border: 0; border-radius: 0; }
.screen-body.split > .card-flush > .grid-footer { flex: none; border-block-start: 1px solid var(--border); margin: 0; }
.pane-fill { flex: 1 1 auto !important; min-block-size: 280px; display: flex; flex-direction: column; }
.pane-fill > .table-scroll { flex: 1 1 auto; max-block-size: none; min-block-size: 0; }

.mono { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; }
.muted { color: var(--text-secondary); }
.strong { font-weight: 600; }
.small { font-size: 12px; }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.accent { color: var(--accent); }
.critical { color: var(--critical); }
.abnormal { color: var(--abnormal); }
.spacer { block-size: 8px; }
.info-line { margin: 0; white-space: pre-wrap; }
.section-title { font-size: 14px; margin-block: 12px 6px; color: var(--text-secondary); }
.count { color: var(--text-muted); font-weight: 400; }

.message.is-normal { background: var(--normal-bg); color: var(--normal); border-color: var(--normal); }
.message.is-abnormal { background: var(--abnormal-bg); color: var(--abnormal); border-color: var(--abnormal); }
.message.is-muted { background: var(--surface-sunken); color: var(--text-secondary); border-color: var(--border-strong); }

.btn-danger { background: var(--surface-raised); border-color: var(--critical); color: var(--critical); }
.btn-danger:hover { background: var(--critical-bg); color: var(--critical-ink); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-small { padding: 2px 8px; min-block-size: 30px; font-size: 12px; }
.link { margin-inline-start: 6px; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
/* The tools at the top of a list, always in this order: the search or scan box, the chips, the refresh. */
.list-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.list-tools > .search-box, .list-tools > .input-with-button { flex: 1 1 220px; max-inline-size: none; min-inline-size: 0; }
.list-tools > .chips { flex: 0 1 auto; }
.list-tools > .list-tools-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.list-pane .list-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.list-pane .list-tools > .search-box, .list-pane .list-tools > .input-with-button { grid-column: 1 / -1; }
.list-pane .list-tools > .field-check { grid-column: 1; }
.list-pane .list-tools > .list-tools-end { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
/* A search or scan box on the first line pushes the end tools below it. The box's presence is a class the
   screen sets (has-search), not a :has(), which Firefox 115 — the Windows 7 and 8 workstations' browser — lacks. */
.list-pane .list-tools.has-search > .list-tools-end { grid-row: 2 / span 2; }
.toolbar-spacer { flex: 1 1 auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.search-box { position: relative; display: flex; align-items: center; flex: 1 1 280px; max-inline-size: 460px; }
.search-box-wide { max-inline-size: none; }
.search-box > .icon { position: absolute; inset-inline-start: 10px; color: var(--text-muted); pointer-events: none; }
.search-box > .input { inline-size: 100%; padding-inline-start: 32px; }
.select-payer { max-inline-size: 240px; }

.suggestions {
    position: absolute; inset-block-start: calc(100% + 2px); inset-inline: 0; z-index: 20;
    margin: 0; padding: 4px 0; list-style: none; max-block-size: 320px; overflow-y: auto;
    background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(20, 33, 43, .14);
}
.suggestions li { display: flex; align-items: baseline; gap: 10px; padding: 6px 12px; cursor: pointer; }
.suggestions li:hover { background: var(--accent-subtle); }
.suggestions li.is-critical .strong { color: var(--critical); }
.suggestions li .num { margin-inline-start: auto; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chips-label { color: var(--text-secondary); font-size: 12px; font-weight: 600; margin-inline-end: 4px; }
.chips-count { margin-inline-start: auto; color: var(--text-muted); font-size: 12px; }
.chip {
    display: inline-flex; align-items: center; min-block-size: 32px;
    border: 1px solid var(--border-strong); background: var(--surface-raised); color: var(--text);
    border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--surface-sunken); }
.chip.is-pressed { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-pressed); font-weight: 600; }
.chip > .icon { margin-inline-end: 6px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.split-even { grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr); }
.split-list { grid-template-columns: 300px minmax(0, 1fr); }
.split-list-wide { grid-template-columns: 360px minmax(0, 1fr); }
.split-picker { grid-template-columns: minmax(0, 1fr) 280px; }
.split-main, .split-side { min-inline-size: 0; }
@media (max-width: 1100px) { .split, .split-even, .split-picker { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .split-list { grid-template-columns: minmax(0, 1fr); } }

.card-flush { padding: 0; overflow: hidden; }
.card-title { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-end: 8px; }
.subcard { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.count-badge { background: var(--accent); color: #FFFFFF; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 600; }

.table-scroll { max-block-size: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-scroll-short { max-block-size: 300px; }
.grid-select tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: var(--surface-sunken); }
.grid tr.is-selected, .grid tr.is-selected:hover { background: var(--accent-subtle); }
.grid tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .grid tr.is-selected td:first-child { box-shadow: inset -3px 0 0 var(--accent); }
.grid tr.is-pending td { color: var(--text-muted); background: var(--surface-sunken); }
.grid tr.is-cancelled td { color: var(--text-muted); text-decoration: line-through; }
.grid tr.is-critical td:first-child { color: var(--critical); font-weight: 600; }
.grid tr.is-abnormal { background: var(--abnormal-bg); }
.grid thead th { position: sticky; inset-block-start: 0; z-index: 1; }
.cell-action { inline-size: 1%; white-space: nowrap; text-align: end; }
/* A row's tick box (Catalogue: several analyses or panels for the portal). */
.cell-check { inline-size: 1%; padding-inline-end: 0; }
.cell-check input { margin: 0; }
/* The portal's row over a list of the catalogue: the count, then its three buttons, wrapping. */
.portal-selection { padding: 6px 8px; border-radius: 6px; background: var(--surface-sunken); }
.portal-selection > [data-state=selection-count] { flex: 1 1 100%; }
.cell-name { font-weight: 600; }
.cell-sub { color: var(--text-secondary); font-size: 12px; }
.grid-footer { padding: 8px 12px; color: var(--text-muted); font-size: 12px; }
.basket-warning td { padding-block: 4px 8px; }
.basket-warning .btn { margin-inline-start: 8px; }

.pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-waiting { background: var(--surface-sunken); color: var(--text-secondary); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-archive { background: var(--archive-bg); color: var(--archive); }
.pill-ok { background: var(--normal-bg); color: var(--normal); }
.pill-warning { background: var(--abnormal-bg); color: var(--abnormal); }
.pill-critical { background: var(--critical-bg); color: var(--critical-ink); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
/* Fields on a fixed grid: the same column from one row to the next. */
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* The first column holds « Patient à jeun »: at least as wide as « Oui », « Non » and « Non renseigné »
   side by side, which ran under « Renseignements cliniques » on a tablet (iPad, Android). */
.form-grid-request { grid-template-columns: minmax(max-content, 1fr) repeat(3, minmax(0, 1fr)); align-items: end; }
.form-grid-request .field-prescriber, .form-grid-request .field-clinical { grid-column: span 2; }
.form-grid-request .field-self-pay { min-block-size: var(--control-height); }
/* The scanned prescription: its buttons, then what is attached, on one line that wraps on a phone. */
.field-prescription { display: flex; flex-direction: column; gap: 4px; margin-block-start: 12px; }
.prescription-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prescription-strip .link { margin-inline-start: 0; }
.prescription-state { display: inline-flex; align-items: center; gap: 4px; }
.prescription-hint { flex-basis: 100%; }
.prescription-preview { display: block; inline-size: 100%; block-size: 70vh; min-block-size: 360px; margin-block-start: 12px;
                        border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
@media (max-width: 900px) {
    .form-grid-3, .form-grid-request { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.form-section { display: flex; flex-direction: column; gap: 8px; padding-block: 4px 12px; }
.form-section + .form-section { padding-block-start: 12px; border-block-start: 1px solid var(--border); }
.form-section-title { padding: 0; margin-block-end: 6px; color: var(--accent-pressed); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
/* A section title with its link to the tab that holds the rest (« Adresse et autres coordonnées › »), at the line's end. */
.form-section-head { display: flex; inline-size: 100%; align-items: baseline; justify-content: space-between; gap: 12px; }
.form-section-head > .link-button { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.field-wide, .span-2 { grid-column: span 2; }
.field-check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.input-with-button { display: flex; gap: 6px; }
.input-with-button > .input { flex: 1 1 auto; min-inline-size: 0; }
.segmented { display: flex; }
.segmented > .btn { border-radius: 0; }
.segmented > .btn:first-child { border-start-start-radius: var(--radius); border-end-start-radius: var(--radius); }
.segmented > .btn:last-child { border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); }
.segmented > .btn + .btn { margin-inline-start: -1px; }
.age-echo { color: var(--text-muted); font-size: 12px; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
fieldset:disabled .input { background: var(--surface-sunken); }

.tabs { display: flex; flex-wrap: wrap; gap: 0; border-block-end: 1px solid var(--border); background: var(--surface-raised); }
.tab {
    border: 0; background: none; font: inherit; color: var(--text-secondary); padding: 10px 16px; cursor: pointer;
    border-block-end: 2px solid transparent; margin-block-end: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-selected, .tab.is-current { color: var(--accent); border-block-end-color: var(--accent); font-weight: 600; }
.tab-page { padding: 12px 16px; }

/* « Paramètres » grouped into six families: the families as a pill row, each revealing its own tabs. */
/* A settings tab kept mounted while another is shown: no box of its own, so its body and its action bar sit in the screen as before. */
.settings-pane { display: contents; }
.settings-pane[hidden] { display: none; }
.settings-families { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; background: var(--surface-sunken); border-block-end: 1px solid var(--border); }
.settings-families .family {
    border: 1px solid var(--border); background: var(--surface); font: inherit; color: var(--text-secondary);
    padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.settings-families .family:hover { color: var(--text); border-color: var(--border-strong); }
.settings-families .family.is-selected { background: var(--accent-subtle); color: var(--accent-pressed); border-color: var(--accent); font-weight: 600; }

.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more-menu {
    position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 4px); z-index: 20; min-inline-size: 240px;
    display: flex; flex-direction: column; gap: 4px; padding: 6px;
    background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(20, 33, 43, .14);
}
.more-menu > .btn { justify-content: flex-start; }
.more-up .more-menu { inset-block-start: auto; inset-block-end: calc(100% + 4px); }
.more-start .more-menu, .action-bar-start .more-menu { inset-inline-end: auto; inset-inline-start: 0; }
.more-rule { inline-size: 100%; margin: 4px 0; border: 0; border-block-start: 1px solid var(--border); }
.more-caret { margin-inline-start: 4px; font-size: 11px; color: var(--text-muted); }

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
    background: rgba(20, 33, 43, .42); padding: 24px;
}
.modal {
    background: var(--surface-raised); border-radius: 6px; box-shadow: 0 18px 48px rgba(20, 33, 43, .28);
    inline-size: min(640px, 100%); max-block-size: calc(100vh - 48px); display: flex; flex-direction: column;
}
.modal-wide { inline-size: min(960px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-block-end: 1px solid var(--border); }
.modal-title { font-size: 16px; }
.modal-close { border: 0; background: none; cursor: pointer; color: var(--text-secondary); padding: 4px; }
.modal-hint { margin: 0; padding: 10px 20px 0; color: var(--text-secondary); font-size: 13px; }
.modal-body { padding: 14px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.modal-footer { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-block-start: 1px solid var(--border); }
.modal-footer > .footer-status { margin-inline-end: auto; }
.prompt-text { margin: 0; white-space: pre-wrap; }
/* A dialog answered by a key (O / N, F10) takes the cursor on its text: no outline around a paragraph. */
.prompt-keys { display: flex; flex-direction: column; gap: 8px; }
.prompt-keys:focus { outline: none; }
/* The refusal window of « Réception des échantillons »: the tube, then the reason beside the new draw, the comment, the keys. */
.refusal { display: flex; flex-direction: column; gap: 12px; }
.refusal-heading { margin: 0; font-size: 1.05rem; }
.refusal-choice { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 20px; }

/*
   The action bar: one row, the same everywhere. Secondary actions at the start, « Plus d'actions »,
   the destructive ones set apart; the message in the middle, shortened rather than wrapped; the
   primary action at the end. At the foot of the screen, out of the scrolled body.
   A row wider than the bar wraps, whatever the screen's width, rather than cutting its last
   buttons (« Désacti… », « Repre… » in Paramètres › Boxes and the Tableau des boxes, on an iPad, an
   Android tablet and a PC at 1366 px): the group that does not fit goes to a second line, and a
   group wider than the bar wraps its own buttons; the primary action stays at the end. A row that
   fits is drawn as before: the middle, of no width of its own (flex-basis 0), takes what is left
   and never pushes a button to the next line.
*/
.action-bar {
    position: sticky; inset-block-end: 0; z-index: 10; flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
    min-block-size: 56px; padding: 8px 12px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 -2px 10px rgba(20, 33, 43, .05);
}
.action-bar-start, .action-bar-end { flex: 0 1 auto; min-inline-size: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.action-bar-end { margin-inline-start: auto; justify-content: flex-end; }
.action-bar-rule { inline-size: 1px; align-self: stretch; margin-inline: 4px; background: var(--border); }
/* The middle: the last action's message over what is left to do, shortened rather than wrapped. */
.action-bar-middle { flex: 1 1 0; min-inline-size: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.action-bar-status { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Alone in the middle, the message takes a second line before it is shortened: « Dossier 2610-000014 —
   2 échantillons — Étiquettes à imprimer depuis le poste Windows… » is read whole at 1366 px. */
.action-bar-middle.is-alone > .action-bar-status {
    white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.3;
}
/* A message is never squeezed to a word: « À compléter : le patient, au moins une analyse, le
   prescripteur » read « À compl… » on an iPad, the buttons taking the whole row. Below this width the
   primary action goes to the next line, at its end, and the message keeps the room to be read. */
.action-bar-middle.has-message { min-inline-size: 22em; }
.action-bar-info { color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-bar-status.is-muted { color: var(--text-secondary); }
.action-bar-status.is-normal { color: var(--normal); }
.action-bar-status.is-abnormal { color: var(--abnormal); }
.action-bar-status.is-critical { color: var(--critical); }
.action-bar-status.is-success { color: var(--normal); }
.action-bar-status.is-warning { color: var(--abnormal); }
.action-bar-status.is-info { color: var(--info); }
@media (max-width: 900px) {
    .action-bar { flex-wrap: wrap; }
    /* A group wider than the bar (tablet portrait) wraps its buttons rather than cutting the last. */
    .action-bar-start, .action-bar-end { flex: 0 1 auto; flex-wrap: wrap; min-inline-size: 0; }
    .action-bar-middle { flex-basis: 100%; order: -1; }
    .action-bar-status { white-space: normal; }
}
.footer-status { color: var(--text-secondary); font-size: 13px; }

/* « Nouvelle demande » */
.patient-band { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.patient-band-text { flex: 1 1 280px; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.patient-band-name { font-size: 17px; font-weight: 600; }
.patient-band-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.initials {
    inline-size: 44px; block-size: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #FFFFFF; font-weight: 600; font-size: 16px; flex: none;
}
.initials.is-critical { background: var(--critical); }
.tubes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-block-start: 10px; }
.tubes .bench-sheet-box { margin-inline-start: auto; }
.collect-receipt { flex-wrap: wrap; gap: 4px 8px; }
.tubes-total { margin-inline-start: auto; }
.tube-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.tube-swatch { display: inline-block; inline-size: 12px; block-size: 12px; border-radius: 50%; border: 1px solid var(--border-strong); vertical-align: middle; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 12px 0 0; padding-block-start: 10px; border-block-start: 1px solid var(--border); }
.totals dt, .totals dd { margin: 0; }
.totals dd.accent { font-size: 16px; }
.picked { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-block-size: 220px; overflow-y: auto; }
.picked li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.picked li > span:first-child { flex: 1 1 auto; min-inline-size: 0; }

/* « Dossier » */
/* A work list at the start of a screen: its tools at the top, the list scrolling under them. */
.list-pane { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.screen-body.split > .list-pane { overflow: hidden; }
.list-pane > * { flex: none; }
.list-pane .card-heading { margin-block-end: 0; }
.file-list { flex: 1 1 auto; min-block-size: 0; list-style: none; margin: 0 -12px -12px; padding: 0; overflow-y: auto; border-block-start: 1px solid var(--border); }
.list-pane > .table-scroll { flex: 1 1 auto; min-block-size: 0; max-block-size: none; margin: 0 -12px -12px; border: 0; border-block-start: 1px solid var(--border); border-radius: 0; }
.file-list li { padding: 8px 12px; border-block-end: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.file-list li:hover { background: var(--surface-sunken); }
.file-list li.is-selected { background: var(--accent-subtle); box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .file-list li.is-selected { box-shadow: inset -3px 0 0 var(--accent); }
.file-list li.is-cancelled { opacity: .6; }
.file-list-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.file-pane { display: flex; flex-direction: column; gap: var(--gap); min-inline-size: 0; padding: 2px; }
.file-pane > * { flex: none; }
.note-banner { font-weight: 600; }
.file-header { display: flex; flex-direction: column; gap: 10px; }
.file-header-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.accession { border: 0; background: none; padding: 0; font-size: 20px; font-weight: 700; color: var(--text); cursor: copy; }
.file-header-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; }
.patient-name { font-size: 15px; }
.fact { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.fact-value { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; }
.progress-line { list-style: none; margin: 0; padding: 12px 16px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
                 background: var(--surface-raised); border: 1px solid var(--border); border-radius: 6px; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; position: relative; }
.step-dot { inline-size: 14px; block-size: 14px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface-raised); }
.step-name { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.step-done .step-dot { background: var(--normal); border-color: var(--normal); }
.step-done .step-name { color: var(--normal); }
.step-current .step-dot { background: var(--accent-subtle); border-color: var(--accent); }
.step-current .step-name { color: var(--accent); }

/* The patients' screens */
.history { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }
.history-card { display: block; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; }
.history-card:hover { background: var(--surface-sunken); color: inherit; }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.identity { display: flex; flex-direction: column; gap: 2px; }
.identity-name { font-size: 16px; font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 6px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-weight: 600; font-size: 13px; }

/* The catalogue of the counter keeps its seven columns within its card. */
.catalog-card, .basket-card { display: flex; flex-direction: column; gap: 10px; }
.catalog-card > *, .basket-card > * { flex: none; }
.catalog-card .card-heading, .basket-card .card-heading { margin-block-end: 0; }
.catalog-card .grid { font-size: 12px; }
.catalog-card .grid th, .catalog-card .grid td { padding: 5px 6px; }
.catalog-card .grid td { overflow-wrap: anywhere; }
.list-pane .search-box { min-inline-size: 0; }
.catalog-card .grid td.mono { overflow-wrap: normal; white-space: nowrap; }

/* The bench screens: collection, reception, recollections, entry and validation. */
.kbd {
    display: inline-block; margin-inline-start: 8px; padding: 0 5px; border-radius: 3px; font: 600 11px/18px ui-monospace, "Cascadia Mono", Consolas, monospace;
    color: inherit; opacity: .75; border: 1px solid currentColor;
}
.btn-primary .kbd { opacity: .8; }
.btn.is-pressed { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-pressed); font-weight: 600; }
.btn.is-emphasised { border-color: var(--critical); color: var(--critical); font-weight: 600; }
.shortcut-only { display: none !important; }
.card-pad { padding: 12px 16px; margin: 0; }
.caption { margin: 12px 0 4px; color: var(--text-secondary); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.normal-ink { color: var(--normal); }
.scan-box .input, .input.scan-box { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
/* In a column of a .field, the box's flex basis would be its height: it keeps its own. */
.field > .search-box { flex: 0 0 auto; }

.file-list li.is-alerted { box-shadow: inset 3px 0 0 var(--critical); }
html[dir="rtl"] .file-list li.is-alerted { box-shadow: inset -3px 0 0 var(--critical); }
.file-list li.is-drawn { opacity: .75; }
.grid tr.is-drawn td { color: var(--text-secondary); }


.fasting-band { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--info-bg); border-color: #C9D6EE; }
.fasting-band.is-critical { background: var(--critical-bg); border-color: #F3B8B2; color: var(--critical-ink); }
.fasting-text { flex: 1 1 260px; font-weight: 600; }
.input-volume { inline-size: 80px; text-align: end; }

.tube-band { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-sunken); }
.tube-cap { inline-size: 18px; block-size: 46px; border-radius: 4px 4px 9px 9px; border: 1px solid var(--border-strong); flex: none; }
.tube-band-text { flex: 1 1 auto; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.delay { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--text-secondary); }
.delay-value { font: 600 18px ui-monospace, "Cascadia Mono", Consolas, monospace; }
.defects { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.defects > legend { padding: 0; margin-block-end: 6px; }
/* The non-conformities, a grid of toggles of one width: read in columns, found at the same place. */
.defect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px; }
.defect-grid > .chip { border-radius: var(--radius); justify-content: flex-start; white-space: normal; text-align: start; line-height: 1.2; }
.defect-grid > .chip::before {
    content: ""; flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 13px; block-size: 13px;
    margin-inline-end: 8px; border: 1.5px solid currentColor; border-radius: 2px; opacity: .55; font-size: 10px; font-weight: 700;
}
.defect-grid > .chip.is-defect::before { content: "✓"; opacity: 1; }
.chip.is-defect { background: var(--abnormal-bg); border-color: var(--abnormal); color: var(--abnormal); }
.reception-work { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); align-items: start; }
.reception-tube { display: flex; flex-direction: column; gap: var(--gap); min-inline-size: 0; }
@media (max-width: 1100px) { .reception-work { grid-template-columns: minmax(0, 1fr); } }
/* The decision beside the tube: accept (with the place the tube goes to), or refuse with its reason. */
.decision { display: flex; flex-direction: column; gap: 12px; }
.decision-group { display: flex; flex-direction: column; gap: 8px; }
.decision-group + .decision-group { padding-block-start: 12px; border-block-start: 1px solid var(--border); }
.decision-group > .btn { inline-size: 100%; }
.decision-group .field-check { align-items: flex-start; }
.grid tr.is-priority td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
html[dir="rtl"] .grid tr.is-priority td:first-child { box-shadow: inset -3px 0 0 var(--critical); }
.grid tr.is-contacted td { color: var(--text-secondary); }

/* Saisie des résultats */
.table-scroll-tall { max-block-size: calc(100vh - 360px); min-block-size: 220px; border: 0; border-radius: 0; }
.pane-fill > .table-scroll-tall { max-block-size: none; min-block-size: 0; }
/* Validation biologique: a long interval ends in « … » (whole in its title), so the antériorité stays beside each result. */
.grid-validation td.range-cell { max-inline-size: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* « Résultats critiques »: the person told and « Personne n'a pu être joint » on one line, a read-back box per value. */
.critical-call-heading { font-size: 16px; margin: 0 0 6px; }
.critical-call-who { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-block: 8px; }
.critical-call-who > .field { flex: 1 1 260px; }
.critical-call-who > .field-check { padding-block-end: 6px; }
.grid tr.critical-call-note td { border-block-end: 0; padding-block: 0 6px; }
.grid tr.critical-call-note .message { margin: 0; }
.grid-entry td { vertical-align: middle; }
.grid tr.section-row td { background: var(--surface-sunken); color: var(--accent-pressed); font-size: 12px; font-weight: 700; letter-spacing: .04em; padding-block: 4px; }
.grid tr.is-heading td { background: var(--surface-sunken); font-weight: 600; font-style: italic; }
.grid tr.is-critical-row td { background: var(--critical-bg); }
.grid tr.is-critical-row td:first-child, .grid tr.is-critical-row td:nth-child(2) { color: var(--critical); font-weight: 600; }
.grid tr.is-released td { color: var(--text-secondary); font-style: italic; }
.input-value { inline-size: 110px; text-align: end; padding-block: 3px; }
html[dir="rtl"] .input-value { text-align: start; }
.input-value[readonly] { background: var(--surface-sunken); color: var(--text-secondary); border-color: var(--border); }
.input-value.is-derived { font-style: italic; }
/* « Re-prélèvement » in the box of a refused tube's analysis: read whole, in the text font, not as a value. */
.input-value[data-state=awaiting-recollection] { padding-inline: 6px; }
.input-value[data-state=awaiting-recollection]::placeholder { font-family: var(--font); font-size: 12px; font-style: italic; }
.input-comment { inline-size: 100%; min-inline-size: 120px; padding-block: 3px; font-size: 12px; }
.input-comment[readonly] { background: transparent; border-color: transparent; }
/* « Dilution »: the factor beside the figure read on the analyser, « ×1 » in grey when there is none. */
.input-factor { inline-size: 96px; text-align: end; padding-block: 3px; }
html[dir="rtl"] .input-factor { text-align: start; }
.grid-entry .input-factor[readonly] { background: transparent; border-color: transparent; color: var(--text-secondary); }
.input-factor.is-muted { color: var(--text-secondary); }
/* « Résultat » and « Dilution » on a line diluted at the bench: the box always holds what is typed —
   the figure read, the bare factor — and shows over it, while the cursor is elsewhere, what the line
   stands for (450,00 ; « 45 × 10 » ; « ×1 »). Swapped by the server when the box took the cursor,
   the text lost its selection and what was typed went after it: 10 typed over « ×1 » read 110. */
.entry-box { position: relative; display: inline-block; vertical-align: middle; }
.entry-box > .entry-shown {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
    padding-inline: 11px; overflow: hidden; white-space: nowrap; pointer-events: none;
}
html[dir="rtl"] .entry-box > .entry-shown { justify-content: flex-start; }
.entry-box.has-shown > .input:not(:focus) { color: transparent; }
.entry-box > .input:focus + .entry-shown { display: none; }
.entry-shown.is-muted { color: var(--text-secondary); }
/* « Résultat »: the unit glued to the box, in a slot of its own width so that the boxes stay one
   above the other; a longer unit ends in an ellipsis. */
.entry-unit {
    display: inline-block; inline-size: 5.5em; margin-inline-start: 6px; vertical-align: middle;
    text-align: start; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dilution-mark { color: var(--info); font-weight: 600; font-size: 12px; margin-inline-end: 4px; }
.field-row { display: flex; align-items: center; gap: 8px; }
.correction-preview { min-block-size: 4.5em; padding: 6px 8px; background: var(--surface-sunken); border-radius: 4px; }
.key-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 12px; border-block-start: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }
.key-hints .kbd { margin-inline-start: 0; color: var(--text); opacity: 1; border-color: var(--border-strong); background: var(--surface-raised); }
.key-hints span { margin-inline-end: 12px; }
.key-hints-note { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; color: var(--text-muted); }

/* Validation biologique */
.tick-col { inline-size: 32px; text-align: center; }
.context-lines { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* « Contexte » of the open file: a band of three columns above its results. */
.context-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 24px; padding: 12px 16px; }
.context-band > div { min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.context-band .caption { margin-block-start: 0; }
.context-band p { margin: 0; }
.context-band .caption ~ .caption { margin-block-start: 8px; }
.context-band .context-lines { margin: 0; }
@media (max-width: 1200px) { .context-band { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.worklist-table td { vertical-align: top; }
.worklist-table th:first-child { inline-size: 100%; }
.worklist-table th, .worklist-table td { padding-inline: 6px; }
.worklist-table th.num { white-space: normal; inline-size: 1%; }
.grid.worklist-table tr.is-critical-row td:nth-child(2) { color: inherit; font-weight: 400; }
.worklist-table .pills { margin-block-start: 4px; }
.context-lines li { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.contacts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 10px; margin: 6px 0 0; align-items: center; }
.contacts dd { margin: 0; display: flex; align-items: center; gap: 6px; }
.btn-icon { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--text-secondary); border-radius: var(--radius); display: inline-flex; }
.btn-icon:hover { background: var(--surface-sunken); color: var(--text); }

/* Antériorités */
.trend { inline-size: 100%; block-size: auto; display: block; margin-block-end: 12px; background: var(--surface-raised); }
.trend-band { fill: var(--normal-bg); }
.trend-grid { stroke: var(--border); stroke-width: 1; }
.trend-label { fill: var(--text-secondary); font-size: 11px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.trend-point { fill: var(--accent); stroke: var(--surface-raised); stroke-width: 1.5; }
.trend-outside { fill: var(--abnormal); stroke: var(--surface-raised); stroke-width: 1.5; }
.trend-current { fill: var(--surface-raised); stroke: var(--accent); stroke-width: 2.5; }
.grid tr.is-current td { background: var(--accent-subtle); font-style: italic; }

/* ---------- « Comptes rendus », « Facturation », « Caisse », « Tiers payant » ---------- */

.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.input-narrow { inline-size: auto; min-inline-size: 150px; }
.grid .col-check { inline-size: 36px; text-align: center; }
.grid tr.is-muted td { color: var(--text-muted); }
.grid tr.is-credit td { font-style: italic; }
.tabs .pill { margin-inline-start: 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block: 8px 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface-sunken); border-radius: var(--radius); }
.tile-value { font-size: 22px; font-weight: 700; }
.takings td { padding-block: 6px; }
.takings tr.is-total td { border-block-start: 2px solid var(--border-strong); }
.screen-body.split > .split-main { display: flex; flex-direction: column; gap: var(--gap); }
.screen-body.split > .split-main > * { flex: none; }

/* ---------- « Utilisateurs », « Journal d'audit », « Paramètres », « Visa des caisses » ---------- */

/* A date or a short box beside its caption in the list tools. */
.field-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.input-date { inline-size: auto; min-inline-size: 150px; }
.input-wide { inline-size: auto; min-inline-size: 360px; max-inline-size: 100%; }
.input-amount { max-inline-size: 200px; text-align: end; }

/* A list over the selected row's detail, in one column: the list takes the height, the detail its own. */
.screen-body.split.split-stack { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
.audit-detail { max-block-size: 180px; }
.audit-detail-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

.grid tr.is-inactive td { color: var(--text-muted); }
.grid tr.is-muted-row td { color: var(--text-secondary); }
.grid tr.is-accent-row td:first-child { color: var(--accent); }

/* The rights of a role, one box per module. */
.permission-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.permission-module { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.permission-module legend { padding-inline: 4px; color: var(--accent-pressed); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.permission-module .field-check { min-block-size: 28px; font-size: 13px; }

.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-block-size: 320px; overflow: auto; }
.check-list > li, .check-list > .field-check { padding: 4px 8px; border-radius: var(--radius); min-block-size: var(--control-height); display: flex; align-items: center; }
.check-list > li.is-selected { background: var(--accent-subtle); }
.field-check.is-disabled { color: var(--text-muted); }

.facts-wide { grid-template-columns: minmax(160px, max-content) 1fr; }
.facts dd .btn { margin-inline-start: 8px; }

/* Forms: labels above their fields on an aligned grid. */
.form-card { display: flex; flex-direction: column; gap: 12px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.field-align-end { align-self: end; min-block-size: var(--control-height); }
@media (max-width: 1100px) { .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-card .section-title { margin-block: 4px 0; }
.banners { display: flex; flex-direction: column; gap: 6px; }
.banners p { margin: 0; }
.reading-column { max-inline-size: 860px; }
.day-boxes { display: flex; flex-wrap: wrap; gap: 4px 16px; min-block-size: var(--control-height); align-items: center; }

/* « Secteurs autorisés à la validation biologique »: two choices, then the departments three to a row. */
.departments-scope { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.departments-scope > legend { padding-inline: 4px; }
.departments-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 16px; padding-inline-start: 24px; }
.departments-grid .field-check { min-block-size: 28px; }
.departments-scope > p { margin: 4px 0 0; }

/* A signature or a logo: the image, its two buttons and the hint. */
.signature-block, .logo-block { display: flex; flex-direction: column; gap: 6px; }
.logo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.signature-box, .logo-box {
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-raised);
}
.signature-box { inline-size: 300px; block-size: 110px; }
.logo-box { inline-size: 220px; block-size: 90px; }
.signature-box img, .logo-box img { max-inline-size: 100%; max-block-size: 100%; object-fit: contain; }
.signature-actions, .logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* A file chosen through its button: the input itself out of sight, the label clicked. */
label.btn { position: relative; cursor: pointer; }
.file-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; overflow: hidden; }
label.btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.grid .cell-sub { display: block; }
.stack-cards { display: flex; flex-direction: column; gap: var(--gap); }
.nowrap { white-space: nowrap; }

/* « Catalogue » and « Données de référence »: the tone of a row, as the workstation colours its cells. */
.grid tr.is-tone-muted td { color: var(--text-muted); }
.grid tr.is-tone-warning td { color: var(--abnormal); }
.grid tr.is-tone-abnormal td { color: var(--abnormal); }
.grid tr.is-tone-critical td { color: var(--critical); font-weight: 600; }
.grid tr.is-tone-strong td:first-child { font-weight: 700; }
/* The detail beside a work list: its cards one under the other, scrolled together. */
.detail-stack { display: flex; flex-direction: column; gap: var(--gap); min-block-size: 0; overflow: auto; }
.detail-stack > .card-flush { display: flex; flex-direction: column; min-block-size: 0; }
.facts-columns { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
@media (max-width: 1100px) { .facts-columns { grid-template-columns: max-content minmax(0, 1fr); } }
.field-span-3 { grid-column: span 3; }
.field-span-4 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .form-grid-4 .field-span-3 { grid-column: 1 / -1; } }
.check-column { display: flex; flex-direction: column; gap: 2px; }
.input-with-swatch { display: flex; align-items: center; gap: 8px; }
.input-with-swatch > .input { flex: 1 1 auto; min-inline-size: 0; }
.input-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.input-pair-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upper { text-transform: uppercase; }
fieldset.subcard { margin: 0; min-inline-size: 0; }
fieldset.subcard > legend { padding-inline: 4px; }
fieldset.subcard:disabled { opacity: .7; }
.grid td .input { min-inline-size: 60px; }

/* « Interfaces automates » and « Reprise de données » (lot 4c). */
.grid tr.is-tone-ok td { color: var(--normal); }
.modal-large { inline-size: min(1240px, 100%); }
.raw-frame { margin: 0; padding: 10px 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); font-family: Consolas, "Cascadia Mono", "Courier New", monospace; font-size: 12px; white-space: pre; overflow: auto; max-block-size: 52vh; direction: ltr; text-align: left; unicode-bidi: plaintext; }
.frame-input { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; font-size: 12px; white-space: pre; overflow: auto; direction: ltr; text-align: left; block-size: auto; min-block-size: 150px; resize: vertical; }
.editor-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .editor-columns { grid-template-columns: minmax(0, 1fr); } }
.editor-columns > * { display: flex; flex-direction: column; gap: 10px; min-inline-size: 0; }
.grid td.cell-input { padding-block: 2px; }
.grid td.cell-input .input { inline-size: 100%; }
.mapping-new td.cell-code .input { background: var(--abnormal-bg); }
.row-alarm td { background: var(--critical-bg); }
.upload-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.screen-head { display: flex; flex-direction: column; gap: 8px; }
.detail-stack > .card-fill { flex: 1 1 auto; min-block-size: 220px; }
.detail-stack > .card-fill > .table-scroll { flex: 1 1 auto; min-block-size: 0; max-block-size: none; border: 0; border-radius: 0; }
.screen-body > .card-fill { flex: 1 1 auto; display: flex; flex-direction: column; min-block-size: 0; }
.screen-body > .card-fill > .table-scroll { flex: 1 1 auto; min-block-size: 0; max-block-size: none; border: 0; border-block-start: 1px solid var(--border); border-radius: 0; }
.source-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.source-row > .field { min-inline-size: 160px; }
.source-row > .field-wide { min-inline-size: 240px; flex: 1 1 240px; max-inline-size: 360px; }
.profile-notes { margin-block-start: 8px; }
.profile-notes > summary { cursor: pointer; }
.profile-notes-list { margin: 6px 0 0; padding-inline-start: 20px; max-block-size: 260px; overflow-y: auto; }
.profile-notes-list > li { unicode-bidi: plaintext; text-align: start; margin-block-end: 4px; }
.source-file { max-inline-size: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.run-progress { display: inline-flex; align-items: center; gap: 8px; }
.run-progress progress { inline-size: 160px; block-size: 8px; }
.more-menu .btn-file { position: relative; }

/* « Interfaces automates »: the link's facts kept short, so its codes and its log keep the height. */
.facts-compact { gap: 4px 20px; font-size: 13px; }
.facts-compact dd.mono { font-weight: 500; }

/* ---------- Nothing cut: the rules every table, list and detail follows at 1366 pixels ---------- */

/*
   A table fits its card: the work surface scrolls vertically only. A heading wraps (a number's
   column keeps its figures on one line, not its caption); a text column wraps; a long technical
   string (field names, a frame, a path, an analyser's alarm) keeps one line and ends in an
   ellipsis, the whole of it in the cell's tooltip and in the row's detail; a column of little use
   goes under the main cell (.cell-sub) or into the detail.
*/
.grid th { white-space: normal; overflow-wrap: break-word; }
.grid th.num { white-space: normal; }
.grid td.num, .grid td.nowrap, .grid td .nowrap { white-space: nowrap; }
.cell-clip { max-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-clip > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-clip-wide { inline-size: 32%; }
.cell-clip-mid { inline-size: 22%; }
.cell-wrap { overflow-wrap: anywhere; }
/* Two lines at most, the rest behind an ellipsis, the whole text in the tooltip. */
.clamp-3, .grid .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.clamp-2, .grid .clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }

/* A name in a work list on the start side: two lines at most, never cut in the middle of a letter. */
.list-name, .grid .list-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-inline-size: 0; }
.file-list-line > .list-name { flex: 1 1 auto; }
.file-list-line > * { min-inline-size: 0; }
.file-list-line > .pill, .file-list-line > .num, .file-list-line > .mono { flex: none; }

/* A value too long for its box ends in an ellipsis; the box's tooltip holds it whole. */
.input { text-overflow: ellipsis; }

/* A long technical text read in full: wrapped, never past the panel's edge. */
.text-full { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* A change of the audit trail opened: field, value before, value after — one line each, wrapped. */
.change-list { inline-size: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.change-list th, .change-list td { padding: 4px 8px; border-block-end: 1px solid var(--border); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.change-list th { color: var(--text-secondary); font-weight: 600; background: var(--surface-sunken); }
.change-list .col-field { inline-size: 24%; }
.change-list td.old { color: var(--text-secondary); }
.change-list td.empty { color: var(--text-muted); }
/* « Saisie des résultats »: the technical comment keeps the width to be read. */
.grid-entry th.col-comment { inline-size: 26%; }
/* A list beside its context keeps the height to show several rows: the pane scrolls, not the list to a slit. */
.pane-fill { min-block-size: 360px; }
/* A bar with no button and no message (a read-only tab): not drawn, no empty band at the foot of the screen.
   ActionBar.razor decides it (is-empty), so every browser draws the same bar. */
.action-bar.is-empty { display: none; }
/* « Journal d'audit »: the reason keeps the width to be read on two lines. */
.grid td.col-reason { inline-size: 26%; min-inline-size: 220px; }

/* ---------- « Contrôle qualité » ---------- */

/* The run typed beside its chart, the rejections awaiting review under both. */
.qc-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
@media (max-width: 1100px) { .qc-top { grid-template-columns: minmax(0, 1fr); } }
.qc-entry, .qc-review { display: flex; flex-direction: column; }
.qc-entry > .table-scroll, .qc-review > .table-scroll { flex: 1 1 auto; max-block-size: none; border: 0; border-block-start: 1px solid var(--border); border-radius: 0; }
.qc-entry .card-heading, .qc-review .card-heading { margin: 0; }
.qc-entry .input-value { inline-size: 92px; min-block-size: 30px; padding-block: 2px; }
.qc-entry .grid td { padding-block: 4px; }
.qc-lot .nowrap { white-space: nowrap; }
.qc-notice { flex: 1 1 260px; display: flex; align-items: flex-start; gap: 6px; margin: 0; margin-inline-start: auto; }
.qc-notice > .icon { flex: none; margin-block-start: 2px; }
.qc-entry td .message { display: block; margin-block-start: 4px; white-space: normal; text-align: start; inline-size: 140px; max-inline-size: 140px; margin-inline-start: auto; }
/* The lot and the instrument break between them, never inside a code: the « Antériorité » and « Règles » columns stay in the card at 1366 px. */
.qc-entry td:first-child .cell-sub { white-space: normal; }
.qc-entry td:first-child .cell-sub > .mono { white-space: nowrap; }
/* « Données de référence », the targets: a mean and its standard deviation on two lines, the status column in the card. */
.grid td.qc-limits { white-space: normal; }
.qc-no-target { white-space: normal; text-align: start; font-family: inherit; font-size: 12px; }
.qc-lot .field-inline > .input { min-inline-size: 260px; }
.input.is-refused { border-color: var(--critical); box-shadow: 0 0 0 1px var(--critical); }
.grid tr.is-tone-critical-fill td { background: var(--critical-bg); color: var(--critical-ink); }
.grid tr.is-tone-critical-fill.is-selected td { background: #F9D9D5; }
.qc-normal { color: var(--normal); }
.qc-chart { display: flex; flex-direction: column; gap: 6px; }
.qc-chart .card-heading { margin: 0; flex-wrap: wrap; }
.qc-chart p { margin: 0; }

/* The Levey-Jennings chart: the band in control, the limits by weight, the points by shape. */
.lj { display: flex; flex-direction: column; gap: 4px; }
.lj-chart { inline-size: 100%; block-size: auto; display: block; direction: ltr; background: var(--surface-raised); }
.lj-empty { margin: 0; padding: 48px 0; text-align: center; }
.lj-header { margin: 0; }
.lj-band { fill: var(--normal-bg); }
.lj-frame { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.lj-limit { stroke-width: 1; }
.lj-limit-mean { stroke: var(--accent); stroke-width: 1.5; }
.lj-limit-rejection { stroke: var(--critical); }
.lj-limit-warning { stroke: var(--abnormal); stroke-dasharray: 5 3; }
.lj-limit-context { stroke: var(--border-strong); stroke-dasharray: 1 3; }
.lj-label { fill: var(--text-secondary); font-size: 10.5px; font-family: Consolas, "Cascadia Mono", "Courier New", monospace; }
.lj-line { fill: none; stroke: var(--text-secondary); stroke-width: 1; }
.lj-point { cursor: pointer; }
.lj-point > :not(.lj-hit):not(.lj-override), .lj-legend svg > * { stroke: var(--surface-raised); stroke-width: 1.5; }
.lj-normal > :not(.lj-hit):not(.lj-override), .lj-legend .lj-normal { fill: var(--normal); }
.lj-abnormal > :not(.lj-hit):not(.lj-override), .lj-legend .lj-abnormal { fill: var(--abnormal); }
.lj-critical > :not(.lj-hit):not(.lj-override), .lj-legend .lj-critical { fill: var(--critical); }
.lj-muted > :not(.lj-hit):not(.lj-override) { fill: var(--text-muted); }
.lj-point.is-picked > :first-of-type { stroke: var(--text); stroke-width: 2; }
.lj-override { fill: none; stroke: var(--critical); stroke-width: 1.5; stroke-dasharray: 1.5 2; }
.lj-hit { fill: transparent; stroke: none; }
.lj-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.lj-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lj-legend svg { inline-size: 12px; block-size: 12px; }

/*
   The quality registers (non-conformities, EQA, controlled documents): the register fills what the
   screen leaves, the sub-list under it (actions, versions) keeps a bounded height of its own.
*/
.quality-main { display: flex; flex-direction: column; gap: var(--gap); overflow: hidden !important; }
.quality-main > .card-fill, .quality-stack > .card-fill { flex: 1 1 auto; display: flex; flex-direction: column; min-block-size: 200px; }
.quality-main > .card-fill > .table-scroll, .quality-stack > .card-fill > .table-scroll { flex: 1 1 auto; min-block-size: 0; max-block-size: none; border: 0; border-radius: 0; }
.quality-sub { flex: none; display: flex; flex-direction: column; }
.quality-sub > .card-heading { margin: 0; flex-wrap: wrap; align-items: flex-start; }
.quality-sub > .card-heading > .card-title { flex: 1 1 220px; min-inline-size: 0; }
.quality-sub > .table-scroll { max-block-size: 190px; border: 0; border-block-start: 1px solid var(--border); border-radius: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.quality-aside { display: flex; flex-direction: column; gap: 10px; }
.quality-aside .facts { margin: 0; }
.screen.nc > .screen-body.split { grid-template-columns: minmax(0, 1fr) 300px; }
.nc-description { min-inline-size: 160px; }
.grid td.nc-description { white-space: normal; }
.nc-person { display: block; overflow-wrap: break-word; }
.nc [data-grid=register] .pill { white-space: normal; text-align: center; border-radius: 10px; }
.nc [data-grid=register] td:last-child { min-inline-size: 104px; }
.quality-aside .facts { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.quality-aside .facts dt, .quality-aside .facts dd { overflow-wrap: break-word; min-inline-size: 0; }
.pill-muted { background: var(--surface-sunken); color: var(--text-muted); }
.ink-normal { color: var(--normal); }
.input-year { inline-size: 96px; }
.eqa-detail { flex: none; }
.eqa-detail .card-heading { flex-wrap: wrap; }
.eqa-detail p { margin: 0; }
.eqa-parameters { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 8px 8px; margin: 0; min-inline-size: 0; }
.eqa-parameters.is-refused { border-color: var(--critical); }
.eqa-check-list { max-block-size: 200px; }
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-inline-size: 0; }
.file-pick > .btn { position: relative; overflow: hidden; }
/* The last column of a quality register keeps clear of the card's edge, menu open or folded. */
.quality-main .grid th:last-child, .quality-main .grid td:last-child,
.quality-stack .grid th:last-child, .quality-stack .grid td:last-child,
.eqa .grid th:last-child, .eqa .grid td:last-child { padding-inline-end: 22px; }
/* A cell written left to right (a reference, a date) in an Arabic page: its end is still the page's left. */
html[dir=rtl] .quality-main .grid td:last-child[dir=ltr], html[dir=rtl] .quality-stack .grid td:last-child[dir=ltr],
html[dir=rtl] .eqa .grid td:last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }
html[dir=rtl] .nc [data-state=completed-on] { text-align: right; }
.grid .doc-read { text-align: center; min-inline-size: 48px; }

/*
   The stock screens (stock, consumption, counts, temperatures): a line below its safety stock, an
   expired lot or an out-of-range reading in the alarm's colours on the whole row, in bold for a
   critical article; a warning said on the cells concerned only.
*/
.grid tr.stock-alarm td { background: var(--critical-bg); color: var(--critical-ink); }
.grid tr.stock-alarm.is-selected td { background: #F9D9D5; }
.grid tr.stock-alarm-strong td { font-weight: 600; }
.grid td.stock-glyphs { font-weight: 700; white-space: nowrap; text-align: center; min-inline-size: 40px; }
.grid td.stock-count { min-inline-size: 104px; }
.grid td.stock-count .input { inline-size: 96px; text-align: end; }
.grid td.stock-comment .input { inline-size: 100%; min-inline-size: 120px; }
.stock-checks { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px 10px; margin: 0; min-inline-size: 0; }
.stock-checks legend { padding: 0 4px; font-weight: 600; }
.stock-range { align-self: end; padding-block-end: 8px; }
.stock-person { display: block; min-inline-size: 9em; overflow-wrap: break-word; }
.stock-heading { flex-wrap: wrap; flex-shrink: 0; align-items: center; margin: 0; }
.stock-heading > .card-title { flex: 1 1 200px; min-inline-size: 0; flex-wrap: wrap; row-gap: 2px; }
.stock-heading > .card-actions { justify-content: flex-end; align-items: center; }
.stock-sheet-time { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stock-sheet-time .input { inline-size: auto; }
.input-month { inline-size: 150px; }
.input-date { inline-size: 150px; }
.list-tools .field-inline { display: inline-flex; align-items: center; gap: 6px; }
.stock-dialog-list { max-block-size: 260px; }
.cert-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); max-block-size: 220px; overflow-y: auto; }
.cert-list li { padding: 6px 10px; cursor: pointer; overflow-wrap: anywhere; }
.cert-list li + li { border-block-start: 1px solid var(--border); }
.cert-list li.is-selected { background: var(--accent-subtle); box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .cert-list li.is-selected { box-shadow: inset -3px 0 0 var(--accent); }
/* Stock screens and their dialogs: the last column keeps clear of the box's edge, in either direction. */
:is([data-screen=inventory], [data-screen=consumption], [data-screen=inventorycounts], [data-screen=temperatures],
    [data-modal=consumption-detail], [data-modal=stock-alerts], [data-modal=recall-list], [data-modal=lot-comparison]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=inventory], [data-screen=consumption], [data-screen=inventorycounts], [data-screen=temperatures],
    [data-modal=consumption-detail], [data-modal=stock-alerts], [data-modal=recall-list], [data-modal=lot-comparison]) .grid td:last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }

/*
   The purchasing screens (purchase orders, quotations, supplier invoices, supplier evaluation): the
   offers side by side next to the suppliers asked, the cheapest net price on the normal fill, the
   offer chosen set apart; the totals under the lines.
*/
.supplier-invoices .list-tools > .search-box { flex-basis: 300px; min-inline-size: 300px; }
.purchase-totals { margin: 0; border-block-start: 1px solid var(--border); text-align: end; }
.quote-detail { flex: none; display: flex; flex-direction: column; }
.quality-stack > .quote-requests.card-fill { min-block-size: 150px; }
.quote-detail > .card-heading { margin: 0; }
.quote-sides { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); border-block-start: 1px solid var(--border); }
.quote-sides > .table-scroll { max-block-size: 290px; border: 0; border-radius: 0; min-inline-size: 0; }
.quote-sides > .table-scroll + .table-scroll { border-inline-start: 1px solid var(--border); }
.quote-legend { margin: 0; border-block-start: 1px solid var(--border); }
.grid td.quote-cell { white-space: normal; min-inline-size: 90px; }
.grid td.quote-cheapest { background: var(--normal-bg); color: var(--normal); }
.grid tr.quote-awarded td { background: var(--accent-subtle); font-weight: 600; }
.quote-pick { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-block: 12px; }
.quote-pick-list { max-block-size: 300px; border: 1px solid var(--border); border-radius: var(--radius); }
.quote-pick-list.is-refused, .invoice-entry-lines.is-refused, .quote-offer-lines.is-refused { border-color: var(--critical); }
.quote-offer-lines, .invoice-entry-lines { max-block-size: 300px; border: 1px solid var(--border); border-radius: var(--radius); }
.grid td.stock-rate .input { inline-size: 72px; text-align: end; }
.grid .cell-check { inline-size: 32px; text-align: center; }
/* Catalogue: the « Portail » column — a box per row, and over it the box that ticks or unticks them all. */
.grid .cell-portal { inline-size: 1%; padding-inline: 4px; text-align: center; }
.grid .cell-portal input:disabled { cursor: not-allowed; }
.portal-all { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; cursor: pointer; }
.portal-all input { margin: 0; }
/* A little wider than the other lists, for the « Portail » column. */
@media (min-width: 1101px) { [data-screen=catalog] .split-list-wide { grid-template-columns: 392px minmax(0, 1fr); } }
.field-span-all { grid-column: 1 / -1; margin: 0; }
.invoice-info p { margin: 0; }
.invoice-info { padding-block: 0 6px; }
.invoice-detail > .tabs { padding-inline: 8px; }
.invoice-due { margin: 0; border-block-start: 1px solid var(--border); }
/* Purchasing screens and their dialogs: the last column keeps clear of the box's edge, in either direction. */
:is([data-screen=purchaseorders], [data-screen=quotes], [data-screen=supplierinvoices], [data-screen=supplierevaluation],
    [data-modal=quote-request], [data-modal=quote-offer], [data-modal=supplier-invoice]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=purchaseorders], [data-screen=quotes], [data-screen=supplierinvoices], [data-screen=supplierevaluation],
    [data-modal=quote-request], [data-modal=quote-offer], [data-modal=supplier-invoice]) .grid td:last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }

/* « Équipements »: the register, and beside it (left in Arabic) the instrument selected, as at the workstation. */
.screen-body.split.equipment-split { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); }
.equipment-card { display: flex; flex-direction: column; gap: 12px; }
.equipment-card > .card-heading { margin: 0; }
/* « Contrats automates »: an intervention later than the contract allows, marked on its delay. */
.grid td.stock-alarm-cell { background: var(--critical-bg); color: var(--critical-ink); }
.contract-pick { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.contract-pick .grid td .input { min-inline-size: 0; }
.field-active { align-self: end; min-block-size: var(--control-height); }
/* Names and kinds broken between words, never inside one; the last column clear of the edge. */
:is([data-screen=equipment], [data-screen=contracts]) .grid :is(.cell-wrap, .list-name) { overflow-wrap: break-word; }
:is([data-screen=equipment], [data-screen=contracts], [data-modal=instrument-contract]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=equipment], [data-screen=contracts]) .grid td:last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }
[data-screen=contracts] .stock-heading > .card-actions { flex: none; }
[data-grid=contracts] > thead > tr > th:first-child { min-inline-size: 160px; }
[data-grid=contracts] .pill { white-space: normal; max-inline-size: 100%; border-radius: 10px; }
html[dir=rtl] .equipment-card .facts dd[dir=ltr] { text-align: right; }
/* « Export comptable »: the period and the layout on a row, the sites and the journals under them; the journals and their anomalies side by side. */
.export-scope { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.export-scope fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.export-scope .export-sites { grid-column: span 1; }
.export-scope .export-journals { grid-column: span 3; }
.export-scope fieldset.is-refused .check-list, .export-scope fieldset.is-refused .export-journal-grid { outline: 1px solid var(--critical); border-radius: var(--radius); }
.export-scope .check-list { max-block-size: 96px; }
.export-journal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 16px; }
.export-results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.export-results > .card { min-inline-size: 0; }
/* Entries to correct: the list takes the whole width, its long piece numbers broken rather than pushed past the edge. */
.export-results.has-problems { grid-template-columns: minmax(0, 1fr); }
[data-grid=problems] .cell-wrap { overflow-wrap: anywhere; }
.export-results .table-scroll { border: 0; border-block-start: 1px solid var(--border); border-radius: 0; max-block-size: 360px; }
/* « Comptes et journaux »: the value typed in place, wide enough for a twenty-character code. */
[data-grid=settings] td.settings-value { inline-size: 260px; }
[data-grid=settings] td.settings-value .input { inline-size: 100%; }
[data-grid=settings] td.settings-value .input::placeholder { font-family: var(--font); font-size: 12px; }
:is([data-grid=settings] td.settings-value, [data-grid=asset-accounts] td) [data-refusal] { display: block; margin-block-start: 4px; white-space: normal; overflow-wrap: break-word; }
/* « Immobilisations »: the year narrow, the plan said under the amounts, the register and its dialogs clear of the edge. */
.asset-year { inline-size: 96px; }
.asset-form .asset-plan { justify-content: end; }
[data-grid=asset-accounts] td .input { inline-size: 100%; min-inline-size: 0; }
:is([data-grid=assets], [data-grid=interventions], [data-grid=settings], [data-grid=journals], [data-grid=problems]) :is(.cell-wrap, .list-name) { overflow-wrap: break-word; }
:is([data-screen=accountingexport], [data-screen=accountingsettings], [data-screen=fixedassets],
    [data-modal=asset-schedule], [data-modal=asset-candidates], [data-modal=asset-accounts]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=accountingexport], [data-screen=accountingsettings], [data-screen=fixedassets],
    [data-modal=asset-schedule], [data-modal=asset-candidates], [data-modal=asset-accounts]) .grid td:last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }
/* The register first: the instrument linked keeps to a few lines under it. */
[data-screen=fixedassets] .quality-stack > [data-card=register] { min-block-size: 340px; }
[data-screen=fixedassets] [data-card=instrument] > .table-scroll { max-block-size: 168px; }
[data-screen=fixedassets] [data-card=instrument] > .card-heading { padding-block: 8px 0; }
[data-screen=fixedassets] [data-card=instrument] > p { margin: 0; padding-block: 4px 8px; }
[data-grid=assets] { font-size: 13px; }
[data-grid=assets] :is(th, td) { padding-inline: 5px; }
[data-grid=assets] :is(th, td):first-child { padding-inline-start: 8px; }
/* A dialog's footer action that is not its answer (« Modifier »): at the start, apart from « Fermer » and the main one. */
.modal-footer > .modal-footer-start { margin-inline-end: auto; }
/* « Rapprochement bancaire »: the statement and the movements side by side taking the height, the balances under them. */
.recon-account { min-inline-size: 240px; max-inline-size: 340px; }
.screen-body > .recon-panes { flex: 1 1 auto; min-block-size: 300px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.recon-pane { display: flex; flex-direction: column; min-inline-size: 0; min-block-size: 0; overflow: hidden; }
.recon-pane > .card-heading { margin: 0; padding-block: 10px; }
.recon-pane > .table-scroll { flex: 1 1 auto; min-block-size: 0; max-block-size: none; border: 0; border-block-start: 1px solid var(--border); border-radius: 0; }
.recon-pane > .table-scroll > .card-pad { border: 0; }
.recon-balances { padding-block: 12px; }
.recon-balance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.recon-balance { min-inline-size: 0; }
.recon-balance dt { color: var(--text-secondary); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.recon-balance dd { margin: 2px 0 0; font-size: 16px; text-align: start; }
.recon-balance-notes { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 8px 0 0; }
:is([data-grid=lines], [data-grid=movements]) { font-size: 13px; }
:is([data-grid=lines], [data-grid=movements]) :is(th, td) { padding-inline: 6px; }
[data-grid=lines] td:last-child { min-inline-size: 120px; }
/* The statement's import: its columns picked in a grid of boxes, the file's raw lines and their reading under it. */
.import-mapping { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 12px; align-items: end; margin-block: 12px 4px; }
.import-mapping .field-label { white-space: normal; }
.import-mapping .check { min-block-size: var(--control-height); }
.import-raw { flex: none; max-block-size: 180px; margin-block: 8px; }
.import-parsed { flex: none; max-block-size: 260px; }
.import-raw .grid td { max-inline-size: 220px; }
/* « Prévision de trésorerie »: the thirteen weeks in one table, the closing in bold, a week below zero in red. */
.forecast-payday { inline-size: 80px; }
[data-grid=weeks] { font-size: 13px; }
[data-grid=weeks] :is(th, td) { padding-inline: 6px; }
.forecast-notes { margin-block: 8px; }
.forecast-notes dd { display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
/* « Coût de revient et marge »: the four key figures in a row, then the tables by tab. */
.margin-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.margin-tile { background: var(--surface-raised); border: 1px solid var(--border); min-inline-size: 0; }
.margin-tile-value { font-size: 17px; overflow-wrap: anywhere; }
.margin-method { margin: 0; }
[data-grid=margins] { font-size: 12.5px; }
[data-grid=margins] :is(th, td) { padding-inline: 5px; }
[data-grid=margins] th { white-space: normal; vertical-align: bottom; }
:is([data-screen=bankreconciliation], [data-screen=cashforecast], [data-screen=costmargin],
    [data-modal=bank-accounts], [data-modal=statement-import], [data-modal=forecast-items]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=bankreconciliation], [data-screen=cashforecast], [data-screen=costmargin],
    [data-modal=bank-accounts], [data-modal=statement-import], [data-modal=forecast-items]) .grid :is(th, td):last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }
@media (max-width: 1100px) { .screen-body > .recon-panes { grid-template-columns: minmax(0, 1fr); } .import-mapping { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* « Statistiques d'activité » and « Pilotage »: the key figures four to a row, then the tables by tab, which take the height left. */
.report-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-tile { background: var(--surface-raised); border: 1px solid var(--border); min-inline-size: 0; gap: 2px; }
.report-tile[data-ink=Abnormal] { border-color: var(--abnormal); }
.report-tile[data-ink=Critical] { border-color: var(--critical); }
.report-tile-caption { font-size: 12px; overflow-wrap: anywhere; }
.report-tile-value { font-size: 19px; overflow-wrap: anywhere; line-height: 1.25; }
.report-tile-value.is-sentence { font-size: 14px; font-weight: 600; }
.report-tile-sub { overflow-wrap: anywhere; }
html[dir=rtl] .report-tile > [dir=ltr] { text-align: right; }
.screen-body > .report-card { flex: 1 1 auto; min-block-size: 260px; display: flex; flex-direction: column; }
.report-card > .table-scroll { flex: 1 1 auto; min-block-size: 0; max-block-size: none; border: 0; border-radius: 0; }
.report-grid th { white-space: normal; vertical-align: bottom; }
.report-grid tr.abnormal td { color: var(--abnormal); }
.report-grid tr.critical td { color: var(--critical); }
:is([data-screen=statistics], [data-screen=steering]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=statistics], [data-screen=steering]) .grid :is(th, td):last-child { padding-left: 22px; padding-right: 8px; }
/* « Tableau de bord »: the banner before go-live, the greeting, the day's flow, then what needs attention beside what is at zero. */
.dashboard-setup { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; gap: 12px; padding: 8px 14px; border: 1px solid #F2C9A8; border-radius: 6px; background: var(--abnormal-bg); color: var(--abnormal); }
.dashboard-setup > .icon { flex: none; }
.dashboard-setup-title { flex: 0 1 auto; min-inline-size: 0; }
/* The detail on the title's line when it fits, else wrapped beneath it on two lines at most: never cut at 1366 px. */
.dashboard-setup-detail { flex: 1 1 320px; -webkit-line-clamp: 2; line-clamp: 2; }
.dashboard-setup-review { flex: none; color: var(--abnormal); border-color: #E0B48F; background: var(--abnormal-bg); }
.dashboard-greeting { display: flex; flex-direction: column; gap: 2px; }
.dashboard-hello { font-size: 20px; }
.dashboard-greeting p { margin: 0; }
.dashboard-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-inline-size: 0; }
.dashboard-card-head > .card-heading { margin: 0; font-size: 15px; flex: none; }
.dashboard-card-head > .list-name { -webkit-line-clamp: 1; line-clamp: 1; text-align: end; }
.dashboard-card-head-stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.dashboard-flow { display: flex; flex-direction: column; gap: 12px; }
/* The steps share their rows (subgrid): a caption on two lines lowers every value with it, the figures stay in line. */
.dashboard-steps { display: grid; grid-auto-flow: column; grid-template-rows: auto auto auto; }
.dashboard-steps > .dashboard-step { grid-row: 1 / span 3; display: grid; grid-template-rows: subgrid; row-gap: 4px; }
.dashboard-steps > .dashboard-arrow { grid-row: 1 / span 3; }
.dashboard-step { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-raised); color: var(--text); text-decoration: none; }
a.dashboard-step:hover { border-color: var(--accent); color: var(--text); }
.dashboard-step.is-highlighted { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-pressed); }
.dashboard-step-caption { color: var(--text-secondary); }
.dashboard-step.is-highlighted .dashboard-step-caption { color: var(--accent-pressed); }
.dashboard-step-value { font-size: 28px; font-weight: 700; line-height: 1.15; }
.dashboard-step-link { align-self: end; color: var(--accent); font-size: 12px; font-weight: 600; }
.dashboard-step.is-highlighted .dashboard-step-link { color: var(--accent-pressed); }
.dashboard-arrow { align-self: center; inline-size: 24px; block-size: 24px; fill: none; stroke: var(--border-strong); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-cards { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.dashboard-cards > .card > .dashboard-card-head { padding: 14px 16px 10px; }
.dashboard-alert-list, .dashboard-quiet-list { list-style: none; margin: 0; padding: 0 16px 8px; }
.dashboard-alert { display: grid; grid-template-columns: 122px 48px minmax(0, 1fr) auto; align-items: center; gap: 0 12px; min-block-size: 44px; padding-block: 4px; border-block-start: 1px solid #E6EBEF; }
.dashboard-alert[data-state=no-priority] { display: block; padding-block: 12px; }
.dashboard-alert-value { font-size: 15px; font-weight: 600; text-align: end; font-variant-numeric: tabular-nums; }
.dashboard-alert-value.info { color: var(--info); }
.dashboard-alert > .btn { margin-inline-end: 6px; }
.dashboard-quiet-list li { display: flex; align-items: center; gap: 8px; min-block-size: 26px; }
.dashboard-quiet-list .icon.normal { color: var(--normal); flex: none; }
.dashboard-quiet-list .list-name { -webkit-line-clamp: 1; line-clamp: 1; }
/* The home: the way to the dashboard, the screen the workstation opens on. */
.home-dashboard { display: flex; align-items: center; gap: 12px; margin-block-start: 16px; color: var(--text); text-decoration: none; max-inline-size: 640px; }
.home-dashboard:hover { border-color: var(--accent); color: var(--text); }
.home-dashboard-text { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 1100px) { .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-cards { grid-template-columns: minmax(0, 1fr); } }
/* « Sérothèque » and « Sous-traitance »: a tube received and never shelved filled in the warning's colours,
   an act awaiting its partner's return muted; the signs of a tube in their narrow column; the acts leaving on the slip. */
.grid tr.is-tone-abnormal-fill td { background: var(--abnormal-bg); color: var(--abnormal); }
.grid tr.is-tone-abnormal-fill.is-selected td { background: #FCE2CF; }
.grid tr.is-tone-secondary td { color: var(--text-secondary); }
.grid .col-flags { inline-size: 56px; }
.dispatch-list { list-style: none; margin: 0 0 12px; padding: 8px 10px; max-block-size: 180px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-sunken); }
.dispatch-list > li { padding-block: 2px; }
/* The last column of the serum bank and of the send-outs well clear of the card's edge (in Arabic, of its left edge). */
:is([data-screen=serumbank], [data-screen=subcontracting]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=serumbank], [data-screen=subcontracting]) .grid :is(th, td):last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }
/* « Dossiers du personnel », « Habilitations » and « Échéances RH »: a list alone in its body; the matrix
   whose cells hold each habilitation (an analyser or a discipline above its level and review date), the cell
   selected framed; the documents of a file in their window; the last column clear of the card's edge. */
.screen-body.split.split-single { grid-template-columns: minmax(0, 1fr); }
.hab-matrix { table-layout: fixed; inline-size: 100%; }
.hab-matrix th { white-space: normal; vertical-align: bottom; font-size: 12px; overflow-wrap: break-word; hyphens: auto; }
.hab-matrix th.hab-name { inline-size: 17%; }
.hab-matrix td { vertical-align: top; cursor: pointer; }
.hab-matrix tr.hab-row-current > td.hab-name { background: var(--accent-subtle); }
.hab-matrix td.is-selected-cell { background: var(--accent-subtle); box-shadow: inset 0 0 0 2px var(--accent); }
.hab-entry { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; inline-size: 100%; min-inline-size: 0; margin-block-end: 3px;
             padding: 3px 4px; border: 1px solid transparent; border-radius: 4px; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.hab-entry:hover { border-color: var(--border-strong); }
.hab-entry.is-picked { border-color: var(--accent); background: var(--surface-raised); }
.hab-entry > .pill { white-space: normal; max-inline-size: 100%; overflow-wrap: anywhere; }
.hab-subject { font-size: 12px; color: var(--text-secondary); max-inline-size: 100%; }
.hab-review { font-size: 12px; color: var(--text-secondary); }
.hab-cell-overdue > .hab-review { color: var(--critical); font-weight: 600; }
.hab-cell-training > .hab-review { color: var(--abnormal); }
.screen-body.split > .card-flush > .hab-detail { color: var(--text); font-size: 13px; }
.screen-body.split > .card-flush > .hab-detail.muted { color: var(--text-secondary); }
.credential-scroll { max-block-size: 420px; }
.employee-file-page { min-block-size: 330px; }
.modal-footer > .credential-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.modal-footer > .credential-actions > .action-bar-rule { block-size: 24px; }
:is([data-screen=personnel], [data-screen=habilitations], [data-screen=hrdeadlines], [data-modal=employee-file]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=personnel], [data-screen=habilitations], [data-screen=hrdeadlines], [data-modal=employee-file]) .grid :is(th, td):last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }
/* « Congés », « Planning », « Paie » and « Accidents du travail »: the lists alone in their body, the last column
   clear of the card's edge; the planning's month in a box of its own that scrolls sideways, the names and hours kept
   in view, each day in its ink (leave, post, a post to check), the days selected framed; the points to check under
   it; an accident's file under the list, its history beside its checks; a date overdue in the alarm's colours. */
:is([data-screen=leave], [data-screen=payroll], [data-screen=accidents], [data-screen=planning], [data-modal=leave-balances], [data-modal=holidays]) .grid:not(.planning-grid) :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=leave], [data-screen=payroll], [data-screen=accidents], [data-screen=planning], [data-modal=leave-balances], [data-modal=holidays]) .grid:not(.planning-grid) :is(th, td):last-child[dir=ltr] { padding-left: 22px; padding-right: 8px; }
.grid td.is-alarm { background: var(--critical-bg); color: var(--critical-ink); font-weight: 600; }
.field-align-end { align-self: end; min-block-size: var(--control-height); }
.leave-preview { justify-content: flex-end; gap: 2px; }
.modal .card-flush .table-scroll { border: 0; border-radius: 0; max-block-size: 360px; }
.planning-month { min-inline-size: 150px; text-align: center; }
.screen-body.split.planning-body { grid-template-rows: minmax(0, 1fr) minmax(0, 210px); }
.screen-body.split.accident-body { grid-template-rows: minmax(0, 1fr) minmax(0, 290px); }
.screen-body.split > .card-flush > .planning-scroll { flex: 1 1 auto; min-block-size: 0; overflow: auto; outline: none; }
.screen-body.split > .card-flush > .planning-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.screen-body.split > .card-flush > .planning-legend { flex: none; border-block-start: 1px solid var(--border); padding-block: 6px; }
.screen-body.split > .card-flush > .planning-refused { flex: none; margin: 8px 12px 0; }
.planning-grid { inline-size: max-content; min-inline-size: 100%; border-collapse: separate; border-spacing: 0; }
.planning-grid th, .planning-grid td { padding: 4px 2px; }
.planning-grid .planning-name { position: sticky; inset-inline-start: 0; z-index: 2; inline-size: 210px; min-inline-size: 210px; max-inline-size: 210px;
                                padding-inline: 10px 8px; background: var(--surface-raised); text-align: start; font-weight: 400; color: var(--text); }
.planning-grid .planning-hours { position: sticky; inset-inline-start: 210px; z-index: 2; inline-size: 52px; min-inline-size: 52px; padding-inline: 6px;
                                 background: var(--surface-raised); border-inline-end: 1px solid var(--border-strong); }
.planning-grid thead :is(.planning-name, .planning-hours) { z-index: 3; background: var(--surface-sunken); color: var(--text-secondary); font-weight: 600; }
.planning-grid .planning-name .list-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planning-grid .planning-day { min-inline-size: 34px; text-align: center; font-size: 11px; line-height: 1.25; }
.planning-grid .planning-day-name { display: block; font-weight: 400; }
.planning-grid :is(.planning-day, .planning-cell):last-child { padding-inline-end: 18px; }
.planning-grid .planning-cell { min-inline-size: 34px; text-align: center; font-size: 12px; font-weight: 600; cursor: pointer; user-select: none;
                                border-inline-start: 1px solid var(--border); white-space: nowrap; }
.planning-grid .is-off { background: var(--surface-sunken); }
.planning-grid .ink-out { color: var(--text-muted); background: repeating-linear-gradient(135deg, var(--surface-sunken) 0 4px, var(--surface) 4px 8px); }
.planning-grid .ink-leave { background: var(--accent-subtle); color: var(--accent); font-weight: 700; }
.planning-grid .ink-leave-pending { color: var(--accent); font-weight: 400; }
.planning-grid .ink-flagged { background: var(--critical-bg); color: var(--critical); }
.planning-grid .ink-unusual { color: var(--abnormal); }
.planning-grid .ink-shift { color: var(--normal); }
.planning-grid td.is-picked { box-shadow: inset 0 0 0 2px var(--accent); }
.planning-grid tbody tr:hover > :is(.planning-name, .planning-hours) { background: var(--surface-sunken); }
.planning-issues .card-heading { flex: none; margin: 0; padding-block: 8px; border-block-end: 1px solid var(--border); }
.planning-issues .card-heading .card-title { font-size: 14px; margin: 0; }
.planning-issues tr.critical td, .planning-issues tr.abnormal td { color: inherit; }
.accident-file { display: flex; flex-direction: column; }
.accident-summary { flex: none; display: flex; flex-direction: column; gap: 4px; padding-block: 10px; border-block-end: 1px solid var(--border); }
.accident-summary > p { margin: 0; }
.accident-summary > p:last-child { max-block-size: 3.2em; overflow-y: auto; }
.accident-tables { flex: 1 1 auto; min-block-size: 0; display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); }
.accident-tables > .table-scroll { min-block-size: 0; max-block-size: none; border: 0; border-radius: 0; overflow: auto; }
.accident-tables > .table-scroll + .table-scroll { border-inline-start: 1px solid var(--border); }
html[dir=rtl] .planning-grid .planning-name .list-name { text-align: right; }
/* « Statistiques prescripteurs », « Visites et conventions » and « Rappels et enquêtes »: a prescriber who started
   sending on the green of a normal result; the visits or conventions above the file of the row selected (its facts
   beside its report or terms, read in full); the consent notice above the campaigns, a message's text on two lines
   with the whole of it on hover; the last column clear of the card's edge (in Arabic, of its left edge). */
.grid tr.is-new td { background: var(--normal-bg); }
.grid tr.is-new.is-selected td { background: var(--accent-subtle); }
.screen-body.split.relations-body { grid-template-rows: minmax(0, 1fr) minmax(0, 196px); }
.relations-notice, .messaging-notice { flex-wrap: nowrap; }
.relations-notice-text, .messaging-notice-text { flex: 1 1 auto; min-inline-size: 0; }
.relation-file-body { flex: 1 1 auto; min-block-size: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); gap: 0 20px; padding: 10px 16px; }
.relation-file-facts, .relation-file-text { min-inline-size: 0; display: flex; flex-direction: column; gap: 6px; }
.relation-file-facts > p, .relation-file-text > p { margin: 0; }
.relation-file-text { border-inline-start: 1px solid var(--border); padding-inline-start: 20px; }
.relation-file-text > .field-label + p { white-space: pre-wrap; margin-block-end: 6px; }
.relation-facts { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
.grid td.col-name { min-inline-size: 140px; }
.grid td.col-purpose { min-inline-size: 120px; }
.grid td.col-purpose .list-name { overflow-wrap: normal; }
.grid td.col-notes { min-inline-size: 200px; }
.grid td.messaging-text { min-inline-size: 220px; }
.grid td.messaging-text .list-name { -webkit-line-clamp: 3; line-clamp: 3; }
.import-details { margin: 8px 0 0; padding: 0; list-style: none; max-block-size: 220px; overflow-y: auto; }
.import-details > li { unicode-bidi: plaintext; text-align: start; }
:is([data-screen=prescriberstats], [data-screen=relations], [data-screen=patientmessaging], [data-modal=prescriber-drill]) .grid :is(th, td):last-child { padding-inline-end: 22px; }
html[dir=rtl] :is([data-screen=prescriberstats], [data-screen=relations], [data-screen=patientmessaging], [data-modal=prescriber-drill]) .grid :is(th, td):last-child { padding-left: 22px; padding-right: 8px; }
@media (max-width: 1100px) { .relation-file-body { grid-template-columns: minmax(0, 1fr); } .relation-file-text { border: 0; padding: 0; } .relation-facts { grid-template-columns: max-content minmax(0, 1fr); } }

/* « Encaissement »: the figures beside the amount due, the change on cash, the till offered at the start. */
.collect-figures { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-block-end: 8px; }
.collect-due { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 14px; border-radius: var(--radius); background: var(--surface-sunken); }
.collect-due .tile-value { font-size: 28px; }
.collect-change { margin: 8px 0 0; min-block-size: 1.4em; font-size: 18px; }
.till-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-block-end: 12px; }
.till-banner-text { flex: 1 1 260px; }
.input-short { inline-size: 110px; }
.cell-actions { text-align: end; white-space: nowrap; }
.cell-actions .btn { padding-block: 2px; }

/* « Box de prélèvement » (tour 102): queue tags and wait, the tube sheet, the countdown, the quick notes. */
.booth-queue-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.booth-wait-long { color: var(--abnormal); font-weight: 600; }
.booth-progress { font-size: 20px; font-weight: 700; color: var(--text); }
.booth-progress.is-complete { color: var(--normal); }
.booth-tubes td.booth-rank { font-size: 18px; font-weight: 700; }
.booth-tubes .booth-swatch { inline-size: 18px; block-size: 18px; margin-inline-end: 6px; }
.booth-tubes .cell-sub { display: block; }
.booth-tubes tr.is-current td { background: var(--accent-subtle); }
.booth-flag { display: inline-block; font-weight: 600; color: var(--abnormal); margin-inline-end: 6px; }
.booth-countdown { border: 2px solid var(--normal); background: var(--normal-bg); }
.booth-countdown-text { font-size: 18px; margin: 0 0 4px; color: var(--normal); }
.booth-countdown-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 8px; }
.booth-notes { display: flex; flex-wrap: wrap; gap: 6px; }
.booth-note.is-pressed { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-pressed); }
.booth-note-list { margin: 8px 0 0; padding-inline-start: 18px; }
.booth-tablet-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; margin-inline-start: auto; }
.booth-tablet-switch input { inline-size: 20px; block-size: 20px; }

/* « Mode tablette »: big targets (48 px and more), larger text, no double-tap zoom, the keys hidden. */
.booth-desk.is-tablet { font-size: 17px; touch-action: manipulation; }
.booth-desk.is-tablet :is(.btn, .input, .booth-note) { min-block-size: 48px; font-size: 17px; padding-inline: 16px; touch-action: manipulation; }
.booth-desk.is-tablet .file-list li { padding-block: 10px; touch-action: manipulation; }
.booth-desk.is-tablet .kbd { display: none; }
.booth-desk.is-tablet .booth-progress { font-size: 26px; }
.booth-desk.is-tablet .booth-tubes td { padding-block: 12px; }
.booth-desk.is-tablet .action-bar { position: sticky; inset-block-end: 0; z-index: 2; gap: 8px; }
.booth-desk.is-tablet .action-bar .btn { min-block-size: 56px; }
.booth-desk.is-tablet .booth-tablet-switch input { inline-size: 28px; block-size: 28px; }
html.booth-tablet .booth-desk { touch-action: manipulation; }
@media (max-width: 900px) { .booth-desk.is-tablet .screen-body.split { grid-template-columns: minmax(0, 1fr); overflow: auto; } }

/* ---- Round 105: the booth desk on a tablet and on a narrow screen ------------------------------ */
/* « Actualisé à HH:mm:ss » by the queue's title. */
.booth-refreshed { white-space: nowrap; font-variant-numeric: tabular-nums; }
.booth-queue-title { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
/* The tube sheet: each header over its values — the rank centred, the volume at the end. */
.booth-desk .grid th.num, .booth-board .grid th.num { text-align: end; }
.booth-desk .booth-tubes :is(th, td).booth-rank { text-align: center; }
/* The ticket and scan boxes: the placeholder in the page's font, clear of the reader's icon. */
.scan-box .input::placeholder { font-family: var(--font); }
.booth-desk.is-tablet .search-box > .input { padding-inline-start: 40px; }
.booth-desk.is-tablet .search-box > .icon { inset-inline-start: 12px; }
.booth-desk .search-box.scan-box { max-inline-size: none; }
/* « Identité confirmée (nom et date de naissance) »: its whole text, on two lines if need be. */
.booth-identity-actions { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); align-items: stretch; }
.booth-identity-actions > .btn { white-space: normal; inline-size: 100%; text-align: center; line-height: 1.25; padding-block: 8px; }
.booth-desk.is-tablet .booth-identity-actions { grid-template-columns: minmax(0, 1fr); }
/* The tablet's action bar wraps instead of pushing its buttons off the screen. */
.booth-desk.is-tablet .action-bar { flex-wrap: wrap; row-gap: 8px; }
.booth-desk.is-tablet :is(.action-bar-start, .action-bar-end) { flex: 1 1 auto; flex-wrap: wrap; min-inline-size: 0; }
.booth-desk.is-tablet .action-bar-end { justify-content: flex-end; }
.booth-desk.is-tablet .action-bar .btn { white-space: normal; text-align: center; line-height: 1.2; }
/* « Mode tablette »: the switch itself a 48-px target. */
.booth-desk.is-tablet .booth-tablet-switch { min-block-size: 48px; padding-inline: 10px; }
/* The desk's dialogs (« J'ai compris », a reason, the fasting) follow the desk, after which they are drawn. */
.booth-desk.is-tablet ~ .modal-backdrop :is(.btn, .input) { min-block-size: 48px; font-size: 17px; }
.booth-desk.is-tablet ~ .modal-backdrop .btn { padding-inline: 18px; touch-action: manipulation; }
.booth-desk.is-tablet ~ .modal-backdrop .modal-close { min-inline-size: 48px; min-block-size: 48px; }
/* Under 1100 px the queue goes above the desk, at most 40 % of the height, and scrolls on its own. */
@media (max-width: 1100px) {
    .booth-desk .screen-body.split { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: max-content; overflow: auto; align-items: start; }
    .booth-desk .screen-body.split > * { overflow: visible; }
    .booth-desk .screen-body.split > .list-pane { max-block-size: 40vh; overflow: auto; }
}
/* A touch screen keeps no hover: the chip or button tapped does not stay grey. */
@media (hover: none) {
    .chip:not(.is-pressed):hover, .btn-secondary:not(.is-pressed):hover { background: var(--surface-raised); }
    .btn-icon:hover { background: none; }
    .booth-desk .file-list li:hover, .booth-desk .grid tbody tr:hover, .booth-board .grid tbody tr:not(.is-selected):hover { background: transparent; }
}

/*
   A finger, not a mouse (tablet): no target under 40 px — the close cross of every dialog, the icon
   buttons, the small buttons (dashboard actions, « Copier l'identifiant »), the copyable accession
   number. The mouse keeps the compact sizes.
*/
@media (pointer: coarse) {
    .modal-close, .btn-icon { min-inline-size: 40px; min-block-size: 40px; display: inline-flex; align-items: center; justify-content: center; }
    .btn-small { min-block-size: 40px; padding-inline: 12px; }
    button.accession { min-block-size: 40px; }
}

/* ---- « Scanner avec la caméra » at the booth desk ---------------------------------------------- */
/* The button by the scan box: the reader's field keeps the width, the camera a 48-px target beside it. */
.booth-scan-row { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.booth-scan-row > .scan-box { flex: 1 1 260px; min-inline-size: 0; }
.booth-scan-row > .booth-camera-button { min-block-size: 48px; white-space: nowrap; }
/* The modal: the preview full width under the patient and the count, the aim over it. */
.camera-scan { display: flex; flex-direction: column; gap: 8px; }
.camera-scan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; font-size: 18px; }
.camera-view { position: relative; inline-size: 100%; background: #000; border-radius: 8px; overflow: hidden; }
.camera-view[hidden] { display: none; }
.camera-view video {
    display: block; inline-size: 100%; aspect-ratio: 16 / 9; object-fit: cover;
    max-block-size: max(180px, calc(100vh - 390px));
}
.camera-aim {
    position: absolute; inset-block-start: 50%; inset-inline-start: 50%; transform: translate(-50%, -50%);
    inline-size: 72%; block-size: 38%; border: 3px solid rgba(255, 255, 255, .92); border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); pointer-events: none;
}
.camera-aim::after {
    content: ""; position: absolute; inset-inline: 6%; inset-block-start: 50%; border-block-start: 2px solid rgba(220, 38, 38, .85);
}
.camera-starting {
    position: absolute; inset: auto 0 12px 0; margin: 0; text-align: center; color: #fff; font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.camera-hint { margin: 0; }
.camera-last {
    margin: 0; padding: 10px 14px; border-radius: 6px; background: var(--normal); color: #fff;
    font-size: 18px; font-weight: 700;
}
.camera-next { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 600; }
/* Touch targets of 48 px in the modal, the desk in tablet mode or not. */
.modal-backdrop[data-modal="camera-scan"] .modal-footer .btn { min-block-size: 48px; padding-inline: 18px; touch-action: manipulation; }
.modal-backdrop[data-modal="camera-scan"] .modal-close { min-inline-size: 48px; min-block-size: 48px; }
.modal-backdrop[data-modal="camera-scan"] .modal { max-block-size: calc(100vh - 24px); }
@media (max-height: 800px) {
    .modal-backdrop[data-modal="camera-scan"] { padding: 12px; }
    .modal-backdrop[data-modal="camera-scan"] .modal-body { padding-block: 10px; }
}

/* ---- « Portail prescripteurs »: the scanned online prescription at the counter ------------------ */
.online-scan-card { padding-block: 10px; }
.online-scan-card .toolbar { margin: 0; }
.online-banner {
    margin-block-start: 10px; padding: 10px 14px; border: 1px solid var(--border); border-inline-start-width: 4px;
    border-radius: 6px; display: flex; flex-direction: column; gap: 6px;
}
.online-banner.is-usable { background: var(--accent-subtle); border-color: var(--accent); }
.online-banner.is-refused { background: var(--critical-bg); border-color: var(--critical); color: var(--critical-ink); }
.online-banner-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.online-candidates { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.online-candidate {
    display: flex; align-items: center; gap: 12px; padding: 6px 10px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--surface-raised); min-inline-size: 420px; justify-content: space-between;
}

/* ---- « Portail Web », the prescriber's tab ------------------------------------------------------ */
.portal-tab { display: flex; flex-direction: column; gap: 12px; min-block-size: 420px; }
.portal-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.portal-options { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; display: flex; gap: 18px; flex-wrap: wrap; margin: 0; }
.portal-options legend { padding-inline: 4px; }
.portal-actions { flex-wrap: wrap; gap: 8px; margin: 0; }
.portal-link .input { min-inline-size: 520px; }
.portal-activity { max-block-size: 220px; }
.portal-activity-title { margin: 4px 0 0; }
/* « Appareils » of the doctor on the portal; « Paramètres › Portail prescripteurs »: a title and its consequence per method. */
.portal-devices { max-block-size: 180px; }
.portal-methods { max-block-size: none; gap: 6px; }
.portal-methods > .field-check { align-items: flex-start; }
.portal-methods > .field-check > input { margin-block-start: 4px; }
.portal-durations { padding-inline-start: 34px; max-inline-size: 560px; }

/* ---- « Double authentification »: the second step of the sign-in, the activation, the backup codes ---- */
.two-factor-who { margin: 0; color: var(--text-secondary); font-size: 13px; }
.two-factor-reason { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; }
.two-factor-reason .pill { white-space: normal; }
.two-factor-step { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.two-factor-associate { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: start; }
.two-factor-qr { inline-size: 140px; block-size: 140px; border: 1px solid var(--border); border-radius: var(--radius); background: #FFFFFF; padding: 4px; }
.two-factor-qr svg { display: block; inline-size: 100%; block-size: 100%; }
.two-factor-instructions { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.two-factor-secret { margin: 0; }
.two-factor-secret code { display: inline-block; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); font-size: 14px; letter-spacing: .08em; user-select: all; overflow-wrap: anywhere; }
.input.two-factor-code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 18px; letter-spacing: .2em; max-inline-size: 220px; }
.two-factor-codes { display: flex; flex-direction: column; gap: 10px; }
.backup-codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.backup-codes li { padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); text-align: center; }
.backup-codes code { font-size: 14px; letter-spacing: .06em; }
.btn.is-waiting { opacity: .5; pointer-events: none; }
.two-factor-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.security-networks { margin: 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); font-size: 13px; overflow-wrap: anywhere; }
.security-policy { margin: 0; font-size: 13px; color: var(--text-secondary); }
/* « Paramètres » › Messagerie: a secret is replaced or cleared, never shown (SecretInput). */
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-row > .input { flex: 1 1 auto; min-inline-size: 0; }
.secret-state.is-normal { color: var(--normal); }
.secret-state.is-warning { color: var(--abnormal); }
.secret-state.is-critical { color: var(--critical); }
.secret-state.is-muted { color: var(--text-muted); }
/* « Ce poste »: what stays in the program's file, read-only. */
.workstation-file { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.workstation-file dt { color: var(--text-secondary); }
.workstation-file dd { margin: 0; }

/* « Accès du support de l'éditeur » (Paramètres › Sécurité) and the banner of a support session. */
.support-card { margin-block-start: 16px; }
.support-card .card-title { display: flex; align-items: center; gap: 8px; }
.support-authorize { border: 0; margin: 0; padding: 0; min-inline-size: 0; display: flex; flex-direction: column; gap: 8px; }
.support-authorize .button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.support-card .table-scroll { overflow-x: auto; }
.support-card [data-grid="support-history"] td { overflow-wrap: anywhere; }
.support-banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-weight: 600;
                  background: var(--abnormal-bg); color: var(--abnormal); border-block-end: 1px solid #F5C9A8; }
.user-support-note { margin-block-start: 8px; }
@media print {
    body.printing-area * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
    .print-area { position: absolute; inset-inline-start: 0; inset-block-start: 0; inline-size: 100%; }
    .print-area .no-print { display: none; }
}

/* « Chiffrement des sauvegardes » : the clé de secours shown once, large, in groups of four. */
.recovery-key {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    padding: 0.75rem;
    background: var(--surface-sunken);
    border-radius: 6px;
    user-select: all;
}

/* « Archivage annuel »: an archived order's banner and tag, the archives' status cards. */
.archive-banner { background: var(--archive-bg); color: var(--archive); border: 1px solid var(--archive); border-radius: var(--radius); margin-block-end: var(--gap); }
.archive-cards { display: flex; flex-wrap: wrap; gap: var(--gap); margin-block-end: var(--gap); align-items: flex-start; }
.archive-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; min-width: 260px; max-width: 560px; }
.archive-card.tone-available { background: var(--archive-bg); color: var(--archive); }
.archive-card.tone-unavailable { background: var(--critical-bg); color: var(--critical-ink); }
.archive-card.tone-building { background: var(--info-bg); color: var(--info); }
.archived-order .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-block: var(--gap); }
.archived-order .plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 4px; }
.notice.is-warning { background: var(--abnormal-bg); color: var(--abnormal); }
.archived-order .plain-list { list-style: none; padding: 0; margin: 0 0 var(--gap); }

/* « Catalogue › Tarifs »: the laboratory price pulled out of the list into a banner, the
   conventions in their own table, the history folded away beneath them. */
.card-flush > .tariff-banner { flex: none; border-block-end: 1px solid var(--border); background: var(--surface-sunken); }
.tariff-banner-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tariff-banner-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.tariff-banner-body { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-block-start: 4px; }
.tariff-banner-price { font-size: 20px; font-weight: 700; color: var(--text); }
.tariff-banner-basis { color: var(--text-secondary); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link-button:hover:not([disabled]) { color: var(--accent-hover); text-decoration: underline; }
.link-button[disabled] { color: var(--text-muted); cursor: default; }
.card-flush > .card-subtitle { flex: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; font-weight: 600; border-block-start: 1px solid var(--border); }
.card-subtitle > .small { font-weight: 400; }
.card-flush > .tariff-history { flex: none; border-block-start: 1px solid var(--border); }
.tariff-history > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-secondary); list-style-position: inside; }
.tariff-history > summary:hover { color: var(--text); }
.tariff-history .table-scroll { max-block-size: 240px; border: 0; }

/* ---- Microscope photos at biological validation ---------------------------------------------- */
.photos-card { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.photos-analysis { display: flex; flex-direction: column; gap: 8px; }
.photo-shown { display: block; width: 100%; max-width: 560px; height: auto; border-radius: 6px; background: #05080A; }
.photo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-chips .chip { min-width: 44px; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-primary); font: inherit; cursor: pointer; }
.photo-chips .chip.is-selected { border: 2px solid var(--accent); }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-unfiled summary { cursor: pointer; color: var(--accent); }
.photo-unfiled-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.photo-unfiled-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
